Skip to content

Commit

Permalink
Remove ZGMTIME test
Browse files Browse the repository at this point in the history
This test used a simple busy loop to wait for one second. The test in
this loop is optimized out on newest compilers, resulting in an
endless loop. Also, on i386 this test sometimes failes because there
were no CPU tics added duting the busy loop.
  • Loading branch information
olebole committed Jun 16, 2021
1 parent fe54e9b commit 14c046e
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 14c046e

Please sign in to comment.