From 14c046e96855280ea152456e11364af96edf2a4e Mon Sep 17 00:00:00 2001 From: Ole Streicher Date: Tue, 15 Jun 2021 09:09:55 +0200 Subject: [PATCH] Remove ZGMTIME test 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. --- test/os.md | 78 ------------------------------------------------------ 1 file changed, 78 deletions(-) diff --git a/test/os.md b/test/os.md index a9b2a0781..9f0127d86 100644 --- a/test/os.md +++ b/test/os.md @@ -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