Update dbl_list functionality

This commit is contained in:
Abdelrahman Said
2025-04-16 00:42:20 +01:00
parent 778a4da092
commit 31373eba03
5 changed files with 68 additions and 67 deletions

View File

@@ -7,8 +7,8 @@
TestFuncResult test_commander_cmd_success(void) {
DBL_LIST(Str8) cmd = {0};
wapp_dbl_list_push_back(Str8, &cmd, &wapp_str8_node_from_cstr("echo"));
wapp_dbl_list_push_back(Str8, &cmd, &wapp_str8_node_from_cstr("hello world"));
wapp_dbl_list_push_back(&cmd, &wapp_str8_node_from_cstr("echo"));
wapp_dbl_list_push_back(&cmd, &wapp_str8_node_from_cstr("hello world"));
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_DISCARD, NULL, &cmd);
bool succeeded = result.exited && result.exit_code == EXIT_SUCCESS &&
@@ -19,7 +19,7 @@ TestFuncResult test_commander_cmd_success(void) {
TestFuncResult test_commander_cmd_failure(void) {
DBL_LIST(Str8) cmd = {0};
wapp_dbl_list_push_back(Str8, &cmd, &wapp_str8_node_from_cstr("grep"));
wapp_dbl_list_push_back(&cmd, &wapp_str8_node_from_cstr("grep"));
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_DISCARD, NULL, &cmd);
bool failed = result.exited && result.exit_code != EXIT_SUCCESS &&
@@ -35,8 +35,8 @@ TestFuncResult test_commander_cmd_out_buf_success(void) {
wapp_str8_copy_cstr_capped(&expected, msg);
DBL_LIST(Str8) cmd = {0};
wapp_dbl_list_push_back(Str8, &cmd, &wapp_str8_node_from_cstr("echo"));
wapp_dbl_list_push_back(Str8, &cmd, &wapp_str8_node_from_cstr(msg));
wapp_dbl_list_push_back(&cmd, &wapp_str8_node_from_cstr("echo"));
wapp_dbl_list_push_back(&cmd, &wapp_str8_node_from_cstr(msg));
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_CAPTURE, &buf, &cmd);
bool succeeded = result.exited && result.exit_code == EXIT_SUCCESS &&
@@ -52,8 +52,8 @@ TestFuncResult test_commander_cmd_out_buf_failure(void) {
wapp_str8_copy_cstr_capped(&expected, msg);
DBL_LIST(Str8) cmd = {0};
wapp_dbl_list_push_back(Str8, &cmd, &wapp_str8_node_from_cstr("echo"));
wapp_dbl_list_push_back(Str8, &cmd, &wapp_str8_node_from_cstr(msg));
wapp_dbl_list_push_back(&cmd, &wapp_str8_node_from_cstr("echo"));
wapp_dbl_list_push_back(&cmd, &wapp_str8_node_from_cstr(msg));
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_CAPTURE, &buf, &cmd);
bool failed = !result.exited && result.exit_code != EXIT_SUCCESS &&