Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55308 - in trunk/libs/spirit/benchmarks: . qi
From: joel_at_[hidden]
Date: 2009-07-30 22:33:09


Author: djowel
Date: 2009-07-30 21:12:51 EDT (Thu, 30 Jul 2009)
New Revision: 55308
URL: http://svn.boost.org/trac/boost/changeset/55308

Log:
fix wrong test numbers. fix for g++ 4.3
Text files modified:
   trunk/libs/spirit/benchmarks/measure.hpp | 1 +
   trunk/libs/spirit/benchmarks/qi/real_parser.cpp | 15 +++++++++++++--
   2 files changed, 14 insertions(+), 2 deletions(-)

Modified: trunk/libs/spirit/benchmarks/measure.hpp
==============================================================================
--- trunk/libs/spirit/benchmarks/measure.hpp (original)
+++ trunk/libs/spirit/benchmarks/measure.hpp 2009-07-30 21:12:51 EDT (Thu, 30 Jul 2009)
@@ -14,6 +14,7 @@
 
 #include "high_resolution_timer.hpp"
 #include <iostream>
+#include <cstring>
 #include <boost/preprocessor/seq/for_each.hpp>
 #include <boost/preprocessor/stringize.hpp>
 

Modified: trunk/libs/spirit/benchmarks/qi/real_parser.cpp
==============================================================================
--- trunk/libs/spirit/benchmarks/qi/real_parser.cpp (original)
+++ trunk/libs/spirit/benchmarks/qi/real_parser.cpp 2009-07-30 21:12:51 EDT (Thu, 30 Jul 2009)
@@ -20,8 +20,8 @@
         "0.1",
         "-1.2e-3",
         "-.2e3",
- "-e3",
- "1.2e",
+ "-2e6",
+ "1.2345e5",
         "-5.7222349715140557e+307",
         "2.0332938517515416e-308"
     };
@@ -90,6 +90,17 @@
             last[i]++;
         std::cout << numbers[i] << std::endl;
     }
+ std::cout.precision(17);
+ std::cout << "///////////////////////////////////////////////////////////////////////////" << std::endl;
+ std::cout << "atof/strtol/qi.double results:" << std::endl;
+ for (int i = 0; i < ndigits; ++i)
+ {
+ std::cout
+ << atof(first[i]) << ','
+ << strtod(first[i], const_cast<char**>(&last[i])) << ','
+ << spirit_double_test::parse(first[i], last[i]) << ','
+ << std::endl;
+ }
     std::cout << "///////////////////////////////////////////////////////////////////////////" << std::endl;
 
     BOOST_SPIRIT_TEST_BENCHMARK(


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