X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a7b7798282622e445efc3318b6c85ff0bed9af8..fec34ef52dad898e72dd488f939ea0db5ec09ead:/tests/config/fileconf.cpp diff --git a/tests/config/fileconf.cpp b/tests/config/fileconf.cpp index a7f67216a3..65e2e6fbaa 100644 --- a/tests/config/fileconf.cpp +++ b/tests/config/fileconf.cpp @@ -80,6 +80,7 @@ private: CPPUNIT_TEST( DeleteLastGroup ); CPPUNIT_TEST( DeleteAndRecreateGroup ); CPPUNIT_TEST( AddToExistingRoot ); + CPPUNIT_TEST( ReadNonExistent ); CPPUNIT_TEST_SUITE_END(); void Path(); @@ -101,6 +102,7 @@ private: void DeleteLastGroup(); void DeleteAndRecreateGroup(); void AddToExistingRoot(); + void ReadNonExistent(); static wxString ChangePath(wxFileConfig& fc, const wxChar *path) @@ -628,5 +630,24 @@ void FileConfigTestCase::AddToExistingRoot() ); } +void FileConfigTestCase::ReadNonExistent() +{ + static const char *confTest = + "community=censored\n" + "[City1]\n" + "URL=www.fake1.na\n" + "[City1/A1]\n" + "[City1/A1/1]\n" + "IP=192.168.1.66\n" + "URL=www.fake2.na\n" + ; + + wxStringInputStream sis(confTest); + wxFileConfig fc(sis); + + wxString url; + CPPUNIT_ASSERT( !fc.Read("URL", &url) ); +} + #endif // wxUSE_FILECONFIG