@@ -633,22 +633,27 @@ TEST(CombineAsTest, NonDefaultConstructible) {
633
633
}
634
634
635
635
TEST (CombineAsTest, CopyConstructible) {
636
- struct CopyConstructible {
636
+ class CopyConstructible {
637
+ public:
637
638
CopyConstructible (const CopyConstructible& other) = default ;
638
639
640
+ CopyConstructible (const int i_arg, std::string s_arg)
641
+ : i_(i_arg), s_(std::move(s_arg)) {}
642
+
639
643
bool operator ==(const CopyConstructible& other) const {
640
- return x == other.x && s == other.s ;
644
+ return i_ == other.i_ && s_ == other.s_ ;
641
645
}
642
646
643
- int x;
644
- std::string s;
647
+ private:
648
+ int i_;
649
+ std::string s_;
645
650
};
646
651
647
652
static_assert (std::is_copy_constructible_v<CopyConstructible>);
648
653
ParamGenerator<CopyConstructible> gen = testing::CombineAs<CopyConstructible>(
649
- Values (CopyConstructible{ 0 , " A" } , CopyConstructible{ 1 , " B" } ));
650
- CopyConstructible expected_values[] = {CopyConstructible{ 0 , " A" } ,
651
- CopyConstructible{ 1 , " B" } };
654
+ Values (CopyConstructible ( 0 , " A" ) , CopyConstructible ( 1 , " B" ) ));
655
+ CopyConstructible expected_values[] = {CopyConstructible ( 0 , " A" ) ,
656
+ CopyConstructible ( 1 , " B" ) };
652
657
VerifyGenerator (gen, expected_values);
653
658
}
654
659
0 commit comments