Rename dbl list

This commit is contained in:
2026-06-26 17:11:27 +01:00
parent 1a0a5b5192
commit f0e9da26bd
8 changed files with 260 additions and 260 deletions
+15 -15
View File
@@ -5,13 +5,13 @@
#include <string.h>
WpTestFuncResult test_commander_cmd_success(void) {
WpStr8List cmd = wapp_dbl_list(WpStr8);
WpStr8List cmd = wpDblList(WpStr8);
WpStr8 echo = wpStr8Lit("echo");
WpStr8 msg = wpStr8Lit("hello world");
wapp_dbl_list_push_back(WpStr8, &cmd, &echo);
wapp_dbl_list_push_back(WpStr8, &cmd, &msg);
wpDblListPushBack(WpStr8, &cmd, &echo);
wpDblListPushBack(WpStr8, &cmd, &msg);
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_DISCARD, nullptr, &cmd);
WpCmdResult result = wpShellCommanderExecute(SHELL_OUTPUT_DISCARD, nullptr, &cmd);
b8 succeeded = result.exited && result.exit_code == EXIT_SUCCESS &&
result.error == SHELL_ERR_NO_ERROR;
@@ -19,11 +19,11 @@ WpTestFuncResult test_commander_cmd_success(void) {
}
WpTestFuncResult test_commander_cmd_failure(void) {
WpStr8List cmd = wapp_dbl_list(WpStr8);
WpStr8List cmd = wpDblList(WpStr8);
WpStr8 grep = wpStr8Lit("grep");
wapp_dbl_list_push_back(WpStr8, &cmd, &grep);
wpDblListPushBack(WpStr8, &cmd, &grep);
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_DISCARD, nullptr, &cmd);
WpCmdResult result = wpShellCommanderExecute(SHELL_OUTPUT_DISCARD, nullptr, &cmd);
b8 failed = result.exited && result.exit_code != EXIT_SUCCESS &&
result.error == SHELL_ERR_NO_ERROR;
@@ -36,13 +36,13 @@ WpTestFuncResult test_commander_cmd_out_buf_success(void) {
char msg[] = "hello world";
wpStr8CopyCstrCapped(&expected, msg);
WpStr8List cmd = wapp_dbl_list(WpStr8);
WpStr8List cmd = wpDblList(WpStr8);
WpStr8 echo = wpStr8Lit("echo");
WpStr8 arg = wpStr8Lit(msg);
wapp_dbl_list_push_back(WpStr8, &cmd, &echo);
wapp_dbl_list_push_back(WpStr8, &cmd, &arg);
wpDblListPushBack(WpStr8, &cmd, &echo);
wpDblListPushBack(WpStr8, &cmd, &arg);
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_CAPTURE, &buf, &cmd);
WpCmdResult result = wpShellCommanderExecute(SHELL_OUTPUT_CAPTURE, &buf, &cmd);
b8 succeeded = result.exited && result.exit_code == EXIT_SUCCESS &&
result.error == SHELL_ERR_NO_ERROR && wpStr8EqualToCount(&buf, &expected, strlen(msg));
@@ -55,13 +55,13 @@ WpTestFuncResult test_commander_cmd_out_buf_failure(void) {
char msg[] = "hello world";
wpStr8CopyCstrCapped(&expected, msg);
WpStr8List cmd = wapp_dbl_list(WpStr8);
WpStr8List cmd = wpDblList(WpStr8);
WpStr8 echo = wpStr8Lit("echo");
WpStr8 arg = wpStr8Lit(msg);
wapp_dbl_list_push_back(WpStr8, &cmd, &echo);
wapp_dbl_list_push_back(WpStr8, &cmd, &arg);
wpDblListPushBack(WpStr8, &cmd, &echo);
wpDblListPushBack(WpStr8, &cmd, &arg);
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_CAPTURE, &buf, &cmd);
WpCmdResult result = wpShellCommanderExecute(SHELL_OUTPUT_CAPTURE, &buf, &cmd);
b8 failed = !result.exited && result.exit_code != EXIT_SUCCESS &&
result.error == SHELL_ERR_OUT_BUF_FULL && !wpStr8Equal(&buf, &expected);