summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeLib
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-09-03 15:50:25 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-09-08 14:15:54 (GMT)
commit0c9cdf30ed91fb4705efed578f90af3226d8fe9f (patch)
tree48bed865afbe34bcd23374cb88e0c17c18a3c467 /Tests/CMakeLib
parent412cc37d357fbbaf5b67e54585dbdd1fbc0a6ae2 (diff)
downloadCMake-0c9cdf30ed91fb4705efed578f90af3226d8fe9f.zip
CMake-0c9cdf30ed91fb4705efed578f90af3226d8fe9f.tar.gz
CMake-0c9cdf30ed91fb4705efed578f90af3226d8fe9f.tar.bz2
cmStringAlgorithms: Add cmStrLen()
Diffstat (limited to 'Tests/CMakeLib')
-rw-r--r--Tests/CMakeLib/testStringAlgorithms.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/Tests/CMakeLib/testStringAlgorithms.cxx b/Tests/CMakeLib/testStringAlgorithms.cxx
index 63826cf..c2706c1 100644
--- a/Tests/CMakeLib/testStringAlgorithms.cxx
+++ b/Tests/CMakeLib/testStringAlgorithms.cxx
@@ -226,5 +226,15 @@ int testStringAlgorithms(int /*unused*/, char* /*unused*/ [])
"cmStrToULong rejects trailing content.");
}
+ // ----------------------------------------------------------------------
+ // Test cmStrLen
+ {
+ constexpr auto len = cmStrLen("Hello world!");
+ assert_ok(len == 12,
+ "cmStrLen returns length of non-empty literal string");
+ assert_ok(cmStrLen("") == 0,
+ "cmStrLen returns length of empty literal string");
+ }
+
return failed;
}