Added hippomocks_test

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@409 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2012-02-07 22:05:27 +00:00
parent 96ad4b068b
commit d1a7049505
4 changed files with 6609 additions and 1 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,45 @@
//
// Copyright Mathieu Champlon 2012
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#define BOOST_AUTO_TEST_MAIN
#include "hippomocks.h"
#include <boost/test/auto_unit_test.hpp>
#define BOOST_LIB_NAME boost_unit_test_framework
#include <boost/config/auto_link.hpp>
namespace
{
struct s
{
virtual void method( int ) {}
};
bool check( int )
{
return false;
}
}
BOOST_AUTO_TEST_CASE( hmm )
{
MockRepository mocks;
s* m = mocks.Mock< s >();
mocks.ExpectCall( m, s::method ).Match( check );
m->method( 7 );
}
//namespace
//{
// void free_function() { std::cout << "ok" << std::endl; }
//}
//
//BOOST_AUTO_TEST_CASE( hmm2 )
//{
// MockRepository mocks;
// mocks.ExpectCallFunc( free_function );
// free_function();
//}