Fix CombineAsTest/CopyConstructible test

This commit is contained in:
stoorx 2025-06-12 00:19:27 +03:00
parent 9848239a79
commit 0681c455bd

View File

@ -633,22 +633,27 @@ TEST(CombineAsTest, NonDefaultConstructible) {
}
TEST(CombineAsTest, CopyConstructible) {
struct CopyConstructible {
class CopyConstructible {
public:
CopyConstructible(const CopyConstructible& other) = default;
CopyConstructible(const int i_arg, std::string s_arg)
: i_(i_arg), s_(std::move(s_arg)) {}
bool operator==(const CopyConstructible& other) const {
return x == other.x && s == other.s;
return i_ == other.i_ && s_ == other.s_;
}
int x;
std::string s;
private:
int i_;
std::string s_;
};
static_assert(std::is_copy_constructible_v<CopyConstructible>);
ParamGenerator<CopyConstructible> gen = testing::CombineAs<CopyConstructible>(
Values(CopyConstructible{0, "A"}, CopyConstructible{1, "B"}));
CopyConstructible expected_values[] = {CopyConstructible{0, "A"},
CopyConstructible{1, "B"}};
Values(CopyConstructible(0, "A"), CopyConstructible(1, "B")));
CopyConstructible expected_values[] = {CopyConstructible(0, "A"),
CopyConstructible(1, "B")};
VerifyGenerator(gen, expected_values);
}