From a968c67510b8dbb1d26a52d4ab473ec5118004db Mon Sep 17 00:00:00 2001 From: Beman Date: Wed, 4 Mar 2015 11:48:21 -0500 Subject: [PATCH] Initial commit of infrastructure. No test cases yet. --- test/float_test.cpp | 57 ++++++++++++++++ test/msvc/endian.sln | 10 ++- test/msvc/float_test/float_test.vcxproj | 88 +++++++++++++++++++++++++ 3 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 test/float_test.cpp create mode 100644 test/msvc/float_test/float_test.vcxproj diff --git a/test/float_test.cpp b/test/float_test.cpp new file mode 100644 index 0000000..ca8ff99 --- /dev/null +++ b/test/float_test.cpp @@ -0,0 +1,57 @@ +// float_test.cpp --------------------------------------------------------------------// + +// Copyright Beman Dawes 2015 + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +// See library home page at http://www.boost.org/libs/endian + +//--------------------------------------------------------------------------------------// + +#include + +//#define BOOST_ENDIAN_LOG +#include +#include +#include +#include +#include + +using namespace boost::endian; +using std::cout; +using std::endl; +using std::numeric_limits; + +namespace +{ + template + void report_limits(const char* type) + { + cout << "\nHeader values for std::numeric_limits<" << type << ">\n\n"; + cout << " is_specialized " << numeric_limits::is_specialized << "\n"; + cout << " min() " << numeric_limits::min() << "\n"; + cout << " max() " << numeric_limits::max() << "\n"; + cout << " lowest() " << numeric_limits::lowest() << "\n"; + cout << " digits " << numeric_limits::digits << "\n"; + cout << " digits10 " << numeric_limits::digits10 << "\n"; + cout << " max_digits10 " << numeric_limits::max_digits10 << "\n"; + } + +} // unnamed namespace + +//--------------------------------------------------------------------------------------// + +int cpp_main(int, char *[]) +{ + cout << "byte swap intrinsics: " BOOST_ENDIAN_INTRINSIC_MSG << endl; + + report_limits("float"); + report_limits("double"); + + cout << "\n done" << endl; + + return ::boost::report_errors(); +} + +#include diff --git a/test/msvc/endian.sln b/test/msvc/endian.sln index bbb605b..a46749d 100644 --- a/test/msvc/endian.sln +++ b/test/msvc/endian.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.22310.1 +VisualStudioVersion = 14.0.22512.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "endian_test", "endian_test\endian_test.vcxproj", "{74C201F3-8308-40BE-BC0F-24974DEAF405}" EndProject @@ -33,6 +33,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "experiment", "experiment\ex EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "deprecated_test", "deprecated_test\deprecated_test.vcxproj", "{DA4BC67F-9284-4D2C-81D5-407312C31BD7}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "float_test", "float_test\float_test.vcxproj", "{27E8FDC5-9669-4940-B24F-94B21FFEE649}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -153,6 +155,12 @@ Global {DA4BC67F-9284-4D2C-81D5-407312C31BD7}.Release|Win32.ActiveCfg = Release|Win32 {DA4BC67F-9284-4D2C-81D5-407312C31BD7}.Release|Win32.Build.0 = Release|Win32 {DA4BC67F-9284-4D2C-81D5-407312C31BD7}.Release|x64.ActiveCfg = Release|Win32 + {27E8FDC5-9669-4940-B24F-94B21FFEE649}.Debug|Win32.ActiveCfg = Debug|Win32 + {27E8FDC5-9669-4940-B24F-94B21FFEE649}.Debug|Win32.Build.0 = Debug|Win32 + {27E8FDC5-9669-4940-B24F-94B21FFEE649}.Debug|x64.ActiveCfg = Debug|Win32 + {27E8FDC5-9669-4940-B24F-94B21FFEE649}.Release|Win32.ActiveCfg = Release|Win32 + {27E8FDC5-9669-4940-B24F-94B21FFEE649}.Release|Win32.Build.0 = Release|Win32 + {27E8FDC5-9669-4940-B24F-94B21FFEE649}.Release|x64.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/test/msvc/float_test/float_test.vcxproj b/test/msvc/float_test/float_test.vcxproj new file mode 100644 index 0000000..13e3dc2 --- /dev/null +++ b/test/msvc/float_test/float_test.vcxproj @@ -0,0 +1,88 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {27E8FDC5-9669-4940-B24F-94B21FFEE649} + Win32Proj + float_test + + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + true + + + false + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file