Compare commits

...

2 Commits

Author SHA1 Message Date
587d52aab3 working on fixing tests 2025-02-08 13:09:55 -08:00
2edd898677 fixed submodules 2025-02-08 12:37:00 -08:00
7 changed files with 18 additions and 8 deletions

3
.gitmodules vendored
View File

@@ -1,3 +1,6 @@
[submodule "externals/Pickler"] [submodule "externals/Pickler"]
path = externals/Pickler path = externals/Pickler
url = http://www.gitea.preacherdhm.com/PreacherDHM/Pickler.git url = http://www.gitea.preacherdhm.com/PreacherDHM/Pickler.git
[submodule "testing/externals/Pickler"]
path = testing/externals/Pickler
url = http://www.gitea.preacherdhm.com/PreacherDHM/Pickler.git

View File

@@ -1 +0,0 @@
add_subdirectory(Pickler)

View File

@@ -17,7 +17,6 @@ struct tart_window tart_create_window() {
for(int i = 0; i < 0xFF; i++) { for(int i = 0; i < 0xFF; i++) {
window.buffers[i] = tart_create_buffer(0, (struct tart_vec2){0,0},(struct tart_vec2){0,0}); window.buffers[i] = tart_create_buffer(0, (struct tart_vec2){0,0},(struct tart_vec2){0,0});
} }
char* data = (char*)malloc((size.x*size.y) * (sizeof(char) * TART_CELL_DATA_SIZE));
window.size = term_current_size(); window.size = term_current_size();
return window; return window;
} }

View File

@@ -1,4 +1,5 @@
project(TartTest) project(TartTest)
add_subdirectory(externals)
set( CMAKE_CXX_STANDARD 11) set( CMAKE_CXX_STANDARD 11)
set( CMAKE_CXX_STANDARD_REQUIRED ON) set( CMAKE_CXX_STANDARD_REQUIRED ON)
set( SOURCES set( SOURCES
@@ -7,10 +8,17 @@ set( SOURCES
test_term.cpp test_term.cpp
) )
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/tests)
add_executable(${PROJECT_NAME} ${SOURCES} ) add_executable(${PROJECT_NAME} ${SOURCES} )
target_link_libraries(${PROJECT_NAME} TartLib PickleLib) target_link_libraries(${PROJECT_NAME} TartLib PickleLib)
add_test(${PROJECT_NAME} "${CMAKE_SOURCE_DIR}/bin/testing.exe") 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) project(InputTartTest)
set( CMAKE_CXX_STANDARD 11) set( CMAKE_CXX_STANDARD 11)

1
testing/externals/CMakeLists.txt vendored Normal file
View File

@@ -0,0 +1 @@
add_subdirectory(Pickler)

View File

@@ -17,13 +17,13 @@ void tart_run(struct pickle_shelf* shelf) {
pickle_shelf __pickle_shelf__ = *shelf; pickle_shelf __pickle_shelf__ = *shelf;
CREATEJAR(tart_objects_test); CREATEJAR(tart_objects_test);
PICKLE(Test_create_buffer) { PICKLE(Test_create_buffer) {
tart_vec2 size = {25,25}; struct tart_vec2 size = {25,25};
tart_vec2 position = {0,0}; struct tart_vec2 position = {0,0};
int data_count = (size.x*size.y) * TART_CELL_DATA_SIZE; int data_count = (size.x*size.y) * TART_CELL_DATA_SIZE;
unsigned int cell_count = (size.x * size.y); unsigned int cell_count = (size.x * size.y);
struct tart_buffer buffer_correct = {cell_count,0,25,size,position,0,0,data_count}; struct tart_buffer buffer_correct = {cell_count,0,25,size,position,0};
struct tart_buffer buffer_test = tart_create_buffer(25,size,position); struct tart_buffer buffer_test = tart_create_buffer(25,size,position);
if(DIFFERENT(buffer_correct.cell_count,buffer_test.cell_count)) if(DIFFERENT(buffer_correct.cell_count,buffer_test.cell_count))
@@ -40,7 +40,7 @@ void tart_run(struct pickle_shelf* shelf) {
ASSERT("position.x is not the same.",false); ASSERT("position.x is not the same.",false);
if(DIFFERENT(buffer_correct.position.y,buffer_test.position.y)) if(DIFFERENT(buffer_correct.position.y,buffer_test.position.y))
ASSERT("position.y is not the same.",false); ASSERT("position.y is not the same.",false);
if(DIFFERENT(buffer_correct.data_count,buffer_test.data_count)) if(DIFFERENT(buffer_correct.cell_count,buffer_test.cell_count))
ASSERT("data_counts are not the same.",false); ASSERT("data_counts are not the same.",false);
ASSERT("GOOD",true); ASSERT("GOOD",true);
}(); }();
@@ -60,7 +60,7 @@ void tart_run(struct pickle_shelf* shelf) {
#else #else
tart_byte f = 20; tart_byte f = 20;
tart_byte b = 40; tart_byte b = 40;
struct tart_cell cell_correct = {f, b, '1', 'f',0}; struct tart_cell cell_correct = {f, b, '1', 'f'};
struct tart_cell cell_test = tart_create_cell('f', '1', f, b); struct tart_cell cell_test = tart_create_cell('f', '1', f, b);
if(DIFFERENT(cell_correct.foreground, cell_test.foreground)) if(DIFFERENT(cell_correct.foreground, cell_test.foreground))
ASSERT("Forground dose not match.",false); ASSERT("Forground dose not match.",false);