Commit Graph

11 Commits

Author SHA1 Message Date
Gennadiy Civil
a79851f2c2 merging 2018-04-12 14:00:38 -04:00
Victor Costan
1324e2d706 Remove multiple inheritance from "unintesting call" mock classes.
Internal CL 156157936, which was published in commit
fe402c2779, introduced undefined behavior
by casting a base class (internal::{Naggy,Nice,Strict}Base<MockClass>,
using the curiously recurring template pattern) pointer to a derived
class ({Naggy,Nice,Strict}Mock<MockClass>), in the base class'
constructor. At that point, the object isn't guaranteed to have taken on
the shape of the derived class, and casting is undefined behavior.

The undefined behavior was caught by Chrome's CFI build bot [1], and
prevents rolling googletest past that commit / CL.

This commit simplifies the {Naggy,Nice,Strict}Mock class hierarchy in
a way that removes the undefined behavior.

[1] https://www.chromium.org/developers/testing/control-flow-integrity
2018-04-12 00:48:30 -07:00
Maurice Gilden
1ee8079651 Remove unused variable 2017-08-21 10:10:14 +02:00
Gennadiy Civil
3cf65b5d86 Added "explicit" as per compiler suggestion 2017-08-20 15:20:13 -04:00
Gennadiy Civil
026735daf3 Proposing these changes, please review
Slightly better names and cleaner tests.
Please review
2017-08-20 15:15:31 -04:00
Maurice Gilden
b0ed43e724 Change tabs to spaces in test case 2017-08-18 15:27:02 +02:00
Maurice Gilden
36777251c0 Switch return type to class without default constructor 2017-08-18 12:28:50 +02:00
Maurice Gilden
cc99900036 Fix test if exceptions are not supported 2017-08-18 11:46:15 +02:00
Maurice Gilden
95f18d9938 adds test for NiceMock with unknown return value 2017-08-18 11:21:28 +02:00
Nico Weber
09fd5b3ebf Use std::string and ::string explicitly in gtest and gmock code.
This merges a Google-internal change (117235625).

Original CL description:
This CL was created manually in about an hour with sed, a Python script
to find all the places unqualified 'string' was mentioned, and some help
from Emacs to add the "std::" qualifications, plus a few manual tweaks.
2017-05-15 17:53:04 -04:00
Billy Donahue
affb09edf0 move googlemock files into googlemock/ subdir 2015-08-25 17:47:18 -04:00