You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/GTest-friend.md
+10-21Lines changed: 10 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,27 +4,24 @@ If you want to make make your classes friend with their test, here are some ways
4
4
5
5
* <fontsize="1">Add `#define private public` & `#define protected public` before including production headers to your test sources. But I never said this.</font>
6
6
7
-
*You can declare your test with an existing class instead of a string :
7
+
*Note that you can declare your test with an existing class instead of a string :
8
8
`GTEST(SomeClass) { ... }`
9
-
With this syntax, the test will inherit from `SomeClass`, so you can access to protected members.
10
-
11
-
This is the least intrusive way, as there is nothing added to the tested class - apart from maybe replace private by protected.
12
9
13
10
* You can declare your class `friend` with the test class `GTEST(SomeClass)` :
0 commit comments