Commit 6ea5d435 authored by Damien L-G's avatar Damien L-G

Add test for policy

parent 02415db4
......@@ -46,6 +46,25 @@ void interpolation_type_not_recognized() {
ASSERT_THROW(SplineMap::get_spline(make_option(invalid)), std::runtime_error);
}
void policy_not_recognized() {
auto make_option = [](std::string const &p) {
char const separator = '<';
std::string const filename = "dummy.csv";
std::string const interpolation_type = "bicubic";
std::string option = separator + filename + separator + filename +
separator + filename + separator + interpolation_type + separator +
p;
return option;
};
std::string const valid = "error";
std::string const not_valid_yet = "extrapolate";
std::string const invalid = "bad";
ASSERT_NO_THROW(SplineMap::get_spline(make_option(valid)));
ASSERT_THROW(
SplineMap::get_spline(make_option(not_valid_yet)), std::runtime_error);
ASSERT_THROW(SplineMap::get_spline(make_option(invalid)), std::runtime_error);
}
void invalid_number_of_options() {
std::string const valid = "dummy.csv";
char const separator = '<';
......@@ -88,6 +107,8 @@ int main() {
interpolation_type_not_recognized();
policy_not_recognized();
invalid_number_of_options();
control_map_growth();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment