Browse Source

Merge pull request #547 from dota17/assert_test

modify json-c default build type, and fix up the assert() errors in t…
tags/json-c-0.14-20200419
Eric Haszlakiewicz GitHub 5 years ago
parent
commit
a8c9284f06
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 5 deletions
  1. +7
    -0
      CMakeLists.txt
  2. +0
    -5
      tests/CMakeLists.txt
  3. +3
    -0
      tests/test_deep_copy.c
  4. +3
    -0
      tests/test_json_pointer.c

+ 7
- 0
CMakeLists.txt View File

@@ -19,6 +19,13 @@ if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()

# set default build type if not specified by user
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE debug)
endif()

set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2")

# Include file check macros honor CMAKE_REQUIRED_LIBRARIES
# i.e. the check_include_file() calls will include -lm when checking.
if(POLICY CMP0075)


+ 0
- 5
tests/CMakeLists.txt View File

@@ -52,8 +52,3 @@ target_link_libraries(

endforeach(TESTNAME)

# Make sure NDEBUG is always undefined for tests
if (UNIX OR MINGW OR CYGWIN)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -UNDEBUG")
endif()


+ 3
- 0
tests/test_deep_copy.c View File

@@ -2,6 +2,9 @@
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#ifdef NDEBUG
#undef NDEBUG
#endif
#include <assert.h>
#include <errno.h>
#include <time.h>


+ 3
- 0
tests/test_json_pointer.c View File

@@ -1,5 +1,8 @@
#include "strerror_override.h"
#include "strerror_override_private.h"
#ifdef NDEBUG
#undef NDEBUG
#endif
#include <assert.h>
#include <stdio.h>
#include <string.h>


Loading…
Cancel
Save