lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 1cbbac5 2/2: Make unit test more robust


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 1cbbac5 2/2: Make unit test more robust
Date: Wed, 23 Nov 2016 20:24:44 +0000 (UTC)

branch: master
commit 1cbbac5bf0230bf64d80a1d8680842ae9bc8ff99
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Make unit test more robust
    
    When a file does not exist, boost::filesystem::last_write_time throws an
    exception whose what() string includes "File not found" on GNU/Linux,
    but "cannot find the file specified" on msw. It seems silly to require
    either of those when another OS might say something different. In this
    unit test, it is sufficient that an exception is thrown and its what()
    string contains the name of the nonexistent file.
    
    This change makes this unit test work at least as well on GNU/Linux as
    it already did elsewhere, as nongnu.org requests.
---
 cache_file_reads_test.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cache_file_reads_test.cpp b/cache_file_reads_test.cpp
index 855cbb4..5df80fe 100644
--- a/cache_file_reads_test.cpp
+++ b/cache_file_reads_test.cpp
@@ -86,7 +86,7 @@ void cache_file_reads_test::test_preconditions()
     BOOST_TEST_THROW
         (X::read_via_cache("no_such_file")
         ,boost::filesystem::filesystem_error
-        ,lmi_test::what_regex("no_such_file.*cannot find the file specified")
+        ,lmi_test::what_regex("no_such_file")
         );
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]