Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[c++] Trivial name-shortens in unit-test code #3125

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions libtiledbsoma/src/soma/soma_array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,7 @@ std::vector<int64_t> SOMAArray::maxshape() {
std::pair<bool, std::string> SOMAArray::_can_set_shape_helper(
const std::vector<int64_t>& newshape,
bool is_resize,
std::string method_name_for_messages) {
std::string function_name_for_messages) {
// E.g. it's an error to try to upgrade_domain or resize specifying
// a 3-D shape on a 2-D array.
auto arg_ndim = newshape.size();
Expand All @@ -1453,7 +1453,7 @@ std::pair<bool, std::string> SOMAArray::_can_set_shape_helper(
false,
fmt::format(
"cannot {}: provided shape has ndim {}, while the array has {}",
method_name_for_messages,
function_name_for_messages,
arg_ndim,
array_ndim));
}
Expand All @@ -1471,7 +1471,7 @@ std::pair<bool, std::string> SOMAArray::_can_set_shape_helper(
fmt::format(
"{}: array currently has no shape: please use "
"tiledbsoma_upgrade_shape.",
method_name_for_messages));
function_name_for_messages));
}
} else {
// They're trying to do upgrade_shape on an array that already has a
Expand All @@ -1483,7 +1483,7 @@ std::pair<bool, std::string> SOMAArray::_can_set_shape_helper(
"{}: array already has a shape: please use resize rather "
"than "
"tiledbsoma_upgrade_shape.",
method_name_for_messages));
function_name_for_messages));
}
}

Expand All @@ -1498,7 +1498,7 @@ std::pair<bool, std::string> SOMAArray::_can_set_shape_helper(
// if the requested shape fits in the array's core domain, it's good to go
// as a new shape.
auto domain_check = _can_set_shape_domainish_helper(
newshape, false, method_name_for_messages);
newshape, false, function_name_for_messages);
if (!domain_check.first) {
return domain_check;
}
Expand All @@ -1507,7 +1507,7 @@ std::pair<bool, std::string> SOMAArray::_can_set_shape_helper(
// shape (core current domain) isn't a downsize of the current one.
if (has_shape) {
auto current_domain_check = _can_set_shape_domainish_helper(
newshape, true, method_name_for_messages);
newshape, true, function_name_for_messages);
if (!current_domain_check.first) {
return current_domain_check;
}
Expand All @@ -1522,7 +1522,7 @@ std::pair<bool, std::string> SOMAArray::_can_set_shape_helper(
std::pair<bool, std::string> SOMAArray::_can_set_shape_domainish_helper(
const std::vector<int64_t>& newshape,
bool check_current_domain,
std::string method_name_for_messages) {
std::string function_name_for_messages) {
Domain domain = arr_->schema().domain();

for (unsigned i = 0; i < domain.ndim(); i++) {
Expand All @@ -1538,7 +1538,7 @@ std::pair<bool, std::string> SOMAArray::_can_set_shape_domainish_helper(
throw TileDBSOMAError(fmt::format(
"{}: internal error: expected {} dim to "
"be {}; got {}",
method_name_for_messages,
function_name_for_messages,
dim_name,
tiledb::impl::type_to_str(TILEDB_INT64),
tiledb::impl::type_to_str(dim.type())));
Expand All @@ -1554,7 +1554,7 @@ std::pair<bool, std::string> SOMAArray::_can_set_shape_domainish_helper(
false,
fmt::format(
"cannot {} for {}: new {} < existing shape {}",
method_name_for_messages,
function_name_for_messages,
dim_name,
newshape[i],
old_dim_shape));
Expand All @@ -1570,7 +1570,7 @@ std::pair<bool, std::string> SOMAArray::_can_set_shape_domainish_helper(
false,
fmt::format(
"cannot {} for {}: new {} < maxshape {}",
method_name_for_messages,
function_name_for_messages,
dim_name,
newshape[i],
old_dim_shape));
Expand Down
4 changes: 2 additions & 2 deletions libtiledbsoma/src/soma/soma_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -1193,15 +1193,15 @@ class SOMAArray : public SOMAObject {
std::pair<bool, std::string> _can_set_shape_helper(
const std::vector<int64_t>& newshape,
bool is_resize,
std::string method_name_for_messages);
std::string function_name_for_messages);

/**
* This is a second-level code-dedupe helper for _can_set_shape_helper.
*/
std::pair<bool, std::string> _can_set_shape_domainish_helper(
const std::vector<int64_t>& newshape,
bool check_current_domain,
std::string method_name_for_messages);
std::string function_name_for_messages);

/**
* This is a code-dedupe helper method for resize and upgrade_shape.
Expand Down
Loading
Loading