1
0
Fork 0

added 'in'-check for agency precondition

This commit is contained in:
Kaveh Vahedipour 2016-06-23 17:17:03 +02:00
parent f673b5c5cc
commit 761b16e407
2 changed files with 5 additions and 9 deletions

View File

@ -352,21 +352,17 @@ bool Store::check(VPackSlice const& slice) const {
if (op.value.getBool() ? found : !found) { if (op.value.getBool() ? found : !found) {
return false; return false;
} }
} else if (oper == "in") { // isEmpty } else if (oper == "in") { // in
if (found) { if (found) {
if (node.slice().isArray()) { if (node.slice().isArray()) {
for (auto const& elem : VPackArrayIterator(node.slice())) { for (auto const& i : VPackArrayIterator(node.slice())) {
if (elem == op.value) { if (i == op.value) {
return true; return true;
} }
} }
return false;
} }
return false;
} }
return false; return false;
} else {
return false;
} }
} }
} else { } else {
@ -375,7 +371,7 @@ bool Store::check(VPackSlice const& slice) const {
} }
} }
} }
return true; return true;
} }

View File

@ -54,7 +54,7 @@ function agencyTestSuite () {
var res = request({url: agencyServers[whoseTurn] + "/_api/agency/config", var res = request({url: agencyServers[whoseTurn] + "/_api/agency/config",
method: "GET", followRedirects: true, body: "", method: "GET", followRedirects: true, body: "",
headers: {"Content-Type": "application/json"}}); headers: {"Content-Type": "application/json"}});
wait(.25); wait(0.25);
res.bodyParsed = JSON.parse(res.body); res.bodyParsed = JSON.parse(res.body);
if (res.bodyParsed.leaderId >= 0 && res.bodyParsed.leaderId < nagents) { if (res.bodyParsed.leaderId >= 0 && res.bodyParsed.leaderId < nagents) {
whoseTurn = res.bodyParsed.leaderId; whoseTurn = res.bodyParsed.leaderId;