summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2023-07-18 20:07:23 +0300
committerEd Tanous <ed@tanous.net>2024-01-19 22:43:50 +0300
commit18f8f608b966c802b3e2a389e3c1ec5a1fd9407b (patch)
tree89684cb74b7492ffc1e34fb8e3a004de18726071 /test
parentf86bcc875a496b3c321a4ed102579a4031617800 (diff)
downloadbmcweb-18f8f608b966c802b3e2a389e3c1ec5a1fd9407b.tar.xz
Remove some boost includes
The less we rely on boost, and more on std algorithms, the less people have to look up, and the more likely that our code will deduplicate. Replace all uses of boost::algorithms with std alternatives. Tested: Redfish Service Validator passes. Change-Id: I8a26f39b5709adc444b4178e92f5f3c7b988b05b Signed-off-by: Ed Tanous <edtanous@google.com>
Diffstat (limited to 'test')
-rw-r--r--test/include/str_utility_test.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/include/str_utility_test.cpp b/test/include/str_utility_test.cpp
index a32ce09d95..c52cab9527 100644
--- a/test/include/str_utility_test.cpp
+++ b/test/include/str_utility_test.cpp
@@ -49,4 +49,29 @@ TEST(Split, Sensor)
"unit", "name"));
}
+TEST(AsciiToLower, Positive)
+{
+ using bmcweb::asciiToLower;
+ // Noop
+ EXPECT_EQ(asciiToLower('a'), 'a');
+ EXPECT_EQ(asciiToLower('z'), 'z');
+ EXPECT_EQ(asciiToLower('0'), '0');
+ EXPECT_EQ(asciiToLower('_'), '_');
+
+ // Converted
+ EXPECT_EQ(asciiToLower('A'), 'a');
+ EXPECT_EQ(asciiToLower('Z'), 'z');
+}
+
+TEST(AsciiIEquals, Positive)
+{
+ using bmcweb::asciiIEquals;
+ EXPECT_TRUE(asciiIEquals("FOO", "foo"));
+ EXPECT_TRUE(asciiIEquals("foo", "foo"));
+ EXPECT_TRUE(asciiIEquals("", ""));
+ EXPECT_TRUE(asciiIEquals("_", "_"));
+
+ EXPECT_FALSE(asciiIEquals("bar", "foo"));
+}
+
} // namespace