Skip to content

Commit

Permalink
Merge pull request #173 from olebole/remove-zgmto-test
Browse files Browse the repository at this point in the history
Remove ZGMTIME test
  • Loading branch information
olebole authored Jun 16, 2021
2 parents fe54e9b + 14c046e commit 2286282
Showing 1 changed file with 0 additions and 78 deletions.
78 changes: 0 additions & 78 deletions test/os.md
Original file line number Diff line number Diff line change
@@ -1,83 +1,5 @@
# OS specific function is host$os

## ZGTIME

ZGTIME returns a local clock time in seconds and the
used cpu time in milliseconds.

File: `timetest.x`
```
task timetest = t_timetest
procedure t_timetest ()
long clktime0, cputime0
long clktime1, cputime1
int errs
begin
call zgtime(clktime0, cputime0)
if (clktime0 < 1280000000) {
call printf("Unreasonable clktime %d (cputime is %d)\n")
call pargl(clktime0)
call pargl(cputime0)
return
}
clktime1 = clktime0
cputime1 = cputime0
errs = 0
# Busy loop until wall clock increases by one second
while (clktime1 == clktime0) {
call zgtime(clktime1, cputime1)
}
if (clktime1 < clktime0) {
call printf("ERROR: Backward clktime %d --> %d\n")
call pargl(clktime0)
call pargl(clktime1)
errs = errs + 1
}
if (clktime1 > clktime0 + 2) {
call printf("ERROR: Clktime is too fast %d --> %d\n")
call pargl(clktime0)
call pargl(clktime1)
errs = errs + 1
}
if (clktime1 > clktime0 + 2) {
call printf("ERROR: Clktime is too fast %d --> %d\n")
call pargl(clktime0)
call pargl(clktime1)
errs = errs + 1
}
if (cputime1 < cputime0) {
call printf("ERROR: Backward cputime %d --> %d\n")
call pargl(cputime0)
call pargl(cputime1)
errs = errs + 1
}
if (cputime1 == cputime0) {
call printf("ERROR: Constant cputime %d --> %d\n")
call pargl(cputime0)
call pargl(cputime1)
errs = errs + 1
}
if (cputime1 > cputime0 + 1000 * (clktime1 - clktime0)) {
call printf("ERROR: Cputime faster that clktime: %d --> %d\n")
call pargl(cputime0)
call pargl(cputime1)
errs = errs + 1
}
call printf("%d errors\n")
call pargi(errs)
end
```

The test program should just return zero errors:

```
cl> softools
cl> xc -w timetest.x
cl> task $timetest = timetest.e
cl> timetest
0 errors
```

## ZGMTCO

ZGMTCO returns the correction, in seconds, from local standard
Expand Down

0 comments on commit 2286282

Please sign in to comment.