Rename Tester

This commit is contained in:
2026-06-26 15:53:08 +01:00
parent cdca775681
commit 28f95b1d41
34 changed files with 479 additions and 479 deletions
+24 -24
View File
@@ -13,22 +13,22 @@ wp_intern I32Array src_array2;
wp_intern I32Array src_array3;
wp_intern I32Array dst_array ;
TestFuncResult test_wapp_file_open(void) {
WpTestFuncResult test_wapp_file_open(void) {
arena = wapp_mem_arena_allocator_init(KiB(16));
src_array1 = wapp_array(i32, 0, 1, 2, 3, 4);
src_array2 = wapp_array(i32, 5, 6, 7, 8, 9);
src_array3 = wapp_array(i32, 10, 11, 12, 13, 14);
dst_array = wapp_array_with_capacity(i32, DST_CAPACITY, false);
test_fp = wapp_file_open(&arena, &test_filename, WAPP_ACCESS_WRITE_EX);
return wapp_tester_result(test_fp != NULL);
return wpTesterResult(test_fp != NULL);
}
TestFuncResult test_wapp_file_get_current_position(void) {
WpTestFuncResult test_wapp_file_get_current_position(void) {
i64 pos = wapp_file_get_current_position(test_fp);
return wapp_tester_result(pos == 0);
return wpTesterResult(pos == 0);
}
TestFuncResult test_wapp_file_seek(void) {
WpTestFuncResult test_wapp_file_seek(void) {
wapp_file_write_array((GenericArray)src_array1, test_fp, wapp_array_count(src_array1));
i64 seek_result = wapp_file_seek(test_fp, 0, WAPP_SEEK_END);
@@ -36,15 +36,15 @@ TestFuncResult test_wapp_file_seek(void) {
wapp_file_seek(test_fp, 0, WAPP_SEEK_START);
return wapp_tester_result(result);
return wpTesterResult(result);
}
TestFuncResult test_wapp_file_get_length(void) {
WpTestFuncResult test_wapp_file_get_length(void) {
i64 length = wapp_file_get_length(test_fp);
return wapp_tester_result(length == (i64)(wapp_array_count(src_array1) * wapp_array_item_size(src_array1)));
return wpTesterResult(length == (i64)(wapp_array_count(src_array1) * wapp_array_item_size(src_array1)));
}
TestFuncResult test_wapp_file_read(void) {
WpTestFuncResult test_wapp_file_read(void) {
wapp_file_seek(test_fp, 0, WAPP_SEEK_START);
u64 byte_count = DST_CAPACITY * sizeof(i32);
@@ -61,19 +61,19 @@ TestFuncResult test_wapp_file_read(void) {
running = index < DST_CAPACITY;
}
return wapp_tester_result(result);
return wpTesterResult(result);
}
TestFuncResult test_wapp_file_write(void) {
WpTestFuncResult test_wapp_file_write(void) {
wapp_file_seek(test_fp, 0, WAPP_SEEK_END);
u64 expected_count = wapp_array_count(src_array2) * wapp_array_item_size(src_array2);
i64 count = wapp_file_write((void *)src_array2, test_fp, expected_count);
return wapp_tester_result(count >= 0 && (u64)count == expected_count);
return wpTesterResult(count >= 0 && (u64)count == expected_count);
}
TestFuncResult test_wapp_file_read_array(void) {
WpTestFuncResult test_wapp_file_read_array(void) {
wapp_file_seek(test_fp, 0, WAPP_SEEK_START);
u64 count = wapp_file_read_array((GenericArray)dst_array, test_fp, wapp_array_count(src_array1));
@@ -90,33 +90,33 @@ TestFuncResult test_wapp_file_read_array(void) {
running = index < wapp_array_count(dst_array);
}
return wapp_tester_result(result);
return wpTesterResult(result);
}
TestFuncResult test_wapp_file_write_array(void) {
WpTestFuncResult test_wapp_file_write_array(void) {
wapp_file_seek(test_fp, 0, WAPP_SEEK_END);
i64 count = wapp_file_write_array((GenericArray)src_array3, test_fp, wapp_array_count(src_array3));
return wapp_tester_result(count >= 0 && (u64)count == wapp_array_count(src_array3));
return wpTesterResult(count >= 0 && (u64)count == wapp_array_count(src_array3));
}
TestFuncResult test_wapp_file_flush(void) {
WpTestFuncResult test_wapp_file_flush(void) {
i32 flush_result = wapp_file_flush(test_fp);
return wapp_tester_result(flush_result == 0);
return wpTesterResult(flush_result == 0);
}
TestFuncResult test_wapp_file_close(void) {
WpTestFuncResult test_wapp_file_close(void) {
i32 close_result = wapp_file_close(test_fp);
return wapp_tester_result(close_result == 0);
return wpTesterResult(close_result == 0);
}
TestFuncResult test_wapp_file_rename(void) {
WpTestFuncResult test_wapp_file_rename(void) {
i32 rename_result = wapp_file_rename(&test_filename, &new_filename);
return wapp_tester_result(rename_result == 0);
return wpTesterResult(rename_result == 0);
}
TestFuncResult test_wapp_file_remove(void) {
WpTestFuncResult test_wapp_file_remove(void) {
i32 remove_result = wapp_file_remove(&new_filename);
return wapp_tester_result(remove_result == 0);
return wpTesterResult(remove_result == 0);
}