예제 #1
0
TEST_F(MessageTest, assignmentOperator_Test)
{
    QMQTT::Message originalMessage(5, "topic", "payload", 5, true, true);
    QMQTT::Message copy;

    copy = originalMessage;

    EXPECT_EQ(5, copy.id());
    EXPECT_EQ(5, copy.qos());
    EXPECT_TRUE(copy.retain());
    EXPECT_TRUE(copy.dup());
    EXPECT_EQ(QString("topic"), copy.topic());
    EXPECT_EQ(QByteArray("payload"), copy.payload());
}
예제 #2
0
void MainWindow::onMQTT_Received(const QMQTT::Message &message)
{
    log(tr("message recevied from %1: qos=%2").arg(message.topic()).arg(message.qos()));
    log(message.payload());
}