@@ -245,6 +245,19 @@ WpTestFuncResult test_i32_array_copy_alloc(void) {
|
||||
return wpTesterResult(result);
|
||||
}
|
||||
|
||||
WpTestFuncResult test_i32_array_remove_swap_end(void) {
|
||||
b8 result;
|
||||
|
||||
WpI32Array array = wpArray(i32, 0, 1, 2, 3, 4, 5, 6, 7, 8);
|
||||
result = wpArrayCount(array) == 9 && array[4] == 4;
|
||||
|
||||
wpArrayRemoveSwapEnd(i32, array, 4);
|
||||
|
||||
result = result && wpArrayCount(array) == 8 && array[4] == 8;
|
||||
|
||||
return wpTesterResult(result);
|
||||
}
|
||||
|
||||
WpTestFuncResult test_i32_array_pop(void) {
|
||||
b8 result;
|
||||
|
||||
|
||||
@@ -261,6 +261,19 @@ WpTestFuncResult test_i32_array_clear(void) {
|
||||
return wpTesterResult(result);
|
||||
}
|
||||
|
||||
WpTestFuncResult test_i32_array_remove_swap_end(void) {
|
||||
b8 result;
|
||||
|
||||
WpI32Array array = wpArray(i32, 0, 1, 2, 3, 4, 5, 6, 7, 8);
|
||||
result = wpArrayCount(array) == 9 && array[4] == 4;
|
||||
|
||||
wpArrayRemoveSwapEnd(i32, array, 4);
|
||||
|
||||
result = result && wpArrayCount(array) == 8 && array[4] == 8;
|
||||
|
||||
return wpTesterResult(result);
|
||||
}
|
||||
|
||||
WpTestFuncResult test_i32_array_pop(void) {
|
||||
b8 result;
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ WpTestFuncResult test_i32_array_alloc_capacity(void);
|
||||
WpTestFuncResult test_i32_array_append_alloc(void);
|
||||
WpTestFuncResult test_i32_array_extend_alloc(void);
|
||||
WpTestFuncResult test_i32_array_copy_alloc(void);
|
||||
WpTestFuncResult test_i32_array_remove_swap_end(void);
|
||||
WpTestFuncResult test_i32_array_pop(void);
|
||||
WpTestFuncResult test_i32_array_clear(void);
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ int main(void) {
|
||||
test_i32_array_append_alloc,
|
||||
test_i32_array_extend_alloc,
|
||||
test_i32_array_copy_alloc,
|
||||
test_i32_array_remove_swap_end,
|
||||
test_i32_array_pop,
|
||||
test_i32_array_clear,
|
||||
test_queue_push,
|
||||
|
||||
@@ -44,6 +44,7 @@ int main(void) {
|
||||
test_i32_array_append_alloc,
|
||||
test_i32_array_extend_alloc,
|
||||
test_i32_array_copy_alloc,
|
||||
test_i32_array_remove_swap_end,
|
||||
test_i32_array_pop,
|
||||
test_i32_array_clear,
|
||||
test_queue_push,
|
||||
|
||||
Reference in New Issue
Block a user