## Summary Standardize naming conventions across the entire wizapp-stdlib codebase by replacing inconsistent prefixes and snake_case with a unified `wp` prefix + CamelCase scheme. ## Changes ### Naming convention applied | Pattern | Before | After | |---|---|---| | Public functions | `wapp_module_function` | `wpModuleFunction` | | Public types | `GenericXxx`, bare `Xxx` | `WpXxx` | | Constants / enum values | `WAPP_XXX`, `SHELL_XXX` | `WP_XXX`, `WP_SHELL_XXX` | | Internal functions | `_module_function` | `_moduleFunction` | | Storage-class macros | `wapp_extern`, `wapp_intern` | `wp_extern`, `wp_intern` | ### Modules affected All 20 modules were renamed: `arena`, `array`, `dbl_list`, `queue`, `str8`, `mem_allocator`, `mem_utils`, `mem_os`, `file`, `cpath`, `log`, `shell_commander`, `shell_termcolour`, `shell_utils`, `prng/xorshift`, `uuid`, `tester`, `aliases`, `assert`, `misc_utils`, `platform` — plus their test files. ### Backward compatibility Added `src/oldnames.h` with `#define OLD_NAME NEW_NAME` for every renamed symbol, organized by module under Constants → Types → Functions sections. Existing code that includes this file will compile without changes. Reviewed-on: #12 Co-authored-by: Abdelrahman <said.abdelrahman89@gmail.com> Co-committed-by: Abdelrahman <said.abdelrahman89@gmail.com>
This commit was merged in pull request #12.
This commit is contained in:
+17
-17
@@ -8,23 +8,23 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
wapp_intern void handle_test_result(TestFuncResult result);
|
||||
wp_intern void handleTestResult(WpTestFuncResult result);
|
||||
|
||||
void run_tests(TestFunc *func1, ...) {
|
||||
void _runTests(WpTestFunc *func1, ...) {
|
||||
printf("\n");
|
||||
|
||||
handle_test_result(func1());
|
||||
handleTestResult(func1());
|
||||
|
||||
va_list args;
|
||||
va_start(args, func1);
|
||||
|
||||
TestFunc *func = va_arg(args, TestFunc *);
|
||||
WpTestFunc *func = va_arg(args, WpTestFunc *);
|
||||
|
||||
while (func) {
|
||||
TestFuncResult result = func();
|
||||
handle_test_result(result);
|
||||
WpTestFuncResult result = func();
|
||||
handleTestResult(result);
|
||||
|
||||
func = va_arg(args, TestFunc *);
|
||||
func = va_arg(args, WpTestFunc *);
|
||||
}
|
||||
|
||||
va_end(args);
|
||||
@@ -32,22 +32,22 @@ void run_tests(TestFunc *func1, ...) {
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
wapp_intern void handle_test_result(TestFuncResult result) {
|
||||
TerminalColour colour;
|
||||
Str8 result_text = wapp_str8_buf(64);
|
||||
wp_intern void handleTestResult(WpTestFuncResult result) {
|
||||
WpTerminalColour colour;
|
||||
WpStr8 result_text = wpStr8Buf(64);
|
||||
|
||||
if (result.passed) {
|
||||
colour = WAPP_TERM_COLOUR_FG_BR_GREEN;
|
||||
wapp_str8_copy_cstr_capped(&result_text, "PASSED");
|
||||
colour = WP_TERM_COLOUR_FG_BR_GREEN;
|
||||
wpStr8CopyCstrCapped(&result_text, "PASSED");
|
||||
} else {
|
||||
colour = WAPP_TERM_COLOUR_FG_BR_RED;
|
||||
wapp_str8_copy_cstr_capped(&result_text, "FAILED");
|
||||
colour = WP_TERM_COLOUR_FG_BR_RED;
|
||||
wpStr8CopyCstrCapped(&result_text, "FAILED");
|
||||
}
|
||||
|
||||
printf("[");
|
||||
wapp_shell_termcolour_print_text(&result_text, colour);
|
||||
wapp_shell_termcolour_clear_colour();
|
||||
printf("] " WAPP_STR8_SPEC "\n", wapp_str8_varg(result.name));
|
||||
wpShellTermcolourPrintText(&result_text, colour);
|
||||
wpShellTermcolourClearColour();
|
||||
printf("] " WP_STR8_SPEC "\n", wpStr8Varg(result.name));
|
||||
|
||||
if (!result.passed) {
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
Reference in New Issue
Block a user