Increase warning level

* Set warning level to /W3 for MSVC to catch more warnings
* remove several excluded checks for clang
* removed several unused variables
* Hide warnings qwt
* add missing parentheses in logical expressions
* Remove double check on same logical expression
This commit is contained in:
Magne Sjaastad
2023-04-17 15:57:39 +02:00
committed by GitHub
parent 0f0cc4c5a8
commit b7f8d0e0f1
60 changed files with 155 additions and 225 deletions

View File

@@ -124,6 +124,11 @@
#include "gtest/gtest.h"
#endif // USE_UNIT_TESTS
// Required to ignore warning of usused variable when defining caf::PdmMarkdownGenerator
#if defined( __clang__ )
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
RiaApplication* RiaApplication::s_riaApplication = nullptr;
//--------------------------------------------------------------------------------------------------

View File

@@ -539,7 +539,7 @@ std::set<QDateTime> RiaQDateTimeTools::createEvenlyDistributedDates( const std::
qint64 timeDiff = std::abs( inputDates[j].toMSecsSinceEpoch() - targetTime );
if ( timeDiff < closestTimeDiff )
{
closestIndex = j;
closestIndex = static_cast<int>( j );
closestTimeDiff = timeDiff;
}
}

View File

@@ -278,8 +278,7 @@ bool RiaWellLogUnitTools<FloatType>::convertValues( const std::vector<FloatType>
*valuesOut = convertBarToNormalizedByPP( tvdRKBs, valuesIn );
return true;
}
else if ( ( stringsMatch( unitsIn, pascalUnitString() ) ||
stringsMatch( unitsIn, pascalUnitString() ) && stringsMatch( unitsOut, barUnitString() ) ) )
else if ( stringsMatch( unitsIn, pascalUnitString() ) && stringsMatch( unitsOut, barUnitString() ) )
{
*valuesOut = multiply( valuesIn, 1.0 / pascalPerBar() );
return true;

View File

@@ -340,8 +340,7 @@ endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(
ApplicationLibCode PRIVATE -Wall -Wno-unused-parameter -Wno-reorder
-Wno-parentheses -Wno-switch
ApplicationLibCode PRIVATE -Wall -Wno-reorder -Wno-parentheses -Wno-switch
)
endif()
@@ -350,22 +349,12 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(
ApplicationLibCode
PRIVATE -Wall
-Wno-unused-parameter
-Wno-reorder
-Wno-parentheses
-Wno-switch
-Wno-undefined-var-template
-Wno-delete-abstract-non-virtual-dtor
-Wno-undefined-var-template
-Wno-invalid-source-encoding
-Wno-enum-compare
-Wno-call-to-pure-virtual-from-ctor-dtor
-Wno-unused-variable
-Wno-unused-private-field
-Wno-unused-lambda-capture
-Wno-delete-non-abstract-non-virtual-dtor
-Wno-braced-scalar-init
-Wno-tautological-constant-out-of-range-compare
-Wno-undefined-var-template
-Wno-ambiguous-reversed-operator
)
endif()
@@ -388,7 +377,7 @@ if(MSVC)
# set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/W3 /wd4190
# /wd4100 /wd4127")
set(BUILD_FLAGS_FOR_MSVC "/wd4190 /wd4100 /wd4127 /wd4245 /wd4005 /wd4251")
set(BUILD_FLAGS_FOR_MSVC "/W3 /wd4190 /wd4100 /wd4127")
if(CMAKE_CXX_COMPILER_VERSION LESS_EQUAL 19.14)
# The following warning is generated over 800 times from a qwt header only

View File

@@ -46,7 +46,6 @@ void RicfCommandFileExecutor::ExportTypeEnum::setUp()
///
//--------------------------------------------------------------------------------------------------
RicfCommandFileExecutor::RicfCommandFileExecutor()
: m_exportDataSourceAsComment( true )
{
}

View File

@@ -66,5 +66,4 @@ private:
std::map<ExportType, QString> m_exportPaths;
QString m_lastProjectPath;
bool m_exportDataSourceAsComment;
};

View File

@@ -73,22 +73,12 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(
Commands
PRIVATE -Wall
-Wno-unused-parameter
-Wno-reorder
-Wno-parentheses
-Wno-switch
-Wno-undefined-var-template
-Wno-delete-abstract-non-virtual-dtor
-Wno-undefined-var-template
-Wno-invalid-source-encoding
-Wno-enum-compare
-Wno-call-to-pure-virtual-from-ctor-dtor
-Wno-unused-variable
-Wno-unused-private-field
-Wno-unused-lambda-capture
-Wno-delete-non-abstract-non-virtual-dtor
-Wno-braced-scalar-init
-Wno-tautological-constant-out-of-range-compare
-Wno-undefined-var-template
-Wno-ambiguous-reversed-operator
)
endif()
@@ -111,7 +101,7 @@ if(MSVC)
# set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/W3 /wd4190
# /wd4100 /wd4127")
set(BUILD_FLAGS_FOR_MSVC "/wd4190 /wd4100 /wd4127 /wd4245 /wd4005 /wd4573")
set(BUILD_FLAGS_FOR_MSVC "/W3 /wd4190 /wd4100 /wd4127")
if(CMAKE_CXX_COMPILER_VERSION LESS_EQUAL 19.14)
# The following warning is generated over 800 times from a qwt header only

View File

@@ -55,7 +55,6 @@ bool RicImportEnsembleFractureStatisticsFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicImportEnsembleFractureStatisticsFeature::onActionTriggered( bool isChecked )
{
RiaGuiApplication* app = RiaGuiApplication::instance();
QString pathCacheName = "INPUT_FILES";
auto [fileNames, groupByEnsemble] = runRecursiveFileSearchDialog( "Import StimPlan Fractures", pathCacheName );

View File

@@ -680,8 +680,6 @@ std::vector<cvf::Vec3d> RicExportFractureCompletionsImpl::computeWellPointsInFra
cvf::Vec3d startPos = wellPathCoords.front();
cvf::Vec3d endPos = wellPathCoords.back();
cvf::Vec3d wellPathTangent = endPos - startPos;
cvf::Plane fracturePlane;
auto fractureTransform = fracture->transformMatrix();
fracturePlane.setFromPointAndNormal( fractureTransform.translation(), static_cast<cvf::Vec3d>( fractureTransform.col( 2 ) ) );

View File

@@ -444,8 +444,6 @@ void RicMswTableFormatterTools::generateCompsegHeader( RifTextDataTableFormatter
//--------------------------------------------------------------------------------------------------
void RicMswTableFormatterTools::generateWsegvalvTable( RifTextDataTableFormatter& formatter, RicMswExportInfo& exportInfo )
{
bool foundValve = false;
std::map<size_t, std::vector<WsegvalveData>> wsegvalveData;
generateWsegvalvTableRecursively( exportInfo.mainBoreBranch(),
@@ -729,8 +727,6 @@ void RicMswTableFormatterTools::writeWelsegsSegment( RicMswSegment*
std::vector<std::pair<double, double>> segments = createSubSegmentMDPairs( startMD, endMD, maxSegmentLength );
CVF_ASSERT( branch->wellPath() );
auto wellPathGeometry = branch->wellPath()->wellPathGeometry();
CVF_ASSERT( wellPathGeometry );
double prevOutMD = branch->startMD();
double prevOutTVD = branch->startTVD();
@@ -851,9 +847,6 @@ void RicMswTableFormatterTools::writeValveWelsegsSegment( const RicMswSegment*
std::vector<std::pair<double, double>> splitSegments = createSubSegmentMDPairs( startMD, endMD, maxSegmentLength );
auto wellPathGeometry = valve->wellPath()->wellPathGeometry();
CVF_ASSERT( wellPathGeometry );
const auto linerDiameter = valve->wellPath()->mswCompletionParameters()->linerDiameter( exportInfo.unitSystem() );
const auto roughnessFactor = valve->wellPath()->mswCompletionParameters()->roughnessFactor( exportInfo.unitSystem() );

View File

@@ -761,8 +761,6 @@ void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfoForWell(
auto cellIntersections = generateCellSegments( eclipseCase, wellPath );
double initialMD = computeIntitialMeasuredDepth( eclipseCase, wellPath, mswParameters, cellIntersections );
RiaDefines::EclipseUnitSystem unitSystem = eclipseCase->eclipseCaseData()->unitsType();
bool enableSegmentSplitting = false;
generateFishbonesMswExportInfo( eclipseCase, wellPath, initialMD, cellIntersections, enableSegmentSplitting, exportInfo, branch );
}
@@ -777,7 +775,6 @@ bool RicWellPathExportMswCompletionsImpl::generateFracturesMswExportInfo( RimEcl
gsl::not_null<RicMswExportInfo*> exportInfo,
gsl::not_null<RicMswBranch*> branch )
{
auto mswParameters = wellPath->mswCompletionParameters();
auto fractures = wellPath->fractureCollection()->activeFractures();
std::vector<WellPathCellIntersectionInfo> filteredIntersections =
@@ -922,8 +919,6 @@ bool RicWellPathExportMswCompletionsImpl::generatePerforationsMswExportInfo( Rim
std::vector<WellPathCellIntersectionInfo> RicWellPathExportMswCompletionsImpl::generateCellSegments( const RimEclipseCase* eclipseCase,
const RimWellPath* wellPath )
{
const RigActiveCellInfo* activeCellInfo = eclipseCase->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
auto wellPathGeometry = wellPath->wellPathGeometry();
CVF_ASSERT( wellPathGeometry );
@@ -1186,9 +1181,6 @@ void RicWellPathExportMswCompletionsImpl::createValveCompletions( gsl::not_null<
double exportStartTVD = RicMswTableFormatterTools::tvdFromMeasuredDepth( wellPath, exportStartMD );
double exportEndTVD = RicMswTableFormatterTools::tvdFromMeasuredDepth( wellPath, exportEndMD );
double overlapStartTVD = RicMswTableFormatterTools::tvdFromMeasuredDepth( wellPath, overlapStart );
double overlapEndTVD = RicMswTableFormatterTools::tvdFromMeasuredDepth( wellPath, overlapEnd );
if ( segment->startMD() <= valveMD && valveMD < segment->endMD() )
{
if ( valve->componentType() == RiaDefines::WellPathComponentType::AICD )

View File

@@ -74,7 +74,6 @@ void RicCreateDepthAdjustedLasFilesFeature::onActionTriggered( bool isChecked )
{
RimCase* selectedCase = featureUi.selectedCase();
RimWellPath* sourceWell = featureUi.sourceWell();
RimWellLogFile* sourceWellLogFile = featureUi.wellLogFile();
std::vector<RimWellPath*> destinationWells = featureUi.destinationWells().ptrReferencedObjects();
std::vector<QString> selectedResultProperties = featureUi.selectedResultProperties();
QString exportFolder = featureUi.exportFolder();
@@ -146,7 +145,6 @@ void RicCreateDepthAdjustedLasFilesFeature::createDepthAdjustedWellLogFileFromGe
{
if ( sourceWell->wellLogFiles().empty() ) return;
auto* wellLogFileData = sourceWell->wellLogFiles()[0]->wellLogFileData();
RimWellLogPlotCollection* wellLogCollection = RimMainPlotCollection::current()->wellLogPlotCollection();
cvf::ref<RigGeoMechWellLogExtractor> sourceWellExtractor = wellLogCollection->findOrCreateExtractor( sourceWell, geoMechCase );
if ( sourceWellExtractor.isNull() )

View File

@@ -415,7 +415,6 @@ QString VdeVizDataExtractor::createModelMetaJsonString( const std::vector<std::u
jsonModelMeta["meshArr"] = jsonMeshMetaList;
jsonModelMeta["labelsArr"] = jsonLabelList;
ResInsightInternalJson::Json jsonCodec;
const bool prettifyJson = true;
QString jsonStr = ResInsightInternalJson::Json::encode( jsonModelMeta, prettifyJson );
return jsonStr;

View File

@@ -55,7 +55,6 @@ void RicAppendSummaryCurvesForObjectsFeature::onActionTriggered( bool isChecked
RicAppendSummaryPlotsForObjectsFeature::isSelectionCompatibleWithPlot( sumAddressCollections, summaryMultiPlot );
auto selectionType = sumAddressCollections.front()->contentType();
auto sourcePlots = summaryMultiPlot->summaryPlots();
std::vector<caf::PdmObjectHandle*> pdmObjects;

View File

@@ -62,7 +62,6 @@ bool RicImportEnsembleSurfaceFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicImportEnsembleSurfaceFeature::onActionTriggered( bool isChecked )
{
RiaApplication* app = RiaApplication::instance();
QString pathCacheName = "ENSEMBLE_SURFACE_FILES";
auto [fileNames, groupByEnsemble] = runRecursiveFileSearchDialog( "Import Ensemble Surface", pathCacheName );

View File

@@ -58,7 +58,6 @@ bool RicImportEnsembleWellLogsFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicImportEnsembleWellLogsFeature::onActionTriggered( bool isChecked )
{
RiaApplication* app = RiaApplication::instance();
QString pathCacheName = "ENSEMBLE_WELL_LOGS_FILES";
auto [fileNames, groupByEnsemble] = runRecursiveFileSearchDialog( "Import Ensemble Well Logs", pathCacheName );
if ( fileNames.isEmpty() ) return;

View File

@@ -52,7 +52,7 @@ void RicNewCustomObjectiveFunctionFeature::onActionTriggered( bool isChecked )
if ( coll.size() == 1 )
{
RimCustomObjectiveFunction* newFunc = coll[0]->addObjectiveFunction();
RimCustomObjectiveFunctionWeight* newWeight = RimObjectiveFunctionTools::addWeight( newFunc );
RimObjectiveFunctionTools::addWeight( newFunc );
coll[0]->updateConnectedEditors();
RiuPlotMainWindowTools::selectAsCurrentItem( newFunc );
RiuPlotMainWindowTools::setExpanded( coll.front() );

View File

@@ -89,11 +89,8 @@ RicRecursiveFileSearchDialogResult RicRecursiveFileSearchDialog::runRecursiveSea
dialog.m_fileFilterField->addItem( fileNameFilter );
dialog.m_pathFilterField->addItem( QDir::toNativeSeparators( pathFilterText ) );
for ( const auto& s : fileExtensions )
{
QString joined = fileExtensions.join( '|' );
dialog.m_fileExtensionsField->setText( joined );
}
dialog.m_fileFilterField->addItem( fileNameFilter );
@@ -414,7 +411,7 @@ void RicRecursiveFileSearchDialog::updateFileListWidget()
for ( const QStringList& groupedFileNames : groupedByEnsemble )
{
QString ensembleName = RiaEnsembleNameTools::findSuitableEnsembleName( groupedFileNames, ensembleGroupingMode() );
QListWidgetItem* item = new QListWidgetItem( QDir::toNativeSeparators( ensembleName ), m_fileListWidget );
new QListWidgetItem( QDir::toNativeSeparators( ensembleName ), m_fileListWidget );
addToFileListWidget( groupedFileNames );
}
}

View File

@@ -66,8 +66,6 @@ bool RicReloadSummaryCaseFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicReloadSummaryCaseFeature::onActionTriggered( bool isChecked )
{
RimSummaryMultiPlotCollection* summaryPlotColl = RiaSummaryTools::summaryMultiPlotCollection();
std::vector<RimSummaryCase*> caseSelection = selectedSummaryCases();
for ( RimSummaryCase* summaryCase : caseSelection )
{

View File

@@ -87,8 +87,6 @@ RimSummaryPlot* RicNewGridTimeHistoryCurveFeature::userSelectedSummaryPlot()
const QString lastUsedSummaryPlotKey( "lastUsedSummaryPlotKey" );
RimSummaryMultiPlotCollection* summaryPlotColl = RiaSummaryTools::summaryMultiPlotCollection();
RimSummaryPlot* defaultSelectedPlot = nullptr;
{
QString lastUsedPlotRef = app->cacheDataObject( lastUsedSummaryPlotKey ).toString();

View File

@@ -108,7 +108,6 @@ std::vector<RimEnsembleCurveSet*> RicNewSummaryEnsembleCurveSetFeature::addDefau
RimSummaryPlot* RicNewSummaryEnsembleCurveSetFeature::createPlotForCurveSetsAndUpdate( std::vector<RimSummaryCaseCollection*> ensembles )
{
RiaGuiApplication* app = RiaGuiApplication::instance();
RimProject* proj = app->project();
RiaPreferencesSummary* prefs = RiaPreferencesSummary::current();

View File

@@ -852,8 +852,6 @@ void RicSummaryPlotEditorUi::updateAppearanceEditor()
//--------------------------------------------------------------------------------------------------
void RicSummaryPlotEditorUi::createNewPlot()
{
RimProject* proj = RimProject::current();
RimSummaryPlot* newSummaryPlot = nullptr;
if ( !m_plotContainer )

View File

@@ -140,7 +140,6 @@ std::vector<RimEclipseCase*> openEclipseCasesForCellPlotting( QStringList gridFi
{
std::vector<RimEclipseCase*> openedCases;
RiaApplication* app = RiaApplication::instance();
RimEclipseCaseCollection* analysisModels = RimProject::current()->activeOilField()->analysisModels();
for ( const QString& fileName : gridFileNames )
{

View File

@@ -152,7 +152,6 @@ void RicCreateMultipleWellPathLaterals::slotAppendFractures()
RimWellPathCollection* wellPathCollection = RimTools::wellPathCollection();
if ( wellPathCollection )
{
int index = 0;
for ( auto measuredDepth : m_ui->locationConfig()->locations() )
{
RimModeledWellPath* newModeledWellPath = dynamic_cast<RimModeledWellPath*>(

View File

@@ -115,7 +115,7 @@ bool RifOpmCommonEclipseSummary::open( const QString& fileName, bool includeRest
RifOpmCommonEclipseSummary::increaseEsmryFileCount();
}
catch ( std::exception& e )
catch ( std::exception& )
{
if ( threadSafeLogger )
{

View File

@@ -151,7 +151,7 @@ void RifOpmGridTools::transferCoordinates( Opm::EclIO::EGrid& opmMainGrid, Opm::
std::vector<cvf::Vec3d> snapToCoordinatesFromMainGrid;
for ( size_t opmCellIndex = 0; opmCellIndex < cellCount; opmCellIndex++ )
for ( int opmCellIndex = 0; opmCellIndex < static_cast<int>( cellCount ); opmCellIndex++ )
{
opmGrid.getCellCorners( opmCellIndex, opmX, opmY, opmZ );
@@ -223,7 +223,7 @@ void RifOpmGridTools::transferCoordinates( Opm::EclIO::EGrid& opmMainGrid, Opm::
{
const auto& pillarCordinates = candidates[closestPillarIndex];
int layerCount = pillarCordinates.size() / 2;
int layerCount = static_cast<int>( pillarCordinates.size() / 2 );
int layerIndexInMainGridCell = ijkCell[2] % layerCount;
int localNodeIndex = opmNodeIndex % 8;
@@ -282,7 +282,7 @@ std::map<int, std::pair<double, double>>
auto mainGridCellIndex = hostCellGlobalIndices[cIdx];
opmMainGrid.getCellCorners( mainGridCellIndex, opmX, opmY, opmZ );
auto ijkLocalGrid = opmGrid.ijk_from_global_index( cIdx );
auto ijkLocalGrid = opmGrid.ijk_from_global_index( static_cast<int>( cIdx ) );
auto layer = ijkLocalGrid[2];
// Four corners for top

View File

@@ -21,9 +21,10 @@
#include "RifCsvUserDataParser.h"
#include "RifRevealCsvSectionSummaryReader.h"
#include "RiaTextStringTools.h"
#include <QFile>
#include <QTextStream>
#include <Qt>
//--------------------------------------------------------------------------------------------------
///
@@ -55,7 +56,7 @@ std::pair<bool, QString> RifRevealCsvSummaryReader::parse( const QString& fileNa
// Split files on strange header line (starts with ",Date").
QString fileContents = in.readAll();
QStringList parts = fileContents.split( ",Date", QString::SkipEmptyParts );
QStringList parts = RiaTextStringTools::splitSkipEmptyParts( fileContents, ",Date" );
// Parse each section separately
bool isFirst = true;

View File

@@ -57,7 +57,7 @@ bool RifSeismicZGYReader::open( QString filename )
return false;
}
}
catch ( const std::exception& err )
catch ( const std::exception& )
{
m_reader.reset();
return false;

View File

@@ -375,7 +375,7 @@ std::pair<std::vector<cvf::Vec3d>, std::vector<unsigned>> RifSurfaceImporter::re
// Checks if the given vector is a possible new candidate for an axis vector and adds it to the given list
// of axesVectorCandidates. Also increases the number of occurrences of vector candidates.
auto maybeInsertAxisVectorCandidate = [epsilon]( const cvf::Vec2d vector,
auto maybeInsertAxisVectorCandidate = []( const cvf::Vec2d vector,
std::map<cvf::Vec2d, double, vec2dCompare>& axesVectorCandidates,
std::map<cvf::Vec2d, unsigned, vec2dCompare>& axesVectorCandidatesNum ) -> bool
{

View File

@@ -239,7 +239,7 @@ void RifWellPathImporter::readAllAsciiWellData( const QString& filePath )
std::string line;
std::getline( stream, line, '\n' );
// Skip possible comment lines (-- is used in eclipse, so Haakon H<>gst<73>l considered it smart to skip these
// Skip possible comment lines (-- is used in eclipse, so Haakon H<>gst<73>l considered it smart to skip these
// here as well) The first "-" is eaten by the stream >> x above
if ( line.find( "-" ) == 0 || line.find( "#" ) == 0 )
{
@@ -248,8 +248,8 @@ void RifWellPathImporter::readAllAsciiWellData( const QString& filePath )
else
{
// Find the first and the last position of any quotes (and do not care to match quotes)
size_t quoteStartIdx = line.find_first_of( "'`<EFBFBD><EFBFBD><EFBFBD>" );
size_t quoteEndIdx = line.find_last_of( "'`<EFBFBD><EFBFBD><EFBFBD>" );
size_t quoteStartIdx = line.find_first_of( "'`" );
size_t quoteEndIdx = line.find_last_of( "'`" );
std::string wellName;
bool haveAPossibleWellStart = false;

View File

@@ -61,7 +61,7 @@ private:
{
RigFemPart* part = m_caseData->femParts()->part( pIdx );
int elmCount = part->elementCount();
auto frames = m_resultsData->findOrLoadScalarResult( pIdx, m_resVarAddr );
m_resultsData->findOrLoadScalarResult( pIdx, m_resVarAddr );
auto [stepIdx, frameIdx] = m_resultsData->stepListIndexToTimeStepAndDataFrameIndex( timeStepIndex );

View File

@@ -152,7 +152,7 @@ void RivElementVectorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::Mode
const std::vector<RigCell>& cells = eclipseCase->mainGrid()->globalCellArray();
auto getFaceCenterAndNormal = [activeCellInfo, cells, arrowScaling, displayCordXf]( size_t globalCellIdx,
auto getFaceCenterAndNormal = [cells, arrowScaling, displayCordXf]( size_t globalCellIdx,
cvf::StructGridInterface::FaceType faceType,
cvf::Vec3d& faceCenter,
cvf::Vec3d& faceNormal )

View File

@@ -80,6 +80,4 @@ private:
cvf::Collection<RivGridPartMgr> m_allGrids; // Main grid and all LGR's
cvf::ref<RivElementVectorResultPartMgr> m_elementVectorResultMgr;
cvf::ref<RivReservoirFaultsPartMgr> m_faultsPartMgr;
RivCellSetEnum m_cellSetType;
};

View File

@@ -615,8 +615,8 @@ void RivReservoirViewPartMgr::computeNativeVisibility( cvf::UByteArray*
size_t reservoirCellIndex = grid->reservoirCellIndex( cellIndex );
bool isCellActive = activeCellInfo->isActive( reservoirCellIndex );
if ( !invalidCellsIsVisible && cell.isInvalid() || !inactiveCellsIsVisible && !isCellActive ||
!activeCellsIsVisible && isCellActive || ( *cellIsInWellStatuses )[cellIndex] )
if ( ( !invalidCellsIsVisible && cell.isInvalid() ) || ( !inactiveCellsIsVisible && !isCellActive ) ||
( !activeCellsIsVisible && isCellActive ) || ( *cellIsInWellStatuses )[cellIndex] )
{
( *cellVisibility )[cellIndex] = false;
}

View File

@@ -91,5 +91,4 @@ private:
caf::PdmPointer<RimEclipseView> m_rimReservoirView;
uint m_count;
size_t m_currentT;
bool m_showAsVectors;
};

View File

@@ -454,11 +454,11 @@ RigWellAllocationOverTime RimWellAllocationOverTimePlot::createWellAllocationOve
}
std::map<QString, const std::vector<double>*> tracerFractionCellValues =
RimWellAllocationTools::findOrCreateRelevantTracerCellFractions( simWellData, m_flowDiagSolution, i );
RimWellAllocationTools::findOrCreateRelevantTracerCellFractions( simWellData, m_flowDiagSolution, static_cast<int>( i ) );
auto simWellBranches = RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineForTimeStep( m_case->eclipseCaseData(),
simWellData,
i,
static_cast<int>( i ),
branchDetection,
true );

View File

@@ -568,9 +568,9 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
: tracerName == RIG_FLOW_WATER_NAME ? cvf::Color3f::BLUE
: cvf::Color3f::DARK_GRAY;
if ( tracerName == RIG_FLOW_OIL_NAME && selectedPhases.count( FLOW_PHASE_OIL ) ||
tracerName == RIG_FLOW_GAS_NAME && selectedPhases.count( FLOW_PHASE_GAS ) ||
tracerName == RIG_FLOW_WATER_NAME && selectedPhases.count( FLOW_PHASE_WATER ) )
if ( ( tracerName == RIG_FLOW_OIL_NAME && selectedPhases.count( FLOW_PHASE_OIL ) ) ||
( tracerName == RIG_FLOW_GAS_NAME && selectedPhases.count( FLOW_PHASE_GAS ) ) ||
( tracerName == RIG_FLOW_WATER_NAME && selectedPhases.count( FLOW_PHASE_WATER ) ) )
{
FlowPhase flowPhase = FLOW_PHASE_NONE;
if ( tracerName == RIG_FLOW_OIL_NAME )

View File

@@ -428,7 +428,7 @@ void RimIntersectionResultDefinition::defineUiOrdering( QString uiConfigName, ca
m_geomResultDefinition->uiOrdering( uiConfigName, uiOrdering );
}
if ( ( eclipseCase && m_eclipseResultDefinition->hasDynamicResult() || m_eclipseResultDefinition->isTernarySaturationSelected() ) ||
if ( ( ( eclipseCase && ( m_eclipseResultDefinition->hasDynamicResult() || m_eclipseResultDefinition->isTernarySaturationSelected() ) ) ) ||
geomCase )
{
uiOrdering.add( &m_timeStep );

View File

@@ -161,7 +161,7 @@ QString RimTools::relocateFile( const QString& originalFileName,
}
}
if ( !pathEndsDiffer && firstDiffIdx < fileNamePathElements.size() || firstDiffIdx < oldProjPathElements.size() )
if ( ( !pathEndsDiffer && firstDiffIdx < fileNamePathElements.size() ) || firstDiffIdx < oldProjPathElements.size() )
{
pathEndsDiffer = true;
}

View File

@@ -98,8 +98,7 @@ void RimSummaryCaseCollection::sortByBinnedVariation( std::vector<RigEnsemblePar
// index
std::stable_sort( parameterVector.begin(),
parameterVector.end(),
[&bins]( const RigEnsembleParameter& lhs, const RigEnsembleParameter& rhs )
{ return lhs.variationBin > rhs.variationBin; } );
[]( const RigEnsembleParameter& lhs, const RigEnsembleParameter& rhs ) { return lhs.variationBin > rhs.variationBin; } );
}
//--------------------------------------------------------------------------------------------------

View File

@@ -115,6 +115,4 @@ private:
caf::PdmField<caf::FontTools::RelativeSizeEnum> m_axisLabelFontSize;
caf::PdmField<caf::FontTools::RelativeSizeEnum> m_valueLabelFontSize;
caf::PdmField<bool> m_showValueLabels;
const int m_initialNumberOfTimeSteps = 10;
};

View File

@@ -59,7 +59,7 @@ std::vector<double> RigDepthResultAccessor::resultValues( RigEclipseCaseData*
for ( auto k : kvals )
{
int tmpCellIdx = grid->cellIndexFromIJK( i, j, k );
size_t tmpCellIdx = grid->cellIndexFromIJK( i, j, k );
double tmpVal = 0.0;
if ( !activeCellInfo->isActive( tmpCellIdx ) )
@@ -91,7 +91,7 @@ std::vector<double> RigDepthResultAccessor::resultValues( RigEclipseCaseData*
std::vector<int> RigDepthResultAccessor::kValues( RigEclipseCaseData* eclipseCaseData, int gridIndex )
{
std::vector<int> kvals;
int maxK = eclipseCaseData->grid( gridIndex )->cellCountK();
int maxK = static_cast<int>( eclipseCaseData->grid( gridIndex )->cellCountK() );
for ( int i = 0; i < maxK; i++ )
{
@@ -115,7 +115,7 @@ std::vector<double> RigDepthResultAccessor::depthValues( RigEclipseCaseData* ecl
if ( grid->ijkFromCellIndex( startCellIndex, &i, &j, &dummy ) )
{
int maxK = grid->cellCountK();
int maxK = static_cast<int>( grid->cellCountK() );
for ( int k = 0; k < maxK; k++ )
{

View File

@@ -130,9 +130,6 @@ private:
bool m_isProducer;
bool m_useTotalWellPhaseRateOnly;
cvf::UByteArray* m_cellVisibilities = nullptr;
RigMainGrid* m_mainGrid = nullptr;
struct BranchFlow
{
std::vector<double> depthValuesFromTop;

View File

@@ -271,7 +271,6 @@ private:
double m_rkbDiff;
bool m_exportTvdrkb;
RiaDefines::DepthUnitType m_depthUnit;
std::vector<double> m_depthValues;
std::vector<SingleChannelData> m_logCurveData;

View File

@@ -47,7 +47,7 @@ void RigTexturedSection::setWhatToUpdate( WhatToUpdateEnum updateInfo, int index
if ( index < 0 )
{
start = 0;
stop = m_sectionParts.size();
stop = static_cast<int>( m_sectionParts.size() );
}
for ( int i = start; i < stop; i++ )
@@ -94,7 +94,7 @@ bool RigTexturedSection::isValid() const
//--------------------------------------------------------------------------------------------------
int RigTexturedSection::partsCount() const
{
return m_sectionParts.size();
return static_cast<int>( m_sectionParts.size() );
}
//--------------------------------------------------------------------------------------------------

View File

@@ -31,10 +31,10 @@
struct RigWellPathFormation
{
double mdTop;
double mdBase;
double tvdTop;
double tvdBase;
double mdTop{ 0.0 };
double mdBase{ 0.0 };
double tvdTop{ 0.0 };
double tvdBase{ 0.0 };
QString formationName;
};

View File

@@ -86,7 +86,6 @@ private:
};
std::multiset<BarEntry> m_sortedBarEntries;
Qt::Orientation m_orientation;
std::map<QString, QColor> m_legendColors;
bool m_isSortingByMaxValueInGroups;
int m_labelPointSize;

View File

@@ -384,7 +384,7 @@ bool RiuCellAndNncPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve
if ( intersectionHit )
selItem = new RiuGeoMechSelectionItem( associatedGridView,
geomResDef,
timestepIndex,
static_cast<int>( timestepIndex ),
dataFrameIndex,
gridIndex,
gridLocalCellIndex,
@@ -395,7 +395,7 @@ bool RiuCellAndNncPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve
else
selItem = new RiuGeoMechSelectionItem( associatedGridView,
geomResDef,
timestepIndex,
static_cast<int>( timestepIndex ),
dataFrameIndex,
gridIndex,
gridLocalCellIndex,

View File

@@ -158,7 +158,11 @@ void RiuFemTimeHistoryResultAccessor::computeTimeHistoryData()
const int frameCount = femPartResultsColl->frameCount( stepIdx );
for ( int frameIdx = 0; frameIdx < frameCount; frameIdx++ )
{
RiuGeoMechXfTensorResultAccessor stressXfAccessor( femPartResultsColl, *m_femResultAddress, m_gridIndex, stepIdx, frameIdx );
RiuGeoMechXfTensorResultAccessor stressXfAccessor( femPartResultsColl,
*m_femResultAddress,
static_cast<int>( m_gridIndex ),
stepIdx,
frameIdx );
float scalarValue = stressXfAccessor.calculateElmNodeValue( m_intersectionTriangle, closestElmNodeResIndex );
m_timeHistoryValues.push_back( scalarValue );
}

View File

@@ -72,7 +72,7 @@ std::list<QMdiSubWindow*> RiuMdiArea::subWindowListSortedByPosition()
// Sort of list so we first sort by window position but retain activation order
// for windows with the same position
windowList.sort(
[this]( QMdiSubWindow* lhs, QMdiSubWindow* rhs )
[]( QMdiSubWindow* lhs, QMdiSubWindow* rhs )
{
if ( lhs->frameGeometry().topLeft().rx() == rhs->frameGeometry().topLeft().rx() )
{
@@ -95,7 +95,7 @@ std::list<QMdiSubWindow*> RiuMdiArea::subWindowListSortedByVerticalPosition()
}
windowList.sort(
[this]( QMdiSubWindow* lhs, QMdiSubWindow* rhs )
[]( QMdiSubWindow* lhs, QMdiSubWindow* rhs )
{
if ( lhs->frameGeometry().topLeft().ry() == rhs->frameGeometry().topLeft().ry() )
{

View File

@@ -447,14 +447,15 @@ void RiuSelectionChangedHandler::addDepthCurveFromSelectionItem( const RiuSelect
std::vector<double> resultValues = RigDepthResultAccessor::resultValues( casedata,
eclResDef,
eclipseSelectionItem->m_gridIndex,
static_cast<int>( eclipseSelectionItem->m_gridIndex ),
eclipseSelectionItem->m_gridLocalCellIndex,
currentTimeStep );
std::vector<int> kValues = RigDepthResultAccessor::kValues( casedata, eclipseSelectionItem->m_gridIndex );
std::vector<int> kValues = RigDepthResultAccessor::kValues( casedata, static_cast<int>( eclipseSelectionItem->m_gridIndex ) );
std::vector<double> depthValues =
RigDepthResultAccessor::depthValues( casedata, eclipseSelectionItem->m_gridLocalCellIndex, eclipseSelectionItem->m_gridIndex );
std::vector<double> depthValues = RigDepthResultAccessor::depthValues( casedata,
static_cast<int>( eclipseSelectionItem->m_gridLocalCellIndex ),
static_cast<int>( eclipseSelectionItem->m_gridIndex ) );
CVF_ASSERT( kValues.size() == resultValues.size() );

View File

@@ -95,67 +95,67 @@ SummaryIdentifierAndField::~SummaryIdentifierAndField()
RiuSummaryVectorSelectionUi::RiuSummaryVectorSelectionUi()
: m_identifierFieldsMap( {
{ RifEclipseSummaryAddress::SUMMARY_FIELD,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } },
{ RifEclipseSummaryAddress::SUMMARY_AQUIFER,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_AQUIFER_NUMBER ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_AQUIFER_NUMBER ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } },
{ RifEclipseSummaryAddress::SUMMARY_NETWORK,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } },
{ RifEclipseSummaryAddress::SUMMARY_MISC,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } },
{ RifEclipseSummaryAddress::SUMMARY_REGION,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_REGION_NUMBER ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_REGION_NUMBER ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } },
{ RifEclipseSummaryAddress::SUMMARY_REGION_2_REGION,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_REGION_2_REGION ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_REGION_2_REGION ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } },
{ RifEclipseSummaryAddress::SUMMARY_GROUP,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_GROUP_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_GROUP_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } },
{ RifEclipseSummaryAddress::SUMMARY_WELL,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } },
{ RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } },
{ RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION_LGR,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_LGR_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_LGR_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } },
{ RifEclipseSummaryAddress::SUMMARY_WELL_LGR,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_LGR_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_LGR_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } },
{ RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_SEGMENT_NUMBER ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_SEGMENT_NUMBER ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } },
{ RifEclipseSummaryAddress::SUMMARY_BLOCK,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } },
{ RifEclipseSummaryAddress::SUMMARY_BLOCK_LGR,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_LGR_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_LGR_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } },
{ RifEclipseSummaryAddress::SUMMARY_IMPORTED,
{ { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } },
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ),
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } },
} )
, m_showIndividualEnsembleCases( true )

View File

@@ -437,7 +437,10 @@ endif()
add_subdirectory(ThirdParty/qwt)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(qwt PRIVATE -Wno-deprecated-copy)
target_compile_options(
qwt PRIVATE -Wno-deprecated-copy -Wno-deprecated-enum-float-conversion
-Wno-deprecated-enum-enum-conversion
)
elseif(MSVC)
target_compile_options(qwt PRIVATE /wd4996 /wd4005)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")

View File

@@ -22,6 +22,12 @@ add_executable(
cafPdmScriptingBasicTest.cpp
)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(
cafPdmScripting_UnitTests PRIVATE -Wno-delete-abstract-non-virtual-dtor
)
endif()
target_link_libraries(
${PROJECT_NAME} cafPdmScripting ${QT_LIBRARIES} ${THREAD_LIBRARY}
)

View File

@@ -37,6 +37,14 @@ set(PROJECT_FILES
# add the executable
add_executable(${PROJECT_NAME} ${PROJECT_FILES})
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(
cafPdmCore_UnitTests PRIVATE -Wno-ambiguous-reversed-operator
-Wno-invalid-source-encoding
)
endif()
source_group("" FILES ${PROJECT_FILES})
if(Qt5Core_FOUND)

View File

@@ -26,6 +26,13 @@ set(PROJECT_FILES cafPdmBasicTest.cpp cafProjectDataModel_UnitTests.cpp
# add the executable
add_executable(${PROJECT_NAME} ${PROJECT_FILES} gtest/gtest-all.cpp)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(
cafProjectDataModel_UnitTests PRIVATE -Wno-ambiguous-reversed-operator
-Wno-invalid-source-encoding
)
endif()
target_link_libraries(
${PROJECT_NAME} cafProjectDataModel ${QT_LIBRARIES} ${THREAD_LIBRARY}
)

View File

@@ -30,7 +30,9 @@ public:
caf::PdmField<std::vector<cvf::Vec3d>> m_vecArrayField;
protected:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue );
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute );
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
};

View File

@@ -45,6 +45,5 @@ template<> Vector2<double> const Vector2<double>::UNDEFINED(UNDEFINED_DOUBLE, UN
template<> Vector2<float> const Vector2<float>::UNDEFINED(UNDEFINED_FLOAT, UNDEFINED_FLOAT);
template<> Vector2<int> const Vector2<int>::UNDEFINED(UNDEFINED_INT, UNDEFINED_INT);
} // namespace cvf

View File

@@ -113,21 +113,6 @@ TEST(ObjectTest, AddRefAndRelease)
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
#if CVF_ENABLE_TIGHT_ASSERTS == 1
TEST(ObjectDeathTest, AddRefAndReleaseBehaviorOnNullPointer)
{
Object* obj = NULL;
EXPECT_DEATH(obj->addRef(), "Assertion");
EXPECT_DEATH(obj->refCount(), "Assertion");
// Release is OK on NULL pointer
EXPECT_EQ(0, obj->release());
}
#endif
//--------------------------------------------------------------------------------------------------

View File

@@ -606,18 +606,10 @@ TEST(StringTest, Number)
EXPECT_STREQ("1.234", s1.toAscii().ptr());
EXPECT_STREQ("-123000", s2.toAscii().ptr());
#ifdef WIN32
EXPECT_STREQ("5.4e+013", s3.toAscii().ptr());
#else
EXPECT_STREQ("5.4e+13", s3.toAscii().ptr());
#endif
String s4 = String::number(-1.2375e5f, 'e', 2);
#ifdef WIN32
EXPECT_STREQ("-1.24e+005", s4.toAscii().ptr());
#else
EXPECT_STREQ("-1.24e+05", s4.toAscii().ptr());
#endif
String s5 = String::number(-1.2375e5f, 'f', 2);
EXPECT_STREQ("-123750.00", s5.toAscii().ptr());
@@ -633,19 +625,11 @@ TEST(StringTest, Number)
EXPECT_STREQ("1.234", s11.toAscii().ptr());
EXPECT_STREQ("-123000", s12.toAscii().ptr());
#ifdef WIN32
EXPECT_STREQ("5.4e+013", s13.toAscii().ptr());
#else
EXPECT_STREQ("5.4e+13", s13.toAscii().ptr());
#endif
String s14 = String::number(-1.2375e5, 'e', 2);
#ifdef WIN32
EXPECT_STREQ("-1.24e+005", s14.toAscii().ptr());
#else
EXPECT_STREQ("-1.24e+05", s14.toAscii().ptr());
#endif
String s15 = String::number(-1.2375e5, 'f', 2);
EXPECT_STREQ("-123750.00", s15.toAscii().ptr());
@@ -975,11 +959,7 @@ TEST(StringTest, StringBuilding)
s11 += String(dfps);
s11 += " (fps)";
#ifdef WIN32
EXPECT_STREQ("Framerate: 1.23457e+014 (fps)", s11.toAscii().ptr());
#else
EXPECT_STREQ("Framerate: 1.23457e+14 (fps)", s11.toAscii().ptr());
#endif
String s13 = "Framerate: " + String::number(dfps, 'f', 1) + " (fps)";
EXPECT_STREQ("Framerate: 123456789012345.6 (fps)", s13.toAscii().ptr());