mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 15:10:22 -05:00
#14517 Share the mock case factory between the summary tests
RimDeltaSummaryEnsemble-Test.cpp and RimSummaryCaseMainCollection-Test.cpp each defined an identical createMockCase() in an anonymous namespace. A unity build concatenates the two translation units, which merges the two anonymous namespaces into one and makes the second definition a redefinition, breaking the build with C2084. Move the factory to RimMockSummaryCase.h, the header both tests already include for the mock case itself, and drop both local copies.
This commit is contained in:
1 parent
8ac2255832
commit
db594490fc
3 files changed
+16
-31
No files matched your search
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "Summary/RiaSummaryTools.h"
|
||||
|
||||
#include "RigCaseRealizationParameters.h"
|
||||
|
||||
#include "RimDeltaSummaryEnsemble.h"
|
||||
#include "RimMockSummaryCase.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
@@ -15,22 +13,10 @@
|
||||
#include "cafPdmPtrField.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
namespace
|
||||
{
|
||||
RimSummaryCase* createMockCase( int realizationNumber )
|
||||
{
|
||||
auto* summaryCase = new RimMockSummaryCase();
|
||||
|
||||
auto parameters = std::make_shared<RigCaseRealizationParameters>();
|
||||
parameters->setRealizationNumber( realizationNumber );
|
||||
summaryCase->setCaseRealizationParameters( parameters );
|
||||
|
||||
return summaryCase;
|
||||
}
|
||||
|
||||
size_t countOf( const std::vector<RimDeltaSummaryEnsemble*>& ensembles, const RimDeltaSummaryEnsemble* ensemble )
|
||||
{
|
||||
return static_cast<size_t>( std::count( ensembles.begin(), ensembles.end(), ensemble ) );
|
||||
|
||||
Reference in new issue
Block a user