1
/* This file is part of MAUS: http://micewww.pp.rl.ac.uk/projects/maus
3
* MAUS is free software: you can redistribute it and/or modify
4
* it under the terms of the GNU General Public License as published by
5
* the Free Software Foundation, either version 3 of the License, or
6
* (at your option) any later version.
8
* MAUS is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with MAUS. If not, see <http://www.gnu.org/licenses/>.
17
#ifndef _TESTS_CPP_UNIT_JSONCPPPROCESSORS_COMMONPROCESSORTEST_HH_
22
namespace ProcessorTest {
24
void test_value(ProcessorBase<TYPE>* proc, std::string test_string) {
26
ASSERT_NO_THROW(json_in = JsonWrapper::StringToJson(test_string))
28
TYPE* cpp_type = NULL;
29
ASSERT_NO_THROW(cpp_type = proc->JsonToCpp(json_in));
30
Json::Value* json_out = NULL;
31
ASSERT_NO_THROW(json_out = proc->CppToJson(*cpp_type));
32
EXPECT_PRED3(JsonWrapper::AlmostEqual, json_in, *json_out, 1e-9);