You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Solve the problem of testcase failure during cmake release-building.
When I run:
cmake -DCMAKE_BUILD_TYPR=Release ..
make
make test
two testcases (test_deep_copy.c / test_json_pointer.c) failed. This is due to NDEBUG macro. When we set -DCMAKE_BUILD_TYPR=Release, this macro will be defined globally by dafault. NDEBUG will make assert() macro invalid. And, at the same time, these two testcases use assert() irregularly. We should avoid function-calling, variable assignment or some operator(++...) in assert( ).
In fact, json-c already consider this issue. emmmm, I think -UNDEBUG is not a valid parameter/option. It does not work.
The solution is shown in #547 . Maybe we should also modify all testcase, include: the including of <assert.h> and correct useage of assert().
2. Set default CMAKE_BUILD_TYPE and add the default compilation optimization options.
The default CMAKE_BUILD_TYPE can be set as Debug, Release, RelWithDebInfo,and so on. Debug is convennient for developers. Details is shown in #547. In fact, Debug, Release, RelWithDebInfo are all good choices.
The text was updated successfully, but these errors were encountered:
1. Solve the problem of testcase failure during cmake release-building.
When I run:
cmake -DCMAKE_BUILD_TYPR=Release .. make make test
two testcases (test_deep_copy.c / test_json_pointer.c) failed. This is due to
NDEBUG
macro. When we set-DCMAKE_BUILD_TYPR=Release
, this macro will be defined globally by dafault.NDEBUG
will makeassert()
macro invalid. And, at the same time, these two testcases useassert()
irregularly. We should avoid function-calling, variable assignment or some operator(++...) inassert( )
.In fact, json-c already consider this issue. emmmm, I think
-UNDEBUG
is not a valid parameter/option. It does not work.json-c/tests/CMakeLists.txt
Line 57 in 30e00cf
The solution is shown in #547 . Maybe we should also modify all testcase, include: the including of
<assert.h>
and correct useage ofassert()
.2. Set default CMAKE_BUILD_TYPE and add the default compilation optimization options.
The default
CMAKE_BUILD_TYPE
can be set asDebug
,Release
,RelWithDebInfo
,and so on.Debug
is convennient for developers. Details is shown in #547. In fact,Debug
,Release
,RelWithDebInfo
are all good choices.The text was updated successfully, but these errors were encountered: