Skip to content

Commit

Permalink
PR fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Ferraiuolo committed Sep 15, 2022
1 parent 0d05d16 commit 8aaedfd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
1 change: 0 additions & 1 deletion src/ir/auth_logic/ast.h
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,6 @@ class Program {
absl::StrJoin(query_strings, "\n"), ")");
}

// for debugging/testing only
bool operator==(const Program& rhs) const {
return relation_declarations_ == rhs.relation_declarations_ &&
says_assertions_ == rhs.says_assertions_ && queries_ == rhs.queries_;
Expand Down
7 changes: 3 additions & 4 deletions src/ir/auth_logic/ast_equality_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,15 @@ TEST_P(AttributeEqTest, AttributeEqTest) {

static datalog::Predicate pred1("foo", {"bar", "baz"}, datalog::kPositive);
static datalog::Predicate pred2("foooo", {"bar", "baz"}, datalog::kPositive);
static datalog::Predicate pred3("foo", {"bar", "baz"}, datalog::kNegated);

static Attribute attr1(prinA, pred1);
static Attribute attr2(prinB, pred2);
static Attribute attr3(prinA, pred2);
static Attribute attr4(prinB, pred1);
static Attribute attr4(prinB, pred3);
static std::pair<Attribute, uint64_t> attributeTestVals[] = {
{attr1, 0},
{attr2, 1},
{attr3, 2},
{attr4, 3},
{attr1, 0}, {attr2, 1}, {attr3, 2}, {attr4, 3}, {attr5, 4},
};

INSTANTIATE_TEST_SUITE_P(
Expand Down
24 changes: 12 additions & 12 deletions src/ir/datalog/program.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ class ArgumentType {
// The name field is only compared for arguments of kind kCustom
// because the name field is only used for kCustom types (and
// not for kPrincipal or kNumber).
return this->kind_ == otherType.kind() &&
this->kind_ == Kind::kCustom ? this->name_ == otherType.name() : true;
return this->kind_ == otherType.kind_ &&
this->kind_ == Kind::kCustom ? this->name_ == otherType.name_ : true;
}

private:
Expand All @@ -120,8 +120,8 @@ class Argument {
}

bool operator==(const Argument& otherArgument) const {
return this->argument_name_ == otherArgument.argument_name() &&
this->argument_type_ == otherArgument.argument_type();
return this->argument_name_ == otherArgument.argument_name_ &&
this->argument_type_ == otherArgument.argument_type_;
}

private:
Expand All @@ -142,9 +142,9 @@ class RelationDeclaration {
const std::vector<Argument>& arguments() const { return arguments_; }

bool operator==(const RelationDeclaration& otherDeclaration) const {
return this->relation_name_ == otherDeclaration.relation_name() &&
this->is_attribute_ == otherDeclaration.is_attribute() &&
this->arguments_ == otherDeclaration.arguments();
return this->relation_name_ == otherDeclaration.relation_name_ &&
this->is_attribute_ == otherDeclaration.is_attribute_ &&
this->arguments_ == otherDeclaration.arguments_;
}

// A potentially ugly print of the state in this class
Expand Down Expand Up @@ -178,8 +178,8 @@ class Rule {
const std::vector<Predicate>& rhs() const { return rhs_; }

bool operator==(const Rule& otherRule) const {
return this->lhs_ == otherRule.lhs() &&
this->rhs_ == otherRule.rhs();
return this->lhs_ == otherRule.lhs_ &&
this->rhs_ == otherRule.rhs_;
}

private:
Expand All @@ -202,9 +202,9 @@ class Program {

bool operator==(const Program& otherProgram) const {
return this->relation_declarations_ ==
otherProgram.relation_declarations() &&
this->rules_ == otherProgram.rules() &&
this->outputs_ == otherProgram.outputs();
otherProgram.relation_declarations_ &&
this->rules_ == otherProgram.rules_ &&
this->outputs_ == otherProgram.outputs_;
}

private:
Expand Down

0 comments on commit 8aaedfd

Please sign in to comment.