From b2b9efebe364af725eb444eb57673d233723a089 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Wed, 26 Feb 2014 10:50:33 -0700 Subject: [PATCH] Add unit test to make sure heap allocation of chai works --- CMakeLists.txt | 4 ++++ unittests/heap_allocated_chaiscript_test.cpp | 10 ++++++++++ 2 files changed, 14 insertions(+) create mode 100644 unittests/heap_allocated_chaiscript_test.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 77f672d..76ed062 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -232,6 +232,10 @@ if(BUILD_TESTING) target_link_libraries(simultaneous_chaiscript_test ${LIBS} ${EXTRA_LINKER_FLAGS}) add_test(NAME Simultaneous_Chaiscript_Test COMMAND simultaneous_chaiscript_test) + add_executable(heap_allocated_chaiscript_test unittests/heap_allocated_chaiscript_test.cpp) + target_link_libraries(heap_allocated_chaiscript_test ${LIBS} ${EXTRA_LINKER_FLAGS}) + add_test(NAME Heap_Allocated_Chaiscript_Test COMMAND heap_allocated_chaiscript_test) + add_executable(c_linkage_test unittests/c_linkage_test.cpp) target_link_libraries(c_linkage_test ${LIBS} ${EXTRA_LINKER_FLAGS}) add_test(NAME C_Linkage_Test COMMAND c_linkage_test) diff --git a/unittests/heap_allocated_chaiscript_test.cpp b/unittests/heap_allocated_chaiscript_test.cpp new file mode 100644 index 0000000..ce37cba --- /dev/null +++ b/unittests/heap_allocated_chaiscript_test.cpp @@ -0,0 +1,10 @@ +#include + + +int main() +{ + chaiscript::ChaiScript *chai = new chaiscript::ChaiScript(); + delete chai; + + return EXIT_SUCCESS; +}