Address PR comments
This commit is contained in:
+6
-13
@@ -29,7 +29,6 @@ namespace TestImpact
|
||||
, m_sourcesCovered(AZStd::move(other.m_sourcesCovered))
|
||||
{
|
||||
AZStd::swap(m_coverageLevel, other.m_coverageLevel);
|
||||
other.~TestCoverage();
|
||||
}
|
||||
|
||||
TestCoverage::TestCoverage(const AZStd::vector<ModuleCoverage>& moduleCoverages)
|
||||
@@ -44,19 +43,13 @@ namespace TestImpact
|
||||
CalculateTestMetrics();
|
||||
}
|
||||
|
||||
TestCoverage::~TestCoverage()
|
||||
{
|
||||
m_modules.clear();
|
||||
m_coverageLevel.reset();
|
||||
m_sourcesCovered.clear();
|
||||
}
|
||||
|
||||
TestCoverage& TestCoverage::operator=(const TestCoverage& other)
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
this->~TestCoverage();
|
||||
new(this)TestCoverage(other);
|
||||
m_modules = other.m_modules;
|
||||
m_sourcesCovered = other.m_sourcesCovered;
|
||||
m_coverageLevel = other.m_coverageLevel;
|
||||
}
|
||||
|
||||
return *this;
|
||||
@@ -66,9 +59,9 @@ namespace TestImpact
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
this->~TestCoverage();
|
||||
new(this)TestCoverage(AZStd::move(other));
|
||||
other.~TestCoverage();
|
||||
m_modules = AZStd::move(other.m_modules);
|
||||
m_sourcesCovered = other.m_sourcesCovered;
|
||||
m_coverageLevel = other.m_coverageLevel;
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
||||
-1
@@ -33,7 +33,6 @@ namespace TestImpact
|
||||
TestCoverage(TestCoverage&&) noexcept;
|
||||
TestCoverage(AZStd::vector<ModuleCoverage>&& moduleCoverages) noexcept;
|
||||
TestCoverage(const AZStd::vector<ModuleCoverage>& moduleCoverages);
|
||||
~TestCoverage();
|
||||
|
||||
TestCoverage& operator=(const TestCoverage&);
|
||||
TestCoverage& operator=(TestCoverage&&) noexcept;
|
||||
|
||||
-10
@@ -28,7 +28,6 @@ namespace TestImpact
|
||||
, m_numFailures(other.m_numFailures)
|
||||
, m_duration(other.m_duration)
|
||||
{
|
||||
other.~TestRun();
|
||||
}
|
||||
|
||||
TestRun::TestRun(AZStd::vector<TestRunSuite>&& testSuites, AZStd::chrono::milliseconds duration) noexcept
|
||||
@@ -45,15 +44,6 @@ namespace TestImpact
|
||||
CalculateTestMetrics();
|
||||
}
|
||||
|
||||
TestRun::~TestRun()
|
||||
{
|
||||
m_numRuns = 0;
|
||||
m_numNotRuns = 0;
|
||||
m_numPasses = 0;
|
||||
m_numFailures = 0;
|
||||
m_duration = AZStd::chrono::milliseconds{ 0 };
|
||||
}
|
||||
|
||||
TestRun& TestRun::operator=(TestRun&& other) noexcept
|
||||
{
|
||||
if (this != &other)
|
||||
|
||||
@@ -28,7 +28,6 @@ namespace TestImpact
|
||||
TestRun(TestRun&&) noexcept;
|
||||
TestRun(const AZStd::vector<TestRunSuite>& testSuites, AZStd::chrono::milliseconds duration);
|
||||
TestRun(AZStd::vector<TestRunSuite>&& testSuites, AZStd::chrono::milliseconds duration) noexcept;
|
||||
~TestRun();
|
||||
|
||||
TestRun& operator=(const TestRun&);
|
||||
TestRun& operator=(TestRun&&) noexcept;
|
||||
|
||||
+6
-15
@@ -26,7 +26,6 @@ namespace TestImpact
|
||||
TestSuiteContainer(TestSuiteContainer&&) noexcept;
|
||||
TestSuiteContainer(const AZStd::vector<TestSuite>& testSuites);
|
||||
TestSuiteContainer(AZStd::vector<TestSuite>&& testSuites) noexcept;
|
||||
virtual ~TestSuiteContainer();
|
||||
|
||||
TestSuiteContainer& operator=(const TestSuiteContainer&);
|
||||
TestSuiteContainer& operator=(TestSuiteContainer&&) noexcept;
|
||||
@@ -61,7 +60,6 @@ namespace TestImpact
|
||||
, m_numDisabledTests(other.m_numDisabledTests)
|
||||
, m_numEnabledTests(other.m_numEnabledTests)
|
||||
{
|
||||
other.~TestSuiteContainer();
|
||||
}
|
||||
|
||||
template<typename TestSuite>
|
||||
@@ -72,14 +70,6 @@ namespace TestImpact
|
||||
{
|
||||
}
|
||||
|
||||
template<typename TestSuite>
|
||||
TestSuiteContainer<TestSuite>::~TestSuiteContainer()
|
||||
{
|
||||
m_testSuites.clear();
|
||||
m_numDisabledTests = 0;
|
||||
m_numEnabledTests = 0;
|
||||
}
|
||||
|
||||
template<typename TestSuite>
|
||||
TestSuiteContainer<TestSuite>::TestSuiteContainer(AZStd::vector<TestSuite>&& testSuites) noexcept
|
||||
: m_testSuites(std::move(testSuites))
|
||||
@@ -99,9 +89,9 @@ namespace TestImpact
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
this->~TestSuiteContainer();
|
||||
new(this)TestSuiteContainer(AZStd::move(other));
|
||||
other.~TestSuiteContainer();
|
||||
m_testSuites = AZStd::move(other.m_testSuites);
|
||||
m_numDisabledTests = other.m_numDisabledTests;
|
||||
m_numEnabledTests = other.m_numEnabledTests;
|
||||
}
|
||||
|
||||
return *this;
|
||||
@@ -112,8 +102,9 @@ namespace TestImpact
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
this->~TestSuiteContainer();
|
||||
new(this)TestSuiteContainer(other);
|
||||
m_testSuites = other.m_testSuites;
|
||||
m_numDisabledTests = other.m_numDisabledTests;
|
||||
m_numEnabledTests = other.m_numEnabledTests;
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
||||
Reference in New Issue
Block a user