Skip to content

Commit

Permalink
test: fix per-file context accessors
Browse files Browse the repository at this point in the history
I reworked the context to not use janky friend declarations, but didn't
change this part. This results in incorrect test output (checks count
towards a wrong context)
  • Loading branch information
Hedede committed Jul 17, 2022
1 parent 4f0ff63 commit 0a7b09f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions test/include/aw/test/test.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ namespace test {

namespace {
extern context file_context;
}

namespace {
class context_block {
friend bool setup();
friend bool preconditions();
Expand Down Expand Up @@ -64,7 +62,6 @@ bool setup() { context_block::enter(stage::setup); return true; }
bool preconditions() { context_block::enter(stage::preconditions); return true; }
bool checks() { context_block::enter(stage::checks); return true; }
bool postconditions() { context_block::enter(stage::postconditions); return true; }
} // namespace

template<typename Evaluator, typename... Args>
bool check(Evaluator eval, Args&&... args)
Expand Down Expand Up @@ -153,6 +150,7 @@ struct _catch {
std::string msg() { return _msg; }
std::string _msg;
};
} // namespace
} // namespace test
} // namespace aw

Expand Down

0 comments on commit 0a7b09f

Please sign in to comment.