|
template<typename ReadLambda , typename WriteLambda > |
void | test_read_write (ReadLambda &act_read, WriteLambda &act_write) |
|
Definition at line 17 of file xdr_test.C.
◆ CPPUNIT_TEST() [1/2]
◆ CPPUNIT_TEST() [2/2]
◆ CPPUNIT_TEST_SUITE_END()
XdrTest::CPPUNIT_TEST_SUITE_END |
( |
| ) |
|
◆ LIBMESH_CPPUNIT_TEST_SUITE()
XdrTest::LIBMESH_CPPUNIT_TEST_SUITE |
( |
XdrTest |
| ) |
|
◆ setUp()
◆ tearDown()
void XdrTest::tearDown |
( |
| ) |
|
|
inline |
◆ test_read_write()
template<typename ReadLambda , typename WriteLambda >
void XdrTest::test_read_write |
( |
ReadLambda & |
act_read, |
|
|
WriteLambda & |
act_write |
|
) |
| |
|
inlineprivate |
◆ testDataStream()
void XdrTest::testDataStream |
( |
| ) |
|
|
inline |
Definition at line 103 of file xdr_test.C.
References libMesh::index_range(), libMesh::Real, and libMesh::TOLERANCE.
107 std::vector<Real> vec(100);
109 vec[i] =
static_cast<Real>(i+1) / vec.size();
113 auto act_write = [&vec](
Xdr & xdr) {
114 xdr.data_stream(vec.data(), vec.size(), 16); };
117 auto act_read = [&vec](
Xdr & xdr) {
118 std::vector<Real> vec_in(100);
119 xdr.data_stream(vec_in.data(), vec_in.size());
123 LIBMESH_ASSERT_FP_EQUAL(vec[i], vec_in[i],
TOLERANCE); };
void test_read_write(ReadLambda &act_read, WriteLambda &act_write)
static constexpr Real TOLERANCE
This class implements a C++ interface to the XDR (eXternal Data Representation) format.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
◆ testDataVec()
void XdrTest::testDataVec |
( |
| ) |
|
|
inline |
Definition at line 82 of file xdr_test.C.
References libMesh::index_range(), libMesh::pi, and libMesh::TOLERANCE.
88 auto act_write = [&vec](
Xdr & xdr) { xdr.data(vec,
"# This is a comment"); };
89 auto act_read = [&vec](
Xdr & xdr) {
90 std::vector<Real> vec_in;
94 CPPUNIT_ASSERT_EQUAL(vec_in.size(), vec.size());
98 LIBMESH_ASSERT_FP_EQUAL(vec[i], vec_in[i],
TOLERANCE); };
void test_read_write(ReadLambda &act_read, WriteLambda &act_write)
static constexpr Real TOLERANCE
This class implements a C++ interface to the XDR (eXternal Data Representation) format.
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
The documentation for this class was generated from the following file: