|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r50450 - in sandbox/chrono/libs/chrono/test: . chrono_msvc chrono_msvc/ratio_fail_test1
From: bdawes_at_[hidden]
Date: 2009-01-03 13:21:49
Author: bemandawes
Date: 2009-01-03 13:21:48 EST (Sat, 03 Jan 2009)
New Revision: 50450
URL: http://svn.boost.org/trac/boost/changeset/50450
Log:
Add ratio_fail_test1
Added:
sandbox/chrono/libs/chrono/test/chrono_msvc/ratio_fail_test1/
sandbox/chrono/libs/chrono/test/chrono_msvc/ratio_fail_test1/ratio_fail_test1.vcproj (contents, props changed)
sandbox/chrono/libs/chrono/test/ratio_fail_test1.cpp (contents, props changed)
Text files modified:
sandbox/chrono/libs/chrono/test/Jamfile.v2 | 37 +++++++++++++++++++------------------
sandbox/chrono/libs/chrono/test/chrono_msvc/chrono_msvc.sln | 6 ++++++
sandbox/chrono/libs/chrono/test/ratio_test.cpp | 9 ++++++++-
3 files changed, 33 insertions(+), 19 deletions(-)
Modified: sandbox/chrono/libs/chrono/test/Jamfile.v2
==============================================================================
--- sandbox/chrono/libs/chrono/test/Jamfile.v2 (original)
+++ sandbox/chrono/libs/chrono/test/Jamfile.v2 2009-01-03 13:21:48 EST (Sat, 03 Jan 2009)
@@ -9,26 +9,27 @@
project
: requirements
- <library>/boost/chrono//boost_chrono
+# <library>/boost/chrono//boost_chrono
<toolset>msvc:<asynch-exceptions>on
;
test-suite "chrono"
- : [ run ../example/time2_demo.cpp
- : # command line
- : # input files
- : # requirements
- <link>static
- ]
- [ run ../example/time2_demo.cpp ../../system/build
- : : : : time2_demo_dll
- ]
- [ run run_timer_test.cpp
- : : : <link>static
- ]
- [ run run_timer_test.cpp ../../system/build
- : : : : run_timer_test_dll
- ]
- [ run ../example/run_timer_example.cpp ../../system/build
- ]
+ :
+# [ run ../example/time2_demo.cpp
+# : # command line
+# : # requirements
+# <link>static
+# ]
+# [ run ../example/time2_demo.cpp ../../system/build
+# : : : : time2_demo_dll
+# ]
+# [ run run_timer_test.cpp
+# : : : <link>static
+# ]
+# [ run run_timer_test.cpp ../../system/build
+# : : : : run_timer_test_dll
+# ]
+# [ run ../example/run_timer_example.cpp ../../system/build
+# ]
+ [ compile-fail ratio_fail_test1.cpp ]
;
Modified: sandbox/chrono/libs/chrono/test/chrono_msvc/chrono_msvc.sln
==============================================================================
--- sandbox/chrono/libs/chrono/test/chrono_msvc/chrono_msvc.sln (original)
+++ sandbox/chrono/libs/chrono/test/chrono_msvc/chrono_msvc.sln 2009-01-03 13:21:48 EST (Sat, 03 Jan 2009)
@@ -34,6 +34,8 @@
{8E1660C2-6981-4D39-ACF4-1594D6BEB212} = {8E1660C2-6981-4D39-ACF4-1594D6BEB212}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ratio_fail_test1", "ratio_fail_test1\ratio_fail_test1.vcproj", "{82C1FB41-A270-4ED5-986F-C3C97588E6C8}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -66,6 +68,10 @@
{724599F0-7DB3-4D37-A8F6-D905020C2D8F}.Debug|Win32.Build.0 = Debug|Win32
{724599F0-7DB3-4D37-A8F6-D905020C2D8F}.Release|Win32.ActiveCfg = Release|Win32
{724599F0-7DB3-4D37-A8F6-D905020C2D8F}.Release|Win32.Build.0 = Release|Win32
+ {82C1FB41-A270-4ED5-986F-C3C97588E6C8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {82C1FB41-A270-4ED5-986F-C3C97588E6C8}.Debug|Win32.Build.0 = Debug|Win32
+ {82C1FB41-A270-4ED5-986F-C3C97588E6C8}.Release|Win32.ActiveCfg = Release|Win32
+ {82C1FB41-A270-4ED5-986F-C3C97588E6C8}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Added: sandbox/chrono/libs/chrono/test/chrono_msvc/ratio_fail_test1/ratio_fail_test1.vcproj
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/chrono_msvc/ratio_fail_test1/ratio_fail_test1.vcproj 2009-01-03 13:21:48 EST (Sat, 03 Jan 2009)
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="ratio_fail_test1"
+ ProjectGUID="{82C1FB41-A270-4ED5-986F-C3C97588E6C8}"
+ RootNamespace="ratio_fail_test1"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\common.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\common.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\ratio_fail_test1.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/chrono/libs/chrono/test/ratio_fail_test1.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/ratio_fail_test1.cpp 2009-01-03 13:21:48 EST (Sat, 03 Jan 2009)
@@ -0,0 +1,13 @@
+// ratio_fail_test1.cpp ----------------------------------------------------//
+
+// Copyright 2008 Beman Dawes
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+#include <boost/ratio.hpp>
+
+typedef boost::ratio<0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFF0> R1;
+typedef boost::ratio<0x7FFFFFFFFFFFFFFE, 0x7FFFFFFFFFFFFFF0> R2;
+typedef boost::ratio_multiply<R1, R2>::type RT;
+
Modified: sandbox/chrono/libs/chrono/test/ratio_test.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/ratio_test.cpp (original)
+++ sandbox/chrono/libs/chrono/test/ratio_test.cpp 2009-01-03 13:21:48 EST (Sat, 03 Jan 2009)
@@ -7,8 +7,15 @@
// See http://www.boost.org/LICENSE_1_0.txt
#include <boost/ratio.hpp>
+#include <boost/chrono/chrono.hpp>
#include <iostream>
+// Test the case described in library working group issue 948.
+
+typedef boost::ratio<0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFF0> R1;
+typedef boost::ratio<8, 7> R2;
+typedef boost::ratio_multiply<R1, R2>::type RT;
+
//////////////////////////////////////////////////////////
//////////////////// User1 Example ///////////////////////
//////////////////////////////////////////////////////////
@@ -187,7 +194,7 @@
std::cout << "* testUser1 *\n";
std::cout << "*************\n";
User1::Distance d( User1::mile(110) );
- User1::Time t( std::chrono::hours(2) );
+ User1::Time t( boost::chrono::hours(2) );
User1::Speed s = d / t;
std::cout << "Speed = " << s.get() << " meters/sec\n";
User1::Acceleration a = User1::Distance( User1::foot(32.2) ) / User1::Time() / User1::Time();
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