#endif
+// ----------------------------------------------------------------------------
+// Specialize numeric_limits<> for our long long wrapper classes.
+// ----------------------------------------------------------------------------
+
+#if wxUSE_LONGLONG_NATIVE
+
+#include <limits>
+
+namespace std
+{
+
+template<> class numeric_limits<wxLongLong>
+ : public numeric_limits<wxLongLong_t>
+{
+};
+
+template<> class numeric_limits<wxULongLong>
+ : public numeric_limits<wxULongLong_t>
+{
+};
+
+} // namespace std
+
+#endif // wxUSE_LONGLONG_NATIVE
+
#endif // wxUSE_LONGLONG
#endif // _WX_LONGLONG_H
CPPUNIT_TEST( BitOperations );
CPPUNIT_TEST( ToString );
CPPUNIT_TEST( LoHi );
+ CPPUNIT_TEST( Limits );
CPPUNIT_TEST_SUITE_END();
void Conversion();
void BitOperations();
void ToString();
void LoHi();
+ void Limits();
DECLARE_NO_COPY_CLASS(LongLongTestCase)
};
CPPUNIT_ASSERT_EQUAL( 987u, ull.GetHi() );
}
+void LongLongTestCase::Limits()
+{
+#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 // wxUSE_LONGLONG