Switch to using b32

This commit is contained in:
Abdelrahman Said
2025-09-14 21:25:56 +01:00
parent b4eb8d2760
commit b7eff6a3e4
31 changed files with 227 additions and 249 deletions

View File

@@ -1,6 +1,5 @@
#include "test_shell_commander.h"
#include "wapp.h"
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -13,7 +12,7 @@ TestFuncResult test_commander_cmd_success(void) {
wapp_str8_list_push_back(&cmd, &msg);
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_DISCARD, nullptr, &cmd);
bool succeeded = result.exited && result.exit_code == EXIT_SUCCESS &&
b32 succeeded = result.exited && result.exit_code == EXIT_SUCCESS &&
result.error == SHELL_ERR_NO_ERROR;
return wapp_tester_result(succeeded);
@@ -25,7 +24,7 @@ TestFuncResult test_commander_cmd_failure(void) {
wapp_str8_list_push_back(&cmd, &grep);
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_DISCARD, nullptr, &cmd);
bool failed = result.exited && result.exit_code != EXIT_SUCCESS &&
b32 failed = result.exited && result.exit_code != EXIT_SUCCESS &&
result.error == SHELL_ERR_NO_ERROR;
return wapp_tester_result(failed);
@@ -44,7 +43,7 @@ TestFuncResult test_commander_cmd_out_buf_success(void) {
wapp_str8_list_push_back(&cmd, &arg);
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_CAPTURE, &buf, &cmd);
bool succeeded = result.exited && result.exit_code == EXIT_SUCCESS &&
b32 succeeded = result.exited && result.exit_code == EXIT_SUCCESS &&
result.error == SHELL_ERR_NO_ERROR && wapp_str8_equal_to_count(&buf, &expected, strlen(msg));
return wapp_tester_result(succeeded);
@@ -63,7 +62,7 @@ TestFuncResult test_commander_cmd_out_buf_failure(void) {
wapp_str8_list_push_back(&cmd, &arg);
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_CAPTURE, &buf, &cmd);
bool failed = !result.exited && result.exit_code != EXIT_SUCCESS &&
b32 failed = !result.exited && result.exit_code != EXIT_SUCCESS &&
result.error == SHELL_ERR_OUT_BUF_FULL && !wapp_str8_equal(&buf, &expected);
return wapp_tester_result(failed);