summaryrefslogtreecommitdiffhomepage
path: root/misc/tests/mytests.c.txt
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-01-21 20:20:24 +0100
committerTyge Løvset <[email protected]>2023-01-21 20:20:24 +0100
commit2c5d525fa939cad8c50903f24b7ecc95ebfc4a87 (patch)
tree74dbdbf48039fcc5b8b60a68f92aa83573b91f3f /misc/tests/mytests.c.txt
parent0197ade3ef8a2e89a466f5a1c3e512363752879b (diff)
downloadSTC-modified-2c5d525fa939cad8c50903f24b7ecc95ebfc4a87.tar.gz
STC-modified-2c5d525fa939cad8c50903f24b7ecc95ebfc4a87.zip
Corrected the names of float/double ctest functions to match GoogleTest
Diffstat (limited to 'misc/tests/mytests.c.txt')
-rw-r--r--misc/tests/mytests.c.txt14
1 files changed, 7 insertions, 7 deletions
diff --git a/misc/tests/mytests.c.txt b/misc/tests/mytests.c.txt
index 71824d14..47db05e3 100644
--- a/misc/tests/mytests.c.txt
+++ b/misc/tests/mytests.c.txt
@@ -197,18 +197,18 @@ CTEST(ctest, test_ctest_err) {
CTEST(ctest, test_dbl_near) {
double a = 0.000111;
- ASSERT_DOUBLE_NEAR(0.0001, a);
+ ASSERT_DOUBLE_EQ(0.0001, a);
}
CTEST(ctest, test_dbl_near_tol) {
double a = 0.000111;
- ASSERT_DOUBLE_NEAR_TOL(0.0001, a, 1e-5); /* will fail */
+ ASSERT_NEAR(0.0001, a, 1e-5); /* will fail */
}
CTEST(ctest, test_dbl_far) {
double a = 1.1;
- ASSERT_DOUBLE_NOTNEAR(1., a);
- ASSERT_DOUBLE_NOTNEAR_TOL(1., a, 0.01);
+ ASSERT_DOUBLE_NE(1., a);
+ ASSERT_NOTNEAR(1., a, 0.01);
}
CTEST(ctest, test_assert_compare) {
@@ -219,9 +219,9 @@ CTEST(ctest, test_assert_compare) {
CTEST(ctest, test_dbl_near2) {
float a = 0.000001000003f;
- ASSERT_FLOAT_NEAR(0.000001f, a); /* ok, uses float epsilon -1e-5 */
- ASSERT_DOUBLE_NEAR_TOL(0.000001, a, -1e-5); /* ok, tol < 0 = relative err (epsilon) */
- ASSERT_DOUBLE_NEAR(0.000001, a); /* fail, tol = -1e-12 (epsilon) */
+ ASSERT_FLOAT_EQ(0.000001f, a); /* ok, uses float epsilon -1e-5 */
+ ASSERT_NEAR(0.000001, a, -1e-5); /* ok, tol < 0 = relative err (epsilon) */
+ ASSERT_DOUBLE_EQ(0.000001, a); /* fail, tol = -1e-12 (epsilon) */
}
CTEST(ctest, test_dbl_compare) {