From f3f345eec970a3008e3971263593a4c24c9d3ca6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 1 Nov 2017 19:35:56 +0100 Subject: [PATCH] Fix harmless signed/unsigned comparison warnings in a test These warnings appeared after switching to Catch, just use the same type for all variables to avoid them. --- tests/config/config.cpp | 8 ++++---- tests/fswatcher/fswatchertest.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/config/config.cpp b/tests/config/config.cpp index 597f681d27..b33d03cc0a 100644 --- a/tests/config/config.cpp +++ b/tests/config/config.cpp @@ -49,7 +49,7 @@ private: void RecordingDefaultsTest(); // return the number of values we (attempted to) read - int ReadValues(wxConfig *config, bool has_values); + size_t ReadValues(wxConfig *config, bool has_values); wxDECLARE_NO_COPY_CLASS(ConfigTestCase); }; @@ -135,9 +135,9 @@ void ConfigTestCase::ReadWriteLocalTest() delete config; } -int ConfigTestCase::ReadValues(wxConfig *config, bool has_values) +size_t ConfigTestCase::ReadValues(wxConfig *config, bool has_values) { - int read = 0; + size_t read = 0; bool r; wxString string1 = config->Read(wxT("string1"), wxT("abc")); @@ -202,7 +202,7 @@ void ConfigTestCase::RecordingDefaultsTest() ReadValues(config, false); CPPUNIT_ASSERT_EQUAL( 0, config->GetNumberOfEntries() ); config->SetRecordDefaults(true); - int read = ReadValues(config, false); + size_t read = ReadValues(config, false); CPPUNIT_ASSERT_EQUAL( read, config->GetNumberOfEntries() ); ReadValues(config, true); config->DeleteAll(); diff --git a/tests/fswatcher/fswatchertest.cpp b/tests/fswatcher/fswatchertest.cpp index 961da588d4..d19b5e5c09 100644 --- a/tests/fswatcher/fswatchertest.cpp +++ b/tests/fswatcher/fswatchertest.cpp @@ -831,7 +831,7 @@ void FileSystemWatcherTestCase::TestTrees() { CPPUNIT_ASSERT(m_watcher); - size_t treeitems = 1; // the trunk + int treeitems = 1; // the trunk #if !defined(__WINDOWS__) && !defined(wxHAVE_FSEVENTS_FILE_NOTIFICATIONS) // When there's no file mask, wxMSW and wxOSX set a single watch // on the trunk which is implemented recursively. @@ -862,7 +862,7 @@ void FileSystemWatcherTestCase::TestTrees() // as it was the first time, despite also adding 'child' separately // Except that in wxMSW this isn't true: each watch will be a // single, recursive dir; so fudge the count - size_t fudge = 0; + int fudge = 0; #if defined(__WINDOWS__) || defined(wxHAVE_FSEVENTS_FILE_NOTIFICATIONS) fudge = 1; #endif // __WINDOWS__ || wxHAVE_FSEVENTS_FILE_NOTIFICATIONS @@ -903,9 +903,9 @@ void FileSystemWatcherTestCase::TestTrees() // and another +1 for "child"). // On OS X, if we use FSEvents then we still only have 1 watch. #ifdef wxHAVE_FSEVENTS_FILE_NOTIFICATIONS - const size_t treeitems = 1; + const int treeitems = 1; #else - const size_t treeitems = subdirs + 2; + const int treeitems = subdirs + 2; #endif m_watcher->AddTree(dir, wxFSW_EVENT_ALL, "*.txt");