mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
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:
parent
96ad4b068b
commit
d1a7049505
4 changed files with 6609 additions and 1 deletions
6351
src/tests/hippomocks_test/hippomocks.h
Normal file
6351
src/tests/hippomocks_test/hippomocks.h
Normal file
File diff suppressed because it is too large
Load diff
45
src/tests/hippomocks_test/test.cpp
Normal file
45
src/tests/hippomocks_test/test.cpp
Normal 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();
|
||||
//}
|
||||
Loading…
Add table
Add a link
Reference in a new issue