An "any" clause with int comparisons where at least one condition is true works:
cr_expect(any(eq(int, 1, 2), eq(int, 3, 3)));
Tried the same with double, and assertion fails for some reason:
double elapsed_time;
elapsed_time = 0.10;
cr_expect(ieee_ulp_eq(dbl, elapsed_time, 0.10, 4)); /* this passes /
cr_expect(ieee_ulp_eq(dbl, elapsed_time, 0.11, 4)); / line 20 - this fails (as expected) /
/ here, first condition should pass (like above), so why does this fail (line 22)? */
cr_expect(any(ieee_ulp_eq(dbl, elapsed_time, 0.10, 4), ieee_ulp_eq(dbl, elapsed_time, 0.11, 4)));
Failure reported:
[----] ... test_any.c:20: Assertion Failed
[----] ieee_ulp_eq(dbl, elapsed_time, 0.11, 4):
[----] diff: [-0.10000000000000001-]{+0.11+}
[----] ulp: 4
[----] ... test_any.c:22: Assertion Failed
[FAIL] test_any::any_with_double: (0.00s)
Also note that the line 22 failure does not report any value diffs, which perhaps is fine.
An "any" clause with int comparisons where at least one condition is true works:
cr_expect(any(eq(int, 1, 2), eq(int, 3, 3)));
Tried the same with double, and assertion fails for some reason:
double elapsed_time;
elapsed_time = 0.10;
cr_expect(ieee_ulp_eq(dbl, elapsed_time, 0.10, 4)); /* this passes /
cr_expect(ieee_ulp_eq(dbl, elapsed_time, 0.11, 4)); / line 20 - this fails (as expected) /
/ here, first condition should pass (like above), so why does this fail (line 22)? */
cr_expect(any(ieee_ulp_eq(dbl, elapsed_time, 0.10, 4), ieee_ulp_eq(dbl, elapsed_time, 0.11, 4)));
Failure reported:
[----] ... test_any.c:20: Assertion Failed
[----] ieee_ulp_eq(dbl, elapsed_time, 0.11, 4):
[----] diff: [-0.10000000000000001-]{+0.11+}
[----] ulp: 4
[----] ... test_any.c:22: Assertion Failed
[FAIL] test_any::any_with_double: (0.00s)
Also note that the line 22 failure does not report any value diffs, which perhaps is fine.