Skip to content

Commit 430c96b

Browse files
committed
Fix real values unit test
1 parent 91e47e2 commit 430c96b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,14 @@ static int real( void ) {
246246
p = json_objClose( p );
247247
p = json_end( p );
248248
#ifdef NO_SPRINTF
249-
static char const rslt[] = "{\"data\":[0,0,5000000]}";
249+
static char const rslt1[] = "{\"data\":[0,0,5000000]}";
250+
static char const rslt2[] = "{\"data\":[0,0,5000000]}";
250251
#else
251-
static char const rslt[] = "{\"data\":[0.2,2e-006,5e+006]}";
252+
static char const rslt1[] = "{\"data\":[0.2,2e-006,5e+006]}";
253+
static char const rslt2[] = "{\"data\":[0.2,2e-06,5e+06]}";
252254
#endif
253-
check( p - buff == sizeof rslt - 1 );
254-
check( 0 == strcmp( buff, rslt ) );
255+
check( p - buff == sizeof rslt1 - 1 || p - buff == sizeof rslt2 - 1 );
256+
check( 0 == strcmp( buff, rslt1 ) || 0 == strcmp( buff, rslt2 ) );
255257
done();
256258
}
257259

0 commit comments

Comments
 (0)