From 3fbd0ad869d51b15fe8c8f052a2c67761669e068 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 2 Jan 2008 18:00:19 -0500 Subject: [PATCH] ENH: Add test for FILE(READ ...HEX). --- Tests/StringFileTest/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt index 97689479f..f3041c348 100644 --- a/Tests/StringFileTest/CMakeLists.txt +++ b/Tests/StringFileTest/CMakeLists.txt @@ -16,6 +16,13 @@ ELSE("${infile_strings}" STREQUAL "${infile_strings_goal}") "FILE(STRINGS) incorrectly read [${infile_strings}]") ENDIF("${infile_strings}" STREQUAL "${infile_strings_goal}") +# test reading a file and getting its binary data as hex string +FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/main.srec" infilehex LIMIT 4 HEX) +IF(NOT "${infilehex}" STREQUAL "53313036") + MESSAGE(SEND_ERROR + "FILE(READ ... HEX) error, read: \"${infilehex}\", expected \"53313036\"") +ENDIF(NOT "${infilehex}" STREQUAL "53313036") + # test that FILE(STRINGS) also work with Intel hex and Motorola S-record files # this file has been created with "sdcc main.c"