Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66001 - sandbox/chrono/libs/chrono/test
From: vicente.botet_at_[hidden]
Date: 2010-10-16 00:55:56


Author: viboes
Date: 2010-10-16 00:55:55 EDT (Sat, 16 Oct 2010)
New Revision: 66001
URL: http://svn.boost.org/trac/boost/changeset/66001

Log:
Chrono:
* Add win32_test.cpp

Added:
   sandbox/chrono/libs/chrono/test/win32_test.cpp (contents, props changed)
Text files modified:
   sandbox/chrono/libs/chrono/test/Jamfile.v2 | 6 ++++++
   1 files changed, 6 insertions(+), 0 deletions(-)

Modified: sandbox/chrono/libs/chrono/test/Jamfile.v2
==============================================================================
--- sandbox/chrono/libs/chrono/test/Jamfile.v2 (original)
+++ sandbox/chrono/libs/chrono/test/Jamfile.v2 2010-10-16 00:55:55 EDT (Sat, 16 Oct 2010)
@@ -243,3 +243,9 @@
         [ run ../example/io_ex4.cpp : : : <link>static ]
         [ run ../example/io_ex5.cpp : : : <link>static ]
         ;
+
+ test-suite "win32"
+ :
+ [ run win32_test.cpp : : : <link>static ]
+ ;
+
\ No newline at end of file

Added: sandbox/chrono/libs/chrono/test/win32_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/win32_test.cpp 2010-10-16 00:55:55 EDT (Sat, 16 Oct 2010)
@@ -0,0 +1,105 @@
+// boost win32_test.cpp -----------------------------------------------------//
+
+// Copyright 2010 Vicente J. Botet Escriba
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// 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)
+
+#include <boost/chrono/detail/static_assert.hpp>
+#if !defined(BOOST_NO_STATIC_ASSERT)
+#define NOTHING ""
+#endif
+
+#include <boost/detail/win/time.hpp>
+#include <windows.h>
+#include <boost/type_traits.hpp>
+#include <boost/typeof/typeof.hpp>
+
+void test() {
+ {
+ boost::detail::win32::LARGE_INTEGER_ a;
+ LARGE_INTEGER b;
+ BOOST_CHRONO_STATIC_ASSERT((
+ sizeof(boost::detail::win32::LARGE_INTEGER_)==sizeof(LARGE_INTEGER)
+ ), NOTHING, (boost::detail::win32::LARGE_INTEGER_, LARGE_INTEGER));
+ BOOST_TEST((
+ sizeof(a.QuadPart)==sizeof(b.QuadPart)
+ ));
+ 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(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((
+ sizeof(boost::detail::win32::DWORD_)==sizeof(DWORD)
+ ), 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((
+ sizeof(boost::detail::win32::LONG_)==sizeof(LONG)
+ ), 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::PLARGE_INTEGER_)==sizeof(PLARGE_INTEGER)
+ ), 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;
+ BOOST_TEST((
+ sizeof(a.dwLowDateTime)==sizeof(b.dwLowDateTime)
+ ));
+ BOOST_TEST((
+ sizeof(a.dwHighDateTime)==sizeof(b.dwHighDateTime)
+ ));
+ BOOST_CHRONO_STATIC_ASSERT((
+ offsetof(boost::detail::win32::FILETIME_, dwLowDateTime)==offsetof(FILETIME, dwLowDateTime)
+ ), NOTHING, (boost::detail::win32::FILETIME_, FILETIME));
+ BOOST_CHRONO_STATIC_ASSERT((
+ offsetof(boost::detail::win32::FILETIME_, dwHighDateTime)==offsetof(FILETIME, dwHighDateTime)
+ ), NOTHING, (boost::detail::win32::FILETIME_, FILETIME));
+
+ }
+
+// BOOST_CHRONO_STATIC_ASSERT((
+// GetLastError==boost::detail::win32::::GetLastError
+// ), NOTHING, ());
+
+}
+#else
+void test() {
+}
+#endif
+int main( )
+{
+ test();
+
+ return boost::report_errors();
+}
+


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