aboutsummaryrefslogtreecommitdiff
path: root/dejagnu.h
diff options
context:
space:
mode:
authorJacob Bachmeyer <jcb@gnu.org>2022-11-30 23:22:32 -0600
committerJacob Bachmeyer <jcb@gnu.org>2022-11-30 23:22:32 -0600
commitac0996ca907ea71f5e9a17ea1b50238f461dc60e (patch)
tree8c852d78bc4d82d97898b47037c863c06dc33f27 /dejagnu.h
parentcc2dcde3edb178434be6ce74fdd12322a35fcfb5 (diff)
downloaddejagnu-ac0996ca907ea71f5e9a17ea1b50238f461dc60e.zip
dejagnu-ac0996ca907ea71f5e9a17ea1b50238f461dc60e.tar.gz
dejagnu-ac0996ca907ea71f5e9a17ea1b50238f461dc60e.tar.bz2
Avoid spurious reinitialization in TestState
Diffstat (limited to 'dejagnu.h')
-rw-r--r--dejagnu.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/dejagnu.h b/dejagnu.h
index 920ff69..571ee51 100644
--- a/dejagnu.h
+++ b/dejagnu.h
@@ -218,6 +218,12 @@ class TestState {
public:
TestState (void)
{
+ DG__status.TestState_count++;
+
+ if (DG__status.TestState_count > 1)
+ return; /* Do not clear the counters if additional TestState
+ objects are constructed. */
+
DG__status.pass = 0;
DG__status.fail = 0;
DG__status.xpass = 0;
@@ -228,7 +234,6 @@ class TestState {
/* C++ object destruction will substitute for atexit(). */
DG__status.endmsg_registered = 1;
- DG__status.TestState_count++;
}
~TestState (void)