Home | History | Annotate | Download | only in ADT

Lines Matching refs:Constructable

27 class Constructable {
41 Constructable() : constructed(true), value(0) {
45 Constructable(int val) : constructed(true), value(val) {
49 Constructable(const Constructable & src) : constructed(true) {
55 Constructable(Constructable && src) : constructed(true) {
61 ~Constructable() {
67 Constructable & operator=(const Constructable & src) {
75 Constructable & operator=(Constructable && src) {
125 friend bool operator==(const Constructable & c0, const Constructable & c1) {
130 operator!=(const Constructable & c0, const Constructable & c1) {
135 int Constructable::numConstructorCalls;
136 int Constructable::numCopyConstructorCalls;
137 int Constructable::numMoveConstructorCalls;
138 int Constructable::numDestructorCalls;
139 int Constructable::numAssignmentCalls;
140 int Constructable::numCopyAssignmentCalls;
141 int Constructable::numMoveAssignmentCalls;
159 void SetUp() override { Constructable::reset(); }
190 v.push_back(Constructable(i));
204 typedef ::testing::Types<SmallVector<Constructable, 0>,
205 SmallVector<Constructable, 1>,
206 SmallVector<Constructable, 2>,
207 SmallVector<Constructable, 4>,
208 SmallVector<Constructable, 5>
217 EXPECT_EQ(0, Constructable::getNumConstructorCalls());
218 EXPECT_EQ(0, Constructable::getNumDestructorCalls());
229 this->theVector.push_back(Constructable(1));
237 this->theVector.push_back(Constructable(2));
257 EXPECT_EQ(5, Constructable::getNumConstructorCalls());
258 EXPECT_EQ(5, Constructable::getNumDestructorCalls());
262 EXPECT_LE(5, Constructable::getNumConstructorCalls());
263 EXPECT_EQ(Constructable::getNumConstructorCalls(),
264 Constructable::getNumDestructorCalls());
277 EXPECT_EQ(4, Constructable::getNumConstructorCalls());
278 EXPECT_EQ(4, Constructable::getNumDestructorCalls());
290 EXPECT_EQ(6, Constructable::getNumConstructorCalls());
291 EXPECT_EQ(5, Constructable::getNumDestructorCalls());
300 EXPECT_EQ(2, Constructable::getNumConstructorCalls());
301 EXPECT_EQ(0, Constructable::getNumDestructorCalls());
308 Constructable::reset();
312 size_t Ctors = Constructable::getNumConstructorCalls();
314 size_t MoveCtors = Constructable::getNumMoveConstructorCalls();
316 size_t Dtors = Constructable::getNumDestructorCalls();
324 this->theVector.resize(3, Constructable(77));
403 this->theVector.push_back(Constructable(1));
413 this->theVector.push_back(Constructable(1));
414 this->theVector.append(2, Constructable(77));
422 this->theVector.push_back(Constructable(1));
423 this->theVector.assign(2, Constructable(77));
433 this->theVector.push_back(Constructable(1));
436 this->otherVector.push_back(Constructable(2));
437 this->otherVector.push_back(Constructable(3));
448 EXPECT_EQ(Constructable::getNumConstructorCalls()-2,
449 Constructable::getNumDestructorCalls());
453 EXPECT_EQ(Constructable::getNumConstructorCalls(),
454 Constructable::getNumDestructorCalls());
481 this->theVector.insert(this->theVector.begin() + 1, Constructable(77));
491 Constructable C(77);
503 Constructable::reset();
505 this->theVector.insert(this->theVector.begin() + 1, 2, Constructable(16));
511 EXPECT_TRUE(Constructable::getNumMoveConstructorCalls() == 2 ||
512 Constructable::getNumMoveConstructorCalls() == 6);
514 EXPECT_EQ(1, Constructable::getNumMoveAssignmentCalls());
516 EXPECT_EQ(2, Constructable::getNumCopyAssignmentCalls());
518 EXPECT_EQ(0, Constructable::getNumCopyConstructorCalls());
528 Constructable::reset();
529 auto I = this->theVector.insert(this->theVector.end(), 2, Constructable(16));
531 EXPECT_EQ(2, Constructable::getNumCopyConstructorCalls());
533 EXPECT_TRUE(Constructable::getNumMoveConstructorCalls() == 0 ||
534 Constructable::getNumMoveConstructorCalls() == 4);
536 EXPECT_EQ(0, Constructable::getNumCopyAssignmentCalls());
537 EXPECT_EQ(0, Constructable::getNumMoveAssignmentCalls());
551 0, Constructable(42)));
554 0, Constructable(42)));
561 Constructable Arr[3] =
562 { Constructable(77), Constructable(77), Constructable(77) };
565 Constructable::reset();
572 EXPECT_TRUE(Constructable::getNumMoveConstructorCalls() == 2 ||
573 Constructable::getNumMoveConstructorCalls() == 5);
575 EXPECT_EQ(2, Constructable::getNumCopyAssignmentCalls());
577 EXPECT_EQ(1, Constructable::getNumCopyConstructorCalls());
586 Constructable Arr[3] =
587 { Constructable(77), Constructable(77), Constructable(77) };
592 Constructable::reset();
595 EXPECT_EQ(3, Constructable::getNumCopyConstructorCalls());
597 EXPECT_EQ(0, Constructable::getNumCopyAssignmentCalls());
600 EXPECT_TRUE(Constructable::getNumMoveConstructorCalls() == 0 ||
601 Constructable::getNumMoveConstructorCalls() == 3);
602 EXPECT_EQ(0, Constructable::getNumMoveAssignmentCalls());
655 EXPECT_EQ(0, Constructable::getNumConstructorCalls());
661 EXPECT_EQ(8, Constructable::getNumConstructorCalls());
687 std::pair<SmallVector<Constructable, 4>, SmallVector<Constructable, 4>>,
689 std::pair<SmallVector<Constructable, 4>, SmallVector<Constructable, 2>>,
691 std::pair<SmallVector<Constructable, 2>, SmallVector<Constructable, 4>>,
693 std::pair<SmallVector<Constructable, 2>, SmallVector<Constructable, 2>>
703 this->otherVector.push_back(Constructable(I));
705 const Constructable *OrigDataPtr = this->otherVector.data();
709 std::move(static_cast<SmallVectorImpl<Constructable>&>(this->otherVector));
717 EXPECT_EQ(Constructable::getNumConstructorCalls()-4,
718 Constructable::getNumDestructorCalls());
727 EXPECT_EQ(Constructable::getNumConstructorCalls(),
728 Constructable::getNumDestructorCalls());
731 EXPECT_EQ(Constructable::getNumCopyConstructorCalls(), 0);