Refactor Zstd dump styles

This commit is contained in:
Richard Berger
2020-08-27 11:59:57 -04:00
parent ced78a72eb
commit 2f629db3d4
11 changed files with 400 additions and 262 deletions

View File

@ -79,17 +79,19 @@ TEST_F(DumpAtomGZTest, compressed_run0)
{
if(!GZIP_BINARY) GTEST_SKIP();
auto text_file = "dump_text_run0.melt";
auto compressed_file = "dump_compressed_run0.melt.gz";
auto text_file = "dump_gz_text_run0.melt";
auto compressed_file = "dump_gz_compressed_run0.melt.gz";
generate_text_and_compressed_dump(text_file, compressed_file, "atom/gz", "", 0);
TearDown();
ASSERT_FILE_EXISTS(text_file);
ASSERT_FILE_EXISTS(compressed_file);
auto converted_file = convert_compressed_to_text(compressed_file);
ASSERT_THAT(converted_file, Eq("dump_compressed_run0.melt"));
ASSERT_THAT(converted_file, Eq("dump_gz_compressed_run0.melt"));
ASSERT_FILE_EXISTS(converted_file);
ASSERT_FILE_EQUAL(text_file, converted_file);
delete_file(text_file);
@ -101,11 +103,13 @@ TEST_F(DumpAtomGZTest, compressed_with_units_run0)
{
if(!GZIP_BINARY) GTEST_SKIP();
auto text_file = "dump_text_with_units_run0.melt";
auto compressed_file = "dump_compressed_with_units_run0.melt.gz";
auto text_file = "dump_gz_text_with_units_run0.melt";
auto compressed_file = "dump_gz_compressed_with_units_run0.melt.gz";
generate_text_and_compressed_dump(text_file, compressed_file, "atom/gz", "scale no units yes", 0);
TearDown();
ASSERT_FILE_EXISTS(text_file);
ASSERT_FILE_EXISTS(compressed_file);
@ -122,11 +126,13 @@ TEST_F(DumpAtomGZTest, compressed_with_time_run0)
{
if(!GZIP_BINARY) GTEST_SKIP();
auto text_file = "dump_text_with_time_run0.melt";
auto compressed_file = "dump_compressed_with_time_run0.melt.gz";
auto text_file = "dump_gz_text_with_time_run0.melt";
auto compressed_file = "dump_gz_compressed_with_time_run0.melt.gz";
generate_text_and_compressed_dump(text_file, compressed_file, "atom/gz", "scale no time yes", 0);
TearDown();
ASSERT_FILE_EXISTS(text_file);
ASSERT_FILE_EXISTS(compressed_file);
@ -143,12 +149,14 @@ TEST_F(DumpAtomGZTest, compressed_triclinic_run0)
{
if(!GZIP_BINARY) GTEST_SKIP();
auto text_file = "dump_text_tri_run0.melt";
auto compressed_file = "dump_compressed_tri_run0.melt.gz";
auto text_file = "dump_gz_text_tri_run0.melt";
auto compressed_file = "dump_gz_compressed_tri_run0.melt.gz";
enable_triclinic();
generate_text_and_compressed_dump(text_file, compressed_file, "atom/gz", "", 0);
TearDown();
ASSERT_FILE_EXISTS(text_file);
ASSERT_FILE_EXISTS(compressed_file);
@ -165,12 +173,14 @@ TEST_F(DumpAtomGZTest, compressed_triclinic_with_units_run0)
{
if(!GZIP_BINARY) GTEST_SKIP();
auto text_file = "dump_text_tri_with_units_run0.melt";
auto compressed_file = "dump_compressed_tri_with_units_run0.melt.gz";
auto text_file = "dump_gz_text_tri_with_units_run0.melt";
auto compressed_file = "dump_gz_compressed_tri_with_units_run0.melt.gz";
enable_triclinic();
generate_text_and_compressed_dump(text_file, compressed_file, "atom/gz", "scale no units yes", 0);
TearDown();
ASSERT_FILE_EXISTS(text_file);
ASSERT_FILE_EXISTS(compressed_file);
@ -187,12 +197,14 @@ TEST_F(DumpAtomGZTest, compressed_triclinic_with_time_run0)
{
if(!GZIP_BINARY) GTEST_SKIP();
auto text_file = "dump_text_tri_with_time_run0.melt";
auto compressed_file = "dump_compressed_tri_with_time_run0.melt.gz";
auto text_file = "dump_gz_text_tri_with_time_run0.melt";
auto compressed_file = "dump_gz_compressed_tri_with_time_run0.melt.gz";
enable_triclinic();
generate_text_and_compressed_dump(text_file, compressed_file, "atom/gz", "scale no time yes", 0);
TearDown();
ASSERT_FILE_EXISTS(text_file);
ASSERT_FILE_EXISTS(compressed_file);
@ -209,12 +221,14 @@ TEST_F(DumpAtomGZTest, compressed_triclinic_with_image_run0)
{
if(!GZIP_BINARY) GTEST_SKIP();
auto text_file = "dump_text_tri_with_image_run0.melt";
auto compressed_file = "dump_compressed_tri_with_image_run0.melt.gz";
auto text_file = "dump_gz_text_tri_with_image_run0.melt";
auto compressed_file = "dump_gz_compressed_tri_with_image_run0.melt.gz";
enable_triclinic();
generate_text_and_compressed_dump(text_file, compressed_file, "atom/gz", "image yes", 0);
TearDown();
ASSERT_FILE_EXISTS(text_file);
ASSERT_FILE_EXISTS(compressed_file);

View File

@ -79,8 +79,8 @@ TEST_F(DumpAtomZSTDTest, compressed_run0)
{
if(!ZSTD_BINARY) GTEST_SKIP();
auto text_file = "dump_text_run0.melt";
auto compressed_file = "dump_compressed_run0.melt.zst";
auto text_file = "dump_zstd_text_run0.melt";
auto compressed_file = "dump_zstd_compressed_run0.melt.zst";
generate_text_and_compressed_dump(text_file, compressed_file, "atom/zstd", "", 0);
@ -92,7 +92,7 @@ TEST_F(DumpAtomZSTDTest, compressed_run0)
auto converted_file = convert_compressed_to_text(compressed_file);
ASSERT_THAT(converted_file, Eq("dump_compressed_run0.melt"));
ASSERT_THAT(converted_file, Eq("dump_zstd_compressed_run0.melt"));
ASSERT_FILE_EXISTS(converted_file);
ASSERT_FILE_EQUAL(text_file, converted_file);
delete_file(text_file);
@ -104,8 +104,8 @@ TEST_F(DumpAtomZSTDTest, compressed_with_units_run0)
{
if(!ZSTD_BINARY) GTEST_SKIP();
auto text_file = "dump_text_with_units_run0.melt";
auto compressed_file = "dump_compressed_with_units_run0.melt.zst";
auto text_file = "dump_zstd_text_with_units_run0.melt";
auto compressed_file = "dump_zstd_compressed_with_units_run0.melt.zst";
generate_text_and_compressed_dump(text_file, compressed_file, "atom/zstd", "scale no units yes", 0);
@ -128,8 +128,8 @@ TEST_F(DumpAtomZSTDTest, compressed_with_time_run0)
{
if(!ZSTD_BINARY) GTEST_SKIP();
auto text_file = "dump_text_with_time_run0.melt";
auto compressed_file = "dump_compressed_with_time_run0.melt.zst";
auto text_file = "dump_zstd_text_with_time_run0.melt";
auto compressed_file = "dump_zstd_compressed_with_time_run0.melt.zst";
generate_text_and_compressed_dump(text_file, compressed_file, "atom/zstd", "scale no time yes", 0);
@ -152,8 +152,8 @@ TEST_F(DumpAtomZSTDTest, compressed_triclinic_run0)
{
if(!ZSTD_BINARY) GTEST_SKIP();
auto text_file = "dump_text_tri_run0.melt";
auto compressed_file = "dump_compressed_tri_run0.melt.zst";
auto text_file = "dump_zstd_text_tri_run0.melt";
auto compressed_file = "dump_zstd_compressed_tri_run0.melt.zst";
enable_triclinic();
generate_text_and_compressed_dump(text_file, compressed_file, "atom/zstd", "", 0);
@ -177,8 +177,8 @@ TEST_F(DumpAtomZSTDTest, compressed_triclinic_with_units_run0)
{
if(!ZSTD_BINARY) GTEST_SKIP();
auto text_file = "dump_text_tri_with_units_run0.melt";
auto compressed_file = "dump_compressed_tri_with_units_run0.melt.zst";
auto text_file = "dump_zstd_text_tri_with_units_run0.melt";
auto compressed_file = "dump_zstd_compressed_tri_with_units_run0.melt.zst";
enable_triclinic();
generate_text_and_compressed_dump(text_file, compressed_file, "atom/zstd", "scale no units yes", 0);
@ -202,8 +202,8 @@ TEST_F(DumpAtomZSTDTest, compressed_triclinic_with_time_run0)
{
if(!ZSTD_BINARY) GTEST_SKIP();
auto text_file = "dump_text_tri_with_time_run0.melt";
auto compressed_file = "dump_compressed_tri_with_time_run0.melt.zst";
auto text_file = "dump_zstd_text_tri_with_time_run0.melt";
auto compressed_file = "dump_zstd_compressed_tri_with_time_run0.melt.zst";
enable_triclinic();
generate_text_and_compressed_dump(text_file, compressed_file, "atom/zstd", "scale no time yes", 0);
@ -227,8 +227,8 @@ TEST_F(DumpAtomZSTDTest, compressed_triclinic_with_image_run0)
{
if(!ZSTD_BINARY) GTEST_SKIP();
auto text_file = "dump_text_tri_with_image_run0.melt";
auto compressed_file = "dump_compressed_tri_with_image_run0.melt.zst";
auto text_file = "dump_zstd_text_tri_with_image_run0.melt";
auto compressed_file = "dump_zstd_compressed_tri_with_image_run0.melt.zst";
enable_triclinic();
generate_text_and_compressed_dump(text_file, compressed_file, "atom/zstd", "image yes", 0);

View File

@ -73,12 +73,14 @@ TEST_F(DumpCustomGZTest, compressed_run1)
{
if(!GZIP_BINARY) GTEST_SKIP();
auto text_file = "dump_custom_text_run1.melt";
auto compressed_file = "dump_custom_compressed_run1.melt.gz";
auto text_file = "dump_custom_gz_text_run1.melt";
auto compressed_file = "dump_custom_gz_compressed_run1.melt.gz";
auto fields = "id type proc x y z ix iy iz xs ys zs xu yu zu xsu ysu zsu vx vy vz fx fy fz";
generate_text_and_compressed_dump(text_file, compressed_file, "custom/gz", fields, "units yes", 1);
TearDown();
ASSERT_FILE_EXISTS(text_file);
ASSERT_FILE_EXISTS(compressed_file);
@ -95,14 +97,16 @@ TEST_F(DumpCustomGZTest, compressed_triclinic_run1)
{
if(!GZIP_BINARY) GTEST_SKIP();
auto text_file = "dump_custom_tri_text_run1.melt";
auto compressed_file = "dump_custom_tri_compressed_run1.melt.gz";
auto text_file = "dump_custom_gz_tri_text_run1.melt";
auto compressed_file = "dump_custom_gz_tri_compressed_run1.melt.gz";
auto fields = "id type proc x y z xs ys zs xsu ysu zsu vx vy vz fx fy fz";
enable_triclinic();
generate_text_and_compressed_dump(text_file, compressed_file, "custom/gz", fields, "units yes", 1);
TearDown();
ASSERT_FILE_EXISTS(text_file);
ASSERT_FILE_EXISTS(compressed_file);

View File

@ -73,12 +73,14 @@ TEST_F(DumpCustomZstdTest, compressed_run1)
{
if(!ZSTD_BINARY) GTEST_SKIP();
auto text_file = "dump_custom_text_run1.melt";
auto compressed_file = "dump_custom_compressed_run1.melt.zst";
auto text_file = "dump_custom_zstd_text_run1.melt";
auto compressed_file = "dump_custom_zstd_compressed_run1.melt.zst";
auto fields = "id type proc x y z ix iy iz xs ys zs xu yu zu xsu ysu zsu vx vy vz fx fy fz";
generate_text_and_compressed_dump(text_file, compressed_file, "custom/zstd", fields, "units yes", 1);
TearDown();
ASSERT_FILE_EXISTS(text_file);
ASSERT_FILE_EXISTS(compressed_file);
@ -95,14 +97,16 @@ TEST_F(DumpCustomZstdTest, compressed_triclinic_run1)
{
if(!ZSTD_BINARY) GTEST_SKIP();
auto text_file = "dump_custom_tri_text_run1.melt";
auto compressed_file = "dump_custom_tri_compressed_run1.melt.zst";
auto text_file = "dump_custom_zstd_tri_text_run1.melt";
auto compressed_file = "dump_custom_zstd_tri_compressed_run1.melt.zst";
auto fields = "id type proc x y z xs ys zs xsu ysu zsu vx vy vz fx fy fz";
enable_triclinic();
generate_text_and_compressed_dump(text_file, compressed_file, "custom/zstd", fields, "units yes", 1);
TearDown();
ASSERT_FILE_EXISTS(text_file);
ASSERT_FILE_EXISTS(compressed_file);