|
Bugzilla – Full Text Bug Listing |
| Summary: | TestCase::GetName () should not be private | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Peter Barnes <pdbarnes> |
| Component: | test framework | Assignee: | Mitch Watrous <watrous> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | ns-bugs |
| Priority: | P5 | ||
| Version: | ns-3-dev | ||
| Hardware: | All | ||
| OS: | All | ||
Thanks for the patch. Bug closed. ns-3-dev changeset: 518fce9abcf9 |
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;