Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68129 - trunk/libs/chrono/test
From: vicente.botet_at_[hidden]
Date: 2011-01-13 17:08:23


Author: viboes
Date: 2011-01-13 17:08:21 EST (Thu, 13 Jan 2011)
New Revision: 68129
URL: http://svn.boost.org/trac/boost/changeset/68129

Log:
Boost.Chrono: Add more test for windows.h emulation

Text files modified:
   trunk/libs/chrono/test/win32_test.cpp | 61 ++++++++++++++++++++++++++++++++++-----
   1 files changed, 52 insertions(+), 9 deletions(-)

Modified: trunk/libs/chrono/test/win32_test.cpp
==============================================================================
--- trunk/libs/chrono/test/win32_test.cpp (original)
+++ trunk/libs/chrono/test/win32_test.cpp 2011-01-13 17:08:21 EST (Thu, 13 Jan 2011)
@@ -8,18 +8,19 @@
 // See http://www.boost.org/libs/chrono for documentation.
 #include <boost/chrono/config.hpp>
 #include <boost/detail/lightweight_test.hpp>
-#if defined(BOOST_CHRONO_WINDOWS_API)
+#if defined(BOOST_CHRONO_WINDOWS_API) || defined(__CYGWIN__)
 
 #include <boost/chrono/detail/static_assert.hpp>
 #if !defined(BOOST_NO_STATIC_ASSERT)
 #define NOTHING ""
 #endif
 
+#include <boost/type_traits.hpp>
+#include <boost/typeof/typeof.hpp>
+#undef BOOST_USE_WINDOWS_H
 #include <boost/detail/win/basic_types.hpp>
 #include <boost/detail/win/time.hpp>
 #include <windows.h>
