aboutsummaryrefslogtreecommitdiff
path: root/tests/strcase/driver.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-09-28 17:58:00 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-09-28 17:58:47 +0300
commit8f14a22e5bbb71d90577b35a09ba8ffae04bfe9c (patch)
tree96bce706024b3ec200170d5e090ac41615887606 /tests/strcase/driver.cxx
parentf488e6473a7d0562c0e2df6d107a36de4d30d9da (diff)
Rename casecmp() function and case_compare_[c_]string structs to icasecmp() and icase_compare_[c_]string
Diffstat (limited to 'tests/strcase/driver.cxx')
-rw-r--r--tests/strcase/driver.cxx28
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/strcase/driver.cxx b/tests/strcase/driver.cxx
index e9b779c..4ebe5f4 100644
--- a/tests/strcase/driver.cxx
+++ b/tests/strcase/driver.cxx
@@ -28,35 +28,35 @@ main ()
const string upper ("+/0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ");
const string lower ("+/0123456789abcdefghijklmnopqrstuvwxyz");
- assert (casecmp (upper, lower) == 0);
- assert (casecmp (upper, lower, upper.size ()) == 0);
- assert (casecmp (upper, lower, 100) == 0);
- assert (casecmp ("a", "A1") < 0);
- assert (casecmp ("A1", "a") > 0);
- assert (casecmp ("a", "A1", 1) == 0);
- assert (casecmp ("A1", "a", 1) == 0);
- assert (casecmp ("a", "b", 0) == 0);
+ assert (icasecmp (upper, lower) == 0);
+ assert (icasecmp (upper, lower, upper.size ()) == 0);
+ assert (icasecmp (upper, lower, 100) == 0);
+ assert (icasecmp ("a", "A1") < 0);
+ assert (icasecmp ("A1", "a") > 0);
+ assert (icasecmp ("a", "A1", 1) == 0);
+ assert (icasecmp ("A1", "a", 1) == 0);
+ assert (icasecmp ("a", "b", 0) == 0);
for (size_t i (0); i < upper.size (); ++i)
{
- assert (casecmp (upper[i], lower[i]) == 0);
+ assert (icasecmp (upper[i], lower[i]) == 0);
if (i > 0)
{
- assert (casecmp (upper[i], lower[i - 1]) > 0);
- assert (casecmp (lower[i - 1], upper[i]) < 0);
+ assert (icasecmp (upper[i], lower[i - 1]) > 0);
+ assert (icasecmp (lower[i - 1], upper[i]) < 0);
}
}
- // As casecmp() compares strings as if they have been converted to the
+ // As icasecmp() compares strings as if they have been converted to the
// lower case the characters [\]^_` (located between 'Z' and 'a' in the ASCII
// table) evaluates as less than any alphabetic character.
//
string ascii_91_96 ("[\\]^_`");
for (const auto& c: ascii_91_96)
{
- assert (casecmp (&c, "A", 1) < 0);
- assert (casecmp (&c, "a", 1) < 0);
+ assert (icasecmp (&c, "A", 1) < 0);
+ assert (icasecmp (&c, "a", 1) < 0);
}
assert (ucase (lower) == upper);