libNbiotCore/test/serial_test.cpp
// Tests that assignment operator copies original content and assigned object is independent of the original object
Tests that assignment operator copies original content and assigned object is independent of the original object
Tests that assignment operator copies original content and assigned object is independent of the original object
TEST(SerialTest, SerialAssignmentOperator) {
    int dbgprf = 1;
    Serial s(dbgprf);
    Serial s_copy;
    s_copy = s;
    EXPECT_EQ(s.getDebugPrefix(), s_copy.getDebugPrefix());
    EXPECT_EQ(s.getError(), s_copy.getError());
    s_copy.setDebugPrefix(dbgprf + 1);
    EXPECT_NE(s.getDebugPrefix(), s_copy.getDebugPrefix());
    s_copy.configSetReadByte(nullptr);
    EXPECT_NE(s.getError(), s_copy.getError());
}
TEST ( SerialTest , SerialAssignmentOperator ) { int dbgprf = 1 ; Serial s ( dbgprf ) ; Serial s_copy ; s_copy = s ; EXPECT_EQ ( s . getDebugPrefix ( ) , s_copy . getDebugPrefix ( ) ) ; EXPECT_EQ ( s . getError ( ) , s_copy . getError ( ) ) ; s_copy . setDebugPrefix ( dbgprf + 1 ) ; EXPECT_NE ( s . getDebugPrefix ( ) , s_copy . getDebugPrefix ( ) ) ; s_copy . configSetReadByte ( nullptr ) ; EXPECT_NE ( s . getError ( ) , s_copy . getError ( ) ) ; }
Tests that assignment operator copies original content and assigned object is independent of the original object
Tests that assignment operator copies original content and assigned object is independent of the original object