]> git.saurik.com Git - wxWidgets.git/commitdiff
work around (harmless) warnings in VC7 release build
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 6 Jun 2009 23:04:50 +0000 (23:04 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 6 Jun 2009 23:04:50 +0000 (23:04 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60922 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/cppunit.h
tests/archive/tartest.cpp
tests/archive/ziptest.cpp
tests/regex/regextest.cpp

index bd131dd57af4e7afe52bcd709060a4a4d1d23bf7..7e10e80a6891ef6e9c3acb1e140d380c512448a7 100644 (file)
 //
 
 #include "wx/beforestd.h"
+#ifdef __VISUALC__
+    // with cppunit 1.12 we get many bogus warnings 4701 (local variable may be
+    // used without having been initialized) in TestAssert.h
+    #pragma warning(disable:4701)
+#endif
+
 #include <cppunit/extensions/TestFactoryRegistry.h>
 #include <cppunit/ui/text/TestRunner.h>
 #include <cppunit/TestCase.h>
 #include <cppunit/extensions/HelperMacros.h>
 #include <cppunit/CompilerOutputter.h>
+
+#ifdef __VISUALC__
+    #pragma warning(default:4701)
+#endif
 #include "wx/afterstd.h"
 
 #include "wx/string.h"
index 2ff2006d8e3fbe7017f5f97c23962d9ab7d368f1..d0110526ff03a806f77d28e2d1cbb68fb484aa97 100644 (file)
@@ -59,13 +59,15 @@ CppUnit::Test *tartest::makeTest(
         return NULL;
 
     if (genericInterface)
+    {
         return new ArchiveTestCase<wxArchiveClassFactory>(
                             descr, new wxTarClassFactory,
                             options, archiver, unarchiver);
-    else
-        return new ArchiveTestCase<wxTarClassFactory>(
-                            descr, new wxTarClassFactory,
-                            options, archiver, unarchiver);
+    }
+
+    return new ArchiveTestCase<wxTarClassFactory>(
+                        descr, new wxTarClassFactory,
+                        options, archiver, unarchiver);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(tartest);
index 966e6e78a0b5e4e87d8a03e0ef97d363c0283a90..4204c7dfb7c0fe67ed7a1f5a72fbf57cfca82905 100644 (file)
@@ -261,11 +261,13 @@ CppUnit::Test *ziptest::makeTest(
         return NULL;
 
     if (genericInterface)
+    {
         return new ArchiveTestCase<wxArchiveClassFactory>(
                             descr, new wxZipClassFactory,
                             options, archiver, unarchiver);
-    else
-        return new ZipTestCase(descr, options, archiver, unarchiver);
+    }
+
+    return new ZipTestCase(descr, options, archiver, unarchiver);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(ziptest);
index 042741ed3e5207722ef51d211f50156326820941..822012b8e20b017fcb62ac2080f604bebec15e5f 100644 (file)
@@ -170,8 +170,8 @@ wxString RegExTestCase::Conv(const char *str)
 
     if (!buf || wxWcscmp(wxConvCurrent->cWX2WC(buf), wstr) != 0)
         return convError();
-    else
-        return buf;
+
+    return buf;
 }
 
 // Parse flags