Skip to content

Instantly share code, notes, and snippets.

@ZenulAbidin
Created February 24, 2020 18:11
Show Gist options
  • Save ZenulAbidin/c30d75bc0be51af813dd98f5f8248687 to your computer and use it in GitHub Desktop.
Save ZenulAbidin/c30d75bc0be51af813dd98f5f8248687 to your computer and use it in GitHub Desktop.
Code I wrote so far. I need a way to pass multiple arguments to a boost test function.
#define BOOST_TEST_MODULE paintColor
#include <boost/test/included/unit_test.hpp>
using namespace std;
void colorpaint_test_function( string s, string out, vector<float> expected )
{
cout << out << endl << "=========" << endl;
vector<float> v = paintColor(s); // paintColor() defined elsewhere
copy(v.begin(), v.end(), ostream_iterator<float>(cout, " "));
cout << endl;
BOOST_TEST( v == expected);
}
BOOST_AUTO_TEST_CASE(color_convert)
{
string[] first = {"#FF0000", "FF0000"};
string[] second = {"paintColor(\"#FF0000\")", paintColor("FF0000")};
vector<float>[] third = {paintColor("#FF0000"), paintColor("FF0000")};
// ...for_each???
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment