From c7500cc5473ab365363527498350abc975fabd67 Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Fri, 4 Sep 2015 17:47:35 +0000 Subject: QPID-6717: Change Selector beaviour and tests to accord with consensus semantics - It seems to be the consensus amongst JMS Selector implementations that the NOT IN expression should return false if none of the types match git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1701301 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/tests/Selector.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'qpid/cpp/src/tests') diff --git a/qpid/cpp/src/tests/Selector.cpp b/qpid/cpp/src/tests/Selector.cpp index d512476f8b..6995420f17 100644 --- a/qpid/cpp/src/tests/Selector.cpp +++ b/qpid/cpp/src/tests/Selector.cpp @@ -450,11 +450,19 @@ QPID_AUTO_TEST_CASE(comparisonEval) BOOST_CHECK(qb::Selector("20 >= 19.0 and 20 > 19").eval(env)); BOOST_CHECK(qb::Selector("42 <= 42.0 and 37.0 >= 37").eval(env)); BOOST_CHECK(qb::Selector("(A IN ('hello', 'there', 1 , true, (1-17))) IS NULL").eval(env)); + BOOST_CHECK(qb::Selector("(-16 IN ('hello', A, 'there', true)) IS NULL").eval(env)); + BOOST_CHECK(qb::Selector("(-16 NOT IN ('hello', 'there', A, true)) IS NULL").eval(env)); + BOOST_CHECK(qb::Selector("(-16 IN ('hello', 'there', true)) IS NOT NULL").eval(env)); + BOOST_CHECK(!qb::Selector("-16 IN ('hello', 'there', true)").eval(env)); + BOOST_CHECK(qb::Selector("(-16 NOT IN ('hello', 'there', true)) IS NOT NULL").eval(env)); + BOOST_CHECK(!qb::Selector("-16 NOT IN ('hello', 'there', true)").eval(env)); + BOOST_CHECK(qb::Selector("(-16 NOT IN ('hello', 'there', A, 1 , true)) IS NULL").eval(env)); BOOST_CHECK(qb::Selector("'hello' IN ('hello', 'there', 1 , true, (1-17))").eval(env)); BOOST_CHECK(qb::Selector("TRUE IN ('hello', 'there', 1 , true, (1-17))").eval(env)); BOOST_CHECK(qb::Selector("-16 IN ('hello', 'there', 1 , true, (1-17))").eval(env)); + BOOST_CHECK(!qb::Selector("-16 NOT IN ('hello', 'there', 1 , true, (1-17))").eval(env)); BOOST_CHECK(!qb::Selector("1 IN ('hello', 'there', 'polly')").eval(env)); - BOOST_CHECK(qb::Selector("1 NOT IN ('hello', 'there', 'polly')").eval(env)); + BOOST_CHECK(!qb::Selector("1 NOT IN ('hello', 'there', 'polly')").eval(env)); BOOST_CHECK(!qb::Selector("'hell' IN ('hello', 'there', 1 , true, (1-17))").eval(env)); BOOST_CHECK(qb::Selector("('hell' IN ('hello', 'there', 1 , true, (1-17), A)) IS NULL").eval(env)); BOOST_CHECK(qb::Selector("('hell' NOT IN ('hello', 'there', 1 , true, (1-17), A)) IS NULL").eval(env)); -- cgit v1.2.1