[svn-r23037] Correct string variable handling/reference

Tested: local and windows
This commit is contained in:
Allen Byrne 2012-11-16 09:03:49 -05:00
parent 4e2e8d118c
commit b06253f597

View File

@ -110,13 +110,13 @@ IF (NOT TEST_SKIP_COMPARE)
# now compare the output with the reference
SET (TEST_RESULT 0)
FILE (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
LIST (LENGTH test_act len_act)
LIST (LENGTH "${test_act}" len_act)
FILE (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
LIST (LENGTH test_ref len_ref)
LIST (LENGTH "${test_ref}" len_ref)
MATH (EXPR _FP_LEN "${len_ref} - 1")
FOREACH (line RANGE 0 ${_FP_LEN})
LIST (GET test_act ${line} str_act)
LIST (GET test_ref ${line} str_ref)
LIST (GET "${test_act}" ${line} str_act)
LIST (GET "${test_ref}" ${line} str_ref)
STRING (COMPARE NOTEQUAL ${str_act} ${str_ref} str_res)
IF (${str_res})
SET (TEST_RESULT 1)
@ -143,13 +143,13 @@ IF (NOT TEST_SKIP_COMPARE)
# now compare the error output with the error reference
SET (TEST_RESULT 0)
FILE (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act)
LIST (LENGTH test_act len_act)
LIST (LENGTH "${test_act}" len_act)
FILE (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref)
LIST (LENGTH test_ref len_ref)
LIST (LENGTH "${test_ref}" len_ref)
MATH (EXPR _FP_LEN "${len_ref} - 1")
FOREACH (line RANGE 0 ${_FP_LEN})
LIST (GET test_act ${line} str_act)
LIST (GET test_ref ${line} str_ref)
LIST (GET "${test_act}" ${line} str_act)
LIST (GET "${test_ref}" ${line} str_ref)
STRING (COMPARE NOTEQUAL ${str_act} ${str_ref} str_res)
IF (${str_res})
SET (TEST_RESULT 1)