diff --git a/Common/Libraries/IRALibrary/tests/CString_test.i b/Common/Libraries/IRALibrary/tests/CString_test.i index d761e4facdaa31322310eec1db89bf13d186c7c3..e469bdbe11a504e1d340df8365aad1a0a6bd91ea 100644 --- a/Common/Libraries/IRALibrary/tests/CString_test.i +++ b/Common/Libraries/IRALibrary/tests/CString_test.i @@ -23,7 +23,7 @@ public: } ::testing::AssertionResult string_checkSplit() { - RecordProperty("description","check the how CString handle string splitting"); + RecordProperty("description","check how CString handle string splitting"); IRA::CString base("That is a test string that must be split"); IRA::CString token("is"); IRA::CString split1,split2; @@ -42,7 +42,28 @@ public: << (const char *)split2 << "' instead of ' a test string that must be split'"; } return ::testing::AssertionSuccess(); - } + } + + ::testing::AssertionResult string_Find() { + RecordProperty("description","check the bug emerged"); + IRA::CString search("KKC QQC CCC MMC"); + IRA::CString failToken("XXP"); + IRA::CString successToken("QQC"); + IRA::CString bugToken("KKC"); + int pos=search.Find(failToken); + if (pos>0) { + return ::testing::AssertionFailure() << "result should be negative as the string is not present"; + } + pos=search.Find(successToken); + if (pos<=0) { + return ::testing::AssertionFailure() << "result should be positive as the string is present"; + } + pos=search.Find(bugToken); + if (pos!=0) { + return ::testing::AssertionFailure() << "result should be zero as the string start with first char"; + } + return ::testing::AssertionSuccess(); + } protected: virtual void SetUp() { diff --git a/Common/Libraries/IRALibrary/tests/unittest.cpp b/Common/Libraries/IRALibrary/tests/unittest.cpp index 846f79260cdfb678daeb17a4a5c7cc5252a609a8..54ac4431a2623b1f4ca8a1cffdbe0f286c22070d 100644 --- a/Common/Libraries/IRALibrary/tests/unittest.cpp +++ b/Common/Libraries/IRALibrary/tests/unittest.cpp @@ -86,6 +86,10 @@ TEST_F(IRALibrary_String,string_checkSplit) { EXPECT_TRUE(string_checkSplit()); } +TEST_F(IRALibrary_String,string_Find) { + EXPECT_TRUE(string_Find()); +} + TEST_F(IRALibrary_BaseConverter,decToBin_checkConversion) { EXPECT_TRUE(decToBin_checkConversion()); } diff --git a/Noto/Servers/NotoReceivers/src/ComponentCore.cpp b/Noto/Servers/NotoReceivers/src/ComponentCore.cpp index 536599e3111157dc8886898bc5ce2bcfbf039986..0c3b7b44374c629a2745c8363101c2989cc5a7f6 100644 --- a/Noto/Servers/NotoReceivers/src/ComponentCore.cpp +++ b/Noto/Servers/NotoReceivers/src/ComponentCore.cpp @@ -3,7 +3,7 @@ #include "Tone.h" #define IS_LO_AVAIL m_configuration.getLocalOscillatorInstance()!="" -#define IS_LO_TUNABLE m_configuration.getLocalOscillatorEnabledReceivers().Find(m_setup)>0 +#define IS_LO_TUNABLE m_configuration.getLocalOscillatorEnabledReceivers().Find(m_setup)>=0 //_IRA_LOGFILTER_IMPORT;