1
0
Fork 0

test fixes

This commit is contained in:
Jan Steemann 2016-04-06 17:39:24 +02:00
parent d997ea0e13
commit 545b87cb76
4 changed files with 11 additions and 15 deletions

View File

@ -29,12 +29,10 @@ describe ArangoDB do
body = "[ [] ]";
doc = ArangoDB.log_post("#{prefix}-create-list1", cmd, :body => body)
doc.code.should eq(400)
doc.code.should eq(202)
doc.headers['content-type'].should eq("application/json; charset=utf-8")
doc.parsed_response['error'].should eq(true)
doc.parsed_response['code'].should eq(400)
doc.parsed_response['errorNum'].should eq(1227)
doc.parsed_response[0]["error"].should eq(true)
doc.parsed_response[0]["errorNum"].should eq(1227)
end
it "creates a document with an invalid type" do

View File

@ -121,8 +121,8 @@ bool RestDocumentHandler::createDocument() {
SingleCollectionTransaction trx(transactionContext,
collectionName, TRI_TRANSACTION_WRITE);
VPackSlice body = parsedBody->slice();
bool isMultiple = body.isArray();
if (!body.isArray()) {
bool const isMultiple = body.isArray();
if (!isMultiple) {
trx.addHint(TRI_TRANSACTION_HINT_SINGLE_OPERATION, false);
}

View File

@ -368,7 +368,7 @@ static void JS_ChecksumCollection(
TRI_document_collection_t* document = trx.documentCollection();
std::string const revisionId = std::to_string(document->_info.revision());
uint64_t hash = 0;
trx.invokeOnAllElements(col->_name, [&hash, &withData, &withRevisions](TRI_doc_mptr_t const* mptr) {
VPackSlice const slice(mptr->vpack());
@ -398,10 +398,10 @@ static void JS_ChecksumCollection(
}
localHash ^= it.key.hash(seed) ^ 0xba5befd00d;
localHash ^= it.value.normalizedHash(seed) ^ 0xf00ba44ba5;
localHash += it.value.normalizedHash(seed) ^ 0xd4129f526421;
}
}
hash ^= localHash;
return true;
});
@ -413,7 +413,7 @@ static void JS_ChecksumCollection(
v8::Handle<v8::Object> result = v8::Object::New(isolate);
result->Set(TRI_V8_ASCII_STRING("checksum"), TRI_V8_STD_STRING(hashString));
result->Set(TRI_V8_ASCII_STRING("revision"), TRI_V8_STD_STRING(revisionId));
TRI_V8_RETURN(result);
TRI_V8_TRY_CATCH_END
}

View File

@ -480,8 +480,6 @@ static bool CheckCollection(TRI_collection_t* collection, bool ignoreErrors) {
// .............................................................................
if (extension == "db") {
TRI_col_header_marker_t* cm;
// found a compaction file. now rename it back
if (filetype == "compaction") {
std::string relName = "datafile-" + qualifier + "." + extension;
@ -530,11 +528,11 @@ static bool CheckCollection(TRI_collection_t* collection, bool ignoreErrors) {
all.emplace_back(datafile);
// check the document header
char* ptr = datafile->_data;
char const* ptr = datafile->_data;
// skip the datafile header
ptr += DatafileHelper::AlignedSize<size_t>(sizeof(TRI_df_header_marker_t));
cm = (TRI_col_header_marker_t*)ptr;
TRI_col_header_marker_t const* cm = reinterpret_cast<TRI_col_header_marker_t const*>(ptr);
if (cm->base.getType() != TRI_DF_MARKER_COL_HEADER) {
LOG(ERR) << "collection header mismatch in file '" << filename