summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorStefan Radomski <github@mintwerk.de>2016-05-13 10:43:55 (GMT)
committerStefan Radomski <github@mintwerk.de>2016-05-13 10:43:55 (GMT)
commit3bf5ef5f882b9ff743deb3d821834e471354128a (patch)
tree9cf2caef956161490a043d725d9ad85f90ec69de /test
parente384dfb778400392d30a098e08ba81e809e383ca (diff)
downloaduscxml-3bf5ef5f882b9ff743deb3d821834e471354128a.zip
uscxml-3bf5ef5f882b9ff743deb3d821834e471354128a.tar.gz
uscxml-3bf5ef5f882b9ff743deb3d821834e471354128a.tar.bz2
Builds cleanly for VS2015
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt16
-rw-r--r--test/src/test-c-machine.scxml.c2
-rw-r--r--test/src/test-gen-c.cpp8
3 files changed, 12 insertions, 14 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 43b89c0..53f2b79 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,6 +1,10 @@
set(TEST_TIMEOUT 15)
set(TEST_BENCHMARK_ITERATIONS 1000)
+if (WIN32)
+ set(GETOPT_FILES ${PROJECT_SOURCE_DIR}/contrib/src/getopt/getopt.c)
+endif()
+
find_program(SPIN spin)
find_program(CC gcc)
find_program(CXX g++)
@@ -11,9 +15,7 @@ function(USCXML_TEST_COMPILE)
set(multiValueArgs FILES ARGS)
cmake_parse_arguments(USCXML_TEST "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
- if (WIN32)
- list(APPEND USCXML_TEST_FILES "${PROJECT_SOURCE_DIR}/contrib/src/getopt/getopt.c")
- endif()
+ list(APPEND USCXML_TEST_FILES ${GETOPT_FILES})
add_executable(${USCXML_TEST_NAME} ${USCXML_TEST_FILES})
target_link_libraries(${USCXML_TEST_NAME} uscxml)
@@ -30,15 +32,11 @@ USCXML_TEST_COMPILE(NAME test-lifecycle LABEL general/test-lifecycle FILES src/t
USCXML_TEST_COMPILE(NAME test-validating LABEL general/test-validating FILES src/test-validating.cpp)
# the one binary to test for pass / fail final states
-if (WIN32)
- add_executable(test-state-pass src/test-state-pass.cpp ${PROJECT_SOURCE_DIR}/contrib/src/getopt/getopt.c)
-else()
- add_executable(test-state-pass src/test-state-pass.cpp)
-endif()
+add_executable(test-state-pass src/test-state-pass.cpp ${GETOPT_FILES})
target_link_libraries(test-state-pass uscxml)
set_target_properties(test-state-pass PROPERTIES FOLDER "Tests")
-add_executable(test-gen-c src/test-gen-c.cpp)
+add_executable(test-gen-c src/test-gen-c.cpp ${GETOPT_FILES})
target_link_libraries(test-gen-c uscxml)
set_target_properties(test-gen-c PROPERTIES FOLDER "Tests")
diff --git a/test/src/test-c-machine.scxml.c b/test/src/test-c-machine.scxml.c
index 4cfc37c..586a286 100644
--- a/test/src/test-c-machine.scxml.c
+++ b/test/src/test-c-machine.scxml.c
@@ -1077,7 +1077,7 @@ static void printBitsetIndices(const unsigned char* a, size_t length) {
const char* seperator = "";
for (i = 0; i < length; i++) {
if (BIT_HAS(i, a)) {
- printf("%s%lu", seperator, i);
+ printf("%s%zu", seperator, i);
seperator = ", ";
}
}
diff --git a/test/src/test-gen-c.cpp b/test/src/test-gen-c.cpp
index 8f70b26..327858c 100644
--- a/test/src/test-gen-c.cpp
+++ b/test/src/test-gen-c.cpp
@@ -85,7 +85,7 @@ public:
}
void init() {
- sessionId = UUID::getUUID();
+ sessionId = uscxml::UUID::getUUID();
isFinalized = false;
// clear and initialize machine context
@@ -284,10 +284,10 @@ public:
invokedMachine->invokeId = invocation->id;
} else if (invocation->idlocation != NULL) {
// test224
- invokedMachine->invokeId = (invocation->sourcename != NULL ? std::string(invocation->sourcename) + "." : "") + UUID::getUUID();
+ invokedMachine->invokeId = (invocation->sourcename != NULL ? std::string(invocation->sourcename) + "." : "") + uscxml::UUID::getUUID();
USER_DATA(ctx)->dataModel.assign(invocation->idlocation, Data(invokedMachine->invokeId, Data::VERBATIM));
} else {
- invokedMachine->invokeId = UUID::getUUID();
+ invokedMachine->invokeId = uscxml::UUID::getUUID();
}
allMachines[invokedMachine->invokeId] = invokedMachine;
topMachine->invocationIds[invocation] = invokedMachine->invokeId;
@@ -344,7 +344,7 @@ public:
if (send->id != NULL) {
sendid = send->id;
} else {
- sendid = UUID::getUUID();
+ sendid = uscxml::UUID::getUUID();
if (send->idlocation != NULL) {
USER_DATA(ctx)->dataModel.assign(send->idlocation, Data(sendid, Data::VERBATIM));
} else {