diff options
Diffstat (limited to 'src/mongo/dbtests')
-rw-r--r-- | src/mongo/dbtests/matchertests.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/mongo/dbtests/matchertests.cpp b/src/mongo/dbtests/matchertests.cpp index 2d009406e24..f700a6f1ba4 100644 --- a/src/mongo/dbtests/matchertests.cpp +++ b/src/mongo/dbtests/matchertests.cpp @@ -57,7 +57,7 @@ class Basic { public: void run() { BSONObj query = fromjson("{\"a\":\"b\"}"); - M m(query, MatchExpressionParser::ExtensionsCallback()); + M m(query, ExtensionsCallback()); ASSERT(m.matches(fromjson("{\"a\":\"b\"}"))); } }; @@ -67,7 +67,7 @@ class DoubleEqual { public: void run() { BSONObj query = fromjson("{\"a\":5}"); - M m(query, MatchExpressionParser::ExtensionsCallback()); + M m(query, ExtensionsCallback()); ASSERT(m.matches(fromjson("{\"a\":5}"))); } }; @@ -78,7 +78,7 @@ public: void run() { BSONObjBuilder query; query.append("a", 5); - M m(query.done(), MatchExpressionParser::ExtensionsCallback()); + M m(query.done(), ExtensionsCallback()); ASSERT(m.matches(fromjson("{\"a\":5}"))); } }; @@ -88,7 +88,7 @@ class MixedNumericGt { public: void run() { BSONObj query = fromjson("{\"a\":{\"$gt\":4}}"); - M m(query, MatchExpressionParser::ExtensionsCallback()); + M m(query, ExtensionsCallback()); BSONObjBuilder b; b.append("a", 5); ASSERT(m.matches(b.done())); @@ -103,7 +103,7 @@ public: ASSERT_EQUALS(4, query["a"].embeddedObject()["$in"].embeddedObject()["0"].number()); ASSERT_EQUALS(NumberInt, query["a"].embeddedObject()["$in"].embeddedObject()["0"].type()); - M m(query, MatchExpressionParser::ExtensionsCallback()); + M m(query, ExtensionsCallback()); { BSONObjBuilder b; @@ -130,7 +130,7 @@ template <typename M> class MixedNumericEmbedded { public: void run() { - M m(BSON("a" << BSON("x" << 1)), MatchExpressionParser::ExtensionsCallback()); + M m(BSON("a" << BSON("x" << 1)), ExtensionsCallback()); ASSERT(m.matches(BSON("a" << BSON("x" << 1)))); ASSERT(m.matches(BSON("a" << BSON("x" << 1.0)))); } @@ -140,7 +140,7 @@ template <typename M> class Size { public: void run() { - M m(fromjson("{a:{$size:4}}"), MatchExpressionParser::ExtensionsCallback()); + M m(fromjson("{a:{$size:4}}"), ExtensionsCallback()); ASSERT(m.matches(fromjson("{a:[1,2,3,4]}"))); ASSERT(!m.matches(fromjson("{a:[1,2,3]}"))); ASSERT(!m.matches(fromjson("{a:[1,2,3,'a','b']}"))); @@ -152,8 +152,7 @@ template <typename M> class WithinBox { public: void run() { - M m(fromjson("{loc:{$within:{$box:[{x: 4, y:4},[6,6]]}}}"), - MatchExpressionParser::ExtensionsCallback()); + M m(fromjson("{loc:{$within:{$box:[{x: 4, y:4},[6,6]]}}}"), ExtensionsCallback()); ASSERT(!m.matches(fromjson("{loc: [3,4]}"))); ASSERT(m.matches(fromjson("{loc: [4,4]}"))); ASSERT(m.matches(fromjson("{loc: [5,5]}"))); @@ -167,7 +166,7 @@ class WithinPolygon { public: void run() { M m(fromjson("{loc:{$within:{$polygon:[{x:0,y:0},[0,5],[5,5],[5,0]]}}}"), - MatchExpressionParser::ExtensionsCallback()); + ExtensionsCallback()); ASSERT(m.matches(fromjson("{loc: [3,4]}"))); ASSERT(m.matches(fromjson("{loc: [4,4]}"))); ASSERT(m.matches(fromjson("{loc: {x:5,y:5}}"))); @@ -180,8 +179,7 @@ template <typename M> class WithinCenter { public: void run() { - M m(fromjson("{loc:{$within:{$center:[{x:30,y:30},10]}}}"), - MatchExpressionParser::ExtensionsCallback()); + M m(fromjson("{loc:{$within:{$center:[{x:30,y:30},10]}}}"), ExtensionsCallback()); ASSERT(!m.matches(fromjson("{loc: [3,4]}"))); ASSERT(m.matches(fromjson("{loc: {x:30,y:30}}"))); ASSERT(m.matches(fromjson("{loc: [20,30]}"))); @@ -197,7 +195,7 @@ template <typename M> class ElemMatchKey { public: void run() { - M matcher(BSON("a.b" << 1), MatchExpressionParser::ExtensionsCallback()); + M matcher(BSON("a.b" << 1), ExtensionsCallback()); MatchDetails details; details.requestElemMatchKey(); ASSERT(!details.hasElemMatchKey()); @@ -228,7 +226,7 @@ template <typename M> class TimingBase { public: long dotime(const BSONObj& patt, const BSONObj& obj) { - M m(patt, MatchExpressionParser::ExtensionsCallback()); + M m(patt, ExtensionsCallback()); Timer t; for (int i = 0; i < 900000; i++) { if (!m.matches(obj)) { |