core, tests: Reset default values for every TestCase
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "abort.h"
|
||||
#include "assert.h"
|
||||
#include "config.h"
|
||||
#include "des-metrics.h"
|
||||
#include "log.h"
|
||||
#include "singleton.h"
|
||||
@@ -351,6 +352,7 @@ TestCase::Run(TestRunnerImpl* runner)
|
||||
NS_LOG_FUNCTION(this << runner);
|
||||
m_result = new Result();
|
||||
m_runner = runner;
|
||||
Config::Reset();
|
||||
DoSetup();
|
||||
m_result->clock.Start();
|
||||
for (auto i = m_children.begin(); i != m_children.end(); ++i)
|
||||
@@ -366,6 +368,7 @@ TestCase::Run(TestRunnerImpl* runner)
|
||||
out:
|
||||
m_result->clock.End();
|
||||
DoTeardown();
|
||||
Config::Reset();
|
||||
m_runner = nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -1234,7 +1234,12 @@ class TestCase
|
||||
|
||||
// methods called by TestRunnerImpl
|
||||
/**
|
||||
* \brief Actually run this TestCase
|
||||
* \brief Executes DoSetup(), DoRun(), and DoTeardown() for the TestCase
|
||||
*
|
||||
* Config::Reset() is called at both the beginning and end of this method
|
||||
* so that any changes to attribute default values (Config::SetDefault(...))
|
||||
* or global values (e.g., RngRun) that are made within the test case's
|
||||
* DoRun() method do not propagate beyond the scope of running the TestCase.
|
||||
*
|
||||
* \param [in] runner The test runner implementation.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user