4#define BOOST_TEST_DYN_LINK
5#include <boost/test/unit_test.hpp>
6#include "CSVReader/CSVReader.hpp"
8BOOST_AUTO_TEST_SUITE(CSVReaderTestSuite)
9BOOST_AUTO_TEST_CASE(csv_reader_int_test)
12 std::string csv_file = std::string(
"openfpm_io/test_data/integer.csv");
14 std::string csv_file = std::string(
"test_data/integer.csv");
20 read_csv_to_vector(csv_file, v_lin, m, n);
24 BOOST_CHECK(m * n == v_lin.
size());
26 for(
int i = 0; i < v_lin.
size() / n; ++i)
28 BOOST_CHECK( v_lin.get(i * n) == i + 1);
29 BOOST_CHECK( v_lin.get(i * n + 1) == (i + 1) * 2);
30 BOOST_CHECK( v_lin.get(i * n + 2) == v_lin.get(i * n) * v_lin.get(i * n + 1));
35BOOST_AUTO_TEST_CASE(csv_reader_char_test)
38 std::string csv_file = std::string(
"openfpm_io/test_data/char.csv");
40 std::string csv_file = std::string(
"test_data/char.csv");
46 read_csv_to_vector(csv_file, v_lin, m, n);
50 BOOST_CHECK(m * n == v_lin.
size());
55 for(
int i = 0; i < v_lin.
size() / n; ++i)
57 BOOST_CHECK(col1.get(i) == v_lin.get(i * n));
58 BOOST_CHECK(col2.get(i) == v_lin.get(i * n + 1));
62BOOST_AUTO_TEST_SUITE_END()
Implementation of 1-D std::vector like structure.