[Bf-blender-cvs] [711b55b5277] master: Fix libmv test on windows

Sebastian Parborg noreply at git.blender.org
Tue Oct 20 14:47:24 CEST 2020


Commit: 711b55b5277021e395171362c7428cbb34f9caba
Author: Sebastian Parborg
Date:   Tue Oct 20 14:45:54 2020 +0200
Branches: master
https://developer.blender.org/rB711b55b5277021e395171362c7428cbb34f9caba

Fix libmv test on windows

There is no point in testing std::vector capacity as it can differ
between std implementations.

===================================================================

M	intern/libmv/libmv/base/vector_test.cc

===================================================================

diff --git a/intern/libmv/libmv/base/vector_test.cc b/intern/libmv/libmv/base/vector_test.cc
index 44b9a152148..f171e3a18b5 100644
--- a/intern/libmv/libmv/base/vector_test.cc
+++ b/intern/libmv/libmv/base/vector_test.cc
@@ -37,11 +37,9 @@ TEST(VectorAlignmentTest, PushBack) {
   vector<Vec2> vs;
   vs.push_back(x1);
   EXPECT_EQ(1, vs.size());
-  EXPECT_EQ(1, vs.capacity());
 
   vs.push_back(x2);
   EXPECT_EQ(2, vs.size());
-  EXPECT_EQ(2, vs.capacity());
 
   // The following is necessary because of some bug in gtest; the expected
   // parameter can't be a fixed size vectorizable type with alignment
@@ -55,7 +53,6 @@ TEST(VectorAlignmentTest, PushBack) {
   vs.push_back(x2);
   vs.push_back(x2);
   EXPECT_EQ(5, vs.size());
-  EXPECT_EQ(8, vs.capacity());
 }
 
 // Count the number of destruct calls to test that the destructor gets called.
@@ -80,7 +77,6 @@ TEST_F(VectorTest, EmptyVectorDoesNotConstruct) {
   {
     vector<Foo> v;
     EXPECT_EQ(0, v.size());
-    EXPECT_EQ(0, v.capacity());
   }
   EXPECT_EQ(0, foo_construct_calls);
   EXPECT_EQ(0, foo_destruct_calls);
@@ -98,13 +94,11 @@ TEST_F(VectorTest, DestructorGetsCalled) {
 TEST_F(VectorTest, ReserveDoesNotCallConstructorsOrDestructors) {
   vector<Foo> v;
   EXPECT_EQ(0, v.size());
-  EXPECT_EQ(0, v.capacity());
   EXPECT_EQ(0, foo_construct_calls);
   EXPECT_EQ(0, foo_destruct_calls);
 
   v.reserve(5);
   EXPECT_EQ(0, v.size());
-  EXPECT_EQ(5, v.capacity());
   EXPECT_EQ(0, foo_construct_calls);
   EXPECT_EQ(0, foo_destruct_calls);
 }
@@ -126,7 +120,6 @@ TEST_F(VectorTest, ResizeConstructsAndDestructsAsExpected) {
   // Delete the last one.
   v.resize(2);
   EXPECT_EQ(2, v.size());
-  EXPECT_EQ(3, v.capacity());
   EXPECT_EQ(3, foo_construct_calls);
 
   // Delete the remaining two.
@@ -158,7 +151,6 @@ TEST_F(VectorTest, CopyConstructor) {
 
   vector<int> b(a);
   EXPECT_EQ(a.size(),     b.size());
-  //EXPECT_EQ(a.capacity(), b.capacity());
   for (int i = 0; i < a.size(); ++i) {
     EXPECT_EQ(a[i], b[i]);
   }
@@ -173,7 +165,6 @@ TEST_F(VectorTest, OperatorEquals) {
   b = a;
 
   EXPECT_EQ(a.size(),     b.size());
-  //EXPECT_EQ(a.capacity(), b.capacity());
   for (int i = 0; i < a.size(); ++i) {
     EXPECT_EQ(a[i], b[i]);
   }



More information about the Bf-blender-cvs mailing list