Bugzilla – Bug 1476
TestCase::GetName () should not be private
Last modified: 2012-07-24 20:16:00 UTC
TestCase::GetName () is currently private, which prevents derived classes (actual test cases) from using the name in output messages. For example, std::cout << GetName () << << "checking ..." << std::endl; to obtain output like ---------- begin standard out ---------- DefaultHash: checking ... Here's a patch to make GetName protected, not private: diff -r c1b33a377c2b src/core/model/test.h --- a/src/core/model/test.h Thu Jul 12 13:17:22 2012 -0700 +++ b/src/core/model/test.h Tue Jul 24 11:14:46 2012 -0700 @@ -876,6 +876,11 @@ */ bool IsStatusSuccess (void) const; + /** + * \return name of this test + */ + std::string GetName (void) const; + // The methods below are used only by test macros and should not // be used by normal users. void ReportTestFailure (std::string cond, std::string actual, @@ -916,7 +921,6 @@ // methods called by TestRunnerImpl void Run (TestRunnerImpl *runner); - std::string GetName (void) const; bool IsFailed (void) const;
Thanks for the patch. Bug closed. ns-3-dev changeset: 518fce9abcf9