[DTrace-devel] [PATCH] test: Allow walltimestamp not to progress on successive calls
eugene.loh at oracle.com
eugene.loh at oracle.com
Fri Apr 22 01:56:04 UTC 2022
From: Eugene Loh <eugene.loh at oracle.com>
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
---
.../unittest/variables/bvar/tst.walltimestamp2.r.p | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/test/unittest/variables/bvar/tst.walltimestamp2.r.p b/test/unittest/variables/bvar/tst.walltimestamp2.r.p
index 48652ded..e72a033d 100755
--- a/test/unittest/variables/bvar/tst.walltimestamp2.r.p
+++ b/test/unittest/variables/bvar/tst.walltimestamp2.r.p
@@ -18,11 +18,15 @@
d4 = $1; getline;
d5 = $1;
- # check that the deltas are all positive
- if (d2 <= 0 ||
- d3 <= 0 ||
- d4 <= 0 ||
- d5 <= 0) print "ERROR: walltimestamp did not advance.";
+ # check that no delta is negative
+ if (d2 < 0 ||
+ d3 < 0 ||
+ d4 < 0 ||
+ d5 < 0) print "ERROR: walltimestamp went backwards.";
+
+ # check walltimestamp advanced
+ if (d2 + d3 + d4 + d5 <= 0)
+ print "ERROR: walltimestamp did not advance.";
# check that the deltas are all under 0.2 seconds
if (d2 > 200000000 ||
--
2.18.4
More information about the DTrace-devel
mailing list