Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 1ca162835ac614defe19dd440319a81c912a27b0
Author: Isaiah Norton <[email protected]>
Date:   Tue Aug 2 23:20:02 2022 -0400

    Update

commit 90f4b95
Author: dhoke4tdb <[email protected]>
Date:   Tue Aug 2 21:13:33 2022 -0400

    change stol() to stoul() for correct cross-platform issues with experimental version numbers (#3410)

    Change stol() to stoul() for correct cross-platform operations with experimental version numbers.

    TYPE: BUG
    DESC: use stoul() to correctly parse (32bit unsigned values) experimental version numbers cross-platform

commit bf465c3
Author: Isaiah Norton <[email protected]>
Date:   Tue Aug 2 08:51:18 2022 -0400

    Fix whitespace (unrelated to PR)

commit ed40669
Author: Isaiah Norton <[email protected]>
Date:   Tue Aug 2 08:49:01 2022 -0400

    Validate Dimension Datatype upon Dimension construction

    Now that Dimension is C.41 compliant, the constructor must take on the responsibility of validation. A new API has been added that validates the incoming Datatype for Dimensions, disallowing certain types.

    ---

    SC-17968

    ---
    TYPE: IMPROVEMENT
    DESC: Validate Dimension datatype

commit d48f874
Author: dhoke4tdb <[email protected]>
Date:   Tue Aug 2 08:11:16 2022 -0400

    add tdb_catch.h wrapper for catch.hpp (#3390)

    * add tdb_catch.h wrapper to aid transition to new/mixed catch2/3 versions in build environments

    * locate tdb_catch.h in test/support (a new [sub-]directory)
  • Loading branch information
ihnorton committed Aug 3, 2022
1 parent c39528a commit 106fa6e
Show file tree
Hide file tree
Showing 116 changed files with 386 additions and 149 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mingw-w64-tiledb/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ build() {
..
make
make -C tiledb

# in a local environ, can build to demo/check for previously seen (windows event) handle leakge
# apparently due to issues with mingw std library implementation.
# note that with S3 enabled above, and minio not running, the aws sdk may fatally error on exit.
Expand Down
2 changes: 1 addition & 1 deletion experimental/tiledb/common/dag/execution/test/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
*/

#define CATCH_CONFIG_MAIN
#include <catch.hpp>
#include <test/support/tdb_catch.h>
2 changes: 1 addition & 1 deletion experimental/tiledb/common/dag/ports/test/unit_fsm.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@

#ifndef TILEDB_UNIT_FSM_H
#define TILEDB_UNIT_FSM_H
#include <catch.hpp>
#include <test/support/tdb_catch.h>
#endif // TILEDB_UNIT_FSM_H
2 changes: 1 addition & 1 deletion experimental/tiledb/common/dag/ports/test/unit_ports.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@

#ifndef TILEDB_UNIT_PORTS_H
#define TILEDB_UNIT_PORTS_H
#include <catch.hpp>
#include <test/support/tdb_catch.h>
#endif // TILEDB_UNIT_PORTS_H
2 changes: 1 addition & 1 deletion experimental/tiledb/common/dag/utils/test/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
*/

#define CATCH_CONFIG_MAIN
#include <catch.hpp>
#include <test/support/tdb_catch.h>
2 changes: 1 addition & 1 deletion experimental/tiledb/common/dag/utils/test/unit_spinlock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* Implement tests for spinlocks.
*/

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <future>
#include <mutex>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion format_spec/consolidated_commits_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ my_array # array folder
* `uuid` is a unique identifier
* `v` is the format version

There may be multiple such files in the array commits folder. Each consolidated commits file combines a list of fragments commits or delete commits.
There may be multiple such files in the array commits folder. Each consolidated commits file combines a list of fragments commits or delete commits.
| **Field** | **Type** | **Description** |
| :--- | :--- | :--- |
| Commit 1 | `uint8_t[]` | Commit 1 |
Expand Down
7 changes: 6 additions & 1 deletion test/ci/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ add_executable(
test_assert.cc
)

target_include_directories(test_assert
PRIVATE
"${TILEDB_CORE_INCLUDE_DIR}"
)

target_link_libraries(test_assert PUBLIC Catch2::Catch2)

if (TILEDB_ASSERTIONS)
Expand Down Expand Up @@ -41,4 +46,4 @@ add_dependencies(test_assert try_assert)
add_test(
NAME "test_ci_asserts"
COMMAND test_assert
)
)
2 changes: 1 addition & 1 deletion test/ci/test_assert.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/

#define CATCH_CONFIG_MAIN
#include <catch.hpp>
#include <test/support/tdb_catch.h>

#include <cassert>
#include <iostream>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ TEST_CASE_METHOD(
auto timestamps_ptr =
GENERATE_REF(as<std::vector<uint64_t>*>{}, nullptr, &timestamps);

uint64_t tstamp = 7;
uint64_t tstamp = 7;
SECTION("Read after all writes") {
// Read after both writes - should see everything.
tstamp = 7;
Expand Down
2 changes: 1 addition & 1 deletion test/performance/msys_handle_leakage/unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ after 70
*/

#define CATCH_CONFIG_RUNNER
#include <catch.hpp>
#include <test/support/tdb_catch.h>

#include <cstdlib>
#include <iostream>
Expand Down
3 changes: 3 additions & 0 deletions test/regression/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
# THE SOFTWARE.
#

set(TILEDB_CORE_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..")

find_package(Catch_EP REQUIRED)

set(SOURCES
Expand Down Expand Up @@ -61,6 +63,7 @@ target_link_libraries(tiledb_regression
target_include_directories(tiledb_regression
PRIVATE
${CMAKE_INSTALL_PREFIX}/include
"${TILEDB_CORE_INCLUDE_DIR}"
)

add_test(
Expand Down
2 changes: 1 addition & 1 deletion test/regression/regression.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define CATCH_CONFIG_RUNNER
#include <catch.hpp>
#include <test/support/tdb_catch.h>

int main(const int argc, char** const argv) {
Catch::Session session;
Expand Down
2 changes: 1 addition & 1 deletion test/src/test-capi-dimension_labels.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#include "tiledb/sm/filesystem/posix.h"
#endif

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>
#include <string>
#include <unordered_map>
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-CellSlabIter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "tiledb/sm/filesystem/posix.h"
#endif

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::sm;
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-DenseTiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "tiledb/sm/cpp_api/tiledb"
#include "tiledb/sm/query/writers/dense_tiler.h"

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb;
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-QueryCondition-serialization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include "tiledb/sm/enums/query_condition_op.h"
#include "tiledb/sm/query/query_condition.h"

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::sm;
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-ReadCellSlabIter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include "tiledb/sm/filesystem/posix.h"
#endif

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::sm;
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-Reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#include "tiledb/sm/filesystem/posix.h"
#endif

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::sm;
Expand Down
4 changes: 2 additions & 2 deletions test/src/unit-Subarray.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "tiledb/sm/filesystem/posix.h"
#endif

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::sm;
Expand Down Expand Up @@ -924,4 +924,4 @@ TEST_CASE_METHOD(
&subarray, 37, 57, 32, 63, {2, 0, 0}, {3, 3, 3});

close_array(ctx_, array_);
}
}
2 changes: 1 addition & 1 deletion test/src/unit-SubarrayPartitioner-dense.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "tiledb/sm/filesystem/posix.h"
#endif

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::common;
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-SubarrayPartitioner-error.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "tiledb/sm/filesystem/posix.h"
#endif

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::common;
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-SubarrayPartitioner-sparse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "tiledb/sm/filesystem/posix.h"
#endif

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::common;
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-Tile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "tiledb/sm/enums/datatype.h"
#include "tiledb/sm/tile/tile.h"

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::sm;
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-bufferlist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "tiledb/sm/c_api/tiledb.h"
#include "tiledb/sm/c_api/tiledb_struct_def.h"

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::sm;
Expand Down
54 changes: 53 additions & 1 deletion test/src/unit-capi-array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2168,4 +2168,56 @@ TEST_CASE_METHOD(

remove_temp_dir(local_fs.file_prefix() + local_fs.temp_dir());
#endif
}
}

TEST_CASE_METHOD(
ArrayFx, "Test dimension datatypes", "[array][dimension][datatypes]") {
SupportedFsLocal local_fs;
std::string array_name =
local_fs.file_prefix() + local_fs.temp_dir() + "array_dim_types";
create_temp_dir(local_fs.file_prefix() + local_fs.temp_dir());

uint64_t dim_domain[] = {1, 10, 1, 10};
uint64_t tile_extent = 2;
tiledb_dimension_t* dim;

SECTION("- valid and supported Datatypes") {
std::vector<tiledb_datatype_t> valid_supported_types = {TILEDB_UINT64,
TILEDB_INT64};

for (auto dim_type : valid_supported_types) {
int rc = tiledb_dimension_alloc(
ctx_, "dim", dim_type, dim_domain, &tile_extent, &dim);
REQUIRE(rc == TILEDB_OK);
}
}

SECTION("- valid and unsupported Datatypes") {
std::vector<tiledb_datatype_t> valid_unsupported_types = {TILEDB_CHAR,
TILEDB_BOOL};

for (auto dim_type : valid_unsupported_types) {
int rc = tiledb_dimension_alloc(
ctx_, "dim", dim_type, dim_domain, &tile_extent, &dim);
REQUIRE(rc == TILEDB_ERR);
}
}

SECTION("- invalid Datatypes") {
std::vector<std::underlying_type_t<tiledb_datatype_t>> invalid_datatypes = {
42, 100};

for (auto dim_type : invalid_datatypes) {
int rc = tiledb_dimension_alloc(
ctx_,
"dim",
tiledb_datatype_t(dim_type),
dim_domain,
&tile_extent,
&dim);
REQUIRE(rc == TILEDB_ERR);
}
}

tiledb_dimension_free(&dim);
}
2 changes: 1 addition & 1 deletion test/src/unit-capi-attributes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -461,4 +461,4 @@ TEST_CASE_METHOD(

remove_temp_dir(temp_dir);
}
}
}
46 changes: 23 additions & 23 deletions test/src/unit-capi-dense_array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1872,28 +1872,28 @@ void DenseArrayFx::write_large_dense_array(const std::string& array_name) {
// Prepare cell buffers
// clang-format off
uint64_t buffer_a1[] = {
101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115,
201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215,
301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315,
401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415,
501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515,
601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615,
701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715,
801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815,
901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915,
1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015,
1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115,
1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215,
1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1314, 1315,
1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 1413, 1414, 1415,
1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514, 1515,
1601, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, 1615,
1701, 1702, 1703, 1704, 1705, 1706, 1707, 1708, 1709, 1710, 1711, 1712, 1713, 1714, 1715,
1801, 1802, 1803, 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, 1814, 1815,
1901, 1902, 1903, 1904, 1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1915,
101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115,
201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215,
301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315,
401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415,
501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515,
601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615,
701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715,
801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815,
901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915,
1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015,
1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115,
1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215,
1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1314, 1315,
1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 1413, 1414, 1415,
1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514, 1515,
1601, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, 1615,
1701, 1702, 1703, 1704, 1705, 1706, 1707, 1708, 1709, 1710, 1711, 1712, 1713, 1714, 1715,
1801, 1802, 1803, 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, 1814, 1815,
1901, 1902, 1903, 1904, 1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1915,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015,
};

uint64_t buffer_size = sizeof(buffer_a1);
// clang-format on

Expand Down Expand Up @@ -5122,7 +5122,7 @@ TEST_CASE_METHOD(

// clang-format off
uint64_t c_a1_cm[] = {
503, 603, 1003, 1103, 1203, 1303, 1403, 1503, 1603,
503, 603, 1003, 1103, 1203, 1303, 1403, 1503, 1603,
504, 604, 1004, 1104, 1204, 1304, 1404, 1504, 1604
};

Expand All @@ -5134,7 +5134,7 @@ TEST_CASE_METHOD(
1203, 1204,
1303, 1304,
1403, 1404,
1503, 1504,
1503, 1504,
1603, 1604
};
// clang-format on
Expand Down Expand Up @@ -5189,7 +5189,7 @@ TEST_CASE_METHOD(
1203, 1204,
1303, 1304,
1403, 1404,
1503, 1504,
1503, 1504,
1603, 1604,
503, 504,
603, 604
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-capi-dense_array_2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "tiledb/sm/filesystem/posix.h"
#endif

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::sm;
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-capi-fragment_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "tiledb/sm/c_api/tiledb.h"
#include "tiledb/sm/global_state/unit_test_config.h"

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::test;
Expand Down
Loading

0 comments on commit 106fa6e

Please sign in to comment.