Skip to content

Commit

Permalink
Add missing __clang__ checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
helly25 committed Mar 12, 2024
1 parent 8e85a2f commit f25292e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mbo/types/extend_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ TEST_F(ExtendTest, Streamable) {
Conditional(kStructNameSupport, R"({.a: 25, .b: 42, .c: "", .ptr: <nullptr>})", R"({25, 42, "", <nullptr>})"));
}

#if defined(__clang__)

namespace debug {

// NOLINTBEGIN(bugprone-easily-swappable-parameters,cert-dcl50-cpp)
Expand Down Expand Up @@ -245,6 +247,8 @@ void Print(const T* ptr) {

} // namespace debug

#endif // __clang__

struct PersonData : Extend<PersonData> {
int index = 0;
Person person;
Expand Down Expand Up @@ -274,12 +278,14 @@ TEST_F(ExtendTest, StreamableComplexFields) {
Conditional(
kStructNameSupport, R"({25, {.name: {.first: "Hugo", .last: "Meyer"}, .age: 42}, *{{"bar", "foo"}}})",
R"({25, {{"Hugo", "Meyer"}, 42}, *{{"bar", "foo"}}})"));
#ifdef __clang__
if (HasFailure()) {
std::cout << "Person:\n";
debug::Print(&person);
std::cout << "Person::person.name:\n";
debug::Print(&person.person.name);
}
#endif // __clang__
}

TEST_F(ExtendTest, Comparable) {
Expand Down

0 comments on commit f25292e

Please sign in to comment.