You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2015/09/02 20:53:36 UTC

svn commit: r1700867 - /qpid/trunk/qpid/cpp/src/tests/Selector.cpp

Author: astitcher
Date: Wed Sep  2 18:53:36 2015
New Revision: 1700867

URL: http://svn.apache.org/r1700867
Log:
QPID-6717: Unit tests to demonstrate the issue (or not!)

Modified:
    qpid/trunk/qpid/cpp/src/tests/Selector.cpp

Modified: qpid/trunk/qpid/cpp/src/tests/Selector.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/Selector.cpp?rev=1700867&r1=1700866&r2=1700867&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/Selector.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/Selector.cpp Wed Sep  2 18:53:36 2015
@@ -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)



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org