testing public mebmer (virtual and static), constructor, and destructor

This commit is contained in:
Lorenzo Caminiti
2015-04-19 19:32:07 -07:00
parent b2b6a7cc18
commit 1408423ccb
65 changed files with 1835 additions and 15383 deletions

39
test/introspect.cpp Normal file
View File

@@ -0,0 +1,39 @@
#include <boost/contract/introspect.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/detail/lightweight_test.hpp>
struct w {};
struct z {
char f(int) { return 'z'; }
};
struct y {
int f(char) { return -1; }
};
struct x {
int f(char) {
BOOST_TEST((introspect_f::has_member_function<y, int,
boost::mpl::vector<char> >::value));
BOOST_TEST((!introspect_f::has_member_function<z, int,
boost::mpl::vector<char> >::value));
BOOST_TEST((!introspect_f::has_member_function<w, int,
boost::mpl::vector<char> >::value));
BOOST_TEST((introspect_f::member_function_address<y,
int (y::*)(char const)>() == &y::f));
return 'x';
}
private:
BOOST_CONTRACT_INTROSPECT(f)
};
int main() {
x xx;
xx.f('a');
return 0;
}