diff options
author | FeRD (Frank Dana) <ferdnyc@gmail.com> | 2022-06-05 17:18:16 (GMT) |
---|---|---|
committer | FeRD (Frank Dana) <ferdnyc@gmail.com> | 2022-06-06 16:27:11 (GMT) |
commit | d8dcfa7776002756efbc30e45be305e425103e31 (patch) | |
tree | 1f6757ecaeb65f48e16b8fec43d4dcb706bcf412 /Tests/RunCMake/PrintHelpers/rot13.c | |
parent | b7ddfcfe084ac1c2652dab524938f84dc37f6230 (diff) | |
download | CMake-d8dcfa7776002756efbc30e45be305e425103e31.zip CMake-d8dcfa7776002756efbc30e45be305e425103e31.tar.gz CMake-d8dcfa7776002756efbc30e45be305e425103e31.tar.bz2 |
Tests: Add tests for CMakePrintHelpers
Add three tests in Tests/RunCMake/PrintHelpers, meant to verify
basic functionality of the module. Tests are:
* Variables: Test the results of a cmake_print_variables()
call on two variables set within the test script.
* Properties: Test cmake_print_properties() calls on a pair
of SOURCES and a pair of TARGETS, printing some basic properties.
* PropertiesSources: Specifically verify the results of a
cmake_print_properties() call for the SOURCES property of a
TARGET. Prior to the fix introduced alongside these tests, it
was a known bug that such a request caused a FATAL_ERROR.
Diffstat (limited to 'Tests/RunCMake/PrintHelpers/rot13.c')
-rw-r--r-- | Tests/RunCMake/PrintHelpers/rot13.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/PrintHelpers/rot13.c b/Tests/RunCMake/PrintHelpers/rot13.c new file mode 100644 index 0000000..053bebd --- /dev/null +++ b/Tests/RunCMake/PrintHelpers/rot13.c @@ -0,0 +1,15 @@ +#include "rot13.h" + +void rot13(char* in) +{ + char* end = in + strlen(in); + for (char* c = in; c < end; c++) { + if (*c >= 'a' && *c <= 'z') { + *c += (*c < 'n') ? 13 : -13; + continue; + } + if (*c >= 'A' && *c <= 'Z') { + *c += (*c < 'N') ? 13 : -13; + } + } +} |