Skip to content

Commit

Permalink
Format code for travis static analysis job.
Browse files Browse the repository at this point in the history
  • Loading branch information
fullset committed Oct 15, 2019
1 parent 614975a commit 0b6dc54
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion test/test_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace
const uint8_t * outXEnd = outX + width;

for( ; outX != outXEnd; ++outX )
(*outX) = Test_Helper::randomValue<uint8_t>( 255 );
( *outX ) = Test_Helper::randomValue<uint8_t>( 255 );
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/test_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace Test_Helper
if( maximum == 0 )
return 0;
else
return static_cast<data>(static_cast<uint32_t>(rand()) % ( maximum + 1 ));
return static_cast<data>( static_cast<uint32_t>( rand() ) % ( maximum + 1 ) );
}

template <typename data>
Expand All @@ -47,7 +47,7 @@ namespace Test_Helper
return 0;
}
else {
data value = static_cast<data>(static_cast<uint32_t>(rand()) % ( maximum + 1 ));
data value = static_cast<data>( static_cast<uint32_t>( rand() ) % ( maximum + 1 ) );

if( value < minimum )
value = minimum;
Expand Down
16 changes: 8 additions & 8 deletions test/unit_tests/cuda/unit_test_image_function_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ namespace image_function_cuda
const std::vector < uint8_t > intensity = intensityArray( 2 );
PenguinV_Image::Image input = uniformImage( intensity[0], 0, 0, reference );

const bool horizontalFlip = (randomValue<uint32_t>( 0, 1 ) == 0);
const bool verticalFlip = (randomValue<uint32_t>( 0, 1 ) == 0);
const bool horizontalFlip = ( randomValue<uint32_t>( 0, 1 ) == 0 );
const bool verticalFlip = ( randomValue<uint32_t>( 0, 1 ) == 0 );
const uint32_t xCorrection = input.width() % 2;
const uint32_t yCorrection = input.height() % 2;

Expand Down Expand Up @@ -249,8 +249,8 @@ namespace image_function_cuda
const uint8_t intensityFill = intensityValue();
std::vector < PenguinV_Image::Image > input = uniformImages( intensity, reference );

const bool horizontalFlip = (randomValue<uint32_t>( 0, 1 ) == 0);
const bool verticalFlip = (randomValue<uint32_t>( 0, 1 ) == 0);
const bool horizontalFlip = ( randomValue<uint32_t>( 0, 1 ) == 0 );
const bool verticalFlip = ( randomValue<uint32_t>( 0, 1 ) == 0 );
const uint32_t xCorrection = input[0].width() % 2;
const uint32_t yCorrection = input[0].height() % 2;

Expand Down Expand Up @@ -291,8 +291,8 @@ namespace image_function_cuda
uint32_t roiX, roiY, roiWidth, roiHeight;
generateRoi( input, roiX, roiY, roiWidth, roiHeight );

const bool horizontalFlip = (randomValue<uint32_t>( 0, 1 ) == 0);
const bool verticalFlip = (randomValue<uint32_t>( 0, 1 ) == 0);
const bool horizontalFlip = ( randomValue<uint32_t>( 0, 1 ) == 0 );
const bool verticalFlip = ( randomValue<uint32_t>( 0, 1 ) == 0 );
const uint32_t xCorrection = roiWidth % 2;
const uint32_t yCorrection = roiHeight % 2;

Expand Down Expand Up @@ -337,8 +337,8 @@ namespace image_function_cuda
uint32_t roiWidth, roiHeight;
generateRoi( image, roiX, roiY, roiWidth, roiHeight );

const bool horizontalFlip = (randomValue<uint32_t>( 0, 1 ) == 0);
const bool verticalFlip = (randomValue<uint32_t>( 0, 1 ) == 0);
const bool horizontalFlip = ( randomValue<uint32_t>( 0, 1 ) == 0 );
const bool verticalFlip = ( randomValue<uint32_t>( 0, 1 ) == 0 );
const uint32_t xCorrection = roiWidth % 2;
const uint32_t yCorrection = roiHeight % 2;

Expand Down
2 changes: 1 addition & 1 deletion test/unit_tests/unit_test_fft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace fft
bool RandomImageFFT()
{
for ( uint32_t i = 0u; i < 32u; ++i ) { // a special case for FFT because it take a lot of time for execution
const uint32_t dimension = (2u << Unit_Test::randomValue<uint8_t>( 10 ));
const uint32_t dimension = ( 2u << Unit_Test::randomValue<uint8_t>( 10 ) );

const PenguinV_Image::Image input = Unit_Test::randomImage( dimension, dimension );

Expand Down
2 changes: 1 addition & 1 deletion test/unit_tests/unit_test_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ namespace Unit_Test
maximumHeight = im->second;
}

width = randomValue<uint32_t>( 1, maximumWidth );
width = randomValue<uint32_t>( 1, maximumWidth );
height = randomValue<uint32_t>( 1, maximumHeight );

x.resize( imageSize.size() );
Expand Down
2 changes: 1 addition & 1 deletion test/unit_tests/unit_test_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace Unit_Test
template <typename _Type>
void generateRoi( const PenguinV_Image::ImageTemplate<_Type> & image, uint32_t & x, uint32_t & y, uint32_t & width, uint32_t & height )
{
width = randomValue<uint32_t>( 1, image.width() );
width = randomValue<uint32_t>( 1, image.width() );
height = randomValue<uint32_t>( 1, image.height() );

x = randomValue<uint32_t>( image.width() - width );
Expand Down
24 changes: 12 additions & 12 deletions test/unit_tests/unit_test_image_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,8 @@ namespace Function_Template
const std::vector < uint8_t > intensity = intensityArray( 2 );
PenguinV_Image::Image input = uniformImage( intensity[0] );

const bool horizontalFlip = (randomValue<uint32_t>( 0, 1 ) == 0);
const bool verticalFlip = (randomValue<uint32_t>( 0, 1 ) == 0);
const bool horizontalFlip = ( randomValue<uint32_t>( 0, 1 ) == 0 );
const bool verticalFlip = ( randomValue<uint32_t>( 0, 1 ) == 0 );
const uint32_t xCorrection = input.width() % 2;
const uint32_t yCorrection = input.height() % 2;

Expand Down Expand Up @@ -781,8 +781,8 @@ namespace Function_Template
const uint8_t intensityFill = intensityValue();
std::vector < PenguinV_Image::Image > input = uniformImages( intensity );

const bool horizontalFlip = (randomValue<uint32_t>( 0, 1 ) == 0);
const bool verticalFlip = (randomValue<uint32_t>( 0, 1 ) == 0);
const bool horizontalFlip = ( randomValue<uint32_t>( 0, 1 ) == 0 );
const bool verticalFlip = ( randomValue<uint32_t>( 0, 1 ) == 0 );
const uint32_t xCorrection = input[0].width() % 2;
const uint32_t yCorrection = input[0].height() % 2;

Expand Down Expand Up @@ -822,8 +822,8 @@ namespace Function_Template
uint32_t roiX, roiY, roiWidth, roiHeight;
generateRoi( input, roiX, roiY, roiWidth, roiHeight );

const bool horizontalFlip = (randomValue<uint32_t>( 0, 1 ) == 0);
const bool verticalFlip = (randomValue<uint32_t>( 0, 1 ) == 0);
const bool horizontalFlip = ( randomValue<uint32_t>( 0, 1 ) == 0 );
const bool verticalFlip = ( randomValue<uint32_t>( 0, 1 ) == 0 );
const uint32_t xCorrection = roiWidth % 2;
const uint32_t yCorrection = roiHeight % 2;

Expand Down Expand Up @@ -867,8 +867,8 @@ namespace Function_Template
uint32_t roiWidth, roiHeight;
generateRoi( image, roiX, roiY, roiWidth, roiHeight );

const bool horizontalFlip = (randomValue<uint32_t>( 0, 1 ) == 0);
const bool verticalFlip = (randomValue<uint32_t>( 0, 1 ) == 0);
const bool horizontalFlip = ( randomValue<uint32_t>( 0, 1 ) == 0 );
const bool verticalFlip = ( randomValue<uint32_t>( 0, 1 ) == 0 );
const uint32_t xCorrection = roiWidth % 2;
const uint32_t yCorrection = roiHeight % 2;

Expand Down Expand Up @@ -1571,7 +1571,7 @@ namespace Function_Template
const uint8_t intensity = intensityValue();
const PenguinV_Image::Image image = uniformImage( intensity );

const bool horizontal = (randomValue<int>(1) == 0);
const bool horizontal = ( randomValue<int>(1) == 0 );

std::vector < uint32_t > projection = ProjectionProfile( image, horizontal );

Expand All @@ -1586,7 +1586,7 @@ namespace Function_Template
const uint8_t intensity = intensityValue();
const PenguinV_Image::Image image = uniformImage( intensity );

const bool horizontal = (randomValue<int>(1) == 0);
const bool horizontal = ( randomValue<int>(1) == 0 );

std::vector < uint32_t > projection;
ProjectionProfile( image, horizontal, projection );
Expand All @@ -1605,7 +1605,7 @@ namespace Function_Template
uint32_t roiX, roiY, roiWidth, roiHeight;
generateRoi( image, roiX, roiY, roiWidth, roiHeight );

const bool horizontal = (randomValue<int>(1) == 0);
const bool horizontal = ( randomValue<int>(1) == 0 );

std::vector < uint32_t > projection = ProjectionProfile( image, roiX, roiY, roiWidth, roiHeight, horizontal );

Expand All @@ -1623,7 +1623,7 @@ namespace Function_Template
uint32_t roiX, roiY, roiWidth, roiHeight;
generateRoi( image, roiX, roiY, roiWidth, roiHeight );

const bool horizontal = (randomValue<int>(1) == 0);
const bool horizontal = ( randomValue<int>(1) == 0 );

std::vector < uint32_t > projection;
ProjectionProfile( image, roiX, roiY, roiWidth, roiHeight, horizontal, projection );
Expand Down

0 comments on commit 0b6dc54

Please sign in to comment.