Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85642 - trunk/libs/multiprecision/test
From: john_at_[hidden]
Date: 2013-09-10 13:40:30


Author: johnmaddock
Date: 2013-09-10 13:40:30 EDT (Tue, 10 Sep 2013)
New Revision: 85642
URL: http://svn.boost.org/trac/boost/changeset/85642

Log:
Fix path used to load test data.

Text files modified:
   trunk/libs/multiprecision/test/Jamfile.v2 | 3 ++-
   trunk/libs/multiprecision/test/test_cpp_int_deserial.cpp | 23 ++++++++++++++++-------
   2 files changed, 18 insertions(+), 8 deletions(-)

Modified: trunk/libs/multiprecision/test/Jamfile.v2
==============================================================================
--- trunk/libs/multiprecision/test/Jamfile.v2 Tue Sep 10 08:47:28 2013 (r85641)
+++ trunk/libs/multiprecision/test/Jamfile.v2 2013-09-10 13:40:30 EDT (Tue, 10 Sep 2013) (r85642)
@@ -571,11 +571,12 @@
 #
 # Serialization tests, run in release mode so we cycle through more values:
 #
+path-constant here : . ;
 run test_cpp_int_serial.cpp ../../serialization/build//boost_serialization : : : release <define>TEST1 : test_cpp_int_serial_1 ;
 run test_cpp_int_serial.cpp ../../serialization/build//boost_serialization : : : release <define>TEST2 : test_cpp_int_serial_2 ;
 run test_cpp_int_serial.cpp ../../serialization/build//boost_serialization : : : release <define>TEST3 : test_cpp_int_serial_3 ;
 run test_cpp_int_serial.cpp ../../serialization/build//boost_serialization : : : release <define>TEST4 : test_cpp_int_serial_4 ;
-run test_cpp_int_deserial.cpp ../../serialization/build//boost_serialization : : : release ;
+run test_cpp_int_deserial.cpp ../../serialization/build//boost_serialization ../../filesystem/build//boost_filesystem : $(here) : : release ;
 run test_cpp_rat_serial.cpp ../../serialization/build//boost_serialization : : : release ;
 run test_adapt_serial.cpp ../../serialization/build//boost_serialization : : : release ;
 run test_cpp_dec_float_serial.cpp ../../serialization/build//boost_serialization : : : release <define>TEST1 : test_cpp_dec_float_serial_1 ;

Modified: trunk/libs/multiprecision/test/test_cpp_int_deserial.cpp
==============================================================================
--- trunk/libs/multiprecision/test/test_cpp_int_deserial.cpp Tue Sep 10 08:47:28 2013 (r85641)
+++ trunk/libs/multiprecision/test/test_cpp_int_deserial.cpp 2013-09-10 13:40:30 EDT (Tue, 10 Sep 2013) (r85642)
@@ -22,6 +22,10 @@
 #include <boost/archive/binary_iarchive.hpp>
 #include <boost/archive/binary_oarchive.hpp>
 #include <boost/exception/all.hpp>
+#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
+
+boost::filesystem::path root;
 
 template <class T>
 void test64()
@@ -1031,7 +1035,7 @@
       "-30820"
       };
 
- std::ifstream is("cpp_int64_serial64.txt");
+ boost::filesystem::ifstream is(root / "cpp_int64_serial64.txt");
    std::cout << "Testing cpp_int64_serial64.txt with T=" << typeid(T).name() << std::endl;
    is.peek();
    BOOST_CHECK(is.good());
@@ -1043,7 +1047,7 @@
       BOOST_CHECK_EQUAL(val, T(text_array[i]));
    }
 
- std::ifstream is2("cpp_int64_serial32.txt");
+ boost::filesystem::ifstream is2(root / "cpp_int64_serial32.txt");
    std::cout << "Testing cpp_int64_serial32.txt with T=" << typeid(T).name() << std::endl;
    is2.peek();
    BOOST_CHECK(is2.good());
@@ -2064,7 +2068,7 @@
       "-375838207",
    };
 
- std::ifstream is("cpp_int128_serial64.txt");
+ boost::filesystem::ifstream is(root / "cpp_int128_serial64.txt");
    std::cout << "Testing cpp_int128_serial64.txt with T=" << typeid(T).name() << std::endl;
    is.peek();
    BOOST_CHECK(is.good());
@@ -2089,7 +2093,7 @@
       }
    }
 
- std::ifstream is2("cpp_int128_serial32.txt");
+ boost::filesystem::ifstream is2(root / "cpp_int128_serial32.txt");
    std::cout << "Testing cpp_int128_serial32.txt with T=" << typeid(T).name() << std::endl;
    is2.peek();
    BOOST_CHECK(is2.good());
@@ -3123,7 +3127,7 @@
       "-1604105217156493424796219158328988017738562338480346273566670218046",
    };
 
- std::ifstream is("cpp_int1024_serial64.txt");
+ boost::filesystem::ifstream is(root / "cpp_int1024_serial64.txt");
    std::cout << "Testing cpp_int1024_serial64.txt with T=" << typeid(T).name() << std::endl;
    is.peek();
    BOOST_CHECK(is.good());
@@ -3148,7 +3152,7 @@
       }
    }
 
- std::ifstream is2("cpp_int1024_serial32.txt");
+ boost::filesystem::ifstream is2(root / "cpp_int1024_serial32.txt");
    std::cout << "Testing cpp_int1024_serial32.txt with T=" << typeid(T).name() << std::endl;
    is2.peek();
    BOOST_CHECK(is2.good());
@@ -3174,8 +3178,13 @@
    }
 }
 
-int main()
+int main(int argc, char const* argv[])
 {
+ if(argc == 2)
+ {
+ root = argv[1];
+ std::cout << "Setting root directory to " << argv[1] << std::endl;
+ }
    using namespace boost::multiprecision;
    test64<cpp_int>();
    test64<number<cpp_int_backend<64, 64> > >();


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