Skip to content
Snippets Groups Projects
Commit 7d6257ec authored by Andrea Orlati's avatar Andrea Orlati Committed by GitHub
Browse files

fix issue #551: a test in real system should be done but I'm confident this will fix it. (#552)

parent d130808b
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,7 @@ public: ...@@ -23,7 +23,7 @@ public:
} }
::testing::AssertionResult string_checkSplit() { ::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 base("That is a test string that must be split");
IRA::CString token("is"); IRA::CString token("is");
IRA::CString split1,split2; IRA::CString split1,split2;
...@@ -44,6 +44,27 @@ public: ...@@ -44,6 +44,27 @@ public:
return ::testing::AssertionSuccess(); 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: protected:
virtual void SetUp() { virtual void SetUp() {
} }
......
...@@ -86,6 +86,10 @@ TEST_F(IRALibrary_String,string_checkSplit) { ...@@ -86,6 +86,10 @@ TEST_F(IRALibrary_String,string_checkSplit) {
EXPECT_TRUE(string_checkSplit()); EXPECT_TRUE(string_checkSplit());
} }
TEST_F(IRALibrary_String,string_Find) {
EXPECT_TRUE(string_Find());
}
TEST_F(IRALibrary_BaseConverter,decToBin_checkConversion) { TEST_F(IRALibrary_BaseConverter,decToBin_checkConversion) {
EXPECT_TRUE(decToBin_checkConversion()); EXPECT_TRUE(decToBin_checkConversion());
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "Tone.h" #include "Tone.h"
#define IS_LO_AVAIL m_configuration.getLocalOscillatorInstance()!="" #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; //_IRA_LOGFILTER_IMPORT;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment