i got a 'testsuitename' and 'testcasename' has not been declared when i use FRIEND_TEST macro #3687
-
Describe the bug gtest version:1.8.1 Steps to reproduce the bug code just for demo #include #define PRIVATE_METHOD_TEST 0 class Calculate { private: #endif // CACL_H` and It‘s implementation int Calculate::calculate(int a, int b, string symbol) int Calculate::add(int a, int b) and define its unittest in another files TEST(addTest, normalINT) #if PRIVATE_METHOD_TEST if PRIVATE_METHOD_TEST is zero ,the unittest is pass(only one unittest), you can got complete demo sulotion from unittestWithGtest Does the bug persist in the most recent commit? because company just use c++98 and pre-vs2010, only can use gtest version:1.8.1(pre c++11). What operating system and version are you using? Redflag and uos and kylin [ both of them are Linux ] What compiler and version are you using? g++ What build system are you using? Makefile and make Additional context i learn googletest from here, it will better if there have any sample for test private code . |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
if want to use FRIENT_TEST macro,need include the head file gtest_prod.h |
Beta Was this translation helpful? Give feedback.
if want to use FRIENT_TEST macro,need include the head file gtest_prod.h
#include "gtest/gtest_prod.h"