[DTrace-devel] [PATCH 2/7] Check that stackdepth is nonzero in test
eugene.loh at oracle.com
eugene.loh at oracle.com
Thu May 6 12:31:45 PDT 2021
From: Eugene Loh <eugene.loh at oracle.com>
This test was passing gratuitously since neither stack() nor
stackdepth was working properly: stack() reported nothing and
stackdepth always reported 0. Change the test to require a
nonempty stack. For now, the test will XFAIL.
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
---
test/unittest/stackdepth/tst.value.d | 3 ++-
test/unittest/stackdepth/tst.value.r.p | 4 +++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/test/unittest/stackdepth/tst.value.d b/test/unittest/stackdepth/tst.value.d
index 857728bd..97cc54df 100644
--- a/test/unittest/stackdepth/tst.value.d
+++ b/test/unittest/stackdepth/tst.value.d
@@ -1,9 +1,10 @@
/*
* Oracle Linux DTrace.
- * Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2021, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
+/* @@xfail: dtv2 */
#pragma D option quiet
diff --git a/test/unittest/stackdepth/tst.value.r.p b/test/unittest/stackdepth/tst.value.r.p
index d5143e38..fa83eb0c 100755
--- a/test/unittest/stackdepth/tst.value.r.p
+++ b/test/unittest/stackdepth/tst.value.r.p
@@ -1,6 +1,6 @@
#!/usr/bin/gawk -f
# Oracle Linux DTrace.
-# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.
@@ -26,6 +26,8 @@ END {
printf "Stack depth too large (%d > %d)\n", depth, count;
else if (count > depth)
printf "Stack depth too small (%d < %d)\n", depth, count;
+ else if (count == 0)
+ printf "Stack depth is 0\n";
else
printf "Stack depth OK\n";
}
--
2.18.4
More information about the DTrace-devel
mailing list