diff options
author | Alexander Neundorf <neundorf@kde.org> | 2009-09-06 14:26:24 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2009-09-06 14:26:24 (GMT) |
commit | f5bcc82b131d48addae3ce1af383f0b142bece74 (patch) | |
tree | 360d208154e15ef35fdfe3a82c725988de88ed2e /Tests/StringFileTest | |
parent | 91fec6d89c5538f4642d8320424e4dc128be0976 (diff) | |
download | CMake-f5bcc82b131d48addae3ce1af383f0b142bece74.zip CMake-f5bcc82b131d48addae3ce1af383f0b142bece74.tar.gz CMake-f5bcc82b131d48addae3ce1af383f0b142bece74.tar.bz2 |
Add a test for FILE(READ ... HEX) together with a tiny binary file.
Alex
Diffstat (limited to 'Tests/StringFileTest')
-rw-r--r-- | Tests/StringFileTest/CMakeLists.txt | 9 | ||||
-rw-r--r-- | Tests/StringFileTest/test.bin | bin | 0 -> 5 bytes |
2 files changed, 9 insertions, 0 deletions
diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt index 798b9cd..2e052bf 100644 --- a/Tests/StringFileTest/CMakeLists.txt +++ b/Tests/StringFileTest/CMakeLists.txt @@ -5,6 +5,15 @@ INCLUDE_DIRECTORIES(${StringFileTest_BINARY_DIR}) # Read file test FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile) +# Test reading a binary file into hex representation +FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/test.bin" hexContents HEX) + +IF("${hexContents}" STREQUAL "0001027700") + MESSAGE("FILE(READ HEX) correctly read [${hexContents}]") +ELSE("${hexContents}" STREQUAL "0001027700") + MESSAGE(SEND_ERROR "FILE(READ HEX) incorrectly read [${hexContents}], but expected was [0001027700]") +ENDIF("${hexContents}" STREQUAL "0001027700") + # FILE(STRINGS) test FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile_strings LIMIT_COUNT 1 LIMIT_INPUT 1024 LIMIT_OUTPUT 1024 diff --git a/Tests/StringFileTest/test.bin b/Tests/StringFileTest/test.bin Binary files differnew file mode 100644 index 0000000..18d62a1 --- /dev/null +++ b/Tests/StringFileTest/test.bin |