Skip to content

Commit

Permalink
#8: add test for reading in compressed json
Browse files Browse the repository at this point in the history
  • Loading branch information
cwschilly committed Sep 4, 2024
1 parent 4bd910e commit 6da8f58
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/unit/utility/test_json_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,12 @@ using JSONReader = vt::tv::utility::JSONReader;
*/
struct JSONReaderTest :public ::testing::Test {};

TEST_F(JSONReaderTest, test_json_reader_1) {
std::filesystem::path p = std::filesystem::path(SRC_DIR) / "data/lb_test_data" ;
void test_json_reader(std::filesystem::path p, std::string suffix) {
std::string path = std::filesystem::absolute(p).string();

NodeType rank = 0;
JSONReader reader{rank};
reader.readFile(path + "/data.0.json");
reader.readFile(path + "/data.0" + suffix);
auto info = reader.parse();

auto const& obj_info = info->getObjectInfo();
Expand Down Expand Up @@ -112,6 +111,16 @@ TEST_F(JSONReaderTest, test_json_reader_1) {
}
}

TEST_F(JSONReaderTest, test_json_reader_1) {
std::filesystem::path p = std::filesystem::path(SRC_DIR) / "data/lb_test_data" ;
test_json_reader(p, ".json");
}

TEST_F(JSONReaderTest, test_json_reader_compressed) {
std::filesystem::path p = std::filesystem::path(SRC_DIR) / "data/lb_test_data_compressed" ;
test_json_reader(p, ".json.br");
}

TEST_F(JSONReaderTest, test_json_reader_metadata_attributes) {
std::filesystem::path p = std::filesystem::path(SRC_DIR) / "data/reader_test_data" ;
std::string path = std::filesystem::absolute(p).string();
Expand Down

0 comments on commit 6da8f58

Please sign in to comment.