diff options
Diffstat (limited to 'dbtests/updatetests.cpp')
-rw-r--r-- | dbtests/updatetests.cpp | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/dbtests/updatetests.cpp b/dbtests/updatetests.cpp index 09caae6..17f861e 100644 --- a/dbtests/updatetests.cpp +++ b/dbtests/updatetests.cpp @@ -17,7 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "stdafx.h" +#include "pch.h" #include "../db/query.h" #include "../db/db.h" @@ -678,6 +678,55 @@ namespace UpdateTests { }; + class inc3 : public SingleTest { + virtual BSONObj initial(){ + return BSON( "_id" << 1 << "x" << 537142123123LL ); + } + virtual BSONObj mod(){ + return BSON( "$inc" << BSON( "x" << 2 ) ); + } + virtual BSONObj after(){ + return BSON( "_id" << 1 << "x" << 537142123125LL ); + } + virtual const char * ns(){ + return "unittests.inc2"; + } + + }; + + class inc4 : public SingleTest { + virtual BSONObj initial(){ + return BSON( "_id" << 1 << "x" << 537142123123LL ); + } + virtual BSONObj mod(){ + return BSON( "$inc" << BSON( "x" << 2LL ) ); + } + virtual BSONObj after(){ + return BSON( "_id" << 1 << "x" << 537142123125LL ); + } + virtual const char * ns(){ + return "unittests.inc2"; + } + + }; + + class inc5 : public SingleTest { + virtual BSONObj initial(){ + return BSON( "_id" << 1 << "x" << 537142123123LL ); + } + virtual BSONObj mod(){ + return BSON( "$inc" << BSON( "x" << 2.0 ) ); + } + virtual BSONObj after(){ + return BSON( "_id" << 1 << "x" << 537142123125LL ); + } + virtual const char * ns(){ + return "unittests.inc2"; + } + + }; + + class bit1 : public Base { const char * ns(){ return "unittests.bit1"; @@ -775,6 +824,9 @@ namespace UpdateTests { add< basic::inc1 >(); add< basic::inc2 >(); + add< basic::inc3 >(); + add< basic::inc4 >(); + add< basic::inc5 >(); add< basic::bit1 >(); add< basic::unset >(); add< basic::setswitchint >(); |