void run() { create(); BSONObjSetDefaultOrder keys; id().getKeysFromObject( fromjson( "{a:[1,2]}" ), keys ); checkSize( 1, keys ); assertEquals( nullObj(), *keys.begin() ); }
void run() { create(); BSONObjSetDefaultOrder keys; id().getKeysFromObject( BSON( "b" << 1 ), keys ); checkSize( 1, keys ); assertEquals( nullObj(), *keys.begin() ); }
void run() { create(); vector< BSONObj > elts; BSONObjBuilder s; s.append( "foo", 41 ); for ( int i = 1; i < 4; ++i ) elts.push_back( s.done() ); BSONObjBuilder b; b.append( "a", elts ); BSONObjSetDefaultOrder keys; id().getKeysFromObject( b.done(), keys ); checkSize( 1, keys ); assertEquals( nullObj(), *keys.begin() ); }
boost::intrusive_ptr<tObj> pEngine::CreatePointObj(float rad,boost::intrusive_ptr<tObj> home,D3DXVECTOR3 delta, int idGroup){ boost::intrusive_ptr<tFormations> tmpObj(new tFormations); tmpObj->home=home; // пустой объект boost::intrusive_ptr<tObj> nullObj(new tObj); nullObj->pos=home->pos+delta; nullObj->tx=D3DXVECTOR3(1,0,0); nullObj->ty=D3DXVECTOR3(0,1,0); nullObj->tz=D3DXVECTOR3(0,0,1); nullObj->radius=rad; nullObj->gRes=0; //********************* tmpObj->obj=nullObj; tmpObj->delta=delta; tmpObj->idGroup=idGroup; formationsObjList.push_back(tmpObj); return nullObj; }
void run() { create(); vector< BSONObj > elts; BSONObjBuilder s; s.append( "foo", 41 ); elts.push_back( s.obj() ); for ( int i = 1; i < 4; ++i ) elts.push_back( simpleBC( i ) ); BSONObjBuilder b; b.append( "a", elts ); BSONObjSetDefaultOrder keys; id().getKeysFromObject( b.done(), keys ); checkSize( 4, keys ); BSONObjSetDefaultOrder::iterator i = keys.begin(); assertEquals( nullObj(), *i++ ); for ( int j = 1; j < 4; ++i, ++j ) { BSONObjBuilder b; b.append( "", j ); assertEquals( b.obj(), *i ); } }