2018-03-22 18:11:39 +01:00
|
|
|
#include <triqs/test_tools/gfs.hpp>
|
|
|
|
#include <app4triqs/toto.hpp>
|
|
|
|
|
|
|
|
using namespace app4triqs;
|
|
|
|
|
2018-03-26 00:31:39 +02:00
|
|
|
TEST(Toto, Add) { // NOLINT
|
2018-03-22 18:11:39 +01:00
|
|
|
|
|
|
|
toto a(0);
|
|
|
|
toto b(2);
|
|
|
|
|
|
|
|
auto c = a + b;
|
2018-03-26 00:31:39 +02:00
|
|
|
EXPECT_EQ(c, b); // NOLINT
|
2018-03-22 18:11:39 +01:00
|
|
|
}
|
|
|
|
|
2018-03-26 00:31:39 +02:00
|
|
|
TEST(Toto, H5) { // NOLINT
|
2018-03-22 18:11:39 +01:00
|
|
|
|
|
|
|
toto a(0);
|
|
|
|
{ // Local scope for file
|
|
|
|
triqs::h5::file f("f.h5", H5F_ACC_TRUNC);
|
|
|
|
h5_write(f, "a", a);
|
|
|
|
}
|
|
|
|
|
|
|
|
toto a2;
|
|
|
|
{
|
|
|
|
triqs::h5::file f("f.h5", H5F_ACC_RDWR);
|
|
|
|
h5_read(f, "a", a2);
|
|
|
|
}
|
|
|
|
|
2018-03-26 00:31:39 +02:00
|
|
|
EXPECT_EQ(a, a2); // NOLINT
|
2018-03-22 18:11:39 +01:00
|
|
|
}
|
|
|
|
|
2018-03-26 00:31:39 +02:00
|
|
|
MAKE_MAIN; // NOLINT
|