refactor(string): remove mcl namespace

This commit is contained in:
2025-09-08 19:18:34 +02:00
parent a21f759d23
commit ed23ef8bf2
4 changed files with 54 additions and 54 deletions

View File

@@ -11,27 +11,27 @@ void test_str1(void) {
char *c_str;
/* Allocate a new dynamic string with an initial capacity */
mcl_string_s *str = mcl_string_new("Hello, world!", 512);
string_s *str = string_new("Hello, world!", 512);
assert(str != NULL);
/* Retrieve a C str from string with mcl_string_cstr() */
c_str = mcl_string_cstr(str);
length = mcl_string_length(str);
capacity = mcl_string_capacity(str);
c_str = string_cstr(str);
length = string_len(str);
capacity = string_cap(str);
assert(strcmp(c_str, "Hello, world!") == 0);
assert(length == 13);
assert(capacity == 512);
/* Append text to a mcl_string */
assert(mcl_string_append(str, " How are you?") == 0);
assert(string_append(str, " How are you?") == 0);
c_str = mcl_string_cstr(str);
length = mcl_string_length(str);
capacity = mcl_string_capacity(str);
c_str = string_cstr(str);
length = string_len(str);
capacity = string_cap(str);
assert(strcmp(c_str, "Hello, world! How are you?") == 0);
assert(length == 26);
assert(capacity == 512);
/* Always deallocate memory */
mcl_string_free(str);
string_free(str);
}