Loading src/lib/kinetic_logger.h +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ #include <stdarg.h> #define KINETIC_LOGGER_DISABLED false #define KINETIC_LOGGER_FLUSH_THREAD_ENABLED false #define KINETIC_LOGGER_FLUSH_THREAD_ENABLED true #define KINETIC_LOG_FILE "kinetic.log" void KineticLogger_Init(const char* logFile, int log_level); Loading test/support/system_test_fixture.c +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ uint8_t data[KINETIC_OBJ_SIZE]; void SystemTestSetup(SystemTestFixture* fixture) { KineticClient_Init("stdout", 3); KineticClient_Init("stdout", 2); TEST_ASSERT_NOT_NULL_MESSAGE(fixture, "System test fixture is NULL!"); Loading test/support/system_test_fixture.h +1 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ #ifndef SYSTEM_TEST_HOST #define SYSTEM_TEST_HOST "localhost" // #define SYSTEM_TEST_HOST "10.138.123.65" #endif typedef struct _SystemTestFixture { Loading test/system/test_system_overlapped_io.c +1 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ void* kinetic_put(void* kinetic_arg) ); // Set operation-specific attributes entry->synchronization = KINETIC_SYNCHRONIZATION_WRITETHROUGH; entry->synchronization = KINETIC_SYNCHRONIZATION_WRITEBACK; // Store the data slice LOGF1(" *** Storing a data slice (%zu bytes)", entry->value.bytesUsed); Loading test/system/test_system_put.c +10 −7 Original line number Diff line number Diff line Loading @@ -123,7 +123,7 @@ void test_Delete_old_object_if_exists(void) } } #if 0 void test_Put_should_create_new_object_on_device(void) { LOG_LOCATION; Loading Loading @@ -326,7 +326,9 @@ void test_Put_should_be_able_to_store_max_sized_entry(void) TEST_ASSERT_EQUAL_ByteBuffer(KeyBuffer, Entry.key); TEST_ASSERT_ByteBuffer_NULL(Entry.newVersion); } #endif #if 1 typedef struct _TestPutClientDataStruct { bool called; int callbackCount; Loading Loading @@ -380,16 +382,16 @@ void test_Put_should_use_asynchronous_mode_if_closure_specified(void) KineticStatus status = KineticClient_Put(Fixture.handle, &Entry, &closure); TEST_ASSERT_EQUAL_KineticStatus(KINETIC_STATUS_SUCCESS, status); const long maxWaitMillisecs = 500; long millisecsWaiting = 0; struct timespec sleepDuration = {.tv_nsec = 1000000}; const long maxWaitMicrosecs = 2000000; long microsecsWaiting = 0; struct timespec sleepDuration = {.tv_nsec = 500000}; while(!TestPutClientData.called) { TEST_ASSERT_TRUE_MESSAGE(millisecsWaiting < maxWaitMillisecs, "Timed out waiting to receive PUT async callback!"); TEST_ASSERT_TRUE_MESSAGE(microsecsWaiting < maxWaitMicrosecs, "Timed out waiting to receive PUT async callback!"); nanosleep(&sleepDuration, NULL); millisecsWaiting += (sleepDuration.tv_nsec / 1000000); microsecsWaiting += (sleepDuration.tv_nsec / 1000); } LOGF0("PUT Response Time = %d ms", millisecsWaiting); LOGF0("PUT Response Time = %.1f ms", microsecsWaiting / 1000.0f); TEST_ASSERT_EQUAL(1, TestPutClientData.callbackCount); TEST_ASSERT_EQUAL(100, TestPutClientData.bytesWritten); Loading @@ -398,6 +400,7 @@ void test_Put_should_use_asynchronous_mode_if_closure_specified(void) TEST_ASSERT_EQUAL_ByteBuffer(KeyBuffer, Entry.key); TEST_ASSERT_ByteBuffer_NULL(Entry.newVersion); } #endif /******************************************************************************* * ENSURE THIS IS AFTER ALL TESTS IN THE TEST SUITE Loading Loading
src/lib/kinetic_logger.h +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ #include <stdarg.h> #define KINETIC_LOGGER_DISABLED false #define KINETIC_LOGGER_FLUSH_THREAD_ENABLED false #define KINETIC_LOGGER_FLUSH_THREAD_ENABLED true #define KINETIC_LOG_FILE "kinetic.log" void KineticLogger_Init(const char* logFile, int log_level); Loading
test/support/system_test_fixture.c +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ uint8_t data[KINETIC_OBJ_SIZE]; void SystemTestSetup(SystemTestFixture* fixture) { KineticClient_Init("stdout", 3); KineticClient_Init("stdout", 2); TEST_ASSERT_NOT_NULL_MESSAGE(fixture, "System test fixture is NULL!"); Loading
test/support/system_test_fixture.h +1 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ #ifndef SYSTEM_TEST_HOST #define SYSTEM_TEST_HOST "localhost" // #define SYSTEM_TEST_HOST "10.138.123.65" #endif typedef struct _SystemTestFixture { Loading
test/system/test_system_overlapped_io.c +1 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ void* kinetic_put(void* kinetic_arg) ); // Set operation-specific attributes entry->synchronization = KINETIC_SYNCHRONIZATION_WRITETHROUGH; entry->synchronization = KINETIC_SYNCHRONIZATION_WRITEBACK; // Store the data slice LOGF1(" *** Storing a data slice (%zu bytes)", entry->value.bytesUsed); Loading
test/system/test_system_put.c +10 −7 Original line number Diff line number Diff line Loading @@ -123,7 +123,7 @@ void test_Delete_old_object_if_exists(void) } } #if 0 void test_Put_should_create_new_object_on_device(void) { LOG_LOCATION; Loading Loading @@ -326,7 +326,9 @@ void test_Put_should_be_able_to_store_max_sized_entry(void) TEST_ASSERT_EQUAL_ByteBuffer(KeyBuffer, Entry.key); TEST_ASSERT_ByteBuffer_NULL(Entry.newVersion); } #endif #if 1 typedef struct _TestPutClientDataStruct { bool called; int callbackCount; Loading Loading @@ -380,16 +382,16 @@ void test_Put_should_use_asynchronous_mode_if_closure_specified(void) KineticStatus status = KineticClient_Put(Fixture.handle, &Entry, &closure); TEST_ASSERT_EQUAL_KineticStatus(KINETIC_STATUS_SUCCESS, status); const long maxWaitMillisecs = 500; long millisecsWaiting = 0; struct timespec sleepDuration = {.tv_nsec = 1000000}; const long maxWaitMicrosecs = 2000000; long microsecsWaiting = 0; struct timespec sleepDuration = {.tv_nsec = 500000}; while(!TestPutClientData.called) { TEST_ASSERT_TRUE_MESSAGE(millisecsWaiting < maxWaitMillisecs, "Timed out waiting to receive PUT async callback!"); TEST_ASSERT_TRUE_MESSAGE(microsecsWaiting < maxWaitMicrosecs, "Timed out waiting to receive PUT async callback!"); nanosleep(&sleepDuration, NULL); millisecsWaiting += (sleepDuration.tv_nsec / 1000000); microsecsWaiting += (sleepDuration.tv_nsec / 1000); } LOGF0("PUT Response Time = %d ms", millisecsWaiting); LOGF0("PUT Response Time = %.1f ms", microsecsWaiting / 1000.0f); TEST_ASSERT_EQUAL(1, TestPutClientData.callbackCount); TEST_ASSERT_EQUAL(100, TestPutClientData.bytesWritten); Loading @@ -398,6 +400,7 @@ void test_Put_should_use_asynchronous_mode_if_closure_specified(void) TEST_ASSERT_EQUAL_ByteBuffer(KeyBuffer, Entry.key); TEST_ASSERT_ByteBuffer_NULL(Entry.newVersion); } #endif /******************************************************************************* * ENSURE THIS IS AFTER ALL TESTS IN THE TEST SUITE Loading