]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/longlong/longlongtest.cpp
Convert wxFSW_EVENT_{WARNING,ERROR} to string correctly.
[wxWidgets.git] / tests / longlong / longlongtest.cpp
index f7790a1658bd69d2fa9582408f7559d0134835f5..595a86553db69e0a30173a3ed9175afb3c4a5631 100644 (file)
@@ -69,6 +69,7 @@ private:
         CPPUNIT_TEST( BitOperations );
         CPPUNIT_TEST( ToString );
         CPPUNIT_TEST( LoHi );
+        CPPUNIT_TEST( Limits );
     CPPUNIT_TEST_SUITE_END();
 
     void Conversion();
@@ -79,6 +80,7 @@ private:
     void BitOperations();
     void ToString();
     void LoHi();
+    void Limits();
 
     DECLARE_NO_COPY_CLASS(LongLongTestCase)
 };
@@ -86,7 +88,7 @@ private:
 // register in the unnamed registry so that these tests are run by default
 CPPUNIT_TEST_SUITE_REGISTRATION( LongLongTestCase );
 
-// also include in it's own registry so that these tests can be run alone
+// also include in its own registry so that these tests can be run alone
 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( LongLongTestCase, "LongLongTestCase" );
 
 LongLongTestCase::LongLongTestCase()
@@ -337,4 +339,19 @@ void LongLongTestCase::LoHi()
     CPPUNIT_ASSERT_EQUAL( 987u, ull.GetHi() );
 }
 
+void LongLongTestCase::Limits()
+{
+    // VC6 doesn't specialize numeric_limits<> for __int64 so skip this test
+    // for it.
+#ifndef __VISUALC6__
+#if wxUSE_LONGLONG_NATIVE
+    CPPUNIT_ASSERT( std::numeric_limits<wxLongLong>::is_specialized );
+    CPPUNIT_ASSERT( std::numeric_limits<wxULongLong>::is_specialized );
+
+    wxULongLong maxval = std::numeric_limits<wxULongLong>::max();
+    CPPUNIT_ASSERT( maxval.ToDouble() > 0 );
+#endif // wxUSE_LONGLONG_NATIVE
+#endif // !__VISUALC6__
+}
+
 #endif // wxUSE_LONGLONG