Quellcode durchsuchen

tests: Enchanced test for faux_str_casecmpn().

Serj Kalichev vor 4 Monaten
Ursprung
Commit
9761840f8f
3 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 2 2
      faux/str/str.c
  2. 1 1
      faux/str/testc_str.c
  3. 1 1
      faux/testc_module/testc_module.c

+ 2 - 2
faux/str/str.c

@@ -428,10 +428,10 @@ int faux_str_casecmp(const char *str1, const char *str2)
 	if (!p1 && !p2) // Empty strings are equal
 		return 0;
 
-	if (!p1) // Consider NULL string to be less then empty string
+	if (!p1) // Consider NULL string to be less than empty string
 		return -1;
 
-	if (!p2) // Consider NULL string to be less then empty string
+	if (!p2) // Consider NULL string to be less than empty string
 		return 1;
 
 	while (*p1 != '\0' && *p2 != '\0') {

+ 1 - 1
faux/str/testc_str.c

@@ -161,7 +161,7 @@ int testc_faux_str_c_esc_quote(void)
 int testc_faux_str_casecmpn(void)
 {
 	const char *line_long = "abcdefj";
-	const char *line_short = "abcde";
+	const char *line_short = "aBCde";
 	const char *line_diff = "abche";
 
 	if (faux_str_casecmpn(line_long, line_short, strlen(line_short)) != 0) {

+ 1 - 1
faux/testc_module/testc_module.c

@@ -18,7 +18,7 @@ const char *testc_module[][2] = {
 	{"testc_faux_str_getline", "Get line from string"},
 	{"testc_faux_str_numcmp", "Numeric comparison"},
 	{"testc_faux_str_c_esc_quote", "Escape and add quotes for string with spaces"},
-	{"testc_faux_str_casecmpn", "String comparison with length"},
+	{"testc_faux_str_casecmpn", "String comparison with length ignoring case"},
 
 	// ini
 	{"testc_faux_ini_parse_file", "Complex test of INI file parsing"},