Skip to content

Commit

Permalink
Windows fixups.
Browse files Browse the repository at this point in the history
  • Loading branch information
1uc committed May 6, 2024
1 parent 296dad0 commit 5955c67
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/unit/tests_high_five_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2333,20 +2333,20 @@ void check_single_string(File file, size_t string_length) {

SECTION("fixed length") {
auto obj = CreateTraits::create(file, "fixed", dataspace, fixed_length);
obj.template write(value);
obj.write(value);
REQUIRE(obj.template read<std::string>() == value);
}

SECTION("overlength null-terminated") {
auto obj =
CreateTraits::create(file, "overlength_nullterm", dataspace, overlength_nullterm);
obj.template write(value);
obj.write(value);
REQUIRE(obj.template read<std::string>() == value);
}

SECTION("overlength null-padded") {
auto obj = CreateTraits::create(file, "overlength_nullpad", dataspace, overlength_nullpad);
obj.template write(value);
obj.write(value);
auto expected = std::string(n_chars_overlength, '\0');
expected.replace(0, value.size(), value.data());
REQUIRE(obj.template read<std::string>() == expected);
Expand All @@ -2355,15 +2355,15 @@ void check_single_string(File file, size_t string_length) {
SECTION("overlength space-padded") {
auto obj =
CreateTraits::create(file, "overlength_spacepad", dataspace, overlength_spacepad);
obj.template write(value);
obj.write(value);
auto expected = std::string(n_chars_overlength, ' ');
expected.replace(0, value.size(), value.data());
REQUIRE(obj.template read<std::string>() == expected);
}

SECTION("variable length") {
auto obj = CreateTraits::create(file, "variable", dataspace, variable_length);
obj.template write(value);
obj.write(value);
REQUIRE(obj.template read<std::string>() == value);
}
}
Expand Down Expand Up @@ -2399,7 +2399,7 @@ void check_multiple_string(File file, size_t string_length) {

SECTION("variable length") {
auto obj = CreateTraits::create(file, "variable", dataspace, variable_length);
obj.template write(value);
obj.write(value);
check(obj.template read<value_t>(), value);
}

Expand All @@ -2416,22 +2416,22 @@ void check_multiple_string(File file, size_t string_length) {
SECTION(label + " null-terminated") {
auto datatype = FixedLengthStringType(length + 1, StringPadding::NullTerminated);
auto obj = CreateTraits::create(file, label + "_nullterm", dataspace, datatype);
obj.template write(value);
obj.write(value);
check(obj.template read<value_t>(), value);
}

SECTION(label + " null-padded") {
auto datatype = FixedLengthStringType(length, StringPadding::NullPadded);
auto obj = CreateTraits::create(file, label + "_nullpad", dataspace, datatype);
obj.template write(value);
obj.write(value);
auto expected = make_padded_reference('\0', length);
check(obj.template read<value_t>(), expected);
}

SECTION(label + " space-padded") {
auto datatype = FixedLengthStringType(length, StringPadding::SpacePadded);
auto obj = CreateTraits::create(file, label + "_spacepad", dataspace, datatype);
obj.template write(value);
obj.write(value);
auto expected = make_padded_reference(' ', length);
check(obj.template read<value_t>(), expected);
}
Expand All @@ -2444,13 +2444,13 @@ void check_multiple_string(File file, size_t string_length) {
SECTION("underlength null-terminated") {
auto datatype = FixedLengthStringType(string_length, StringPadding::NullTerminated);
auto obj = CreateTraits::create(file, "underlength_nullterm", dataspace, datatype);
REQUIRE_THROWS(obj.template write(value));
REQUIRE_THROWS(obj.write(value));
}

SECTION("underlength nullpad") {
auto datatype = FixedLengthStringType(string_length - 1, StringPadding::NullPadded);
auto obj = CreateTraits::create(file, "underlength_nullpad", dataspace, datatype);
REQUIRE_THROWS(obj.template write(value));
REQUIRE_THROWS(obj.write(value));
}

SECTION("underlength spacepad") {
Expand Down

0 comments on commit 5955c67

Please sign in to comment.