Skip to content

Instantly share code, notes, and snippets.

@sat0b
Created June 19, 2017 15:33
Show Gist options
  • Select an option

  • Save sat0b/b6687804cad6cfe296204476576cee96 to your computer and use it in GitHub Desktop.

Select an option

Save sat0b/b6687804cad6cfe296204476576cee96 to your computer and use it in GitHub Desktop.
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>
#include <boost/test/data/test_case.hpp>
#include <iostream>
#include <vector>
using namespace std;
BOOST_AUTO_TEST_CASE(sample_test) {
int a = 10;
int b = 13;
BOOST_TEST(a == b);
}
BOOST_DATA_TEST_CASE(data_test, boost::unit_test::data::xrange(-5, 5)) {
BOOST_TEST((-3 < sample && sample < 3));
}
BOOST_AUTO_TEST_CASE(vec_test) {
vector<int> v = {1, 2, 3, 4};
vector<int> e = {1, 2, 4, 3};
BOOST_CHECK_EQUAL_COLLECTIONS(v.begin(), v.end(), e.begin(), e.end());
}
@sat0b
Copy link
Author

sat0b commented Jun 19, 2017

clang++ -std=c++14 sample_test.cpp -lboost_unit_test_framework

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment