Commit Graph

8 Commits

Author SHA1 Message Date
David Sunderland
cf7b25961a Clone of unsubmitted cr/176529515. Introduce parameterless expectations. 2018-04-18 19:28:56 -04:00
Victor Costan
75b1be4ad1 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
Gennadiy Civil
f906f8446e Merging gMock, 2 2018-04-05 16:09:17 -04:00
Gennadiy Civil
05c81235a1 Code merges 2018-01-26 11:57:58 -05:00
Jonathan Wakely
c61e22b1fe Use gender-neutral pronouns in comments and docs 2017-09-27 13:31:13 +01:00
Alyssa Wilk
10232c3adb Adding a flag option to change the default mock type 2017-08-10 09:41:09 -04:00
Nico Weber
3ec8d72fc1 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