Compare commits

...

4 Commits

Author SHA1 Message Date
Abseil Team
c370cf063b Export Test - Do Not Merge
Update example Environment class destructor annotation

PiperOrigin-RevId: 283986183
2019-12-05 13:56:14 -05:00
Gennadiy Civil
95a8864c05 Merge pull request #2594 from kuzkry:remove-workaround_msvc-unneeded-const-dropping
PiperOrigin-RevId: 283979494
2019-12-05 13:56:05 -05:00
Abseil Team
8026417d21 Export Test - Do Not Merge
Internal change

PiperOrigin-RevId: 283948137
2019-12-05 13:55:55 -05:00
Krystian Kuzniarek
6748df1eab remove MSVC workaround: cease const dropping 2019-11-22 17:17:41 +01:00
3 changed files with 6 additions and 19 deletions

View File

@ -4044,11 +4044,7 @@ template <typename Container>
inline PolymorphicMatcher<internal::ContainerEqMatcher< inline PolymorphicMatcher<internal::ContainerEqMatcher<
typename std::remove_const<Container>::type>> typename std::remove_const<Container>::type>>
ContainerEq(const Container& rhs) { ContainerEq(const Container& rhs) {
// This following line is for working around a bug in MSVC 8.0, return MakePolymorphicMatcher(internal::ContainerEqMatcher<Container>(rhs));
// which causes Container to be a const type sometimes.
typedef typename std::remove_const<Container>::type RawContainer;
return MakePolymorphicMatcher(
internal::ContainerEqMatcher<RawContainer>(rhs));
} }
// Returns a matcher that matches a container that, when sorted using // Returns a matcher that matches a container that, when sorted using
@ -4081,12 +4077,8 @@ template <typename TupleMatcher, typename Container>
inline internal::PointwiseMatcher<TupleMatcher, inline internal::PointwiseMatcher<TupleMatcher,
typename std::remove_const<Container>::type> typename std::remove_const<Container>::type>
Pointwise(const TupleMatcher& tuple_matcher, const Container& rhs) { Pointwise(const TupleMatcher& tuple_matcher, const Container& rhs) {
// This following line is for working around a bug in MSVC 8.0, return internal::PointwiseMatcher<TupleMatcher, Container>(tuple_matcher,
// which causes Container to be a const type sometimes (e.g. when rhs);
// rhs is a const int[])..
typedef typename std::remove_const<Container>::type RawContainer;
return internal::PointwiseMatcher<TupleMatcher, RawContainer>(
tuple_matcher, rhs);
} }
@ -4117,14 +4109,9 @@ inline internal::UnorderedElementsAreArrayMatcher<
typename std::remove_const<RhsContainer>::type>::type::value_type>> typename std::remove_const<RhsContainer>::type>::type::value_type>>
UnorderedPointwise(const Tuple2Matcher& tuple2_matcher, UnorderedPointwise(const Tuple2Matcher& tuple2_matcher,
const RhsContainer& rhs_container) { const RhsContainer& rhs_container) {
// This following line is for working around a bug in MSVC 8.0,
// which causes RhsContainer to be a const type sometimes (e.g. when
// rhs_container is a const int[]).
typedef typename std::remove_const<RhsContainer>::type RawRhsContainer;
// RhsView allows the same code to handle RhsContainer being a // RhsView allows the same code to handle RhsContainer being a
// STL-style container and it being a native C-style array. // STL-style container and it being a native C-style array.
typedef typename internal::StlContainerView<RawRhsContainer> RhsView; typedef typename internal::StlContainerView<RhsContainer> RhsView;
typedef typename RhsView::type RhsStlContainer; typedef typename RhsView::type RhsStlContainer;
typedef typename RhsStlContainer::value_type Second; typedef typename RhsStlContainer::value_type Second;
const RhsStlContainer& rhs_stl_container = const RhsStlContainer& rhs_stl_container =

View File

@ -1231,7 +1231,7 @@ environment, which knows how to set-up and tear-down:
```c++ ```c++
class Environment : public ::testing::Environment { class Environment : public ::testing::Environment {
public: public:
virtual ~Environment() {} ~Environment() override {}
// Override this to define how to set up the environment. // Override this to define how to set up the environment.
void SetUp() override {} void SetUp() override {}

View File

@ -29,7 +29,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""Tests the text output of Google C++ Testing and Mocking Framework. r"""Tests the text output of Google C++ Testing and Mocking Framework.
To update the golden file: To update the golden file:
googletest_output_test.py --build_dir=BUILD/DIR --gengolden googletest_output_test.py --build_dir=BUILD/DIR --gengolden