mirror of https://github.com/CGAL/cgal
Kernel_23: Deal with concurrent executions and IO
This commit is contained in:
parent
8ee8f27d45
commit
f4154836ae
|
|
@ -17,26 +17,19 @@
|
||||||
#ifndef CGAL__TEST_IO_H
|
#ifndef CGAL__TEST_IO_H
|
||||||
#define CGAL__TEST_IO_H
|
#define CGAL__TEST_IO_H
|
||||||
|
|
||||||
#include <fstream>
|
#include <sstream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#ifndef TEST_FILENAME
|
|
||||||
# define TEST_FILENAME "Test_IO.out"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
void
|
void
|
||||||
_test_io_for(const T& t)
|
_test_io_for(const T& t)
|
||||||
{
|
{
|
||||||
{
|
std::stringstream ss;
|
||||||
std::ofstream oFile(TEST_FILENAME, std::ios::out);
|
ss << t << std::endl;
|
||||||
oFile << t << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::ifstream iFile(TEST_FILENAME, std::ios::in);
|
|
||||||
T u = t;
|
T u = t;
|
||||||
iFile >> u;
|
ss >> u;
|
||||||
assert(!iFile.fail());
|
assert(! ss.fail() );
|
||||||
assert(u == t);
|
assert(u == t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue