Rename dbl list
This commit is contained in:
@@ -5,11 +5,11 @@
|
||||
#include <string.h>
|
||||
|
||||
WpTestFuncResult test_commander_cmd_success(void) {
|
||||
WpStr8List cmd = wapp_dbl_list(WpStr8);
|
||||
wapp_dbl_list_push_back(WpStr8, &cmd, &wpStr8Lit("echo"));
|
||||
wapp_dbl_list_push_back(WpStr8, &cmd, &wpStr8Lit("hello world"));
|
||||
WpStr8List cmd = wpDblList(WpStr8);
|
||||
wpDblListPushBack(WpStr8, &cmd, &wpStr8Lit("echo"));
|
||||
wpDblListPushBack(WpStr8, &cmd, &wpStr8Lit("hello world"));
|
||||
|
||||
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_DISCARD, NULL, &cmd);
|
||||
WpCmdResult result = wpShellCommanderExecute(SHELL_OUTPUT_DISCARD, NULL, &cmd);
|
||||
b8 succeeded = result.exited && result.exit_code == EXIT_SUCCESS &&
|
||||
result.error == SHELL_ERR_NO_ERROR;
|
||||
|
||||
@@ -17,10 +17,10 @@ WpTestFuncResult test_commander_cmd_success(void) {
|
||||
}
|
||||
|
||||
WpTestFuncResult test_commander_cmd_failure(void) {
|
||||
WpStr8List cmd = wapp_dbl_list(WpStr8);
|
||||
wapp_dbl_list_push_back(WpStr8, &cmd, &wpStr8Lit("grep"));
|
||||
WpStr8List cmd = wpDblList(WpStr8);
|
||||
wpDblListPushBack(WpStr8, &cmd, &wpStr8Lit("grep"));
|
||||
|
||||
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_DISCARD, NULL, &cmd);
|
||||
WpCmdResult result = wpShellCommanderExecute(SHELL_OUTPUT_DISCARD, NULL, &cmd);
|
||||
b8 failed = result.exited && result.exit_code != EXIT_SUCCESS &&
|
||||
result.error == SHELL_ERR_NO_ERROR;
|
||||
|
||||
@@ -33,11 +33,11 @@ WpTestFuncResult test_commander_cmd_out_buf_success(void) {
|
||||
char msg[] = "hello world";
|
||||
wpStr8CopyCstrCapped(&expected, msg);
|
||||
|
||||
WpStr8List cmd = wapp_dbl_list(WpStr8);
|
||||
wapp_dbl_list_push_back(WpStr8, &cmd, &wpStr8Lit("echo"));
|
||||
wapp_dbl_list_push_back(WpStr8, &cmd, &wpStr8Lit(msg));
|
||||
WpStr8List cmd = wpDblList(WpStr8);
|
||||
wpDblListPushBack(WpStr8, &cmd, &wpStr8Lit("echo"));
|
||||
wpDblListPushBack(WpStr8, &cmd, &wpStr8Lit(msg));
|
||||
|
||||
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));
|
||||
|
||||
@@ -50,11 +50,11 @@ WpTestFuncResult test_commander_cmd_out_buf_failure(void) {
|
||||
char msg[] = "hello world";
|
||||
wpStr8CopyCstrCapped(&expected, msg);
|
||||
|
||||
WpStr8List cmd = wapp_dbl_list(WpStr8);
|
||||
wapp_dbl_list_push_back(WpStr8, &cmd, &wpStr8Lit("echo"));
|
||||
wapp_dbl_list_push_back(WpStr8, &cmd, &wpStr8Lit(msg));
|
||||
WpStr8List cmd = wpDblList(WpStr8);
|
||||
wpDblListPushBack(WpStr8, &cmd, &wpStr8Lit("echo"));
|
||||
wpDblListPushBack(WpStr8, &cmd, &wpStr8Lit(msg));
|
||||
|
||||
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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user