How do I unit test a protected method in C++?

后端 未结 6 1705
遇见更好的自我
遇见更好的自我 2020-12-28 16:57

How do I unit test a protected method in C++?

In Java, I\'d either create the test class in the same package as the class under test or create an anonymous subcla

6条回答
  •  伪装坚强ぢ
    2020-12-28 17:42

    Consider a public, possibly static 'unit test' function.

    Ugly, but better than the alternatives I can think of using macros or friends or such.

提交回复
热议问题