Googletest export
Remove linked_ptr and use std::shared_ptr instead PiperOrigin-RevId: 219129336
This commit is contained in:
		@@ -35,6 +35,7 @@
 | 
			
		||||
#include "gmock/gmock-generated-actions.h"
 | 
			
		||||
 | 
			
		||||
#include <functional>
 | 
			
		||||
#include <memory>
 | 
			
		||||
#include <sstream>
 | 
			
		||||
#include <string>
 | 
			
		||||
#include "gmock/gmock.h"
 | 
			
		||||
@@ -1129,9 +1130,9 @@ ACTION_TEMPLATE(ReturnSmartPointer,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
TEST(ActionTemplateTest, WorksForTemplateTemplateParameters) {
 | 
			
		||||
  using ::testing::internal::linked_ptr;
 | 
			
		||||
  const Action<linked_ptr<int>()> a = ReturnSmartPointer<linked_ptr>(42);
 | 
			
		||||
  linked_ptr<int> p = a.Perform(std::make_tuple());
 | 
			
		||||
  const Action<std::shared_ptr<int>()> a =
 | 
			
		||||
      ReturnSmartPointer<std::shared_ptr>(42);
 | 
			
		||||
  std::shared_ptr<int> p = a.Perform(std::make_tuple());
 | 
			
		||||
  EXPECT_EQ(42, *p);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -1161,11 +1162,10 @@ ACTION_TEMPLATE(ReturnGiant,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
TEST(ActionTemplateTest, WorksFor10TemplateParameters) {
 | 
			
		||||
  using ::testing::internal::linked_ptr;
 | 
			
		||||
  typedef GiantTemplate<linked_ptr<int>, bool, double, 5,
 | 
			
		||||
      true, 6, char, unsigned, int> Giant;
 | 
			
		||||
  const Action<Giant()> a = ReturnGiant<
 | 
			
		||||
      int, bool, double, 5, true, 6, char, unsigned, int, linked_ptr>(42);
 | 
			
		||||
  using Giant = GiantTemplate<std::shared_ptr<int>, bool, double, 5, true, 6,
 | 
			
		||||
                              char, unsigned, int>;
 | 
			
		||||
  const Action<Giant()> a = ReturnGiant<int, bool, double, 5, true, 6, char,
 | 
			
		||||
                                        unsigned, int, std::shared_ptr>(42);
 | 
			
		||||
  Giant giant = a.Perform(std::make_tuple());
 | 
			
		||||
  EXPECT_EQ(42, giant.value);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user