Added loose function tokenCOntainsStar to StarToken.cpp

This commit is contained in:
Joakim Hove 2013-10-14 21:24:03 +02:00
parent f38cd79839
commit dabfdb922b
3 changed files with 20 additions and 1 deletions

View File

@ -26,6 +26,15 @@
namespace Opm {
bool tokenContainsStar(const std::string& token) {
if (token.find('*') == std::string::npos)
return false;
else
return true;
}
template <>
int readValueToken(const std::string& valueToken) {
@ -51,5 +60,7 @@ namespace Opm {
std::string readValueToken(const std::string& valueToken) {
return valueToken;
}
}

View File

@ -28,7 +28,8 @@
namespace Opm {
bool tokenContainsStar(const std::string& token);
template <class T>
T readValueToken(const std::string& valueToken) {
return 0;

View File

@ -113,3 +113,10 @@ BOOST_AUTO_TEST_CASE(CorrectStringValue) {
BOOST_AUTO_TEST_CASE( ContainsStar_WithStar_ReturnsTrue ) {
BOOST_CHECK_EQUAL( true , Opm::tokenContainsStar("*") );
BOOST_CHECK_EQUAL( true , Opm::tokenContainsStar("1*") );
BOOST_CHECK_EQUAL( true , Opm::tokenContainsStar("1*2") );
BOOST_CHECK_EQUAL( false , Opm::tokenContainsStar("12") );
}