file DOWNLOAD: Test non-zero return status.

This commit is contained in:
Matt McCormick 2014-01-15 19:40:28 -05:00
parent f73f0fb357
commit 1cb9ef8173
1 changed files with 13 additions and 0 deletions

View File

@ -94,3 +94,16 @@ file(DOWNLOAD
EXPECTED_MD5 d16778650db435bda3a8c3435c3ff5d1 EXPECTED_MD5 d16778650db435bda3a8c3435c3ff5d1
) )
message(STATUS "${status}") message(STATUS "${status}")
message(STATUS "FileDownload:11")
file(DOWNLOAD
badhostname.png
${dir}/file11.png
TIMEOUT 2
STATUS status
)
message(STATUS "${status}")
list(GET status 0 status_code)
if(NOT ${status_code} EQUAL 6)
message(SEND_ERROR "error: expected status code 6 for bad host name, got: ${status_code}")
endif()