Reformat
This commit is contained in:
parent
a0dfe8acd0
commit
16a1b8fa35
@ -19,12 +19,9 @@ internal inline void *mem_arena_realloc_aligned(void *ptr, u64 old_size, u64 new
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/***************************************************************************/ //
|
||||
|
||||
Allocator wapp_mem_arena_allocator_init_custom(u64 base_capacity,
|
||||
MemAllocFlags flags,
|
||||
bool zero_buffer) {
|
||||
Allocator wapp_mem_arena_allocator_init_custom(u64 base_capacity, MemAllocFlags flags, bool zero_buffer) {
|
||||
Allocator allocator = {0};
|
||||
bool initialised = wapp_mem_arena_init_custom(
|
||||
(Arena **)(&allocator.obj), base_capacity, flags, zero_buffer);
|
||||
bool initialised = wapp_mem_arena_init_custom((Arena **)(&allocator.obj), base_capacity, flags, zero_buffer);
|
||||
if (!initialised) {
|
||||
return allocator;
|
||||
}
|
||||
@ -57,8 +54,7 @@ internal inline void *mem_arena_alloc(u64 size, void *alloc_obj) {
|
||||
return wapp_mem_arena_alloc(arena, size);
|
||||
}
|
||||
|
||||
internal inline void *mem_arena_alloc_aligned(u64 size, u64 alignment,
|
||||
void *alloc_obj) {
|
||||
internal inline void *mem_arena_alloc_aligned(u64 size, u64 alignment, void *alloc_obj) {
|
||||
Arena *arena = (Arena *)alloc_obj;
|
||||
return wapp_mem_arena_alloc_aligned(arena, size, alignment);
|
||||
}
|
||||
|
@ -7,9 +7,7 @@
|
||||
#include <string.h>
|
||||
|
||||
TestFuncResult test_commander_cmd_success(void) {
|
||||
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_DISCARD, NULL, 0,
|
||||
"echo", "hello world");
|
||||
|
||||
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_DISCARD, NULL, 0, "echo", "hello world");
|
||||
bool succeeded = result.exited && result.exit_code == EXIT_SUCCESS &&
|
||||
result.error == SHELL_ERR_NO_ERROR;
|
||||
|
||||
@ -17,9 +15,7 @@ TestFuncResult test_commander_cmd_success(void) {
|
||||
}
|
||||
|
||||
TestFuncResult test_commander_cmd_failure(void) {
|
||||
CMDResult result =
|
||||
wapp_shell_commander_execute(SHELL_OUTPUT_DISCARD, NULL, 0, "grep");
|
||||
|
||||
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_DISCARD, NULL, 0, "grep");
|
||||
bool failed = result.exited && result.exit_code != EXIT_SUCCESS &&
|
||||
result.error == SHELL_ERR_NO_ERROR;
|
||||
|
||||
@ -32,9 +28,7 @@ TestFuncResult test_commander_cmd_out_buf_success(void) {
|
||||
const char *msg = "hello world";
|
||||
sprintf(expected_output, "%s\n", msg);
|
||||
|
||||
CMDResult result =
|
||||
wapp_shell_commander_execute(SHELL_OUTPUT_CAPTURE, buf, 64, "echo", msg);
|
||||
|
||||
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_CAPTURE, buf, 64, "echo", msg);
|
||||
bool succeeded = result.exited && result.exit_code == EXIT_SUCCESS &&
|
||||
result.error == SHELL_ERR_NO_ERROR &&
|
||||
strcmp(buf, expected_output) == 0;
|
||||
@ -45,9 +39,7 @@ TestFuncResult test_commander_cmd_out_buf_success(void) {
|
||||
TestFuncResult test_commander_cmd_out_buf_failure(void) {
|
||||
char buf[4] = {0};
|
||||
const char *msg = "hello world";
|
||||
CMDResult result =
|
||||
wapp_shell_commander_execute(SHELL_OUTPUT_CAPTURE, buf, 4, "echo", msg);
|
||||
|
||||
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_CAPTURE, buf, 4, "echo", msg);
|
||||
bool failed = !result.exited && result.exit_code != EXIT_SUCCESS &&
|
||||
result.error == SHELL_ERR_OUT_BUF_FULL && strcmp(buf, msg) != 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user