Skip to content

Commit

Permalink
Fix tests expected URIs
Browse files Browse the repository at this point in the history
  • Loading branch information
ypatia committed Oct 17, 2024
1 parent 3186b6e commit d1df508
Showing 1 changed file with 8 additions and 21 deletions.
29 changes: 8 additions & 21 deletions test/src/unit-cppapi-group.cc
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ TEST_CASE_METHOD(
std::string array1_uri = vfs_test_setup_.array_uri("array1");
std::string array2_uri = vfs_test_setup_.array_uri("array2");
std::string array3_uri = vfs_test_setup_.array_uri("array3");
std::cerr << array1_uri << std::endl;

create_array(array1_uri);
create_array(array2_uri);
Expand All @@ -313,22 +312,14 @@ TEST_CASE_METHOD(
std::string group2_uri = vfs_test_setup_.array_uri("group2");
tiledb::Group::create(ctx_, group1_uri);
tiledb::Group::create(ctx_, group2_uri);
std::cerr << group1_uri << std::endl;

// Set expected
auto uri_format = [&](std::string uri) {
return vfs_test_setup_.is_rest() ? vfs_test_setup_.with_prefix(uri) : uri;
};
auto expected_uri = vfs_test_setup_.is_rest() ?
vfs_test_setup_.with_prefix(array1_uri) :
array1_uri;
std::vector<tiledb::Object> group1_expected = {
tiledb::Object(
tiledb::Object::Type::Array, uri_format(array1_uri), "array1"),
tiledb::Object::Type::Array, tiledb::sm::URI(array1_uri).to_string(), "array1"),
tiledb::Object(
tiledb::Object::Type::Array, uri_format(array2_uri), "array2"),
tiledb::Object::Type::Array, tiledb::sm::URI(array2_uri).to_string(), "array2"),
tiledb::Object(
tiledb::Object::Type::Group, uri_format(group2_uri), "group2"),
tiledb::Object::Type::Group, tiledb::sm::URI(group2_uri).to_string(), "group2"),
};
std::vector<std::tuple<tiledb::Object::Type, std::optional<std::string>>>
group1_exp_det = {
Expand All @@ -337,7 +328,7 @@ TEST_CASE_METHOD(
{tiledb::Object::Type::Group, "group2"}};
std::vector<tiledb::Object> group2_expected = {
tiledb::Object(
tiledb::Object::Type::Array, uri_format(array3_uri), "array3"),
tiledb::Object::Type::Array, tiledb::sm::URI(array3_uri).to_string(), "array3"),
};
std::vector<std::tuple<tiledb::Object::Type, std::optional<std::string>>>
group2_exp_det = {{tiledb::Object::Type::Array, "array3"}};
Expand Down Expand Up @@ -466,17 +457,13 @@ TEST_CASE_METHOD(
tiledb::Group::create(ctx_, group1_uri);
tiledb::Group::create(ctx_, group2_uri);

// Set expected
auto uri_format = [&](std::string uri) {
return vfs_test_setup_.is_rest() ? vfs_test_setup_.with_prefix(uri) : uri;
};
std::vector<tiledb::Object> group1_expected = {
tiledb::Object(
tiledb::Object::Type::Array, uri_format(array1_uri), std::nullopt),
tiledb::Object::Type::Array, tiledb::sm::URI(array1_uri).to_string(), std::nullopt),
tiledb::Object(
tiledb::Object::Type::Array, uri_format(array2_uri), std::nullopt),
tiledb::Object::Type::Array, tiledb::sm::URI(array2_uri).to_string(), std::nullopt),
tiledb::Object(
tiledb::Object::Type::Group, uri_format(group2_uri), std::nullopt),
tiledb::Object::Type::Group, tiledb::sm::URI(group2_uri).to_string(), std::nullopt),
};
std::vector<std::tuple<tiledb::Object::Type, std::optional<std::string>>>
group1_exp_det = {
Expand All @@ -485,7 +472,7 @@ TEST_CASE_METHOD(
{tiledb::Object::Type::Group, std::nullopt}};
std::vector<tiledb::Object> group2_expected = {
tiledb::Object(
tiledb::Object::Type::Array, uri_format(array3_uri), std::nullopt),
tiledb::Object::Type::Array, tiledb::sm::URI(array3_uri).to_string(), std::nullopt),
};
std::vector<std::tuple<tiledb::Object::Type, std::optional<std::string>>>
group2_exp_det = {{tiledb::Object::Type::Array, std::nullopt}};
Expand Down

0 comments on commit d1df508

Please sign in to comment.