I use googlemock to mock the std::fstream object in my unit tests, for example:
TEST_F(SomeTest, SomethingIsDoneCorrectly) { class MockFstream : public std::fstream {}; MockFstream lMockFstream;
When compiling, I get the following warnings:
Warning 1 warning C4250: 'SomeTest_SomethingIsDoneCorrectly_Test :: TestBody :: MockFstream': inherits 'std :: basic_istream <_Elem, _Traits> :: std :: basic_istream <_Elem, _Traits> :: _ Add_vtordisp1' through dominance
Warning 2 Warning C4250: "SomeTest_SomethingIsDoneCorrectly_Test :: TestBody :: MockFstream": inherits "std :: basic_ostream <_Elem, _Traits> :: std :: basic_ostream <_Elem, _Traits> :: _ Add_vtordisp2 'through dominance
I would prefer clean assembly output, so I want to suppress these specific warnings, but I write cross-platform code, so I would also prefer to avoid the #pragma s compiler-specific ones.
Is there something I can do in the googlemock object that will hide these warnings?
M. Dudley
source share