Commit 2cbb97a1 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

unittest: Split alpha ordering checks in a separated function

(cherry picked from commit 3f2623ae)
Signed-off-by: default avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent 2c19d681
......@@ -39,6 +39,16 @@
namespace
{
auto constexpr NbTriggers = 35u;
bool checkAlphaOrderedVector( const std::vector<const char*> in )
{
for ( auto i = 0u; i < in.size() - 1; i++ )
{
if ( strcmp( in[i], in[i + 1] ) >= 0 )
return false;
}
return true;
}
}
class Misc : public Tests
......@@ -48,10 +58,8 @@ class Misc : public Tests
TEST_F( Misc, FileExtensions )
{
const auto supportedExtensions = ml->getSupportedExtensions();
for ( auto i = 0u; i < supportedExtensions.size() - 1; i++ )
{
ASSERT_LT( strcmp( supportedExtensions[i], supportedExtensions[i + 1] ), 0 );
}
auto res = checkAlphaOrderedVector( supportedExtensions );
ASSERT_TRUE( res );
}
TEST_F( Misc, TrimString )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment