Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a csv_datasource initialization c++ test
- Loading branch information
Dane Springmeyer
committed
Aug 23, 2012
1 parent
a325496
commit f4a74d0
Showing
2 changed files
with
40 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include <boost/version.hpp> | ||
#include <boost/detail/lightweight_test.hpp> | ||
#include <iostream> | ||
#include "plugins/input/csv/csv_datasource.hpp" | ||
#include <mapnik/params.hpp> | ||
|
||
|
||
int main( int, char*[] ) | ||
{ | ||
// test of directly instanciating a datasource | ||
try { | ||
mapnik::parameters params; | ||
params["type"]="csv"; | ||
params["file"]="./tests/data/csv/wkt.csv"; | ||
csv_datasource ds(params); | ||
BOOST_TEST(true); | ||
} catch (std::exception const& ex) { | ||
BOOST_TEST(false); | ||
std::clog << "threw: " << ex.what() << "\n"; | ||
} | ||
|
||
if (!::boost::detail::test_errors()) { | ||
std::clog << "C++ CSV parse: \x1b[1;32m✓ \x1b[0m\n"; | ||
#if BOOST_VERSION >= 104600 | ||
::boost::detail::report_errors_remind().called_report_errors_function = true; | ||
#endif | ||
} else { | ||
return ::boost::report_errors(); | ||
} | ||
} |