reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

References

unittests/ADT/SmallVectorTest.cpp
  214   this->theVector = SmallVector<Constructable, 2>(2, 2);
  215   this->assertValuesInOrder(this->theVector, 2u, 2, 2);
  222   this->theVector =
  224   this->assertValuesInOrder(this->theVector, 3u, 1, 2, 3);
  230   this->assertEmpty(this->theVector);
  231   EXPECT_TRUE(this->theVector.rbegin() == this->theVector.rend());
  231   EXPECT_TRUE(this->theVector.rbegin() == this->theVector.rend());
  241   bool RequiresGrowth = this->theVector.capacity() < 3;
  244   this->theVector.push_back(Constructable(1));
  247   this->assertValuesInOrder(this->theVector, 1u, 1);
  248   EXPECT_FALSE(this->theVector.begin() == this->theVector.end());
  248   EXPECT_FALSE(this->theVector.begin() == this->theVector.end());
  249   EXPECT_FALSE(this->theVector.empty());
  252   this->theVector.push_back(Constructable(2));
  253   this->assertValuesInOrder(this->theVector, 2u, 1, 2);
  256   this->theVector.insert(this->theVector.begin(), this->theVector[1]);
  256   this->theVector.insert(this->theVector.begin(), this->theVector[1]);
  256   this->theVector.insert(this->theVector.begin(), this->theVector[1]);
  257   this->assertValuesInOrder(this->theVector, 3u, 2, 1, 2);
  260   this->theVector.pop_back();
  261   this->assertValuesInOrder(this->theVector, 2u, 2, 1);
  264   this->theVector.pop_back();
  265   this->theVector.pop_back();
  266   this->assertEmpty(this->theVector);
  287   this->theVector.reserve(2);
  288   this->makeSequence(this->theVector, 1, 2);
  289   this->theVector.clear();
  291   this->assertEmpty(this->theVector);
  300   this->theVector.reserve(3);
  301   this->makeSequence(this->theVector, 1, 3);
  302   this->theVector.resize(1);
  304   this->assertValuesInOrder(this->theVector, 1u, 1);
  313   this->theVector.resize(2);
  317   EXPECT_EQ(2u, this->theVector.size());
  321   this->theVector.resize(2);
  325   this->theVector.resize(4);
  339   this->theVector.resize(3, Constructable(77));
  340   this->assertValuesInOrder(this->theVector, 3u, 77, 77, 77);
  348   this->makeSequence(this->theVector, 1, 10);
  351   EXPECT_EQ(10u, this->theVector.size());
  353     EXPECT_EQ(i+1, this->theVector[i].getValue());
  357   this->theVector.resize(1);
  359   this->assertValuesInOrder(this->theVector, 1u, 1);
  364   this->makeSequence(this->theVector, 1, 2);
  367   typename TypeParam::iterator it = this->theVector.begin();
  368   EXPECT_TRUE(*it == this->theVector.front());
  369   EXPECT_TRUE(*it == this->theVector[0]);
  372   EXPECT_TRUE(*it == this->theVector[1]);
  373   EXPECT_TRUE(*it == this->theVector.back());
  376   EXPECT_TRUE(it == this->theVector.end());
  378   EXPECT_TRUE(*it == this->theVector[1]);
  381   EXPECT_TRUE(*it == this->theVector[0]);
  385   typename TypeParam::reverse_iterator rit = this->theVector.rbegin();
  386   EXPECT_TRUE(*rit == this->theVector[1]);
  389   EXPECT_TRUE(*rit == this->theVector[0]);
  392   EXPECT_TRUE(rit == this->theVector.rend());
  394   EXPECT_TRUE(*rit == this->theVector[0]);
  397   EXPECT_TRUE(*rit == this->theVector[1]);
  405   this->makeSequence(this->theVector, 1, 2);
  406   std::swap(this->theVector, this->otherVector);
  408   this->assertEmpty(this->theVector);
  418   this->theVector.push_back(Constructable(1));
  419   this->theVector.append(this->otherVector.begin(), this->otherVector.end());
  421   this->assertValuesInOrder(this->theVector, 3u, 1, 2, 3);
  428   this->theVector.push_back(Constructable(1));
  429   this->theVector.append(2, Constructable(77));
  430   this->assertValuesInOrder(this->theVector, 3u, 1, 77, 77);
  437   this->theVector.push_back(Constructable(1));
  438   this->theVector.append(2, 7);
  439   this->assertValuesInOrder(this->theVector, 3u, 1, 7, 7);
  455   this->theVector.push_back(Constructable(1));
  456   this->theVector.append(output_iterator(), output_iterator());
  457   this->assertValuesInOrder(this->theVector, 3u, 1, 7, 7);
  464   this->theVector.push_back(Constructable(1));
  465   this->theVector.assign(2, Constructable(77));
  466   this->assertValuesInOrder(this->theVector, 2u, 77, 77);
  473   this->theVector.push_back(Constructable(1));
  475   this->theVector.assign(std::begin(arr), std::end(arr));
  476   this->assertValuesInOrder(this->theVector, 3u, 1, 2, 3);
  483   this->theVector.push_back(Constructable(1));
  484   this->theVector.assign(2, 7);
  485   this->assertValuesInOrder(this->theVector, 2u, 7, 7);
  493   this->theVector.reserve(4);
  494   this->theVector.push_back(Constructable(1));
  501   this->theVector = std::move(this->otherVector);
  504   this->assertValuesInOrder(this->theVector, 2u, 2, 3);
  513   this->theVector.clear();
  522   this->makeSequence(this->theVector, 1, 3);
  523   const auto &theConstVector = this->theVector;
  524   this->theVector.erase(theConstVector.begin());
  525   this->assertValuesInOrder(this->theVector, 2u, 2, 3);
  532   this->makeSequence(this->theVector, 1, 3);
  533   const auto &theConstVector = this->theVector;
  534   this->theVector.erase(theConstVector.begin(), theConstVector.begin() + 2);
  535   this->assertValuesInOrder(this->theVector, 1u, 3);
  542   this->makeSequence(this->theVector, 1, 3);
  544     this->theVector.insert(this->theVector.begin() + 1, Constructable(77));
  544     this->theVector.insert(this->theVector.begin() + 1, Constructable(77));
  545   EXPECT_EQ(this->theVector.begin() + 1, I);
  546   this->assertValuesInOrder(this->theVector, 4u, 1, 77, 2, 3);
  553   this->makeSequence(this->theVector, 1, 3);
  556       this->theVector.insert(this->theVector.begin() + 1, C);
  556       this->theVector.insert(this->theVector.begin() + 1, C);
  557   EXPECT_EQ(this->theVector.begin() + 1, I);
  558   this->assertValuesInOrder(this->theVector, 4u, 1, 77, 2, 3);
  565   this->makeSequence(this->theVector, 1, 4);
  568       this->theVector.insert(this->theVector.begin() + 1, 2, Constructable(16));
  568       this->theVector.insert(this->theVector.begin() + 1, 2, Constructable(16));
  582   EXPECT_EQ(this->theVector.begin() + 1, I);
  583   this->assertValuesInOrder(this->theVector, 6u, 1, 16, 16, 2, 3, 4);
  589   this->makeSequence(this->theVector, 1, 4);
  591   auto I = this->theVector.insert(this->theVector.begin() + 1, 2, 7);
  591   auto I = this->theVector.insert(this->theVector.begin() + 1, 2, 7);
  592   EXPECT_EQ(this->theVector.begin() + 1, I);
  593   this->assertValuesInOrder(this->theVector, 6u, 1, 7, 7, 2, 3, 4);
  599   this->makeSequence(this->theVector, 1, 4);
  601   auto I = this->theVector.insert(this->theVector.end(), 2, Constructable(16));
  601   auto I = this->theVector.insert(this->theVector.end(), 2, Constructable(16));
  611   EXPECT_EQ(this->theVector.begin() + 4, I);
  612   this->assertValuesInOrder(this->theVector, 6u, 1, 2, 3, 4, 16, 16);
  618   this->makeSequence(this->theVector, 10, 15);
  621   EXPECT_EQ(this->theVector.end(),
  622             this->theVector.insert(this->theVector.end(),
  622             this->theVector.insert(this->theVector.end(),
  624   EXPECT_EQ(this->theVector.begin() + 1,
  625             this->theVector.insert(this->theVector.begin() + 1,
  625             this->theVector.insert(this->theVector.begin() + 1,
  636   this->makeSequence(this->theVector, 1, 3);
  638   auto I = this->theVector.insert(this->theVector.begin() + 1, Arr, Arr + 3);
  638   auto I = this->theVector.insert(this->theVector.begin() + 1, Arr, Arr + 3);
  650   EXPECT_EQ(this->theVector.begin() + 1, I);
  651   this->assertValuesInOrder(this->theVector, 6u, 1, 77, 77, 77, 2, 3);
  661   this->makeSequence(this->theVector, 1, 3);
  665   auto I = this->theVector.insert(this->theVector.end(), Arr, Arr+3);
  665   auto I = this->theVector.insert(this->theVector.end(), Arr, Arr+3);
  675   EXPECT_EQ(this->theVector.begin() + 3, I);
  676   this->assertValuesInOrder(this->theVector, 6u,
  683   this->makeSequence(this->theVector, 1, 3);
  686   EXPECT_EQ(this->theVector.end(),
  687             this->theVector.insert(this->theVector.end(),
  687             this->theVector.insert(this->theVector.end(),
  688                                    this->theVector.begin(),
  689                                    this->theVector.begin()));
  690   EXPECT_EQ(this->theVector.begin() + 1,
  691             this->theVector.insert(this->theVector.begin() + 1,
  691             this->theVector.insert(this->theVector.begin() + 1,
  692                                    this->theVector.begin(),
  693                                    this->theVector.begin()));
  700   this->makeSequence(this->theVector, 1, 3);
  703   EXPECT_TRUE(this->theVector == this->otherVector);
  704   EXPECT_FALSE(this->theVector != this->otherVector);
  709   EXPECT_FALSE(this->theVector == this->otherVector);
  710   EXPECT_TRUE(this->theVector != this->otherVector);
  724   EXPECT_EQ(0u, this->theVector.size());
  725   this->theVector.reserve(4);
  726   EXPECT_LE(4u, this->theVector.capacity());
  728   this->theVector.push_back(1);
  729   this->theVector.push_back(2);
  730   this->theVector.push_back(3);
  731   this->theVector.push_back(4);
  732   EXPECT_EQ(4u, this->theVector.size());
  734   EXPECT_EQ(1, this->theVector[0].getValue());
  735   EXPECT_EQ(2, this->theVector[1].getValue());
  736   EXPECT_EQ(3, this->theVector[2].getValue());
  737   EXPECT_EQ(4, this->theVector[3].getValue());
  742   this->theVector.insert(this->theVector.end(), L.begin(), L.end());
  742   this->theVector.insert(this->theVector.end(), L.begin(), L.end());