diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2020-09-09 12:21:20 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-09-09 12:21:26 (GMT) |
commit | e366977e62edc366e5b7ac38ed6c1c5cf729b428 (patch) | |
tree | 6323e24d8740467eec569ea72cf3aa419137c44e /Tests/CMakeLib | |
parent | 9a0a5f84208f652d3ce84e141adf7e9b304574cb (diff) | |
parent | 0c9cdf30ed91fb4705efed578f90af3226d8fe9f (diff) | |
download | CMake-e366977e62edc366e5b7ac38ed6c1c5cf729b428.zip CMake-e366977e62edc366e5b7ac38ed6c1c5cf729b428.tar.gz CMake-e366977e62edc366e5b7ac38ed6c1c5cf729b428.tar.bz2 |
Merge topic 'cmstrlen'
0c9cdf30ed cmStringAlgorithms: Add cmStrLen()
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5201
Diffstat (limited to 'Tests/CMakeLib')
-rw-r--r-- | Tests/CMakeLib/testStringAlgorithms.cxx | 10 |
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; } |