I'm learning how to use Boost Test.
I want to test the method JulianToGreenWich(float jd)
:
#include <ctime>
class Convert
{
private:
public:
Convert();
~Convert();
tm JulianToGreenWich(float jd);
};
To test it with Boost Test, I have written down this code:
struct TestFixture
{
Convert convert_instance;
TestFixture()
: convert_instance()
{}
~TestFixture() = default;
};
BOOST_FIXTURE_TEST_SUITE(TestConvert, TestFixture)
BOOST_AUTO_TEST_CASE(julianToGreenWichCase)
{
BOOST_TEST(1 == 1);
BOOST_TEST(true);
}
My problem is that I want to test it with many (more than one) values. To do it, I've been reading about BOOST_DATA_TEST_CASE_F, but it seems that it needs a dataset (and I don't know how to create one and use it). So, I have started to read this at boost documentation: Datasets. But its example of a Example of custom dataset is very complicated.
If I want to check that is a pass a value (a float) to JulianToGreenWich
method a I will get a get an specific tm
struct.
How can I test my method with many pair values (float jd, tm)?