Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix macro gating for single vs. double precision in unit tests. #138

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading