Skip to content

Commit

Permalink
Fix copcprovider tests and clang-tidy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Withalion authored and wonder-sk committed Nov 14, 2024
1 parent c9c4aad commit 7333faf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/core/pointcloud/qgspointclouddataprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,13 +303,13 @@ struct MapIndexedPointCloudNode
// however often times the flag is set wrong, so we determine if the value is bigger than the maximum amount of seconds in week then it has to be adjusted standard time
if ( copcIndex->gpsTimeFlag() || pointAttr[QStringLiteral( "GpsTime" )].toDouble() > numberOfSecsInWeek )
{
const QString utcTime = gpsBaseTime.addSecs( pointAttr[QStringLiteral( "GpsTime" )].toDouble() + 1e9 ).toString( Qt::ISODate );
const QString utcTime = gpsBaseTime.addSecs( static_cast<qint64>( pointAttr[QStringLiteral( "GpsTime" )].toDouble() + 1e9 ) ).toString( Qt::ISODate );
pointAttr[ QStringLiteral( "GpsTime (raw)" )] = pointAttr[QStringLiteral( "GpsTime" )];
pointAttr[ QStringLiteral( "GpsTime" )] = utcTime;
}
else
{
const QString weekTime = gpsBaseTime.addSecs( pointAttr[QStringLiteral( "GpsTime" )].toDouble() ).toString( "ddd hh:mm:ss" );
const QString weekTime = gpsBaseTime.addSecs( pointAttr[QStringLiteral( "GpsTime" )].toLongLong() ).toString( "ddd hh:mm:ss" );
pointAttr[ QStringLiteral( "GpsTime (raw)" )] = pointAttr[QStringLiteral( "GpsTime" )];
pointAttr[ QStringLiteral( "GpsTime" )] = weekTime;
}
Expand Down
22 changes: 11 additions & 11 deletions tests/src/providers/testqgscopcprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ void TestQgsCopcProvider::testIdentify()
expected[ QStringLiteral( "Blue" ) ] = 0;
expected[ QStringLiteral( "Classification" ) ] = 2;
expected[ QStringLiteral( "EdgeOfFlightLine" ) ] = 0;
expected[ QStringLiteral( "GpsTime" ) ] = 268793.37257748609409;
expected[ QStringLiteral( "GpsTime (raw)" ) ] = 268793.37257748609409;
expected[ QStringLiteral( "Green" ) ] = 0;
expected[ QStringLiteral( "Intensity" ) ] = 1765;
expected[ QStringLiteral( "NumberOfReturns" ) ] = 1;
Expand Down Expand Up @@ -436,7 +436,7 @@ void TestQgsCopcProvider::testIdentify()
point[ QStringLiteral( "Blue" ) ] = "0" ;
point[ QStringLiteral( "Classification" ) ] = "2" ;
point[ QStringLiteral( "EdgeOfFlightLine" ) ] = "0" ;
point[ QStringLiteral( "GpsTime" ) ] = "268793.3373408913" ;
point[ QStringLiteral( "GpsTime (raw)" ) ] = "268793.3373408913" ;
point[ QStringLiteral( "Green" ) ] = "0" ;
point[ QStringLiteral( "Intensity" ) ] = "278" ;
point[ QStringLiteral( "NumberOfReturns" ) ] = "1" ;
Expand Down Expand Up @@ -479,7 +479,7 @@ void TestQgsCopcProvider::testIdentify()
point[ QStringLiteral( "Blue" ) ] = "0" ;
point[ QStringLiteral( "Classification" ) ] = "2" ;
point[ QStringLiteral( "EdgeOfFlightLine" ) ] = "0" ;
point[ QStringLiteral( "GpsTime" ) ] = "268793.3813974548" ;
point[ QStringLiteral( "GpsTime (raw)" ) ] = "268793.3813974548" ;
point[ QStringLiteral( "Green" ) ] = "0" ;
point[ QStringLiteral( "Intensity" ) ] = "1142" ;
point[ QStringLiteral( "NumberOfReturns" ) ] = "1" ;
Expand All @@ -499,7 +499,7 @@ void TestQgsCopcProvider::testIdentify()
point[ QStringLiteral( "Blue" ) ] = "0" ;
point[ QStringLiteral( "Classification" ) ] = "3" ;
point[ QStringLiteral( "EdgeOfFlightLine" ) ] = "0" ;
point[ QStringLiteral( "GpsTime" ) ] = "269160.5176644815" ;
point[ QStringLiteral( "GpsTime (raw)" ) ] = "269160.5176644815" ;
point[ QStringLiteral( "Green" ) ] = "0" ;
point[ QStringLiteral( "Intensity" ) ] = "1631" ;
point[ QStringLiteral( "NumberOfReturns" ) ] = "1" ;
Expand Down Expand Up @@ -589,7 +589,7 @@ void TestQgsCopcProvider::testExtraBytesAttributesValues()
point[ QStringLiteral( "Classification" ) ] = "2" ;
point[ QStringLiteral( "Deviation" ) ] = "0" ;
point[ QStringLiteral( "EdgeOfFlightLine" ) ] = "0" ;
point[ QStringLiteral( "GpsTime" ) ] = "302522582.235839" ;
point[ QStringLiteral( "GpsTime (raw)" ) ] = "302522582.235839" ;
point[ QStringLiteral( "Green" ) ] = "0" ;
point[ QStringLiteral( "Intensity" ) ] = "1417" ;
point[ QStringLiteral( "NumberOfReturns" ) ] = "3" ;
Expand All @@ -612,7 +612,7 @@ void TestQgsCopcProvider::testExtraBytesAttributesValues()
point[ QStringLiteral( "Classification" ) ] = "5" ;
point[ QStringLiteral( "Deviation" ) ] = "2" ;
point[ QStringLiteral( "EdgeOfFlightLine" ) ] = "0" ;
point[ QStringLiteral( "GpsTime" ) ] = "302522582.235838" ;
point[ QStringLiteral( "GpsTime (raw)" ) ] = "302522582.235838" ;
point[ QStringLiteral( "Green" ) ] = "0" ;
point[ QStringLiteral( "Intensity" ) ] = "441" ;
point[ QStringLiteral( "NumberOfReturns" ) ] = "3" ;
Expand Down Expand Up @@ -673,7 +673,7 @@ void TestQgsCopcProvider::testClassFlagsValues()
point[ QStringLiteral( "Classification" ) ] = "2" ;
point[ QStringLiteral( "Deviation" ) ] = "0" ;
point[ QStringLiteral( "EdgeOfFlightLine" ) ] = "0" ;
point[ QStringLiteral( "GpsTime" ) ] = "302522582.235839" ;
point[ QStringLiteral( "GpsTime (raw)" ) ] = "302522582.235839" ;
point[ QStringLiteral( "Green" ) ] = "0" ;
point[ QStringLiteral( "Intensity" ) ] = "1417" ;
point[ QStringLiteral( "NumberOfReturns" ) ] = "3" ;
Expand All @@ -700,7 +700,7 @@ void TestQgsCopcProvider::testClassFlagsValues()
point[ QStringLiteral( "Classification" ) ] = "5" ;
point[ QStringLiteral( "Deviation" ) ] = "2" ;
point[ QStringLiteral( "EdgeOfFlightLine" ) ] = "0" ;
point[ QStringLiteral( "GpsTime" ) ] = "302522582.235838" ;
point[ QStringLiteral( "GpsTime (raw)" ) ] = "302522582.235838" ;
point[ QStringLiteral( "Green" ) ] = "0" ;
point[ QStringLiteral( "Intensity" ) ] = "441" ;
point[ QStringLiteral( "NumberOfReturns" ) ] = "3" ;
Expand All @@ -727,7 +727,7 @@ void TestQgsCopcProvider::testClassFlagsValues()
point[ QStringLiteral( "Classification" ) ] = "5" ;
point[ QStringLiteral( "Deviation" ) ] = "8" ;
point[ QStringLiteral( "EdgeOfFlightLine" ) ] = "0" ;
point[ QStringLiteral( "GpsTime" ) ] = "302522582.235837" ;
point[ QStringLiteral( "GpsTime (raw)" ) ] = "302522582.235837" ;
point[ QStringLiteral( "Green" ) ] = "0" ;
point[ QStringLiteral( "Intensity" ) ] = "754" ;
point[ QStringLiteral( "NumberOfReturns" ) ] = "3" ;
Expand All @@ -754,7 +754,7 @@ void TestQgsCopcProvider::testClassFlagsValues()
point[ QStringLiteral( "Classification" ) ] = "2" ;
point[ QStringLiteral( "Deviation" ) ] = "6" ;
point[ QStringLiteral( "EdgeOfFlightLine" ) ] = "0" ;
point[ QStringLiteral( "GpsTime" ) ] = "302522582.235838" ;
point[ QStringLiteral( "GpsTime (raw)" ) ] = "302522582.235838" ;
point[ QStringLiteral( "Green" ) ] = "0" ;
point[ QStringLiteral( "Intensity" ) ] = "1539" ;
point[ QStringLiteral( "NumberOfReturns" ) ] = "3" ;
Expand All @@ -781,7 +781,7 @@ void TestQgsCopcProvider::testClassFlagsValues()
point[ QStringLiteral( "Classification" ) ] = "5" ;
point[ QStringLiteral( "Deviation" ) ] = "43" ;
point[ QStringLiteral( "EdgeOfFlightLine" ) ] = "0" ;
point[ QStringLiteral( "GpsTime" ) ] = "302522582.23583597" ;
point[ QStringLiteral( "GpsTime (raw)" ) ] = "302522582.23583597" ;
point[ QStringLiteral( "Green" ) ] = "0" ;
point[ QStringLiteral( "Intensity" ) ] = "1171" ;
point[ QStringLiteral( "NumberOfReturns" ) ] = "3" ;
Expand Down

0 comments on commit 7333faf

Please sign in to comment.