Skip to content

Commit

Permalink
all done
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinPrivitera committed Nov 10, 2023
1 parent 5b09d46 commit 4cf800b
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/tests/relay/t_relay_io_silo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,10 @@ TEST(conduit_relay_io_silo, unstructured_points)
/// when cycle is present, "default" ==> "cycle"
/// else, "default" ==> "none"
///
/// root_file_ext: "default", "root", "silo"
/// "default" ==> "root"
/// if overlink, this parameter is unused.
///
/// mesh_name: (used if present, default ==> "mesh")
///
/// ovl_topo_name: (used if present, default ==> "")
Expand Down Expand Up @@ -1127,6 +1131,45 @@ TEST(conduit_relay_io_silo, round_trip_save_option_suffix)
}
}

//-----------------------------------------------------------------------------
TEST(conduit_relay_io_silo, round_trip_save_option_root_file_ext)
{
const std::vector<std::string> root_file_exts = {"default", "root", "silo"};

for (int i = 0; i < root_file_exts.size(); i ++)
{
Node opts;
opts["root_file_ext"] = root_file_exts[i];

std::string actual_file_ext = root_file_exts[i];
if (actual_file_ext == "default")
{
actual_file_ext = "root";
}

const std::string basename = "round_trip_save_option_root_file_ext_" +
root_file_exts[i] + "_basic";
const std::string filename = basename + "." + actual_file_ext;

Node save_mesh, load_mesh, info;
blueprint::mesh::examples::basic("rectilinear", 3, 4, 0, save_mesh);
remove_path_if_exists(filename);
io::silo::save_mesh(save_mesh, basename, opts);
io::silo::load_mesh(filename, load_mesh);
EXPECT_TRUE(blueprint::mesh::verify(load_mesh, info));

save_mesh["state/cycle"] = (int64) 0;
save_mesh["state/domain_id"] = 0;
silo_name_changer("mesh", save_mesh);

// the loaded mesh will be in the multidomain format
// but the saved mesh is in the single domain format
EXPECT_EQ(load_mesh.number_of_children(), 1);
EXPECT_EQ(load_mesh[0].number_of_children(), save_mesh.number_of_children());
EXPECT_FALSE(load_mesh[0].diff(save_mesh, info));
}
}

//-----------------------------------------------------------------------------
TEST(conduit_relay_io_silo, round_trip_save_option_mesh_name)
{
Expand Down

0 comments on commit 4cf800b

Please sign in to comment.