Skip to content

Commit

Permalink
Force verification results to keep a isOk_ member or provide a bool c…
Browse files Browse the repository at this point in the history
…onstructor
  • Loading branch information
orzechow committed Nov 19, 2024
1 parent 2624083 commit b9e2d6f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
6 changes: 4 additions & 2 deletions include/arbitration_graphs/verification.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ namespace arbitration_graphs::verification {
* robots. Otherwise these are a good starting point to implement your own meaningful verifier.
*/
struct PlaceboResult {
static bool isOk() {
return true;
bool isOk() const {
return isOk_;
};

bool isOk_{true};
};
template <typename DataT>
struct PlaceboVerifier {
Expand Down
11 changes: 3 additions & 8 deletions test/dummy_types.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include "behavior.hpp"
#include "verification.hpp"


namespace arbitration_graphs_tests {
Expand Down Expand Up @@ -66,20 +67,14 @@ class DummyBehavior : public Behavior<DummyCommand> {
class BrokenDummyBehavior : public DummyBehavior {
public:
BrokenDummyBehavior(const bool invocation, const bool commitment, const std::string& name = "BrokenDummyBehavior")
: DummyBehavior(invocation, commitment, name) {};
: DummyBehavior(invocation, commitment, name){};

DummyCommand getCommand(const Time& time) override {
throw std::runtime_error("BrokenDummyBehavior::getCommand() is broken");
}
};

struct DummyResult {
bool isOk() const {
return isOk_;
};

bool isOk_;
};
struct DummyResult : public verification::PlaceboResult {};

} // namespace arbitration_graphs_tests

Expand Down

0 comments on commit b9e2d6f

Please sign in to comment.