~chris-rogers/maus/emr_mc_digitization

« back to all changes in this revision

Viewing changes to tests/cpp_unit/JsonCppProcessors/ArrayProcessorsTest.cc

  • Committer: Chris Rogers
  • Date: 2014-04-16 11:48:45 UTC
  • mfrom: (707 merge)
  • mto: This revision was merged to the branch mainline in revision 711.
  • Revision ID: chris.rogers@stfc.ac.uk-20140416114845-h3u3q7pdcxkxvovs
Update to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
    PointerArrayProcessor<double> proc(new DoubleProcessor());
61
61
    Json::Value json_array(Json::arrayValue);
62
62
    json_array.append(Json::Value("string type"));
63
 
    EXPECT_THROW(proc.JsonToCpp(json_array), Squeal); // and should clean up
 
63
    EXPECT_THROW(proc.JsonToCpp(json_array), MAUS::Exception); // and should clean up
64
64
                                                      // memory allocation
65
65
}
66
66
 
80
80
TEST(ArrayProcessorsTest, PointerArrayJsonToCppNotArrayTest) {
81
81
    PointerArrayProcessor<double> proc(new DoubleProcessor());
82
82
    Json::Value json_string("string_type");
83
 
    EXPECT_THROW(proc.JsonToCpp(json_string), Squeal); // and should clean up
 
83
    EXPECT_THROW(proc.JsonToCpp(json_string), MAUS::Exception); // and should clean up
84
84
}
85
85
 
86
86
// test empty vector is handled okay in CppToJson
175
175
    ValueArrayProcessor<double> proc(new DoubleProcessor());
176
176
    Json::Value json_array(Json::arrayValue);
177
177
    json_array.append(Json::Value("string type"));
178
 
    EXPECT_THROW(proc.JsonToCpp(json_array), Squeal); // and should clean up
 
178
    EXPECT_THROW(proc.JsonToCpp(json_array), MAUS::Exception); // and should clean up
179
179
                                                      // memory allocation
180
180
}
181
181
 
183
183
TEST(ArrayProcessorsTest, ValueArrayJsonToCppNotArrayTest) {
184
184
    ValueArrayProcessor<double> proc(new DoubleProcessor());
185
185
    Json::Value json_string("string_type");
186
 
    EXPECT_THROW(proc.JsonToCpp(json_string), Squeal); // and should clean up
 
186
    EXPECT_THROW(proc.JsonToCpp(json_string), MAUS::Exception); // and should clean up
187
187
}
188
188
 
189
189
// test empty vector is handled okay in CppToJson