From 1059458e111b178688c19ebdb08b903c6df49f89 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 14 Feb 2016 00:16:10 +0100 Subject: [PATCH] MockElm: add the ability to store/query received errors and messages this is just a draft and in expectation of what we'll likely add to the real model::Element and model::Controller entities --- tests/gui/test/mock-elm.hpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/gui/test/mock-elm.hpp b/tests/gui/test/mock-elm.hpp index f42052cbf..738f0b62d 100644 --- a/tests/gui/test/mock-elm.hpp +++ b/tests/gui/test/mock-elm.hpp @@ -68,6 +68,7 @@ #include "test/test-nexus.hpp" #include "lib/format-cout.hpp" #include "lib/symbol.hpp" +#include "lib/util.hpp" #include @@ -81,6 +82,7 @@ namespace gui { namespace test{ + using util::isnil; using lib::Symbol; using std::string; @@ -106,6 +108,9 @@ namespace test{ bool virgin_{true}; bool expanded_{false}; + string message_; + string error_; + /* ==== Tangible interface ==== */ @@ -116,6 +121,8 @@ namespace test{ if (virgin_) return false; // there was nothing to reset + error_ = ""; + message_ = ""; expanded_ = false; virgin_ = true; log_.event("reset"); @@ -152,6 +159,8 @@ namespace test{ { log_.call (this->identify(), "doMsg", text); cout << this->identify() << " <-- Message(\""<identify(), "doErr", text); cerr << this->identify() << " <-- Error(\""<