Skip to content

Commit

Permalink
fixed build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
glookka committed Jan 6, 2019
1 parent 72050ae commit a876222
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 21 deletions.
47 changes: 28 additions & 19 deletions src/gtests_functions.cpp
Expand Up @@ -1180,31 +1180,31 @@ static void TestRebalance_fn ( tstcase * pData, int iLen, int iStride )
TEST ( functions, Rebalance )
{
// old weights, timers, new weights
tstcase dData1[] = { {50.5669, 186751, 55.0625}, {49.4316, 228828, 44.9375},
{55.6222, 207608, 51.2823}, {44.3763, 218537, 48.7177},
{56.8841, 214800, 47.4951}, {43.1144, 194305, 52.5049},
{54.4091, 207614, 47.7932}, {45.5894, 190062, 52.2068},
{52.2103, 221708, 47.5706}, {47.7882, 201162, 52.4294},
{49.7810, 247379, 43.8821}, {50.2174, 193441, 56.1179},
{43.6667, 223202, 46.6167}, {56.3317, 194910, 53.3833},
{40.3662, 361018, 38.7370}, {59.6323, 228274, 61.2630},
{29.9718, 275050, 44.7756}, {70.0267, 223009, 55.2244},
{25.7618, 279008, 42.3951}, {74.2367, 205340, 57.6049},
{20.3433, 201466, 51.4136}, {79.6551, 213189, 48.5864},
{21.2741, 197584, 51.5511}, {78.7243, 210235, 48.4489},
{25.3498, 318349, 39.5014}, {74.6487, 207860, 60.4986},
{18.1476, 487120, 29.5299}, {81.8509, 204124, 70.4701},
{08.5008, 412733, 32.9526}, {91.4977, 202851, 67.0474} };
tstcase dData1[] = { {50.5669f, 186751, 55.0625f}, {49.4316f, 228828, 44.9375f},
{55.6222f, 207608, 51.2823f}, {44.3763f, 218537, 48.7177f},
{56.8841f, 214800, 47.4951f}, {43.1144f, 194305, 52.5049f},
{54.4091f, 207614, 47.7932f}, {45.5894f, 190062, 52.2068f},
{52.2103f, 221708, 47.5706f}, {47.7882f, 201162, 52.4294f},
{49.7810f, 247379, 43.8821f}, {50.2174f, 193441, 56.1179f},
{43.6667f, 223202, 46.6167f}, {56.3317f, 194910, 53.3833f},
{40.3662f, 361018, 38.7370f}, {59.6323f, 228274, 61.2630f},
{29.9718f, 275050, 44.7756f}, {70.0267f, 223009, 55.2244f},
{25.7618f, 279008, 42.3951f}, {74.2367f, 205340, 57.6049f},
{20.3433f, 201466, 51.4136f}, {79.6551f, 213189, 48.5864f},
{21.2741f, 197584, 51.5511f}, {78.7243f, 210235, 48.4489f},
{25.3498f, 318349, 39.5014f}, {74.6487f, 207860, 60.4986f},
{18.1476f, 487120, 29.5299f}, {81.8509f, 204124, 70.4701f},
{08.5008f, 412733, 32.9526f}, {91.4977f, 202851, 67.0474f} };
TestRebalance_fn ( dData1, sizeof(dData1) / sizeof( tstcase), 2 );

tstcase dData2[] = { { 0.000000, 0, 10.00000 }, { 00.0015, 18469, 90.0000 } };
tstcase dData2[] = { { 0.000000f, 0, 10.00000f }, { 00.0015f, 18469, 90.0000f } };
TestRebalance_fn ( dData2, sizeof(dData2) / sizeof( tstcase), 2 );

tstcase dData3[] = { { 0.000000, 0, 3.3333 }, { 0.0015, 0, 3.3333 }
, { 0.0031, 0, 3.3333 }, { 0.0046, 18469, 90.0000 } };
tstcase dData3[] = { { 0.000000f, 0, 3.3333f }, { 0.0015f, 0, 3.3333f }
, { 0.0031f, 0, 3.3333f }, { 0.0046f, 18469, 90.0000f } };
TestRebalance_fn ( dData3, sizeof ( dData3 ) / sizeof ( tstcase ), 4 );

tstcase dData4[] = { { 0.000000, 7100, 65.0088 }, { 0.0015, 0, 10.0 }, { .0031, 18469, 24.9912 } };
tstcase dData4[] = { { 0.000000f, 7100, 65.0088f }, { 0.0015f, 0, 10.0f }, { .0031f, 18469, 24.9912f } };
TestRebalance_fn ( dData4, sizeof ( dData4 ) / sizeof ( tstcase ), 3 );
}

Expand Down Expand Up @@ -2030,6 +2030,11 @@ TEST ( functions, VectorEx )

}

#ifdef _WIN32
#pragma warning(push) // store current warning values
#pragma warning(disable:4101)
#endif

TEST ( functions, wider_and_widest )
{
WIDER<BYTE,DWORD>::T VARIABLE_IS_NOT_USED dw;
Expand All @@ -2045,6 +2050,10 @@ TEST ( functions, wider_and_widest )
ASSERT_EQ ( sizeof ( pchar ), sizeof ( char* ) );
}

#ifdef _WIN32
#pragma warning(pop) // restore warnings
#endif

TEST ( functions, warner_c )
{
Warner_c sMsg;
Expand Down
2 changes: 1 addition & 1 deletion src/gtests_searchd.cpp
Expand Up @@ -34,7 +34,7 @@ void ThdSearch ( void * )
ARRAY_FOREACH ( i, g_dLocals )
{
auto pDesc = GetTestLocal ( g_dLocals[i] );
bool bGot = pDesc;
bool bGot = pDesc!=nullptr;

// check that it exists
if ( !bGot )
Expand Down
2 changes: 1 addition & 1 deletion src/gtests_searchdaemon.cpp
Expand Up @@ -173,7 +173,7 @@ class T_ConfigureMultiAgent : protected tstlogger, public ::testing::Test
g_bHostnameLookup = true;
const char * pTest = sInExpr;
auto pResult = ConfigureMultiAgent ( pTest, "tstidx", tAgentOptions );
EXPECT_EQ ( (bool)pResult, bExpectedResult ) << sInExpr;
EXPECT_EQ ( pResult!=nullptr, bExpectedResult ) << sInExpr;
return pResult;
}

Expand Down

0 comments on commit a876222

Please sign in to comment.