From 50a588e678aadc0c085c5523d6752adfd945361e Mon Sep 17 00:00:00 2001 From: Matt Broadstone Date: Mon, 9 Jun 2014 14:07:13 -0400 Subject: [PATCH] allow for creation of a queue with no name, added auto test for validation --- src/amqp_queue.cpp | 5 ----- tests/auto/qamqpqueue/tst_qamqpqueue.cpp | 12 ++++++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/amqp_queue.cpp b/src/amqp_queue.cpp index 653e1b0..43dce77 100644 --- a/src/amqp_queue.cpp +++ b/src/amqp_queue.cpp @@ -207,11 +207,6 @@ void QueuePrivate::deliver(const Frame::Method &frame) void QueuePrivate::declare() { - if (name.isEmpty()) { - qAmqpDebug() << Q_FUNC_INFO << "can't declare queue with no name"; - return; - } - Frame::Method frame(Frame::fcQueue, QueuePrivate::miDeclare); frame.setChannel(channelNumber); diff --git a/tests/auto/qamqpqueue/tst_qamqpqueue.cpp b/tests/auto/qamqpqueue/tst_qamqpqueue.cpp index 8fc77fd..603e0cf 100644 --- a/tests/auto/qamqpqueue/tst_qamqpqueue.cpp +++ b/tests/auto/qamqpqueue/tst_qamqpqueue.cpp @@ -19,6 +19,8 @@ private Q_SLOTS: void standardExchanges_data(); void standardExchanges(); + void unnamedQueue(); + void remove(); void removeIfUnused(); void unbind(); @@ -90,6 +92,16 @@ void tst_QAMQPQueue::standardExchanges() QCOMPARE(queue->getMessage().payload(), QByteArray("test message")); } +void tst_QAMQPQueue::unnamedQueue() +{ + Queue *queue = client->createQueue(); + queue->declare(); + QVERIFY(waitForSignal(queue, SIGNAL(declared()))); + queue->consume(); + + QVERIFY(!queue->name().isEmpty()); +} + void tst_QAMQPQueue::remove() { Queue *queue = client->createQueue("test-remove");