Add wpArrayRemoveSwapEnd
Release / release (push) Successful in 3s

This commit is contained in:
2026-09-19 22:41:10 +01:00
parent 9029e21a4f
commit 3c81feedbb
8 changed files with 56 additions and 3 deletions
+13
View File
@@ -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;
+13
View File
@@ -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;
+1
View File
@@ -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);
+1
View File
@@ -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,
+1
View File
@@ -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,