From a06fd679e0a0d7f038fbff10003d6f8f61ea2257 Mon Sep 17 00:00:00 2001 From: Robert Manner Date: Fri, 25 May 2018 09:38:02 +0200 Subject: [PATCH] tests/qampqpexchange: skip test if rabbitmq does not support reject publish References: jira PAM-5269 --- tests/auto/qamqpexchange/tst_qamqpexchange.cpp | 5 +++++ tests/common/qamqptestcase.h | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/tests/auto/qamqpexchange/tst_qamqpexchange.cpp b/tests/auto/qamqpexchange/tst_qamqpexchange.cpp index 9683244..14c2ceb 100644 --- a/tests/auto/qamqpexchange/tst_qamqpexchange.cpp +++ b/tests/auto/qamqpexchange/tst_qamqpexchange.cpp @@ -285,6 +285,11 @@ void tst_QAMQPExchange::testRejectedMessagePublish() QVERIFY(exchange->waitForConfirms()); + if (deliveryConfirmedSpy.count() == 2) + { + SKIP("The AMQP server does not support x-overflow: reject-publish. For rabbitmq, it requires version >=3.7 (Skipped test)"); + } + QCOMPARE(deliveryConfirmedSpy.count(), 1); QCOMPARE(deliveryConfirmedSpy.first().first().toLongLong(), firstDeliveryTag); diff --git a/tests/common/qamqptestcase.h b/tests/common/qamqptestcase.h index 78a8b70..05ca0f0 100644 --- a/tests/common/qamqptestcase.h +++ b/tests/common/qamqptestcase.h @@ -6,6 +6,12 @@ #include "qamqpqueue.h" +#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) +#define SKIP(x) QSKIP(x) +#else +#define SKIP(x) QSKIP(x, SkipAll) +#endif + class TestCase : public QObject { public: