Improve the JSON C API (#3943)
* Added more details into documentation. * Moved the C unit-test into its own file. * Added extra test cases. * Extended the API reference documentation with doctests. JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
This commit is contained in:
@@ -42,6 +42,26 @@
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define TEST_ASSERT_STR(EXPECTED, RESULT) \
|
||||
do \
|
||||
{ \
|
||||
const char* __expected = (const char *) (EXPECTED); \
|
||||
const char* __result = (const char *) (RESULT); \
|
||||
if (strcmp(__expected, __result) != 0) \
|
||||
{ \
|
||||
jerry_port_log (JERRY_LOG_LEVEL_ERROR, \
|
||||
"TEST: String comparison failed at %s(%s):%lu.\n" \
|
||||
" Expected: '%s'\n Got: '%s'\n", \
|
||||
__FILE__, \
|
||||
__func__, \
|
||||
(unsigned long) __LINE__, \
|
||||
__expected, \
|
||||
__result); \
|
||||
jerry_port_fatal (ERR_FAILED_INTERNAL_ASSERTION); \
|
||||
\
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* Test initialization statement that should be included
|
||||
* at the beginning of main function in every unit test.
|
||||
|
||||
Reference in New Issue
Block a user