1
1
mirror of https://github.com/theoludwig/libcproject.git synced 2025-05-21 23:21:15 +02:00

refactor: avoid usage of char*, instead use string_t

This commit is contained in:
2023-08-10 00:32:49 +02:00
parent 07e2f4db45
commit c6df05e634
6 changed files with 14 additions and 14 deletions

View File

@@ -10,7 +10,7 @@ void convert_test() {
}
void convert_character_to_string_test() {
char* result = convert_character_to_string('a');
string_t result = convert_character_to_string('a');
assert(assert_string_equal(result, "a"));
free(result);
@@ -77,7 +77,7 @@ void convert_string_to_number_test() {
}
void convert_number_to_string_test() {
char* result = convert_number_to_string(0);
string_t result = convert_number_to_string(0);
assert(assert_string_equal(result, "0"));
free(result);
@@ -143,7 +143,7 @@ void convert_number_to_string_test() {
}
void convert_number_from_base_to_another_test() {
char* result = convert_number_from_base_to_another("15", 10, 16);
string_t result = convert_number_from_base_to_another("15", 10, 16);
assert(assert_string_equal(result, "F"));
free(result);

View File

@@ -203,7 +203,7 @@ void string_get_is_substring_test() {
}
void string_get_formatted_number_test() {
char* result = string_get_formatted_number(1000, " ");
string_t result = string_get_formatted_number(1000, " ");
assert(assert_string_equal(result, "1 000"));
free(result);
@@ -235,7 +235,7 @@ void string_get_formatted_number_test() {
void string_get_last_occurence_of_character_test() {
string_t string = "abcdef";
char* result = string_get_last_occurence_of_character(string, 'a');
string_t result = string_get_last_occurence_of_character(string, 'a');
assert(assert_string_equal(result, "abcdef"));
free(result);