From 27472cd394cfd173d29851d6d41749dcc2d0c5bd Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Wed, 2 Sep 2015 18:53:36 +0000 Subject: QPID-6717: Unit tests to demonstrate the issue (or not!) git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1700867 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/tests/Selector.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'qpid/cpp/src/tests') diff --git a/qpid/cpp/src/tests/Selector.cpp b/qpid/cpp/src/tests/Selector.cpp index 73af1a9623..7d6dbf0010 100644 --- a/qpid/cpp/src/tests/Selector.cpp +++ b/qpid/cpp/src/tests/Selector.cpp @@ -419,8 +419,25 @@ QPID_AUTO_TEST_CASE(comparisonEval) 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("1 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)); + BOOST_CHECK(!qb::Selector("'hello kitty' BETWEEN 30 and 40").eval(env)); + BOOST_CHECK(qb::Selector("'hello kitty' NOT BETWEEN 30 and 40").eval(env)); + BOOST_CHECK(!qb::Selector("14 BETWEEN 'aardvark' and 'zebra'").eval(env)); + BOOST_CHECK(qb::Selector("14 NOT BETWEEN 'aardvark' and 'zebra'").eval(env)); + BOOST_CHECK(!qb::Selector("TRUE BETWEEN 'aardvark' and 'zebra'").eval(env)); + BOOST_CHECK(qb::Selector("TRUE NOT BETWEEN 'aardvark' and 'zebra'").eval(env)); + BOOST_CHECK(qb::Selector("(A BETWEEN 'aardvark' and 14) IS NULL").eval(env)); + BOOST_CHECK(qb::Selector("(A NOT BETWEEN 'aardvark' and 14) IS NULL").eval(env)); + BOOST_CHECK(qb::Selector("(14 BETWEEN A and 17) IS NULL").eval(env)); + BOOST_CHECK(qb::Selector("(14 NOT BETWEEN A and 17) IS NULL").eval(env)); + BOOST_CHECK(qb::Selector("(14 BETWEEN 11 and A) IS NULL").eval(env)); + BOOST_CHECK(qb::Selector("(14 NOT BETWEEN 11 and A) IS NULL").eval(env)); + BOOST_CHECK(qb::Selector("14 NOT BETWEEN 11 and 9").eval(env)); + BOOST_CHECK(qb::Selector("14 BETWEEN -11 and 54367").eval(env)); } QPID_AUTO_TEST_CASE(NullEval) -- cgit v1.2.1