-#include <boost/type_traits.hpp>
-#include <boost/typeof/typeof.hpp>
 
 void test() {
     {
@@ -34,42 +35,72 @@
     BOOST_CHRONO_STATIC_ASSERT((
             offsetof(boost::detail::win32::LARGE_INTEGER_, QuadPart)==offsetof(LARGE_INTEGER, QuadPart)
         ), NOTHING, (boost::detail::win32::LARGE_INTEGER_, LARGE_INTEGER));
+ BOOST_CHRONO_STATIC_ASSERT((
+ boost::is_same<
+ BOOST_TYPEOF(a.QuadPart),
+ BOOST_TYPEOF(b.QuadPart)
+ >::value
+ ), NOTHING, (boost::detail::win32::LARGE_INTEGER_, LARGE_INTEGER));
     }
-// BOOST_CHRONO_STATIC_ASSERT((
-// boost::is_same<
-// BOOST_TYPEOF(boost::detail::win32::LARGE_INTEGER_::QuadPart),
-// BOOST_TYPEOF(LARGE_INTEGER::QuadPart)
-// >::value
-// ), NOTHING, (boost::detail::win32::LARGE_INTEGER_, LARGE_INTEGER));
 
     BOOST_CHRONO_STATIC_ASSERT((
             sizeof(boost::detail::win32::BOOL_)==sizeof(BOOL)
         ), NOTHING, (boost::detail::win32::BOOL_, BOOL));
     BOOST_CHRONO_STATIC_ASSERT((
+ boost::is_same<boost::detail::win32::BOOL_,BOOL>::value
+ ), NOTHING, (boost::detail::win32::BOOL_, BOOL));
+
+ BOOST_CHRONO_STATIC_ASSERT((
             sizeof(boost::detail::win32::DWORD_)==sizeof(DWORD)
         ), NOTHING, (boost::detail::win32::DWORD_, DWORD));
     BOOST_CHRONO_STATIC_ASSERT((
+ boost::is_same<boost::detail::win32::DWORD_,DWORD>::value
+ ), NOTHING, (boost::detail::win32::DWORD_, DWORD));
+
+ BOOST_CHRONO_STATIC_ASSERT((
             sizeof(boost::detail::win32::HANDLE_)==sizeof(HANDLE)
         ), NOTHING, (boost::detail::win32::HANDLE_, HANDLE));
     BOOST_CHRONO_STATIC_ASSERT((
+ boost::is_same<boost::detail::win32::HANDLE_,HANDLE>::value
+ ), NOTHING, (boost::detail::win32::HANDLE_, HANDLE));
+
+ BOOST_CHRONO_STATIC_ASSERT((
             sizeof(boost::detail::win32::LONG_)==sizeof(LONG)
         ), NOTHING, (boost::detail::win32::LONG_, LONG));
     BOOST_CHRONO_STATIC_ASSERT((
+ boost::is_same<boost::detail::win32::LONG_,LONG>::value
+ ), NOTHING, (boost::detail::win32::LONG_, LONG));
+
+ BOOST_CHRONO_STATIC_ASSERT((
             sizeof(boost::detail::win32::LONGLONG_)==sizeof(LONGLONG)
         ), NOTHING, (boost::detail::win32::LONGLONG_, LONGLONG));
     BOOST_CHRONO_STATIC_ASSERT((
             boost::is_same<boost::detail::win32::LONGLONG_,LONGLONG>::value
         ), NOTHING, (boost::detail::win32::LONGLONG_, LONGLONG));
+
+ BOOST_CHRONO_STATIC_ASSERT((
+ sizeof(boost::detail::win32::ULONG_PTR_)==sizeof(ULONG_PTR)
+ ), NOTHING, (boost::detail::win32::ULONG_PTR_, ULONG_PTR));
+ BOOST_CHRONO_STATIC_ASSERT((
+ boost::is_same<boost::detail::win32::ULONG_PTR_,ULONG_PTR>::value
+ ), NOTHING, (boost::detail::win32::ULONG_PTR_, ULONG_PTR));
+
     BOOST_CHRONO_STATIC_ASSERT((
             sizeof(boost::detail::win32::PLARGE_INTEGER_)==sizeof(PLARGE_INTEGER)
         ), NOTHING, (boost::detail::win32::PLARGE_INTEGER_, PLARGE_INTEGER));
+ //~ BOOST_CHRONO_STATIC_ASSERT((
+ //~ boost::is_same<boost::detail::win32::PLARGE_INTEGER_,PLARGE_INTEGER>::value
+ //~ ), NOTHING, (boost::detail::win32::PLARGE_INTEGER_, PLARGE_INTEGER));
+
     {
         BOOST_CHRONO_STATIC_ASSERT((
                 sizeof(boost::detail::win32::FILETIME_)==sizeof(FILETIME)
             ), NOTHING, (boost::detail::win32::FILETIME_, FILETIME));
+
         BOOST_CHRONO_STATIC_ASSERT((
                 sizeof(boost::detail::win32::PFILETIME_)==sizeof(PFILETIME)
             ), NOTHING, (boost::detail::win32::PFILETIME_, PFILETIME));
+
 
         boost::detail::win32::FILETIME_ a;
         FILETIME b;
@@ -85,6 +116,18 @@
         BOOST_CHRONO_STATIC_ASSERT((
                 offsetof(boost::detail::win32::FILETIME_, dwHighDateTime)==offsetof(FILETIME, dwHighDateTime)
             ), NOTHING, (boost::detail::win32::FILETIME_, FILETIME));
+ BOOST_CHRONO_STATIC_ASSERT((
+ boost::is_same<
+ BOOST_TYPEOF(a.dwLowDateTime),
+ BOOST_TYPEOF(b.dwLowDateTime)
+ >::value
+ ), NOTHING, (boost::detail::win32::FILETIME_, FILETIME));
+ BOOST_CHRONO_STATIC_ASSERT((
+ boost::is_same<
+ BOOST_TYPEOF(a.dwHighDateTime),
+ BOOST_TYPEOF(b.dwHighDateTime)
+ >::value
+ ), NOTHING, (boost::detail::win32::FILETIME_, FILETIME));
 
     }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk