#1292 Fixed CppCheck Issues in UnitTests

This commit is contained in:
Jacob Støren 2017-03-06 11:19:31 +01:00
parent 29d30f34d8
commit 1275279528
5 changed files with 15 additions and 22 deletions

View File

@ -35,7 +35,6 @@ TEST(RigGridManager, BasicTest)
cvf::ref<RigEclipseCaseData> eclipseCase = new RigEclipseCaseData;
eclipseCase->setMainGrid(mainGridA.p());
int count = mainGridA->refCount();
EXPECT_EQ(mainGridA->refCount(), 2);
RigGridManager gridCollection;

View File

@ -130,7 +130,7 @@ TEST(RigStatisticsMath, HistogramPercentiles)
std::vector<size_t> histogram;
RigHistogramCalculator histCalc(min, max, 100, &histogram);
histCalc.addData(values);
std::vector<double> pVals;
double p10, p50, p90;
p10 = histCalc.calculatePercentil(0.1);
p50 = histCalc.calculatePercentil(0.5);

View File

@ -14,11 +14,8 @@ TEST(ScalarMapperTest, TestHumanReadableTickmarks)
cvf::ref<cvf::ScalarMapperDiscreteLinear> m_linDiscreteScalarMapper = new cvf::ScalarMapperDiscreteLinear;
double adjustedMin = 0.0;
double adjustedMax = 0.0;
adjustedMin = 2141234;
adjustedMax = 2165239;
double adjustedMin = 2141234;
double adjustedMax = 2165239;
size_t m_numLevels = 10;

View File

@ -167,8 +167,7 @@ TEST(CellFaceIntersectionTst, Intersection1)
edgeIntersectionStorage.setVertexCount(nodes.size());
{
std::vector<cvf::uint> polygon;
bool isOk = false;
isOk = GeometryTools::calculateOverlapPolygonOfTwoQuads(
bool isOk = GeometryTools::calculateOverlapPolygonOfTwoQuads(
&polygon,
&additionalVertices,
&edgeIntersectionStorage,
@ -187,8 +186,7 @@ TEST(CellFaceIntersectionTst, Intersection1)
{
std::vector<cvf::uint> polygon;
bool isOk = false;
isOk = GeometryTools::calculateOverlapPolygonOfTwoQuads(
bool isOk = GeometryTools::calculateOverlapPolygonOfTwoQuads(
&polygon,
&additionalVertices,
&edgeIntersectionStorage,
@ -207,8 +205,7 @@ TEST(CellFaceIntersectionTst, Intersection1)
{
std::vector<cvf::uint> polygon;
bool isOk = false;
isOk = GeometryTools::calculateOverlapPolygonOfTwoQuads(
bool isOk = GeometryTools::calculateOverlapPolygonOfTwoQuads(
&polygon,
&additionalVertices,
&edgeIntersectionStorage,
@ -230,7 +227,7 @@ TEST(CellFaceIntersectionTst, Intersection1)
for (cvf::uint vxIdx = 0; vxIdx < nodes.size(); ++vxIdx)
{
bool inserted = GeometryTools::insertVertexInPolygon(
GeometryTools::insertVertexInPolygon(
&basePolygon,
wrapArrayConst(&nodes),
vxIdx,
@ -245,7 +242,7 @@ TEST(CellFaceIntersectionTst, Intersection1)
{
for (cvf::uint vxIdx = 0; vxIdx < nodes.size(); ++vxIdx)
{
bool inserted = GeometryTools::insertVertexInPolygon(
GeometryTools::insertVertexInPolygon(
&overlapPolygons[pIdx],
wrapArrayConst(&nodes),
vxIdx,

View File

@ -20,7 +20,7 @@ TEST(opm_parser_test, basicConstruction)
std::string filename = "d:/Models/Statoil/Brillig/BRILLIG.DATA";
*/
std::string filename = "d:/gitroot-magnesj/opm-parser/testdata/cases_with_issues/testcase_juli_2011/TEST10K_FLT_LGR_NNC.DATA";
// std::string filename = "d:/gitroot-magnesj/opm-parser/testdata/cases_with_issues/testcase_juli_2011/TEST10K_FLT_LGR_NNC.DATA";
/*
std::string filename = "d:/Models/Statoil/1.2.0_Osesyd_segfault/BASEPRED6.DATA";
std::string filename = "d:/Models/Statoil/1.3.0_fault_assert_binary/BV-R2-11-0.DATA";