MCPcopy Create free account
hub / github.com/TileDB-Inc/TileDB / validate_data_var

Method validate_data_var

test/src/test-cppapi-aggregates.cc:939–1155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

937
938template <class T>
939void CppAggregatesFx<T>::validate_data_var(
940 Query& query,
941 std::vector<uint64_t>& dim1,
942 std::vector<uint64_t>& dim2,
943 std::string& a1_data,
944 std::vector<uint64_t>& a1_offsets,
945 std::vector<uint8_t>& a1_validity,
946 const bool validate_count) {
947 auto result_el = query.result_buffer_elements_nullable();
948 uint64_t expected_count = 0;
949 std::vector<uint64_t> expected_dim1;
950 std::vector<uint64_t> expected_dim2;
951 std::vector<std::string> expected_a1;
952 std::vector<uint8_t> expected_a1_validity;
953
954 if (dense_) {
955 if (layout_ == TILEDB_ROW_MAJOR) {
956 if (set_ranges_) {
957 expected_count = 24;
958 expected_dim1 = {2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
959 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5};
960 expected_dim2 = {1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6,
961 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6};
962 expected_a1 = {"3", "4", "5", "12", "13", "14", "6", "7",
963 "8", "15", "16", "17", "18", "19", "20", "21",
964 "22", "23", "24", "25", "26", "27", "28", "29"};
965 expected_a1_validity = {0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1,
966 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0};
967 } else {
968 expected_count = 36;
969 expected_dim1 = {1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
970 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6};
971 expected_dim2 = {1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6,
972 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6};
973 expected_a1 = {"0", "1", "2", "999", "10", "11", "3", "4", "5",
974 "12", "13", "14", "6", "7", "8", "15", "16", "17",
975 "18", "19", "20", "21", "22", "23", "24", "25", "26",
976 "27", "28", "29", "30", "31", "32", "33", "34", "35"};
977 expected_a1_validity = {1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0,
978 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0,
979 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0};
980 }
981 } else if (layout_ == TILEDB_COL_MAJOR) {
982 if (set_ranges_) {
983 expected_count = 24;
984 expected_dim1 = {2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5,
985 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5};
986 expected_dim2 = {1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3,
987 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6};
988 expected_a1 = {"3", "6", "18", "24", "4", "7", "19", "25",
989 "5", "8", "20", "26", "12", "15", "21", "27",
990 "13", "16", "22", "28", "14", "17", "23", "29"};
991 expected_a1_validity = {0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1,
992 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0};
993 } else {
994 expected_count = 36;
995 expected_dim1 = {1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6,
996 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6};

Callers 1

Calls 4

reserveMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected