aboutsummaryrefslogtreecommitdiffstats
path: root/longbow/src/LongBow/test
diff options
context:
space:
mode:
Diffstat (limited to 'longbow/src/LongBow/test')
-rw-r--r--longbow/src/LongBow/test/.gitignore30
-rw-r--r--longbow/src/LongBow/test/CMakeLists.txt52
-rwxr-xr-xlongbow/src/LongBow/test/test_MemoryLeaks.c76
-rwxr-xr-xlongbow/src/LongBow/test/test_assertions.c23
-rwxr-xr-xlongbow/src/LongBow/test/test_fixtureConfiguration.c70
-rw-r--r--longbow/src/LongBow/test/test_longBow_ArrayList.c110
-rwxr-xr-xlongbow/src/LongBow/test/test_longBow_Backtrace.c106
-rwxr-xr-xlongbow/src/LongBow/test/test_longBow_CommandLineOptions.c73
-rwxr-xr-xlongbow/src/LongBow/test/test_longBow_Config.c98
-rwxr-xr-xlongbow/src/LongBow/test/test_longBow_Debug.c77
-rwxr-xr-xlongbow/src/LongBow/test/test_longBow_Expected.c71
-rw-r--r--longbow/src/LongBow/test/test_longBow_Fixture.c141
-rwxr-xr-xlongbow/src/LongBow/test/test_longBow_Location.c74
-rwxr-xr-xlongbow/src/LongBow/test/test_longBow_Main.c70
-rw-r--r--longbow/src/LongBow/test/test_longBow_MeasureTime.c155
-rwxr-xr-xlongbow/src/LongBow/test/test_longBow_Memory.c113
-rwxr-xr-xlongbow/src/LongBow/test/test_longBow_OpenFile.c85
-rwxr-xr-xlongbow/src/LongBow/test/test_longBow_Properties.c137
-rwxr-xr-xlongbow/src/LongBow/test/test_longBow_Runner.c74
-rwxr-xr-xlongbow/src/LongBow/test/test_longBow_Runtime.c80
-rwxr-xr-xlongbow/src/LongBow/test/test_longBow_Status.c140
-rwxr-xr-xlongbow/src/LongBow/test/test_longBow_String.c192
-rwxr-xr-xlongbow/src/LongBow/test/test_longBow_TestCase.c79
-rwxr-xr-xlongbow/src/LongBow/test/test_longBow_TestCaseClipBoard.c124
-rwxr-xr-xlongbow/src/LongBow/test/test_longBow_UnitTesting.c115
25 files changed, 2365 insertions, 0 deletions
diff --git a/longbow/src/LongBow/test/.gitignore b/longbow/src/LongBow/test/.gitignore
new file mode 100644
index 00000000..182506bc
--- /dev/null
+++ b/longbow/src/LongBow/test/.gitignore
@@ -0,0 +1,30 @@
+*.gcda
+*.gcno
+*.gcov
+*.longbow
+*.log
+test_longBow_ArrayList
+test_longBow_Backtrace
+test_longBow_Config
+test_longBow_Debug
+test_longBow_Fixture
+test_longBow_Memory
+test_longBow_Main
+test_longBow_OpenFile
+test_longBow_Report
+test_longBow_Runner
+test_longBow_Runtime
+test_longBow_Status
+test_longBow_TestCase
+test_longBow_TestCaseClipBoard
+test_longBow_Properties
+test_longBow_UnitTesting
+test_longBow_Empty
+test_longBow_File
+test_longBow_String
+test_longBow_Thread
+test_longBow_CommandLineOptions
+test_longBow_Expected
+test_assertions
+test_longBow_Properties
+test_longBow_MeasureTime
diff --git a/longbow/src/LongBow/test/CMakeLists.txt b/longbow/src/LongBow/test/CMakeLists.txt
new file mode 100644
index 00000000..5eba0444
--- /dev/null
+++ b/longbow/src/LongBow/test/CMakeLists.txt
@@ -0,0 +1,52 @@
+# Enable gcov output for the tests
+add_definitions(--coverage)
+set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} " --coverage")
+
+
+macro(AddTest testFile)
+ add_executable(${ARGV0} ${ARGV0}.c)
+ target_link_libraries(${ARGV0} longbow longbow-ansiterm)
+ add_test(${ARGV0} ${ARGV0})
+ set_target_properties(${ARGV0} PROPERTIES FOLDER Test)
+endmacro(AddTest)
+
+set(TestsExpectedToFail
+ test_longBow_Expected;
+)
+
+# test_assertions;
+
+set(TestsExpectedToPass
+ test_MemoryLeaks;
+ test_longBow_ArrayList;
+ test_longBow_Config;
+ test_longBow_Fixture;
+ test_longBow_Memory;
+ test_longBow_Location;
+ test_fixtureConfiguration;
+ test_longBow_Backtrace;
+ test_longBow_CommandLineOptions;
+ test_longBow_Debug;
+ test_longBow_Main;
+ test_longBow_MeasureTime;
+ test_longBow_OpenFile;
+ test_longBow_Properties;
+ test_longBow_Runner;
+ test_longBow_Runtime;
+ test_longBow_Status;
+ test_longBow_String;
+ test_longBow_TestCase;
+ test_longBow_TestCaseClipBoard;
+ test_longBow_UnitTesting
+ )
+
+foreach(test ${TestsExpectedToPass})
+ AddTest(${test})
+endforeach()
+
+foreach(test ${TestsExpectedToFail})
+ AddTest(${test})
+ set_tests_properties(${test} PROPERTIES WILL_FAIL TRUE)
+endforeach()
+
+
diff --git a/longbow/src/LongBow/test/test_MemoryLeaks.c b/longbow/src/LongBow/test/test_MemoryLeaks.c
new file mode 100755
index 00000000..f5eb4160
--- /dev/null
+++ b/longbow/src/LongBow/test/test_MemoryLeaks.c
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/** *
+ */
+// Include the file(s) containing the functions to be tested.
+// This permits internal static functions to be visible to this Test Framework.
+
+#include <LongBow/testing.h>
+#include <LongBow/debugging.h>
+
+#include <inttypes.h>
+
+#include "../private/longBow_Memory.h"
+
+LONGBOW_TEST_RUNNER(test_MemoryLeaks)
+{
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified, but all tests should be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+ LONGBOW_RUN_TEST_FIXTURE(Global);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(test_MemoryLeaks)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(test_MemoryLeaks)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Global)
+{
+// LONGBOW_RUN_TEST_CASE(Global, myTest);
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_CASE(Global, myTest)
+{
+}
+
+int
+main(int argc, char *argv[argc])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(test_MemoryLeaks);
+ int exitStatus = longBowMain(argc, argv, testRunner, NULL);
+ longBowTestRunner_Destroy(&testRunner);
+ assertTrue(longBowMemory_OutstandingAllocations() == 0, "Memory leaks %" PRId64, longBowMemory_OutstandingAllocations());
+
+ exit(exitStatus);
+}
diff --git a/longbow/src/LongBow/test/test_assertions.c b/longbow/src/LongBow/test/test_assertions.c
new file mode 100755
index 00000000..f20d0e5b
--- /dev/null
+++ b/longbow/src/LongBow/test/test_assertions.c
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <LongBow/runtime.h>
+#include <stdbool.h>
+
+int
+main(int argc, char *argv[argc])
+{
+ assertTrue(false, "Must fail.");
+}
diff --git a/longbow/src/LongBow/test/test_fixtureConfiguration.c b/longbow/src/LongBow/test/test_fixtureConfiguration.c
new file mode 100755
index 00000000..92023f48
--- /dev/null
+++ b/longbow/src/LongBow/test/test_fixtureConfiguration.c
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/** *
+ */
+// Include the file(s) containing the functions to be tested.
+// This permits internal static functions to be visible to this Test Framework.
+
+#include <LongBow/testing.h>
+#include <LongBow/debugging.h>
+
+LONGBOW_TEST_RUNNER(test_fixtureConfiguration)
+{
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified, but all tests should be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+ LONGBOW_RUN_TEST_FIXTURE(Global);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(test_fixtureConfiguration)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(test_fixtureConfiguration)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_OPTIONS(Global, .enabled = false)
+{
+ LONGBOW_RUN_TEST_CASE(Global, myTest);
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_CASE(Global, myTest)
+{
+}
+
+int
+main(int argc, char *argv[argc])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(test_fixtureConfiguration);
+ int exitStatus = longBowMain(argc, argv, testRunner, NULL);
+ longBowTestRunner_Destroy(&testRunner);
+ exit(exitStatus);
+}
diff --git a/longbow/src/LongBow/test/test_longBow_ArrayList.c b/longbow/src/LongBow/test/test_longBow_ArrayList.c
new file mode 100644
index 00000000..5ce70885
--- /dev/null
+++ b/longbow/src/LongBow/test/test_longBow_ArrayList.c
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <LongBow/testing.h>
+
+#include <stdio.h>
+#include <stdint.h>
+#include <inttypes.h>
+
+#include "../private/longBow_ArrayList.h"
+#include "../private/longBow_Memory.h"
+
+// Include the file(s) containing the functions to be tested.
+// This permits internal static functions to be visible to this Test Framework.
+
+LONGBOW_TEST_RUNNER(longBow_ArrayList)
+{
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified, but all tests should be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+ LONGBOW_RUN_TEST_FIXTURE(Global);
+ LONGBOW_RUN_TEST_FIXTURE(Local);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(longBow_ArrayList)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(longBow_ArrayList)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Global)
+{
+ LONGBOW_RUN_TEST_CASE(Global, CreateDestroy);
+ LONGBOW_RUN_TEST_CASE(Global, longBowArrayList_Add);
+}
+
+uint64_t _setupAllocations;
+
+LONGBOW_TEST_FIXTURE_SETUP(Global)
+{
+ _setupAllocations = longBowMemory_OutstandingAllocations();
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
+{
+ uint64_t leaks = longBowMemory_OutstandingAllocations() - _setupAllocations;
+ if (leaks != 0) {
+ printf("leaks %" PRId64 " allocations.\n", leaks);
+ }
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_CASE(Global, CreateDestroy)
+{
+ LongBowArrayList *list = longBowArrayList_Create((void (*)(void **))longBowMemory_Deallocate);
+
+ longBowArrayList_Destroy(&list);
+}
+
+LONGBOW_TEST_CASE(Global, longBowArrayList_Add)
+{
+ LongBowArrayList *list = longBowArrayList_Create((void (*)(void **))longBowMemory_Deallocate);
+
+ char *thing = longBowMemory_StringCopy("name");
+ longBowArrayList_Add(list, thing);
+
+ longBowArrayList_Destroy(&list);
+}
+
+LONGBOW_TEST_FIXTURE(Local)
+{
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+int
+main(int argc, char *argv[])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(longBow_ArrayList);
+ int exitStatus = LONGBOW_TEST_MAIN(argc, argv, testRunner);
+ longBowTestRunner_Destroy(&testRunner);
+ exit(exitStatus);
+}
diff --git a/longbow/src/LongBow/test/test_longBow_Backtrace.c b/longbow/src/LongBow/test/test_longBow_Backtrace.c
new file mode 100755
index 00000000..40582b85
--- /dev/null
+++ b/longbow/src/LongBow/test/test_longBow_Backtrace.c
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "../longBow_Backtrace.h"
+
+#include <stdio.h>
+#include "../testing.h"
+#include <LongBow/private/longBow_Memory.h>
+
+// Include the file(s) containing the functions to be tested.
+// This permits internal static functions to be visible to this Test Framework.
+
+LONGBOW_TEST_RUNNER(longBow_Backtrace)
+{
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified, but all tests should be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+ LONGBOW_RUN_TEST_FIXTURE(Global);
+ LONGBOW_RUN_TEST_FIXTURE(Local);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(longBow_Backtrace)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(longBow_Backtrace)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Global)
+{
+ LONGBOW_RUN_TEST_CASE(Global, LongBowBacktrace_ToString);
+ LONGBOW_RUN_TEST_CASE(Global, longBowBacktrace_Create);
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_CASE(Global, LongBowBacktrace_ToString)
+{
+ LongBowBacktrace *backtrace = longBowBacktrace_Create(100, 0);
+ char *result = longBowBacktrace_ToString(backtrace);
+
+ assertNotNull(result, "Expected non-null result from LongBowBacktrace_ToString()");
+
+ longBowMemory_Deallocate((void **) &result);
+ longBowBacktrace_Destroy(&backtrace);
+}
+
+LONGBOW_TEST_CASE(Global, longBowBacktrace_Create)
+{
+ LongBowBacktrace *backtrace = longBowBacktrace_Create(100, 0);
+ assertNotNull(backtrace, "Expected non-null result from longBowBacktrace_Create()");
+ longBowBacktrace_Destroy(&backtrace);
+ assertNull(backtrace, "Expected LongBowBacktrace_Destroy() to set the pointer to null");
+
+ backtrace = longBowBacktrace_Create(100, 1);
+ longBowBacktrace_Destroy(&backtrace);
+}
+
+LONGBOW_TEST_FIXTURE(Local)
+{
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+int
+main(int argc, char *argv[])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(longBow_Backtrace);
+ int exitStatus = LONGBOW_TEST_MAIN(argc, argv, testRunner);
+ longBowTestRunner_Destroy(&testRunner);
+
+ exit(exitStatus);
+}
diff --git a/longbow/src/LongBow/test/test_longBow_CommandLineOptions.c b/longbow/src/LongBow/test/test_longBow_CommandLineOptions.c
new file mode 100755
index 00000000..b63375fe
--- /dev/null
+++ b/longbow/src/LongBow/test/test_longBow_CommandLineOptions.c
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/** *
+ */
+#include <stdio.h>
+
+#include <LongBow/testing.h>
+#include <LongBow/debugging.h>
+
+LONGBOW_TEST_RUNNER(test_longBow_CommandLineOptions)
+{
+ printf("test_longBow_CommandLineOptions\n");
+
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified, but all tests should be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+ LONGBOW_RUN_TEST_FIXTURE(testFixture);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(test_longBow_CommandLineOptions)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(test_longBow_CommandLineOptions)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(testFixture)
+{
+ printf(" testFixture\n");
+ LONGBOW_RUN_TEST_CASE(testFixture, testCase);
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(testFixture)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(testFixture)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_CASE(testFixture, testCase)
+{
+ printf(" testCase\n");
+}
+
+int
+main(int argc, char *argv[argc])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(test_longBow_CommandLineOptions);
+ int exitStatus = longBowMain(argc, argv, testRunner, NULL);
+ longBowTestRunner_Destroy(&testRunner);
+ exit(exitStatus);
+}
diff --git a/longbow/src/LongBow/test/test_longBow_Config.c b/longbow/src/LongBow/test/test_longBow_Config.c
new file mode 100755
index 00000000..98589d32
--- /dev/null
+++ b/longbow/src/LongBow/test/test_longBow_Config.c
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <LongBow/testing.h>
+
+#include <stdio.h>
+#include <inttypes.h>
+
+#include <LongBow/longBow_Config.h>
+#include "../private/longBow_Memory.h"
+
+LONGBOW_TEST_RUNNER(longBow_Config)
+{
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified, but all tests should be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+ LONGBOW_RUN_TEST_FIXTURE(Global);
+ LONGBOW_RUN_TEST_FIXTURE(Local);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(longBow_Config)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(longBow_Config)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Global)
+{
+ LONGBOW_RUN_TEST_CASE(Global, CreateDestroy);
+}
+
+uint64_t _setupAllocations;
+
+LONGBOW_TEST_FIXTURE_SETUP(Global)
+{
+ _setupAllocations = longBowMemory_OutstandingAllocations();
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
+{
+ uint64_t leaks = longBowMemory_OutstandingAllocations() - _setupAllocations;
+ if (leaks != 0) {
+ printf("leaks %" PRId64 " allocations.\n", leaks);
+ }
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_CASE(Global, CreateDestroy)
+{
+ LongBowConfig *config = longBowConfig_Create(0, NULL, NULL);
+
+ longBowConfig_Destroy(&config);
+}
+
+LONGBOW_TEST_FIXTURE(Local)
+{
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+int
+main(int argc, char *argv[])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(longBow_Config);
+ int exitStatus = LONGBOW_TEST_MAIN(argc, argv, testRunner);
+ longBowTestRunner_Destroy(&testRunner);
+ if (longBowMemory_OutstandingAllocations() != 0) {
+ printf("%" PRId64 " allocation leaks.", longBowMemory_OutstandingAllocations());
+ }
+ exit(exitStatus);
+}
diff --git a/longbow/src/LongBow/test/test_longBow_Debug.c b/longbow/src/LongBow/test/test_longBow_Debug.c
new file mode 100755
index 00000000..30805d4a
--- /dev/null
+++ b/longbow/src/LongBow/test/test_longBow_Debug.c
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <LongBow/testing.h>
+
+// Include the file(s) containing the functions to be tested.
+// This permits internal static functions to be visible to this Test Framework.
+
+LONGBOW_TEST_RUNNER(longBow_Debug)
+{
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified, but all tests should be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+ LONGBOW_RUN_TEST_FIXTURE(Global);
+ LONGBOW_RUN_TEST_FIXTURE(Local);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(longBow_Debug)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(longBow_Debug)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Global)
+{
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Local)
+{
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+int
+main(int argc, char *argv[])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(longBow_Debug);
+ int exitStatus = LONGBOW_TEST_MAIN(argc, argv, testRunner);
+ longBowTestRunner_Destroy(&testRunner);
+ exit(exitStatus);
+}
diff --git a/longbow/src/LongBow/test/test_longBow_Expected.c b/longbow/src/LongBow/test/test_longBow_Expected.c
new file mode 100755
index 00000000..7b49cb89
--- /dev/null
+++ b/longbow/src/LongBow/test/test_longBow_Expected.c
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <LongBow/testing.h>
+
+LONGBOW_TEST_RUNNER(longBow_Expected)
+{
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified, but all tests should be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+ LONGBOW_RUN_TEST_FIXTURE(Global);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(longBow_Expected)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(longBow_Expected)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Global)
+{
+ LONGBOW_RUN_TEST_CASE(Global, ExpectFailure);
+ LONGBOW_RUN_TEST_CASE(Global, ExpectSuccess);
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_CASE_EXPECTS(Global, ExpectSuccess, .event = &LongBowAssertEvent)
+{
+ assertTrue(false, "This must be successful by failing.");
+}
+
+LONGBOW_TEST_CASE_EXPECTS(Global, ExpectFailure, .event = &LongBowAssertEvent)
+{
+ assertNull(NULL, "This must fail to fail.");
+}
+
+int
+main(int argc, char *argv[])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(longBow_Expected);
+ int exitStatus = LONGBOW_TEST_MAIN(argc, argv, testRunner);
+ longBowTestRunner_Destroy(&testRunner);
+ exit(exitStatus);
+}
diff --git a/longbow/src/LongBow/test/test_longBow_Fixture.c b/longbow/src/LongBow/test/test_longBow_Fixture.c
new file mode 100644
index 00000000..599b4be5
--- /dev/null
+++ b/longbow/src/LongBow/test/test_longBow_Fixture.c
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <inttypes.h>
+#include <LongBow/testing.h>
+#include <LongBow/private/longBow_Memory.h>
+
+LONGBOW_TEST_RUNNER(longBow_Fixture)
+{
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified, but all tests should be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+ LONGBOW_RUN_TEST_FIXTURE(CreateDestroy);
+ LONGBOW_RUN_TEST_FIXTURE(Global);
+ LONGBOW_RUN_TEST_FIXTURE(Local);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(longBow_Fixture)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(longBow_Fixture)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(CreateDestroy)
+{
+ LONGBOW_RUN_TEST_CASE(CreateDestroy, LongBowTestFixture_Create_Destroy);
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(CreateDestroy)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(CreateDestroy)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_CASE(CreateDestroy, LongBowTestFixture_Create_Destroy)
+{
+ uint64_t allocations = longBowMemory_OutstandingAllocations();
+ LongBowTestRunner *runner = longBowTestRunner_Create("runner", NULL, NULL, NULL);
+
+ LongBowTestFixture *fixture = longBowTestFixture_Create(runner, "fixture", NULL, NULL, NULL);
+ assertNotNull(fixture, "Expected non-null result from LongBowTestFixture_Create");
+ longBowTestFixture_Destroy(&fixture);
+ longBowTestRunner_Destroy(&runner);
+ assertTrue(longBowMemory_OutstandingAllocations() == allocations,
+ "Memory leaks %" PRId64, longBowMemory_OutstandingAllocations());
+}
+
+LONGBOW_TEST_FIXTURE(Global)
+{
+ LONGBOW_RUN_TEST_CASE(Global, longBowTestFixture_GetRunner);
+ LONGBOW_RUN_TEST_CASE(Global, longBowTestFixture_GetClipBoard);
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Global)
+{
+ LongBowTestRunner *runner = longBowTestRunner_Create("testRunner", NULL, NULL, NULL);
+ LongBowTestFixture *fixture = longBowTestFixture_Create(runner, "testFixture", NULL, NULL, NULL);
+
+ longBowClipBoard_Set(testClipBoard, "runner", runner);
+ longBowClipBoard_Set(testClipBoard, "fixture", fixture);
+ longBowTestCase_SetClipBoardData(testCase, fixture);
+
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
+{
+ LongBowTestFixture *fixture = longBowTestCase_GetClipBoardData(testCase);
+
+ LongBowTestRunner *runner = longBowTestFixture_GetRunner(fixture);
+
+ longBowTestRunner_Destroy(&runner);
+ longBowTestFixture_Destroy(&fixture);
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_CASE(Global, longBowTestFixture_GetRunner)
+{
+ LongBowTestRunner *xrunner = longBowClipBoard_Get(testClipBoard, "runner");
+ LongBowTestFixture *xfixture = longBowClipBoard_Get(testClipBoard, "fixture");
+ LongBowTestFixture *fixture = longBowTestCase_GetClipBoardData(testCase);
+ LongBowTestRunner *runner = longBowTestFixture_GetRunner(fixture);
+
+ assertTrue(xrunner == runner, "Expected runner to be equal.");
+ assertTrue(xfixture == fixture, "Expected runner to be equal.");
+
+ assertNotNull(runner, "Expected the test runner to not be null");
+}
+
+LONGBOW_TEST_CASE(Global, longBowTestFixture_GetClipBoard)
+{
+ LongBowTestFixture *fixture = longBowTestCase_GetClipBoardData(testCase);
+ LongBowClipBoard *clipboard = longBowTestFixture_GetClipBoard(fixture);
+ assertNotNull(clipboard, "Expected non-null result from longBowTestFixture_GetClipBoard");
+}
+
+LONGBOW_TEST_FIXTURE(Local)
+{
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+int
+main(int argc, char *argv[])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(longBow_Fixture);
+ int exitStatus = LONGBOW_TEST_MAIN(argc, argv, testRunner);
+ longBowTestRunner_Destroy(&testRunner);
+ exit(exitStatus);
+}
diff --git a/longbow/src/LongBow/test/test_longBow_Location.c b/longbow/src/LongBow/test/test_longBow_Location.c
new file mode 100755
index 00000000..9ed77079
--- /dev/null
+++ b/longbow/src/LongBow/test/test_longBow_Location.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <LongBow/testing.h>
+
+LONGBOW_TEST_RUNNER(longBow_Location)
+{
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified, but all tests should be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+ LONGBOW_RUN_TEST_FIXTURE(Global);
+ LONGBOW_RUN_TEST_FIXTURE(Local);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(longBow_Location)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(longBow_Location)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Global)
+{
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Local)
+{
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+int
+main(int argc, char *argv[])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(longBow_Location);
+ int exitStatus = LONGBOW_TEST_MAIN(argc, argv, testRunner);
+ longBowTestRunner_Destroy(&testRunner);
+ exit(exitStatus);
+}
diff --git a/longbow/src/LongBow/test/test_longBow_Main.c b/longbow/src/LongBow/test/test_longBow_Main.c
new file mode 100755
index 00000000..f8be93ed
--- /dev/null
+++ b/longbow/src/LongBow/test/test_longBow_Main.c
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <LongBow/testing.h>
+
+LONGBOW_TEST_RUNNER(longBow_Main)
+{
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified, but all tests should be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+
+ LONGBOW_RUN_TEST_FIXTURE(Global);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(longBow_Main)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(longBow_Main)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Global)
+{
+ LONGBOW_RUN_TEST_CASE(Global, longBowMain);
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_CASE(Global, longBowMain)
+{
+ LongBowStatus expected = LONGBOW_STATUS_SUCCEEDED;
+
+ int actual = longBowMain(0, NULL, NULL);
+ assertTrue(expected == actual, "Expected %d, actual %d", expected, actual);
+}
+
+int
+main(int argc, char *argv[])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(longBow_Main);
+ int exitStatus = LONGBOW_TEST_MAIN(argc, argv, testRunner);
+ longBowTestRunner_Destroy(&testRunner);
+ exit(exitStatus);
+}
diff --git a/longbow/src/LongBow/test/test_longBow_MeasureTime.c b/longbow/src/LongBow/test/test_longBow_MeasureTime.c
new file mode 100644
index 00000000..294c7c60
--- /dev/null
+++ b/longbow/src/LongBow/test/test_longBow_MeasureTime.c
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+// Include the file(s) containing the functions to be tested.
+// This permits internal static functions to be visible to this Test Runner.
+#include "../longBow_MeasureTime.c"
+
+#include <stdint.h>
+#include <inttypes.h>
+#include <LongBow/private/longBow_Memory.h>
+#include <LongBow/unit-test.h>
+
+LONGBOW_TEST_RUNNER(longBow_MeasureTime)
+{
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified here, but every test must be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+ LONGBOW_RUN_TEST_FIXTURE(Global);
+ LONGBOW_RUN_TEST_FIXTURE(Static);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(longBow_MeasureTime)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(longBow_MeasureTime)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Global)
+{
+ LONGBOW_RUN_TEST_CASE(Global, longBowMeasureTime_CountDown);
+ LONGBOW_RUN_TEST_CASE(Global, longBowMeasureTime_Report);
+ LONGBOW_RUN_TEST_CASE(Global, longBowMeasureTime_Start);
+ LONGBOW_RUN_TEST_CASE(Global, longBowMeasureTime_Stop);
+ LONGBOW_RUN_TEST_CASE(Global, longBowMeasureTime_Destroy);
+ LONGBOW_RUN_TEST_CASE(Global, longBowMeasureTime);
+}
+
+uint64_t _setupAllocations;
+
+LONGBOW_TEST_FIXTURE_SETUP(Global)
+{
+ _setupAllocations = longBowMemory_OutstandingAllocations();
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
+{
+ uint64_t leaks = longBowMemory_OutstandingAllocations() - _setupAllocations;
+ if (leaks != 0) {
+ printf("%s leaks %" PRId64 " allocations.\n", longBowTestCase_GetFullName(testCase), leaks);
+ return LONGBOW_STATUS_MEMORYLEAK;
+ }
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_CASE(Global, longBowMeasureTime_CountDown)
+{
+ LongBowMeasureTime *measure = longBowMeasureTime_Start(1);
+ assertTrue(measure->iterations == 1, "Expected iterations to be 1, actual %d", measure->iterations);
+
+ longBowMeasureTime_CountDown(measure);
+ assertTrue(measure->iterations == 0, "Expected iterations to be 0, actual %d", measure->iterations);
+
+ longBowMeasureTime_Destroy(&measure);
+}
+
+LONGBOW_TEST_CASE(Global, longBowMeasureTime_Report)
+{
+ LongBowMeasureTime *measure = longBowMeasureTime_Start(1);
+ assertTrue(measure->iterations == 1, "Expected iterations to be 1, actual %d", measure->iterations);
+
+ longBowMeasureTime_Report(measure, __FILE__, __func__, __LINE__);
+
+ longBowMeasureTime_Destroy(&measure);
+}
+
+LONGBOW_TEST_CASE(Global, longBowMeasureTime_Start)
+{
+ LongBowMeasureTime *measure = longBowMeasureTime_Start(1);
+ assertNotNull(measure, "Expected longBowMeasureTime_Start to return non-NULL result.");
+
+ longBowMeasureTime_Destroy(&measure);
+}
+
+LONGBOW_TEST_CASE(Global, longBowMeasureTime_Stop)
+{
+ LongBowMeasureTime *measure = longBowMeasureTime_Start(1);
+ assertNotNull(measure, "Expected longBowMeasureTime_Start to return non-NULL result.");
+ sleep(2);
+ longBowMeasureTime_Stop(measure);
+
+ uint64_t nanos = longBowMeasureTime_GetNanoseconds(measure);
+ assertTrue(nanos >= 1000000000ULL, "Expected more than 1,000,000 ns to have elapsed.");
+
+ longBowMeasureTime_Destroy(&measure);
+}
+
+LONGBOW_TEST_CASE(Global, longBowMeasureTime_Destroy)
+{
+ LongBowMeasureTime *measure = longBowMeasureTime_Start(1);
+ assertNotNull(measure, "Expected longBowMeasureTime_Start to return non-NULL result.");
+
+ longBowMeasureTime_Destroy(&measure);
+ assertNull(measure, "Expected longBowMeasureTime_Destroy to NULL the pointer.");
+}
+
+LONGBOW_TEST_CASE(Global, longBowMeasureTime)
+{
+ longBowMeasureTime(1)
+ {
+ sleep(2);
+ }
+}
+
+LONGBOW_TEST_FIXTURE(Static)
+{
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Static)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Static)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+int
+main(int argc, char *argv[])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(longBow_MeasureTime);
+ int exitStatus = longBowMain(argc, argv, testRunner, NULL);
+ longBowTestRunner_Destroy(&testRunner);
+ exit(exitStatus);
+}
diff --git a/longbow/src/LongBow/test/test_longBow_Memory.c b/longbow/src/LongBow/test/test_longBow_Memory.c
new file mode 100755
index 00000000..d1943860
--- /dev/null
+++ b/longbow/src/LongBow/test/test_longBow_Memory.c
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ */
+#include "../private/longBow_Memory.c"
+
+#include <LongBow/unit-test.h>
+#include <LongBow/debugging.h>
+
+LONGBOW_TEST_RUNNER(test_longBow_Memory)
+{
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified, but all tests should be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+ LONGBOW_RUN_TEST_FIXTURE(Global);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(test_longBow_Memory)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(test_longBow_Memory)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Global)
+{
+ LONGBOW_RUN_TEST_CASE(Global, longBowMemory_Allocate);
+ LONGBOW_RUN_TEST_CASE(Global, longBowMemory_Reallocate);
+ LONGBOW_RUN_TEST_CASE(Global, longBowMemory_StringCopy);
+}
+
+static uint64_t _setupAllocations;
+
+LONGBOW_TEST_FIXTURE_SETUP(Global)
+{
+ _setupAllocations = longBowMemory_OutstandingAllocations();
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
+{
+ if (longBowMemory_OutstandingAllocations() != _setupAllocations) {
+ printf("%s Memory leak\n", longBowTestCase_GetFullName(testCase));
+ return LONGBOW_STATUS_MEMORYLEAK;
+ }
+
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_CASE(Global, longBowMemory_Allocate)
+{
+ void *memory = longBowMemory_Allocate(10);
+ assertNotNull(memory, "Return value from longBowMemory_Allocate(10) cannot be NULL.");
+ longBowMemory_Deallocate((void **) &memory);
+ assertNull(memory, "longBowMemory_Deallocated must NULL the pointer.");
+}
+
+LONGBOW_TEST_CASE(Global, longBowMemory_Reallocate)
+{
+ void *memory = longBowMemory_Allocate(10);
+ assertNotNull(memory, "Return value from longBowMemory_Allocate(10) cannot be NULL.");
+
+ memory = longBowMemory_Reallocate(memory, 100);
+ assertNotNull(memory, "Return value from longBowMemory_Reallocate cannot be NULL.");
+
+ longBowMemory_Deallocate((void **) &memory);
+ assertNull(memory, "longBowMemory_Deallocated must NULL the pointer.");
+}
+
+LONGBOW_TEST_CASE(Global, longBowMemory_Reallocate_NULL)
+{
+ void *memory = longBowMemory_Reallocate(NULL, 100);
+ assertNotNull(memory, "Return value from longBowMemory_Reallocate cannot be NULL.");
+
+ longBowMemory_Deallocate((void **) &memory);
+ assertNull(memory, "longBowMemory_Deallocated must NULL the pointer.");
+}
+
+LONGBOW_TEST_CASE(Global, longBowMemory_StringCopy)
+{
+ char *expected = "Hello World";
+
+ char *actual = longBowMemory_StringCopy(expected);
+ assertTrue(strcmp(expected, actual) == 0, "Expected '%s', actual '%s'", expected, actual);
+ longBowMemory_Deallocate((void **) &actual);
+}
+
+int
+main(int argc, char *argv[])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(test_longBow_Memory);
+ int exitStatus = longBowMain(argc, argv, testRunner, NULL);
+ longBowTestRunner_Destroy(&testRunner);
+ exit(exitStatus);
+}
diff --git a/longbow/src/LongBow/test/test_longBow_OpenFile.c b/longbow/src/LongBow/test/test_longBow_OpenFile.c
new file mode 100755
index 00000000..2a881fdb
--- /dev/null
+++ b/longbow/src/LongBow/test/test_longBow_OpenFile.c
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <LongBow/testing.h>
+#include "../private/longBow_ArrayList.h"
+#include "../private/longBow_OpenFile.h"
+
+LONGBOW_TEST_RUNNER(longBow_Files)
+{
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified, but all tests should be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+ LONGBOW_RUN_TEST_FIXTURE(Global);
+ LONGBOW_RUN_TEST_FIXTURE(Local);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(longBow_Files)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(longBow_Files)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Global)
+{
+ LONGBOW_RUN_TEST_CASE(Global, longBow_OpenFiles);
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_CASE(Global, longBow_OpenFiles)
+{
+ LongBowArrayList *list = longBowOpenFile_CurrentlyOpen();
+ assertTrue(longBowArrayList_Length(list) > 0, "Expected the number of open files to be > 0");
+
+ longBowArrayList_Destroy(&list);
+}
+
+LONGBOW_TEST_FIXTURE(Local)
+{
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+int
+main(int argc, char *argv[])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(longBow_Files);
+ int exitStatus = LONGBOW_TEST_MAIN(argc, argv, testRunner);
+ longBowTestRunner_Destroy(&testRunner);
+ exit(exitStatus);
+}
diff --git a/longbow/src/LongBow/test/test_longBow_Properties.c b/longbow/src/LongBow/test/test_longBow_Properties.c
new file mode 100755
index 00000000..736a8141
--- /dev/null
+++ b/longbow/src/LongBow/test/test_longBow_Properties.c
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/** *
+ */
+// Include the file(s) containing the functions to be tested.
+// This permits internal static functions to be visible to this Test Framework.
+
+#include <LongBow/testing.h>
+#include <LongBow/debugging.h>
+
+#include <stdio.h>
+#include <inttypes.h>
+
+#include <LongBow/longBow_Properties.h>
+#include "../private/longBow_Memory.h"
+
+LONGBOW_TEST_RUNNER(test_longBow_Properties)
+{
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified, but all tests should be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+ LONGBOW_RUN_TEST_FIXTURE(Global);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(test_longBow_Properties)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(test_longBow_Properties)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Global)
+{
+ LONGBOW_RUN_TEST_CASE(Global, CreateDestroy);
+ LONGBOW_RUN_TEST_CASE(Global, longBowProperties_Set);
+ LONGBOW_RUN_TEST_CASE(Global, longBowProperties_Get);
+ LONGBOW_RUN_TEST_CASE(Global, longBowProperties_Length);
+ LONGBOW_RUN_TEST_CASE(Global, longBowProperties_Exists);
+}
+
+static uint64_t _setupAllocations;
+
+LONGBOW_TEST_FIXTURE_SETUP(Global)
+{
+ _setupAllocations = longBowMemory_OutstandingAllocations();
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
+{
+ uint64_t leaks = longBowMemory_OutstandingAllocations() - _setupAllocations;
+ if (leaks != 0) {
+ printf("%s leaks %" PRId64 " allocations.\n", longBowTestCase_GetFullName(testCase), leaks);
+ return LONGBOW_STATUS_MEMORYLEAK;
+ }
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_CASE(Global, CreateDestroy)
+{
+ LongBowProperties *properties = longBowProperties_Create();
+ longBowProperties_Destroy(&properties);
+}
+
+LONGBOW_TEST_CASE(Global, longBowProperties_Set)
+{
+ LongBowProperties *properties = longBowProperties_Create();
+ longBowProperties_Set(properties, "name", "value");
+ longBowProperties_Destroy(&properties);
+}
+
+LONGBOW_TEST_CASE(Global, longBowProperties_Get)
+{
+ LongBowProperties *properties = longBowProperties_Create();
+ char *expected = "value";
+ longBowProperties_Set(properties, "name", expected);
+
+ const char *actual = longBowProperties_Get(properties, "name");
+
+ assertTrue(strcmp(expected, actual) == 0, "Expected %s, actual %s", expected, actual);
+ longBowProperties_Destroy(&properties);
+}
+
+LONGBOW_TEST_CASE(Global, longBowProperties_Length)
+{
+ LongBowProperties *properties = longBowProperties_Create();
+ assertTrue(longBowProperties_Length(properties) == 0, "Expected empty longBowProperties to be 0 length");
+
+ char *expected = "value";
+ longBowProperties_Set(properties, "name", expected);
+ assertTrue(longBowProperties_Length(properties) == 1, "Expected longBowProperties to be 1 length");
+
+ const char *actual = longBowProperties_Get(properties, "name");
+
+ assertTrue(strcmp(expected, actual) == 0, "Expected %s, actual %s", expected, actual);
+ longBowProperties_Destroy(&properties);
+}
+
+LONGBOW_TEST_CASE(Global, longBowProperties_Exists)
+{
+ char *expected = "value";
+
+ LongBowProperties *properties = longBowProperties_Create();
+ assertFalse(longBowProperties_Exists(properties, expected), "Expected longBowProperties_Exists to be false");
+
+ longBowProperties_Set(properties, "name", expected);
+ assertTrue(longBowProperties_Exists(properties, "name"), "Expected longBowProperties_Exists to be true");
+
+ longBowProperties_Destroy(&properties);
+}
+
+int
+main(int argc, char *argv[argc])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(test_longBow_Properties);
+ int exitStatus = longBowMain(argc, argv, testRunner, NULL);
+ longBowTestRunner_Destroy(&testRunner);
+ exit(exitStatus);
+}
diff --git a/longbow/src/LongBow/test/test_longBow_Runner.c b/longbow/src/LongBow/test/test_longBow_Runner.c
new file mode 100755
index 00000000..7d7492e9
--- /dev/null
+++ b/longbow/src/LongBow/test/test_longBow_Runner.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <LongBow/testing.h>
+
+LONGBOW_TEST_RUNNER(longBow_Runner)
+{
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified, but all tests should be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+ LONGBOW_RUN_TEST_FIXTURE(Global);
+ LONGBOW_RUN_TEST_FIXTURE(Local);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(longBow_Runner)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(longBow_Runner)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Global)
+{
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Local)
+{
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+int
+main(int argc, char *argv[])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(longBow_Runner);
+ int exitStatus = LONGBOW_TEST_MAIN(argc, argv, testRunner);
+ longBowTestRunner_Destroy(&testRunner);
+ exit(exitStatus);
+}
diff --git a/longbow/src/LongBow/test/test_longBow_Runtime.c b/longbow/src/LongBow/test/test_longBow_Runtime.c
new file mode 100755
index 00000000..b9d963e9
--- /dev/null
+++ b/longbow/src/LongBow/test/test_longBow_Runtime.c
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <LongBow/testing.h>
+
+LONGBOW_TEST_RUNNER(longBow_Runtime)
+{
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified, but all tests should be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+ LONGBOW_RUN_TEST_FIXTURE(Global);
+ LONGBOW_RUN_TEST_FIXTURE(Local);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(longBow_Runtime)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(longBow_Runtime)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Global)
+{
+ LONGBOW_RUN_TEST_CASE(Global, longBowRuntime_StackTrace);
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_CASE(Global, longBowRuntime_StackTrace)
+{
+ longBowRuntime_StackTrace(1);
+}
+
+LONGBOW_TEST_FIXTURE(Local)
+{
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+int
+main(int argc, char *argv[])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(longBow_Runtime);
+ int exitStatus = LONGBOW_TEST_MAIN(argc, argv, testRunner);
+ longBowTestRunner_Destroy(&testRunner);
+ exit(exitStatus);
+}
diff --git a/longbow/src/LongBow/test/test_longBow_Status.c b/longbow/src/LongBow/test/test_longBow_Status.c
new file mode 100755
index 00000000..a1c01eb2
--- /dev/null
+++ b/longbow/src/LongBow/test/test_longBow_Status.c
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <LongBow/testing.h>
+
+LONGBOW_TEST_RUNNER(longBow_Status)
+{
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified, but all tests should be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+ LONGBOW_RUN_TEST_FIXTURE(Global);
+ LONGBOW_RUN_TEST_FIXTURE(Local);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(longBow_Status)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(longBow_Status)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Global)
+{
+ LONGBOW_RUN_TEST_CASE(Global, longBowStatus_ToString);
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_CASE(Global, longBowStatus_ToString)
+{
+ char *expected;
+ char *actual;
+
+ expected = "Succeeded";
+ actual = longBowStatus_ToString(LONGBOW_STATUS_SUCCEEDED);
+ assertTrue(strcmp(expected, actual) == 0, "Expected '%s', actual '%s'", expected, actual);
+ free(actual);
+
+ expected = "Warning";
+ actual = longBowStatus_ToString(LongBowStatus_WARNED);
+ assertTrue(strcmp(expected, actual) == 0, "Expected '%s', actual '%s'", expected, actual);
+ free(actual);
+
+ expected = "Tear Down Warning";
+ actual = longBowStatus_ToString(LongBowStatus_TEARDOWN_WARNED);
+ assertTrue(strcmp(expected, actual) == 0, "Expected '%s', actual '%s'", expected, actual);
+ free(actual);
+
+ expected = "Skipped";
+ actual = longBowStatus_ToString(LONGBOW_STATUS_SKIPPED);
+ assertTrue(strcmp(expected, actual) == 0, "Expected '%s', actual '%s'", expected, actual);
+ free(actual);
+
+ expected = "Unimplemented";
+ actual = longBowStatus_ToString(LongBowStatus_UNIMPLEMENTED);
+ assertTrue(strcmp(expected, actual) == 0, "Expected '%s', actual '%s'", expected, actual);
+ free(actual);
+
+ expected = "Impotent";
+ actual = longBowStatus_ToString(LongBowStatus_IMPOTENT);
+ assertTrue(strcmp(expected, actual) == 0, "Expected '%s', actual '%s'", expected, actual);
+ free(actual);
+
+ expected = "Failed";
+ actual = longBowStatus_ToString(LONGBOW_STATUS_FAILED);
+ assertTrue(strcmp(expected, actual) == 0, "Expected '%s', actual '%s'", expected, actual);
+ free(actual);
+
+ expected = "Stopped";
+ actual = longBowStatus_ToString(LongBowStatus_STOPPED);
+ assertTrue(strcmp(expected, actual) == 0, "Expected '%s', actual '%s'", expected, actual);
+ free(actual);
+
+ expected = "Tear Down Failed";
+ actual = longBowStatus_ToString(LONGBOW_STATUS_TEARDOWN_FAILED);
+ assertTrue(strcmp(expected, actual) == 0, "Expected '%s', actual '%s'", expected, actual);
+ free(actual);
+
+ expected = "Setup Failed";
+ actual = longBowStatus_ToString(LONGBOW_STATUS_SETUP_FAILED);
+ assertTrue(strcmp(expected, actual) == 0, "Expected '%s', actual '%s'", expected, actual);
+ free(actual);
+
+ expected = "Memory Leak";
+ actual = longBowStatus_ToString(LONGBOW_STATUS_MEMORYLEAK);
+ assertTrue(strcmp(expected, actual) == 0, "Expected '%s', actual '%s'", expected, actual);
+ free(actual);
+
+ actual = longBowStatus_ToString(LongBowStatus_SIGNALLED + 1);
+ assertNotNull(actual, "Expected longBowStatus_ToString to return non-null value");
+ free(actual);
+}
+
+LONGBOW_TEST_FIXTURE(Local)
+{
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+int
+main(int argc, char *argv[])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(longBow_Status);
+ int exitStatus = LONGBOW_TEST_MAIN(argc, argv, testRunner);
+ longBowTestRunner_Destroy(&testRunner);
+ exit(exitStatus);
+}
diff --git a/longbow/src/LongBow/test/test_longBow_String.c b/longbow/src/LongBow/test/test_longBow_String.c
new file mode 100755
index 00000000..96750706
--- /dev/null
+++ b/longbow/src/LongBow/test/test_longBow_String.c
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+// Include the file(s) containing the functions to be tested.
+// This permits internal static functions to be visible to this Test Runner.
+#include <stdio.h>
+#include <inttypes.h>
+
+#include "../private/longBow_String.c"
+
+#include <LongBow/unit-test.h>
+
+LONGBOW_TEST_RUNNER(longBow_String)
+{
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified here, but every test must be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+ LONGBOW_RUN_TEST_FIXTURE(Global);
+ LONGBOW_RUN_TEST_FIXTURE(Static);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(longBow_String)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(longBow_String)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Global)
+{
+ LONGBOW_RUN_TEST_CASE(Global, longBowString_Create);
+ LONGBOW_RUN_TEST_CASE(Global, longBowString_Append);
+ LONGBOW_RUN_TEST_CASE(Global, longBowString_Append_Append);
+ LONGBOW_RUN_TEST_CASE(Global, longBowString_Format);
+
+ LONGBOW_RUN_TEST_CASE(Global, longBowString_StartsWith_True);
+ LONGBOW_RUN_TEST_CASE(Global, longBowString_StartsWith_False);
+ LONGBOW_RUN_TEST_CASE(Global, longBowString_Tokenise);
+ LONGBOW_RUN_TEST_CASE(Global, longBowString_Tokenise_empty);
+ LONGBOW_RUN_TEST_CASE(Global, longBowString_Tokenise_NULL);
+ LONGBOW_RUN_TEST_CASE(Global, longBowString_CoreDump);
+}
+
+static uint64_t _outstandingAllocations;
+
+LONGBOW_TEST_FIXTURE_SETUP(Global)
+{
+ _outstandingAllocations = longBowMemory_OutstandingAllocations();
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
+{
+ if (longBowMemory_OutstandingAllocations() > _outstandingAllocations) {
+ printf("%s: memory leak\n", longBowTestCase_GetName(testCase));
+ return LONGBOW_STATUS_MEMORYLEAK;
+ }
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_CASE(Global, longBowString_Create)
+{
+ LongBowString *string = longBowString_Create(128);
+ assertNotNull(string, "Expected non-NULL result from longBowString_Create");
+
+ longBowString_Destroy(&string);
+ assertNull(string, "Expected the instance pointer to be NULL after longBowString_Destroy");
+}
+
+LONGBOW_TEST_CASE(Global, longBowString_Append)
+{
+ char *expected = "Hello World";
+ LongBowString *string = longBowString_Create(0);
+ longBowString_Append(string, expected);
+
+ assertTrue(strcmp(expected, string->buffer) == 0,
+ "Expected buffer to contain '%s', actual '%s'", expected, string->buffer);
+ longBowString_Destroy(&string);
+}
+
+LONGBOW_TEST_CASE(Global, longBowString_Append_Append)
+{
+ char *expected = "Hello World";
+ LongBowString *string = longBowString_Create(0);
+ longBowString_Append(string, "Hello");
+ longBowString_Append(string, " ");
+ longBowString_Append(string, "World");
+
+ assertTrue(strcmp(expected, string->buffer) == 0,
+ "Expected buffer to contain '%s', actual '%s'", expected, string->buffer);
+ longBowString_Destroy(&string);
+}
+
+LONGBOW_TEST_CASE(Global, longBowString_Format)
+{
+ char *expected = "Hello World";
+ LongBowString *string = longBowString_Create(0);
+ longBowString_Format(string, "%s", expected);
+
+ assertTrue(strcmp(expected, string->buffer) == 0,
+ "Expected buffer to contain '%s', actual '%s'", expected, string->buffer);
+ longBowString_Destroy(&string);
+}
+
+LONGBOW_TEST_CASE(Global, longBowString_StartsWith_True)
+{
+ bool actual = longBowString_StartsWith("abcde", "abc");
+ assertTrue(actual, "Expected true");
+}
+
+LONGBOW_TEST_CASE(Global, longBowString_StartsWith_False)
+{
+ bool actual = longBowString_StartsWith("abcde", "ayz");
+
+ assertFalse(actual, "Expected false");
+}
+
+LONGBOW_TEST_CASE(Global, longBowString_Tokenise)
+{
+ LongBowArrayList *actual = longBowString_Tokenise("--t.x=10", "-=");
+
+ assertTrue(strcmp("t.x", longBowArrayList_Get(actual, 0)) == 0,
+ "Expected first token to be t.x, actual %s", (char *) longBowArrayList_Get(actual, 0));
+ assertTrue(strcmp("10", longBowArrayList_Get(actual, 1)) == 0,
+ "Expected first token to be 10, actual %s", (char *) longBowArrayList_Get(actual, 1));
+
+ longBowArrayList_Destroy(&actual);
+}
+
+LONGBOW_TEST_CASE(Global, longBowString_Tokenise_empty)
+{
+ LongBowArrayList *actual = longBowString_Tokenise("", "-=");
+
+ assertTrue(longBowArrayList_Length(actual) == 0, "Expected zero length LongBowArrayList, actual %zd", longBowArrayList_Length(actual));
+
+ longBowArrayList_Destroy(&actual);
+}
+
+LONGBOW_TEST_CASE(Global, longBowString_Tokenise_NULL)
+{
+ LongBowArrayList *actual = longBowString_Tokenise(NULL, "-=");
+
+ assertTrue(longBowArrayList_Length(actual) == 0, "Expected zero length LongBowArrayList, actual %zd", longBowArrayList_Length(actual));
+
+ longBowArrayList_Destroy(&actual);
+}
+
+LONGBOW_TEST_CASE(Global, longBowString_CoreDump)
+{
+ //assertFalse(true, "foo");
+}
+
+LONGBOW_TEST_FIXTURE(Static)
+{
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Static)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Static)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+int
+main(int argc, char *argv[])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(longBow_String);
+ int exitStatus = longBowMain(argc, argv, testRunner, NULL);
+ longBowTestRunner_Destroy(&testRunner);
+ exit(exitStatus);
+}
diff --git a/longbow/src/LongBow/test/test_longBow_TestCase.c b/longbow/src/LongBow/test/test_longBow_TestCase.c
new file mode 100755
index 00000000..3fe6c8e1
--- /dev/null
+++ b/longbow/src/LongBow/test/test_longBow_TestCase.c
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <LongBow/testing.h>
+
+LONGBOW_TEST_RUNNER(longBow_TestCase)
+{
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified, but all tests should be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+ LONGBOW_RUN_TEST_FIXTURE(Global);
+ LONGBOW_RUN_TEST_FIXTURE(Local);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(longBow_TestCase)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(longBow_TestCase)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Global)
+{
+ LONGBOW_RUN_TEST_CASE(Global, ExpectEvent);
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_CASE(Global, ExpectEvent)
+{
+}
+
+LONGBOW_TEST_FIXTURE(Local)
+{
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+int
+main(int argc, char *argv[])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(longBow_TestCase);
+ int exitStatus = LONGBOW_TEST_MAIN(argc, argv, testRunner);
+ longBowTestRunner_Destroy(&testRunner);
+ exit(exitStatus);
+}
diff --git a/longbow/src/LongBow/test/test_longBow_TestCaseClipBoard.c b/longbow/src/LongBow/test/test_longBow_TestCaseClipBoard.c
new file mode 100755
index 00000000..521a817b
--- /dev/null
+++ b/longbow/src/LongBow/test/test_longBow_TestCaseClipBoard.c
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <inttypes.h>
+#include <LongBow/testing.h>
+#include <LongBow/private/longBow_Memory.h>
+
+LONGBOW_TEST_RUNNER(longBow_TestCaseClipBoard)
+{
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified, but all tests should be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+ LONGBOW_RUN_TEST_FIXTURE(Global);
+ LONGBOW_RUN_TEST_FIXTURE(Local);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(longBow_TestCaseClipBoard)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(longBow_TestCaseClipBoard)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Global)
+{
+ LONGBOW_RUN_TEST_CASE(Global, longBowTestCaseClipBoard_CreateDestroy);
+ LONGBOW_RUN_TEST_CASE(Global, longBowTestCaseClipBoard_Get);
+ LONGBOW_RUN_TEST_CASE(Global, longBowTestCaseClipBoard_Set);
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_CASE(Global, longBowTestCaseClipBoard_CreateDestroy)
+{
+ uint64_t allocations = longBowMemory_OutstandingAllocations();
+ char *shared = longBowMemory_StringCopy("shared data");
+
+ LongBowTestCaseClipBoard *clipboard = longBowTestCaseClipBoard_Create(shared);
+ assertNotNull(clipboard, "Expected non-null result from longBowTestCaseClipBoard_Create");
+
+ longBowTestCaseClipBoard_Destroy(&clipboard);
+ longBowMemory_Deallocate((void **) &shared);
+
+ assertTrue(longBowMemory_OutstandingAllocations() == allocations,
+ "Memory leaks %" PRId64, longBowMemory_OutstandingAllocations());
+}
+
+LONGBOW_TEST_CASE(Global, longBowTestCaseClipBoard_Get)
+{
+ char *shared = longBowMemory_StringCopy("shared data");
+
+ LongBowTestCaseClipBoard *clipboard = longBowTestCaseClipBoard_Create(shared);
+
+ char *actual = longBowTestCaseClipBoard_Get(clipboard);
+ assertTrue(strcmp(shared, actual) == 0, "Expected %s, actual %s", shared, actual);
+
+ longBowTestCaseClipBoard_Destroy(&clipboard);
+ longBowMemory_Deallocate((void **) &shared);
+}
+
+LONGBOW_TEST_CASE(Global, longBowTestCaseClipBoard_Set)
+{
+ char *shared = longBowMemory_StringCopy("shared data");
+
+ LongBowTestCaseClipBoard *clipboard = longBowTestCaseClipBoard_Create(shared);
+
+ char *expected = longBowMemory_StringCopy("expected");
+
+ longBowTestCaseClipBoard_Set(clipboard, expected);
+ char *actual = longBowTestCaseClipBoard_Get(clipboard);
+ assertTrue(strcmp(expected, actual) == 0, "Expected %s, actual %s", expected, actual);
+
+ longBowTestCaseClipBoard_Destroy(&clipboard);
+ longBowMemory_Deallocate((void **) &shared);
+ longBowMemory_Deallocate((void **) &expected);
+}
+
+LONGBOW_TEST_FIXTURE(Local)
+{
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+int
+main(int argc, char *argv[])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(longBow_TestCaseClipBoard);
+ int exitStatus = LONGBOW_TEST_MAIN(argc, argv, testRunner);
+ longBowTestRunner_Destroy(&testRunner);
+ exit(exitStatus);
+}
diff --git a/longbow/src/LongBow/test/test_longBow_UnitTesting.c b/longbow/src/LongBow/test/test_longBow_UnitTesting.c
new file mode 100755
index 00000000..de0f9c56
--- /dev/null
+++ b/longbow/src/LongBow/test/test_longBow_UnitTesting.c
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "../testing.h"
+
+LONGBOW_TEST_RUNNER(longBow_UnitTesting)
+{
+ // The following Test Fixtures will run their corresponding Test Cases.
+ // Test Fixtures are run in the order specified, but all tests should be idempotent.
+ // Never rely on the execution order of tests or share state between them.
+ LONGBOW_RUN_TEST_FIXTURE(Global);
+ LONGBOW_RUN_TEST_FIXTURE(Local);
+}
+
+// The Test Runner calls this function once before any Test Fixtures are run.
+LONGBOW_TEST_RUNNER_SETUP(longBow_UnitTesting)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+// The Test Runner calls this function once after all the Test Fixtures are run.
+LONGBOW_TEST_RUNNER_TEARDOWN(longBow_UnitTesting)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE(Global)
+{
+ LONGBOW_RUN_TEST_CASE(Global, longBowUnitTesting_AssertCompareToContract);
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Global)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+static int
+compareTo(const void *a, const void *b)
+{
+ if (a == NULL) {
+ if (b == NULL) {
+ return 0;
+ }
+ return -1;
+ } else {
+ if (b == NULL) {
+ return 1;
+ }
+ }
+
+ return strcmp(a, b);
+}
+
+LONGBOW_TEST_CASE(Global, longBowUnitTesting_AssertCompareToContract)
+{
+ char *exemplar = "exemplar";
+ void *equivalent[] = {
+ "exemplar",
+ NULL,
+ };
+ void *lesser[] = {
+ "exempla",
+ NULL,
+ };
+ void *greater[] = {
+ "exemplarr",
+ "fexemplarr",
+ NULL,
+ };
+
+ bool expected = true;
+ bool actual = longBowUnitTesting_AssertCompareToContract(compareTo, exemplar, equivalent, lesser, greater);
+
+ assertTrue(expected == actual, "Expected %d, actual %d", expected, actual);
+}
+
+LONGBOW_TEST_FIXTURE(Local)
+{
+}
+
+LONGBOW_TEST_FIXTURE_SETUP(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+LONGBOW_TEST_FIXTURE_TEARDOWN(Local)
+{
+ return LONGBOW_STATUS_SUCCEEDED;
+}
+
+int
+main(int argc, char *argv[])
+{
+ LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(longBow_UnitTesting);
+ int exitStatus = LONGBOW_TEST_MAIN(argc, argv, testRunner);
+ longBowTestRunner_Destroy(&testRunner);
+ exit(exitStatus);
+}