diff options
author | Andrew Morrow <acm@mongodb.com> | 2015-06-10 18:08:48 -0400 |
---|---|---|
committer | Andrew Morrow <acm@mongodb.com> | 2015-06-10 22:37:49 -0400 |
commit | d7d1fdb75966c684e9a42150e6e9b69c4a10ee08 (patch) | |
tree | d28b0767cbd8c1a09535f1676152e7ac57e829ce /src/mongo/db/matcher/expression_parser_leaf_test.cpp | |
parent | a9b6612f5322f916298c19a6728817a1034c6aab (diff) | |
download | mongo-d7d1fdb75966c684e9a42150e6e9b69c4a10ee08.tar.gz |
SERVER-17308 Replace boost::scoped_ptr<T> with std::unique_ptr<T>
Diffstat (limited to 'src/mongo/db/matcher/expression_parser_leaf_test.cpp')
-rw-r--r-- | src/mongo/db/matcher/expression_parser_leaf_test.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/mongo/db/matcher/expression_parser_leaf_test.cpp b/src/mongo/db/matcher/expression_parser_leaf_test.cpp index f0ef78ae40c..10655322580 100644 --- a/src/mongo/db/matcher/expression_parser_leaf_test.cpp +++ b/src/mongo/db/matcher/expression_parser_leaf_test.cpp @@ -49,7 +49,7 @@ namespace mongo { BSONObj query = BSON( "x" << BSON( "$eq" << 2 ) ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); ASSERT( !result.getValue()->matchesBSON( BSON( "x" << 1 ) ) ); ASSERT( result.getValue()->matchesBSON( BSON( "x" << 2 ) ) ); @@ -66,7 +66,7 @@ namespace mongo { BSONObj query = BSON( "x" << BSON( "$gt" << 2 ) ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); ASSERT( !result.getValue()->matchesBSON( BSON( "x" << 2 ) ) ); ASSERT( result.getValue()->matchesBSON( BSON( "x" << 3 ) ) ); @@ -76,7 +76,7 @@ namespace mongo { BSONObj query = BSON( "x" << BSON( "$lt" << 2 ) ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); ASSERT( result.getValue()->matchesBSON( BSON( "x" << 1 ) ) ); ASSERT( !result.getValue()->matchesBSON( BSON( "x" << 2 ) ) ); @@ -87,7 +87,7 @@ namespace mongo { BSONObj query = BSON( "x" << BSON( "$gte" << 2 ) ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); ASSERT( !result.getValue()->matchesBSON( BSON( "x" << 1 ) ) ); ASSERT( result.getValue()->matchesBSON( BSON( "x" << 2 ) ) ); @@ -98,7 +98,7 @@ namespace mongo { BSONObj query = BSON( "x" << BSON( "$lte" << 2 ) ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); ASSERT( result.getValue()->matchesBSON( BSON( "x" << 1 ) ) ); ASSERT( result.getValue()->matchesBSON( BSON( "x" << 2 ) ) ); @@ -109,7 +109,7 @@ namespace mongo { BSONObj query = BSON( "x" << BSON( "$ne" << 2 ) ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); ASSERT( result.getValue()->matchesBSON( BSON( "x" << 1 ) ) ); ASSERT( !result.getValue()->matchesBSON( BSON( "x" << 2 ) ) ); @@ -120,7 +120,7 @@ namespace mongo { BSONObj query = BSON( "x" << BSON( "$mod" << BSON_ARRAY( 3 << 2 ) ) ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy1(result.getValue()); + std::unique_ptr<MatchExpression> destroy1(result.getValue()); query = BSON( "x" << BSON( "$mod" << BSON_ARRAY( 3 ) ) ); result = MatchExpressionParser::parse( query ); @@ -147,7 +147,7 @@ namespace mongo { BSONObj query = BSON( "x" << BSON( "$mod" << BSON_ARRAY( 3 << 2 ) ) ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); ASSERT( result.getValue()->matchesBSON( BSON( "x" << 5 ) ) ); ASSERT( !result.getValue()->matchesBSON( BSON( "x" << 4 ) ) ); @@ -158,7 +158,7 @@ namespace mongo { BSONObj query = BSON( "x" << BSON( "$mod" << BSON_ARRAY( 2 << "r" ) ) ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); ASSERT( result.getValue()->matchesBSON( BSON( "x" << 2 ) ) ); ASSERT( result.getValue()->matchesBSON( BSON( "x" << 4 ) ) ); @@ -171,7 +171,7 @@ namespace mongo { BSONObj query = BSON( "x" << BSON( "$in" << BSON_ARRAY( 2 << 3 ) ) ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); ASSERT( !result.getValue()->matchesBSON( BSON( "x" << 1 ) ) ); ASSERT( result.getValue()->matchesBSON( BSON( "x" << 2 ) ) ); @@ -185,7 +185,7 @@ namespace mongo { BSON( "$ref" << "coll" << "$id" << oid << "$db" << "db" ) ) ) ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); OID oidx = OID::gen(); ASSERT( !result.getValue()->matchesBSON( @@ -222,7 +222,7 @@ namespace mongo { BSON( "$ref" << "coll" << "$id" << oid << "$db" << "db" ) ) ) ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); OID oidx = OID::gen(); ASSERT( !result.getValue()->matchesBSON( @@ -285,7 +285,7 @@ namespace mongo { BSON( "$ref" << "coll" << "$id" << oid << "foo" << 12345 ) ) ) ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); OID oidx = OID::gen(); ASSERT( !result.getValue()->matchesBSON( @@ -384,7 +384,7 @@ namespace mongo { BSONObj query = BSON( "a" << operand.obj() ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); BSONObj matchFirst = BSON( "a" << "ax" ); BSONObj matchFirstRegex = BSONObjBuilder().appendRegex( "a", "^a", "" ).obj(); @@ -407,7 +407,7 @@ namespace mongo { BSONObj query = BSON( "x" << BSON( "$nin" << BSON_ARRAY( 2 << 3 ) ) ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); ASSERT( result.getValue()->matchesBSON( BSON( "x" << 1 ) ) ); ASSERT( !result.getValue()->matchesBSON( BSON( "x" << 2 ) ) ); @@ -427,7 +427,7 @@ namespace mongo { BSONObj query = b.obj(); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); ASSERT( result.getValue()->matchesBSON( BSON( "x" << "abc" ) ) ); ASSERT( result.getValue()->matchesBSON( BSON( "x" << "ABC" ) ) ); @@ -438,7 +438,7 @@ namespace mongo { BSONObj query = BSON( "x" << BSON( "$regex" << "abc" << "$options" << "i" ) ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); ASSERT( result.getValue()->matchesBSON( BSON( "x" << "abc" ) ) ); ASSERT( result.getValue()->matchesBSON( BSON( "x" << "ABC" ) ) ); @@ -450,7 +450,7 @@ namespace mongo { StatusWithMatchExpression result = MatchExpressionParser::parse( query ); log() << "result: " << result.getStatus() << endl; ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); ASSERT( result.getValue()->matchesBSON( BSON( "x" << "abc" ) ) ); ASSERT( result.getValue()->matchesBSON( BSON( "x" << "ABC" ) ) ); @@ -487,7 +487,7 @@ namespace mongo { BSONObj query = BSON( "x" << b.obj() ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); ASSERT( result.getValue()->matchesBSON( BSON( "x" << "abc" ) ) ); ASSERT( !result.getValue()->matchesBSON( BSON( "y" << "AC" ) ) ); @@ -499,7 +499,7 @@ namespace mongo { BSONObj query = BSON( "x" << b.obj() ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); ASSERT( !result.getValue()->matchesBSON( BSON( "x" << "abc" ) ) ); ASSERT( result.getValue()->matchesBSON( BSON( "y" << "AC" ) ) ); @@ -509,7 +509,7 @@ namespace mongo { BSONObj query = BSON( "x" << BSON( "$type" << String ) ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); ASSERT( result.getValue()->matchesBSON( BSON( "x" << "abc" ) ) ); ASSERT( !result.getValue()->matchesBSON( BSON( "x" << 5 ) ) ); @@ -519,7 +519,7 @@ namespace mongo { BSONObj query = BSON( "x" << BSON( "$type" << (double)NumberDouble ) ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); ASSERT( result.getValue()->matchesBSON( BSON( "x" << 5.3 ) ) ); ASSERT( !result.getValue()->matchesBSON( BSON( "x" << 5 ) ) ); @@ -529,7 +529,7 @@ namespace mongo { BSONObj query = BSON( "x" << BSON( "$type" << 1.5 ) ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); ASSERT( !result.getValue()->matchesBSON( BSON( "x" << 5.3 ) ) ); ASSERT( !result.getValue()->matchesBSON( BSON( "x" << 5 ) ) ); @@ -539,7 +539,7 @@ namespace mongo { BSONObj query = BSON( "x" << BSON( "$type" << jstNULL ) ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); ASSERT( !result.getValue()->matchesBSON( BSONObj() ) ); ASSERT( !result.getValue()->matchesBSON( BSON( "x" << 5 ) ) ); @@ -554,7 +554,7 @@ namespace mongo { BSONObj query = BSON( "x" << b.obj() ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - boost::scoped_ptr<MatchExpression> destroy(result.getValue()); + std::unique_ptr<MatchExpression> destroy(result.getValue()); ASSERT( !result.getValue()->matchesBSON( BSON( "x" << 5.3 ) ) ); ASSERT( !result.getValue()->matchesBSON( BSON( "x" << 5 ) ) ); |