diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt index 9e07135c..e3cdc838 100644 --- a/testing/CMakeLists.txt +++ b/testing/CMakeLists.txt @@ -9,7 +9,6 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Lossless_UDP_testclient.cmake) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Lossless_UDP_testserver.cmake) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Messenger_test.cmake) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/crypto_speed_test.cmake) -include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/timer_test.cmake) if(WIN32) # include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/nTox_win32.cmake) diff --git a/testing/cmake/timer_test.cmake b/testing/cmake/timer_test.cmake deleted file mode 100644 index a5f8c5ec..00000000 --- a/testing/cmake/timer_test.cmake +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 2.6.0) -project(timer_test C) - -set(exe_name timer_test) - -add_executable(${exe_name} - timer_test.c) - -linkCoreLibraries(${exe_name}) diff --git a/testing/timer_test.c b/testing/timer_test.c deleted file mode 100644 index f47d4878..00000000 --- a/testing/timer_test.c +++ /dev/null @@ -1,68 +0,0 @@ -#include "../core/timer.h" -#include - -#ifdef WINDOWS -#include -#else -#include -#endif - -void mssleep(int ms) -{ -#ifdef WINDOWS - Sleep(ms); -#else - usleep(ms * 1000); -#endif -} - -int callback(timer *t, void *arg) -{ - printf("%s\n", (char *)arg); - return 1; -} - -int repeating(timer *t, void *arg) -{ - printf("%s\n", (char *)arg); - timer_start(t, 3); - return 0; -} - -extern void timer_debug_print(); - -int main(int argc, char **argv) -{ - timer_init(); - timer_debug_print(); - - timer *t = new_timer(); - timer_setup(t, &callback, "Long setup method, 4 seconds"); - timer_start(t, 4); - timer_debug_print(); - - timer_single(&repeating, (void *)"This repeats every 3 seconds", 3); - timer_debug_print(); - - timer_single(&callback, "Short method, 4 seconds", 4); - timer_debug_print(); - - timer_single(&callback, "1 second", 1); - timer_debug_print(); - - timer_single(&callback, "15 seconds", 15); - timer_debug_print(); - - timer_single(&callback, "10 seconds", 10); - timer_debug_print(); - - timer_us(&callback, "100000us", 100000); - timer_us(&callback, "13s", 13 * US_PER_SECOND); - - while (true) { - timer_poll(); - mssleep(10); - } - - return 0; -}