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

Cosmetic changes. #937

Merged
merged 1 commit into from
Feb 5, 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
9 changes: 5 additions & 4 deletions include/highfive/bits/H5Inspector_misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@

if (n_dim_requested == 0) {
if (!checkDimensions(dims, n_dim_requested)) {
throw std::invalid_argument(format_error_message());
throw std::invalid_argument("Failed dimensions check: " + format_error_message());

Check warning on line 80 in include/highfive/bits/H5Inspector_misc.hpp

View check run for this annotation

Codecov / codecov/patch

include/highfive/bits/H5Inspector_misc.hpp#L80

Added line #L80 was not covered by tests
}

return {1ul};
}

auto n_dim = dims.size();
if (n_dim < n_dim_requested) {
throw std::invalid_argument(format_error_message());
throw std::invalid_argument("Failed 'n_dim < n_dim_requested: " + format_error_message());

Check warning on line 88 in include/highfive/bits/H5Inspector_misc.hpp

View check run for this annotation

Codecov / codecov/patch

include/highfive/bits/H5Inspector_misc.hpp#L88

Added line #L88 was not covered by tests
}

if (n_dim_requested == 1ul) {
Expand All @@ -95,7 +95,8 @@
if (non_singleton_dim == size_t(-1)) {
non_singleton_dim = i;
} else {
throw std::invalid_argument(format_error_message());
throw std::invalid_argument("Failed one-dimensional: " +
format_error_message());
}
}
}
Expand All @@ -106,7 +107,7 @@
size_t n_dim_excess = dims.size() - n_dim_requested;
for (size_t i = 1; i <= n_dim_excess; ++i) {
if (dims[n_dim - i] != 1) {
throw std::invalid_argument(format_error_message());
throw std::invalid_argument("Failed stripping from back:" + format_error_message());
}
}

Expand Down
8 changes: 4 additions & 4 deletions tests/unit/tests_high_five_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <type_traits>
#include <vector>


#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_template_test_macros.hpp>
#include <catch2/matchers/catch_matchers_vector.hpp>
Expand Down Expand Up @@ -907,8 +906,9 @@ TEST_CASE("HighFiveReadWriteShortcut") {
const std::string dataset_name("dset");
std::vector<unsigned> vec;
vec.resize(x_size);
for (unsigned i = 0; i < x_size; i++)
for (unsigned i = 0; i < x_size; i++) {
vec[i] = i * 2;
}
std::string at_contents("Contents of string");
int my_int = 3;
std::vector<std::vector<int>> my_nested = {{1, 2}, {3, 4}};
Expand Down Expand Up @@ -945,7 +945,7 @@ TEST_CASE("HighFiveReadWriteShortcut") {
}

// Plain c arrays. 1D
{
SECTION("int-c-array") {
int int_c_array[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
DataSet ds_int2 = file.createDataSet("/TmpCArrayInt", int_c_array);

Expand All @@ -957,7 +957,7 @@ TEST_CASE("HighFiveReadWriteShortcut") {
}

// Plain c arrays. 2D
{
SECTION("char-c-array") {
char char_c_2darray[][3] = {"aa", "bb", "cc", "12"};
DataSet ds_char2 = file.createDataSet("/TmpCArray2dchar", char_c_2darray);

Expand Down
Loading