allow for creation of a queue with no name, added auto test for validation
This commit is contained in:
parent
60167321a9
commit
50a588e678
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in New Issue