#include #include "UnitTest++.h" #include "test_utils.hh" #include "geners/CompressedIO.hh" #include "geners/StringArchive.hh" #include "geners/Record.hh" #include "geners/Reference.hh" using namespace gs; using namespace std; namespace { TEST(compressedIO_read) { StringArchive ar; const unsigned len = 100000; std::string s(len, '\0'); for (unsigned i=0; i par = read_compressed_item(is); CHECK(ar == *par); Reference ref(*par, "dummy", "haha"); CHECK(ref.unique()); std::string rb; ref.restore(0, &rb); CHECK(rb == s); } TEST(compressedIO_restore) { std::ostringstream os1; std::ostringstream os2; const unsigned len = 100000; std::string s(len, '\0'); for (unsigned i=0; i