I'd like to add a request for gtest. There was a request about a year ago. The issue arises in that you define tests by declaring them with a macro invocation, which seems to completely flummox SE.
Defining the test class is simple enough, and SE does fine:
#include "gtest/gtest.h"
#include "MockLogger.h"
class ClassTest : public ::testing::Test
{
protected:
MockLogger _logger;
};
And then ...
#include "ClassTest.h"
#include "Class.h"
TEST_F(ClassTest, testConstructor)
{
Class c(_logger);
ASSERT_EQ(0, c.getProperty());
}
No matter how many of the gtest macro definitions I import into C/C++ Preprocessing, it won't identify _logger as a member, because it doesn't recognize "testConstructor" that it's actually defining a method in ClassTest.