From 1cb9ef817334235fa9ebb57060b6df78d1a0b058 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 15 Jan 2014 19:40:28 -0500 Subject: file DOWNLOAD: Test non-zero return status. --- Tests/CMakeTests/FileDownloadTest.cmake.in | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Tests/CMakeTests/FileDownloadTest.cmake.in b/Tests/CMakeTests/FileDownloadTest.cmake.in index 91086c6..83ade2b 100644 --- a/Tests/CMakeTests/FileDownloadTest.cmake.in +++ b/Tests/CMakeTests/FileDownloadTest.cmake.in @@ -94,3 +94,16 @@ file(DOWNLOAD EXPECTED_MD5 d16778650db435bda3a8c3435c3ff5d1 ) 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() -- cgit v0.12