Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix check for out of bounds dimension in Dimension::dimension_ptr. #5094

Merged
merged 5 commits into from
Jun 18, 2024

Conversation

robertbindar
Copy link
Contributor

@robertbindar robertbindar commented Jun 17, 2024

Fix domain::dimension_ptr(int) out of bounds check.

Also adding a unit test to make sure the issue doesn't regress.

[sc-49597]


TYPE: BUG
DESC: Fix check for out of bounds dimension in Dimension::dimension_ptr.

@robertbindar
Copy link
Contributor Author

Anyone knows why that build is failing? The test I enabled doesn't seem to use deprecated APIs

@@ -36,18 +36,27 @@
#include "tiledb/sm/enums/datatype.h"
#include "tiledb/sm/enums/layout.h"

#include "tiledb/api/c_api/context/context_api_internal.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might cause the build issues?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue was that the helpers header includes the CPP header which contains some deprecated declarations.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't add this header to a unit test.

tiledb/sm/array_schema/test/unit_domain.cc Show resolved Hide resolved
#include <test/support/tdb_catch.h>

using namespace tiledb;
using namespace tiledb::common;
using namespace tiledb::sm;
using namespace tiledb::test;

struct DomainFx : TemporaryDirectoryFixture {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, to get a context in a oneliner.

@@ -36,18 +36,27 @@
#include "tiledb/sm/enums/datatype.h"
#include "tiledb/sm/enums/layout.h"

#include "tiledb/api/c_api/context/context_api_internal.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't add this header to a unit test.

@@ -30,12 +30,16 @@ commence(unit_test array_schema)
this_target_object_libraries(array_schema)
# should be `this_target_include_directories`, when available
target_include_directories(unit_array_schema PUBLIC ${TILEDB_SOURCE_ROOT}/test/support)
if (NOT MSVC)
target_compile_options(unit_array_schema PUBLIC -Wno-deprecated-declarations)
endif()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this now?

@KiterLuc KiterLuc changed the title Fix domain::dimension_ptr(int) oob Fix check for out of bounds dimension in Dimension::dimension_ptr. Jun 18, 2024
@KiterLuc KiterLuc merged commit 4044e84 into dev Jun 18, 2024
63 checks passed
@KiterLuc KiterLuc deleted the rbin/ch49597/domain_oob branch June 18, 2024 13:05
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants