mirror of https://github.com/CGAL/cgal
Make filenames unique to avoid IO errors when executing two tests in parallel threads
This commit is contained in:
parent
a0ca27e40a
commit
28b99d55ce
|
|
@ -4,6 +4,7 @@
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <CGAL/enum.h>
|
#include <CGAL/enum.h>
|
||||||
#include <CGAL/use.h>
|
#include <CGAL/use.h>
|
||||||
|
#include <CGAL/Random.h>
|
||||||
|
|
||||||
#include <CGAL/Vector_2.h> // this is done in order to avoid error
|
#include <CGAL/Vector_2.h> // this is done in order to avoid error
|
||||||
// when the Segment_2_Segment_2_intersection.h file is included from
|
// when the Segment_2_Segment_2_intersection.h file is included from
|
||||||
|
|
@ -839,24 +840,29 @@ bool test_algo_generic(InputStream& is)
|
||||||
// file I/O methods
|
// file I/O methods
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
{
|
{
|
||||||
std::ofstream ofs("ag_testsuite.tmp");
|
std::string fname = "ag_testsuite_" + std::to_string(CGAL::Random().get_seed()) + ".tmp";
|
||||||
|
std::cout << "writing to " << fname << std::endl;
|
||||||
|
|
||||||
|
std::ofstream ofs(fname);
|
||||||
assert( ofs );
|
assert( ofs );
|
||||||
ag.file_output(ofs);
|
ag.file_output(ofs);
|
||||||
ofs.close();
|
ofs.close();
|
||||||
|
|
||||||
std::ifstream ifs("ag_testsuite.tmp");
|
std::ifstream ifs(fname);
|
||||||
assert( ifs );
|
assert( ifs );
|
||||||
ag.file_input(ifs);
|
ag.file_input(ifs);
|
||||||
ifs.close();
|
ifs.close();
|
||||||
assert( ag.is_valid() );
|
assert( ag.is_valid() );
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
std::ofstream ofs("ag_testsuite.tmp");
|
std::string fname = "ag_testsuite_" + std::to_string(CGAL::Random().get_seed()) + ".tmp";
|
||||||
|
std::cout << "writing to " << fname << std::endl;
|
||||||
|
std::ofstream ofs(fname);
|
||||||
assert( ofs );
|
assert( ofs );
|
||||||
ofs << ag;
|
ofs << ag;
|
||||||
ofs.close();
|
ofs.close();
|
||||||
|
|
||||||
std::ifstream ifs("ag_testsuite.tmp");
|
std::ifstream ifs(fname);
|
||||||
assert( ifs );
|
assert( ifs );
|
||||||
ifs >> ag;
|
ifs >> ag;
|
||||||
ifs.close();
|
ifs.close();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue