~ubuntu-branches/ubuntu/utopic/mongodb/utopic

« back to all changes in this revision

Viewing changes to src/mongo/dbtests/directclienttests.cpp

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-07-03 09:23:46 UTC
  • mfrom: (1.3.10) (44.1.14 sid)
  • Revision ID: package-import@ubuntu.com-20140703092346-c5bvt46wnzougyly
Tags: 1:2.6.3-0ubuntu1
* New upstream stable release:
  - Dropped patches, included upstream:
    + 0003-All-platforms-but-Windows-find-hash-in-std-tr1.patch
    + 0008-Use-system-libstemmer.patch
    + 0011-Use-a-signed-char-to-store-BSONType-enumerations.patch
    + 0001-SERVER-12064-Atomic-operations-for-gcc-non-Intel-arc.patch
    + 0002-SERVER-12065-Support-ARM-and-AArch64-builds.patch
  - d/p/*: Refreshed/rebased remaining patches.
  - Use system provided libyaml-cpp:
    + d/control: Add libyaml-cpp-dev to BD's.
    + d/rules: Enable --with-system-yaml option.
    + d/p/fix-yaml-detection.patch: Fix detection of libyaml-cpp library.
  - d/mongodb-server.mongodb.upstart: Sync changes from upstream.
  - d/control,mongodb-dev.*: Drop mongodb-dev package; it has no reverse
    dependencies and upstream no longer install header files.
  - d/NEWS: Point users to upstream upgrade documentation for upgrades
    from 2.4 to 2.6.
* Merge from Debian unstable.
* d/control: BD on libv8-3.14-dev to ensure that transitioning to new v8
  versions is a explicit action due to changes in behaviour in >= 3.25
  (LP: #1295723).
* d/mongodb-server.prerm: Dropped debug echo call from maintainer script
  (LP: #1294455).

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 *
16
16
 *    You should have received a copy of the GNU Affero General Public License
17
17
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
 *
 
19
 *    As a special exception, the copyright holders give permission to link the
 
20
 *    code of portions of this program with the OpenSSL library under certain
 
21
 *    conditions as described in each individual source file and distribute
 
22
 *    linked combinations including the program with the OpenSSL library. You
 
23
 *    must comply with the GNU Affero General Public License in all respects
 
24
 *    for all of the code used other than as permitted herein. If you modify
 
25
 *    file(s) with this exception, you may extend this exception to your
 
26
 *    version of the file(s), but you are not obligated to do so. If you do not
 
27
 *    wish to do so, delete this exception statement from your version. If you
 
28
 *    delete this exception statement from all source files in the program,
 
29
 *    then also delete it in the license file.
18
30
 */
19
31
 
20
 
#include "pch.h"
21
 
#include "../db/db.h"
22
 
#include "../db/instance.h"
23
 
#include "../db/json.h"
24
 
#include "../db/lasterror.h"
25
 
#include "../util/timer.h"
26
 
#include "dbtests.h"
 
32
#include "mongo/pch.h"
 
33
 
 
34
#include "mongo/db/db.h"
 
35
#include "mongo/db/instance.h"
 
36
#include "mongo/db/json.h"
 
37
#include "mongo/db/lasterror.h"
 
38
#include "mongo/dbtests/dbtests.h"
 
39
#include "mongo/util/timer.h"
27
40
 
28
41
namespace DirectClientTests {
29
42
 
102
115
    public:
103
116
        virtual void run(){
104
117
            auto_ptr<DBClientCursor> cursor = client().query( "", Query(), 1 );
 
118
            ASSERT(cursor->more());
105
119
            BSONObj result = cursor->next().getOwned();
106
120
            ASSERT( result.hasField( "$err" ));
 
121
            ASSERT_EQUALS(result["code"].Int(), 16332);
107
122
        }
108
123
    };
109
124
 
110
125
    class BadNSGetMore : ClientBase {
111
126
    public:
112
127
        virtual void run(){
113
 
            ASSERT( !client().getMore( "", 1, 1 )->more() );
 
128
            auto_ptr<DBClientCursor> cursor = client().getMore("", 1, 1);
 
129
            ASSERT(cursor->more());
 
130
            BSONObj result = cursor->next().getOwned();
 
131
            ASSERT(result.hasField("$err"));
 
132
            ASSERT_EQUALS(result["code"].Int(), 16258);
114
133
        }
115
134
    };
116
135