aboutsummaryrefslogtreecommitdiff
path: root/src/test.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test.c')
-rw-r--r--src/test.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/test.c b/src/test.c
index 6b95516..7360a60 100644
--- a/src/test.c
+++ b/src/test.c
@@ -13,7 +13,7 @@
if(vecres == res) \
passed++; \
else \
- CCTK_VWarn(warnlevel, __LINE__, __FILE__, \
+ CCTK_VWarn(CCTK_WARN_ALERT, __LINE__, __FILE__, \
CCTK_THORNSTRING, "Failed test %s", testname); \
numtests++; \
} \
@@ -24,12 +24,6 @@ void Vectors_Test(CCTK_ARGUMENTS)
DECLARE_CCTK_ARGUMENTS;
DECLARE_CCTK_PARAMETERS;
- int warnlevel;
- if (CCTK_EQUALS(tests, "abort"))
- warnlevel = CCTK_WARN_ABORT;
- else
- warnlevel = CCTK_WARN_ALERT;
-
CCTK_INT passed = 0, numtests=0;
CCTK_REAL a[CCTK_REAL_VEC_SIZE];
@@ -79,6 +73,11 @@ void Vectors_Test(CCTK_ARGUMENTS)
VECTEST("kifthen 0", kifthen(ToReal(0.),bv,cv), signbit(0.)?c[i]:b[i]);
VECTEST("kifthen -0", kifthen(ToReal(-0.),bv,cv), signbit(-0.)?c[i]:b[i]);
- CCTK_VInfo(CCTK_THORNSTRING, "%d/%d tests passed ", passed, numtests);
+ if (passed != numtests)
+ CCTK_VWarn(CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Failed %d correctness tests", numtests - passed);
+ else
+ CCTK_VInfo(CCTK_THORNSTRING, "%d/%d tests passed ", passed, numtests);
+
return;
}