Skip to content

Commit

Permalink
Fix macro gating for single vs. double precision in unit tests. (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenroche5 authored Jan 30, 2024
1 parent a057a49 commit bbb727d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions test/src/JSON_number_handling_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,10 @@ SCENARIO("Marshalling")

GIVEN("A JSON object with a numeric field with the max value of JINTEGER "
"plus 4096") {
#ifdef NOTE_C_LOW_MEM
// In the NOTE_C_LOW_MEM case, where JNUMBER is a single-precision
// float, JINTEGER_MAX_PLUS_4096 is indistinguishable from JINTEGER_MAX.
#ifdef NOTE_C_TEST_SINGLE_PRECISION
// In the NOTE_C_TEST_SINGLE_PRECISION case, where JNUMBER is a
// single-precision float, JINTEGER_MAX_PLUS_4096 is indistinguishable
// from JINTEGER_MAX.
const char expected[] = "{\"" FIELD "\":" JINTEGER_MAX_STR "}";
#else
const char expected[] = "{\"" FIELD "\":" \
Expand Down Expand Up @@ -331,10 +332,10 @@ SCENARIO("Marshalling")

GIVEN("A J object with a numeric field with the min value of JINTEGER minus"
" 4096") {
#ifdef NOTE_C_LOW_MEM
// In the NOTE_C_LOW_MEM case, where JNUMBER is a single-precision
// float, JINTEGER_MIN_MINUS_4096 is indistinguishable from
// JINTEGER_MIN.
#ifdef NOTE_C_TEST_SINGLE_PRECISION
// In the NOTE_C_TEST_SINGLE_PRECISION case, where JNUMBER is a
// single-precision float, JINTEGER_MIN_MINUS_4096 is indistinguishable
// from JINTEGER_MIN.
const char expected[] = "{\"" FIELD "\":" JINTEGER_MIN_STR "}";
#else
const char expected[] = "{\"" FIELD "\":" \
Expand Down

0 comments on commit bbb727d

Please sign in to comment.