Commit 32723b9c authored by Damien L-G's avatar Damien L-G

Forgot to format TestMap

parent a33b3c64
......@@ -17,8 +17,7 @@ std::string make_option(std::string const &x, std::string const &y,
return option;
};
template <typename Spline>
void file_not_found() {
template <typename Spline> void file_not_found() {
std::string const valid = "dummy.csv";
std::string const invalid = "does_not_exist.csv";
ASSERT_NO_THROW(Map<Spline>::get_spline(make_option(valid, valid, valid)));
......@@ -30,37 +29,31 @@ void file_not_found() {
std::runtime_error);
}
template <typename Spline>
void invalid_number_of_options() {
template <typename Spline> void invalid_number_of_options() {
std::string const valid = "dummy.csv";
char const separator = '<';
ASSERT_NO_THROW(Map<Spline>::get_spline(separator + valid + separator + valid +
separator + valid));
ASSERT_THROW(
Map<Spline>::get_spline(separator + valid + separator + valid + separator),
std::runtime_error);
ASSERT_NO_THROW(Map<Spline>::get_spline(separator + valid + separator +
valid + separator + valid));
ASSERT_THROW(Map<Spline>::get_spline(separator + valid + separator + valid +
separator + valid + separator +
"whatever"),
separator),
std::runtime_error);
ASSERT_THROW(Map<Spline>::get_spline(separator + valid + separator + valid +
separator + valid + separator +
"whatever"),
std::runtime_error);
}
template <typename Spline>
void control_map_growth() {
template <typename Spline> void control_map_growth() {
Map<Spline>::clear();
assert(Map<Spline>::size() == 0);
Map<Spline>::get_spline(
":dummy.csv: :dummy.csv: :dummy.csv:");
Map<Spline>::get_spline(
":dummy.csv: :dummy.csv: :dummy.csv:");
Map<Spline>::get_spline(":dummy.csv: :dummy.csv: :dummy.csv:");
Map<Spline>::get_spline(":dummy.csv: :dummy.csv: :dummy.csv:");
assert(Map<Spline>::size() == 1);
Map<Spline>::get_spline("|dummy.csv |dummy.csv |dummy.csv");
Map<Spline>::get_spline(
"? dummy.csv? ? ? ?dummy.csv???dummy.csv");
Map<Spline>::get_spline("? dummy.csv? ? ? ?dummy.csv???dummy.csv");
assert(Map<Spline>::size() == 3);
Map<Spline>::get_spline(
":dummy.csv: :dummy.csv: :dummy.csv:");
Map<Spline>::get_spline(":dummy.csv: :dummy.csv: :dummy.csv:");
assert(Map<Spline>::size() == 3);
}
......
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