From d1dadebe4aca4db956fc5e97071af2c5d20399e5 Mon Sep 17 00:00:00 2001 From: PreacherDHM Date: Sat, 8 Feb 2025 13:26:52 -0800 Subject: [PATCH] removeing testing stuff --- CMakeLists.txt | 1 - testing/CMakeLists.txt | 27 ----- testing/Temporary/CTestCostData.txt | 1 - testing/Temporary/LastTest.log | 3 - testing/externals/CMakeLists.txt | 1 - testing/externals/Pickler | 1 - testing/input.cpp | 27 ----- testing/main.cpp | 9 -- testing/test_tart.cpp | 166 ---------------------------- testing/test_tart.h | 6 - testing/test_term.cpp | 48 -------- testing/test_term.h | 7 -- 12 files changed, 297 deletions(-) delete mode 100644 testing/CMakeLists.txt delete mode 100644 testing/Temporary/CTestCostData.txt delete mode 100644 testing/Temporary/LastTest.log delete mode 100644 testing/externals/CMakeLists.txt delete mode 160000 testing/externals/Pickler delete mode 100644 testing/input.cpp delete mode 100644 testing/main.cpp delete mode 100644 testing/test_tart.cpp delete mode 100644 testing/test_tart.h delete mode 100644 testing/test_term.cpp delete mode 100644 testing/test_term.h diff --git a/CMakeLists.txt b/CMakeLists.txt index b912b54..a5e8dcd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,5 +24,4 @@ enable_testing() add_subdirectory(externals) # PROJECT add_subdirectory(source) -add_subdirectory(testing) diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt deleted file mode 100644 index a310f3d..0000000 --- a/testing/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -project(TartTest) -add_subdirectory(externals) -set( CMAKE_CXX_STANDARD 11) -set( CMAKE_CXX_STANDARD_REQUIRED ON) -set( SOURCES - main.cpp - test_tart.cpp - test_term.cpp -) - -set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/tests) - -add_executable(${PROJECT_NAME} ${SOURCES} ) -target_link_libraries(${PROJECT_NAME} TartLib PickleLib) - -if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - add_test(${PROJECT_NAME} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/testing") -endif() -if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - add_test(${PROJECT_NAME} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/testing.exe") -endif() - -project(InputTartTest) -set( CMAKE_CXX_STANDARD 11) -set( CMAKE_CXX_STANDARD_REQUIRED ON) -add_executable(${PROJECT_NAME} input.cpp ) -target_link_libraries(${PROJECT_NAME} TartLib PickleLib) diff --git a/testing/Temporary/CTestCostData.txt b/testing/Temporary/CTestCostData.txt deleted file mode 100644 index ed97d53..0000000 --- a/testing/Temporary/CTestCostData.txt +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/testing/Temporary/LastTest.log b/testing/Temporary/LastTest.log deleted file mode 100644 index a08c3eb..0000000 --- a/testing/Temporary/LastTest.log +++ /dev/null @@ -1,3 +0,0 @@ -Start testing: Jan 28 14:11 Pacific Standard Time (Mexico) ----------------------------------------------------------- -End testing: Jan 28 14:11 Pacific Standard Time (Mexico) diff --git a/testing/externals/CMakeLists.txt b/testing/externals/CMakeLists.txt deleted file mode 100644 index d3e2ada..0000000 --- a/testing/externals/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(Pickler) diff --git a/testing/externals/Pickler b/testing/externals/Pickler deleted file mode 160000 index 22a9fb9..0000000 --- a/testing/externals/Pickler +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 22a9fb9fabce4a1f3add4d2531858b20597190d1 diff --git a/testing/input.cpp b/testing/input.cpp deleted file mode 100644 index 1609df7..0000000 --- a/testing/input.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include -#include -#ifdef _LINUX -#endif - -char* bbuf; - -int main (int argc, char *argv[]) { - int n; - int counter = 0; - term_disable_cursor(); - term_threaded_input_init(); - bbuf = term_tinputb(); - while(bbuf[0] != 'q') { - - std::cout << counter++ << '['; - for (int i = 0; i < 8; i++) { - std::cout << bbuf[i] << ','; - } - std::cout << "] \r"; - } - std::cout << '\n'; - term_threaded_input_stop(); - term_enable_cursor(); - exit(0); - return 0; -} diff --git a/testing/main.cpp b/testing/main.cpp deleted file mode 100644 index fe14d97..0000000 --- a/testing/main.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "test_tart.h" -#include "test_term.h" -#include -int main (int argc, char *argv[]) { - INSTALLSHELF; - tart_run(&__pickle_shelf__); - term_run(&__pickle_shelf__); - return PICKLESHELF; -} diff --git a/testing/test_tart.cpp b/testing/test_tart.cpp deleted file mode 100644 index 7bf82fa..0000000 --- a/testing/test_tart.cpp +++ /dev/null @@ -1,166 +0,0 @@ -#include "test_tart.h" -#include "Pickler.h" -bool rgb_test(struct tart_rgb* lhs, struct tart_rgb* rhs) { - if(lhs->r != rhs->r) {return false;} - if(lhs->g != rhs->g) {return false;} - if(lhs->b != rhs->b) {return false;} - return true; -} - -bool vec2_test(struct tart_vec2* lhs, struct tart_vec2* rhs) { - if(lhs->x != rhs->x) {return false;} - if(lhs->y != rhs->y) {return false;} - return true; -} - -void tart_run(struct pickle_shelf* shelf) { - pickle_shelf __pickle_shelf__ = *shelf; - CREATEJAR(tart_objects_test); - PICKLE(Test_create_buffer) { - struct tart_vec2 size = {25,25}; - struct tart_vec2 position = {0,0}; - - int data_count = (size.x*size.y) * TART_CELL_DATA_SIZE; - - unsigned int cell_count = (size.x * size.y); - struct tart_buffer buffer_correct = {cell_count,0,25,size,position,0}; - struct tart_buffer buffer_test = tart_create_buffer(25,size,position); - - if(DIFFERENT(buffer_correct.cell_count,buffer_test.cell_count)) - ASSERT("Cell count not the same.",false); - if(DIFFERENT(buffer_correct.layer,buffer_test.layer)) - ASSERT("Layers not the same.",false); - if(DIFFERENT(buffer_correct.id,buffer_test.id)) - ASSERT("Ids are not the same.",false); - if(DIFFERENT(buffer_correct.size.x,buffer_test.size.x)) - ASSERT("size.x is not the same",false); - if(DIFFERENT(buffer_correct.size.y,buffer_test.size.y)) - ASSERT("size.y is not the same",false); - if(DIFFERENT(buffer_correct.position.x,buffer_test.position.x)) - ASSERT("position.x is not the same.",false); - if(DIFFERENT(buffer_correct.position.y,buffer_test.position.y)) - ASSERT("position.y is not the same.",false); - if(DIFFERENT(buffer_correct.cell_count,buffer_test.cell_count)) - ASSERT("data_counts are not the same.",false); - ASSERT("GOOD",true); - }(); - - - PICKLE(Test_create_cell) { - -#ifdef TART_RGB_COLOR - struct tart_rgb b = {80,80,80}; - struct tart_rgb f = {80,80,80}; - struct tart_cell cell_correct = {f, b, '1', 'f'}; - struct tart_cell cell_test = tart_create_cell('f', '1', f, b); - if(!rgb_test(&cell_correct.foreground, &cell_test.foreground)) - ASSERT("Forground dose not match.",false); - if(!rgb_test(&cell_correct.background, &cell_test.background)) - ASSERT("background dose not match.",false); -#else - tart_byte f = 20; - tart_byte b = 40; - struct tart_cell cell_correct = {f, b, '1', 'f'}; - struct tart_cell cell_test = tart_create_cell('f', '1', f, b); - if(DIFFERENT(cell_correct.foreground, cell_test.foreground)) - ASSERT("Forground dose not match.",false); - if(DIFFERENT(cell_correct.background, cell_test.background)) - ASSERT("background dose not match.",false); -#endif - if(DIFFERENT(cell_correct.style, cell_test.style)) - ASSERT("style dose not match.",false); - if(DIFFERENT(cell_correct.display, cell_test.display)) - ASSERT("display dose not match.",false); - ASSERT("GOOD",true); - }(); - - PICKLE(Test_create_window) { - struct tart_buffer buffer = tart_create_buffer(10, {10,20}, {0,0}); - struct tart_window window = tart_create_window(); - for(int i = 0; i < 0xFF + 1; i++) { - if(DIFFERENT(window.buffers[i].id, 0)) - ASSERT("buffer not same", false); - } - ASSERT("GOOD", true); - }(); - PICKLE(Test_add_buffer) { - struct tart_buffer buffer = tart_create_buffer(10, {10,20}, {0,0}); - struct tart_window window = tart_create_window(); - tart_add_buffer(&window, buffer); - if(SAME(window.buffer_count, 0)) - ASSERT("index has not indexed", false); - if(DIFFERENT(window.buffers[0].id, buffer.id)) - ASSERT("buffer not same", false); - ASSERT("GOOD", true); - }(); - - PICKLE(Test_set_buffer) { - struct tart_buffer buffer = tart_create_buffer(10, {10,20}, {0,0}); - struct tart_window window = tart_create_window(); - tart_set_buffer(&window, buffer, 0); - if(DIFFERENT(window.buffers[0].id, buffer.id)) - ASSERT("buffer not same", false); - ASSERT("GOOD", true); - }(); - - PICKLE(Test_get_buffer) { - struct tart_buffer buffer = tart_create_buffer(10, {10,20}, {0,0}); - struct tart_window window = tart_create_window(); - tart_set_buffer(&window, buffer, 0); - if(DIFFERENT(tart_get_buffer(&window, 0)->id, buffer.id)) - ASSERT("buffer not same", false); - ASSERT("GOOD", true); - }(); - - PICKLE(Test_set_cell) { -#ifdef TART_RGB_COLORS - tart_rgb foreground = {90,90,90}; - tart_rgb background = {80,80,80}; - -#else - tart_byte foreground = 9; - tart_byte background = 8; -#endif - struct tart_cell cell = tart_create_cell('0',10,foreground, background); - struct tart_buffer buffer = tart_create_buffer(10, {10,20}, {10,20}); - struct tart_window window = tart_create_window(); - - tart_set_cell(&buffer, cell, 0); - if(DIFFERENT(buffer.cells[0].display, cell.display)) - ASSERT("buffer not same", false); - ASSERT("GOOD", true); - }(); - - PICKLE(Test_get_cell) { -#ifdef TART_RGB_COLORS - tart_rgb foreground = {90,90,90}; - tart_rgb background = {80,80,80}; - -#else - tart_byte foreground = 9; - tart_byte background = 8; -#endif - - struct tart_cell cell = tart_create_cell('0',10,foreground, background); - struct tart_buffer buffer = tart_create_buffer(10, {10,20}, {10,20}); - struct tart_window window = tart_create_window(); - - tart_set_cell(&buffer, cell, 0); - if(DIFFERENT(tart_get_cell(&buffer,0)->display, cell.display)) - ASSERT("buffer not same", false); - ASSERT("GOOD", true); - }(); - - - - ADDPICKLE(tart_objects_test,Test_create_buffer); - ADDPICKLE(tart_objects_test,Test_create_cell); - ADDPICKLE(tart_objects_test,Test_create_buffer); - ADDPICKLE(tart_objects_test,Test_add_buffer); - ADDPICKLE(tart_objects_test,Test_set_buffer); - ADDPICKLE(tart_objects_test,Test_get_buffer); - ADDPICKLE(tart_objects_test,Test_set_cell); - ADDPICKLE(tart_objects_test,Test_get_cell); - PUTJARONSHELF(tart_objects_test); - *shelf = __pickle_shelf__; -} diff --git a/testing/test_tart.h b/testing/test_tart.h deleted file mode 100644 index dfd1eaa..0000000 --- a/testing/test_tart.h +++ /dev/null @@ -1,6 +0,0 @@ -#include -#include - -bool rgb_test(struct tart_rgb* lhs, struct tart_rgb* rhs); -bool vec2_test(struct tart_vec2* lhs, struct tart_vec2* rhs); -void tart_run(struct pickle_shelf* shelf); diff --git a/testing/test_term.cpp b/testing/test_term.cpp deleted file mode 100644 index 963a34a..0000000 --- a/testing/test_term.cpp +++ /dev/null @@ -1,48 +0,0 @@ - -#if defined(_WIN64) || defined(_WIN32) -#include -#else -#include -#include -#include -#endif -#include -#include "test_term.h" -void term_run(struct pickle_shelf* shelf) { - struct pickle_shelf __pickle_shelf__ = *shelf; //start - - - CREATEJAR(Test_Term); - - PICKLE(Test_get_window_size) { -#if defined(_WIN64) || defined(_WIN32) - CONSOLE_SCREEN_BUFFER_INFO csbi; - - GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi); - int columns = (unsigned int)(csbi.srWindow.Right - csbi.srWindow.Left + 1); - int rows = (unsigned int)(csbi.srWindow.Bottom - csbi.srWindow.Top + 1); -#else - struct winsize w; - - - ioctl(STDOUT_FILENO, TIOCGWINSZ, &w); - - unsigned int rows = w.ws_row; - unsigned int columns = w.ws_col; -#endif - - std::cout << "\n"; - std::cout << term_current_size().x << "term_current_size()\n"; - std::cout << columns << " columns\n"; - - if(term_current_size().x != columns) - ASSERT("current_size.x is not the same as columns", false); - if(term_current_size().y != rows) - ASSERT("current_size.y is not the same as rows", false); - ASSERT("GOOD", true); - }(); - - ADDPICKLE(Test_Term, Test_get_window_size); - PUTJARONSHELF(Test_Term); - *shelf = __pickle_shelf__; // end -} diff --git a/testing/test_term.h b/testing/test_term.h deleted file mode 100644 index 80a739a..0000000 --- a/testing/test_term.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef TEST_TERM_H -#define TEST_TERM_H - -#include -#include -void term_run(struct pickle_shelf*); -#endif