libNbiotCore/test/serial_test.cpp
// Tests that URC filters can be added and removed.
Tests that URC filters can be added and removed.
Tests that URC filters can be added and removed .
TEST_F(SerialFixture, AddingAndRemovingUrcFilter) {
    Serial s;
    MockUrcCallback UHC;
    ASSERT_TRUE(s.addUrcFilter("+NSOMNI", do_nothing))
                                << "Failed to add URC Filter with free callback function.";
    ASSERT_FALSE(s.addUrcFilter<MockUrcCallback>("+NSOMNI", &UHC, &MockUrcCallback::do_nothing))
                                << "Failed to add already existing URC Filter with member method.";
    ASSERT_TRUE(s.hasFilter()) << "No filter was added.";
    s.removeUrcFilter("+NSOMNI");
    EXPECT_FALSE(s.hasFilter()) << "Failed to remove URC Filter.";
    ASSERT_TRUE(s.addUrcFilter("+NSOMNI", do_nothing))
                                << "Failed to add URC Filter with free callback function.";
    ASSERT_TRUE(s.addUrcFilter<MockUrcCallback>("+NSTAT", &UHC, &MockUrcCallback::do_nothing));
    ASSERT_TRUE(s.hasFilter()) << "Failed to add multiple URC Filter.";
    s.clearFilter();
    EXPECT_FALSE(s.hasFilter()) << "Failed to clear URC FilterList";
}
TEST_F ( SerialFixture , AddingAndRemovingUrcFilter ) { Serial s ; MockUrcCallback UHC ; ASSERT_TRUE ( s . addUrcFilter ( " " , do_nothing ) ) << " " ; ASSERT_FALSE ( s . addUrcFilter < MockUrcCallback > ( " " , & UHC , & MockUrcCallback :: do_nothing ) ) << " " ; ASSERT_TRUE ( s . hasFilter ( ) ) << " " ; s . removeUrcFilter ( " " ) ; EXPECT_FALSE ( s . hasFilter ( ) ) << " " ; ASSERT_TRUE ( s . addUrcFilter ( " " , do_nothing ) ) << " " ; ASSERT_TRUE ( s . addUrcFilter < MockUrcCallback > ( " " , & UHC , & MockUrcCallback :: do_nothing ) ) ; ASSERT_TRUE ( s . hasFilter ( ) ) << " " ; s . clearFilter ( ) ; EXPECT_FALSE ( s . hasFilter ( ) ) << " " ; }
Tests that URC filters can be added and removed.
Tests that URC filters can be added and removed .