mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Avoid unused function warnings in compile fail tests
This avoids false positives when warnings-as-error is enabled
This commit is contained in:
parent
f4c7401e2c
commit
2dede8303b
7 changed files with 50 additions and 71 deletions
|
|
@ -8,17 +8,14 @@
|
||||||
|
|
||||||
#include <turtle/mock.hpp>
|
#include <turtle/mock.hpp>
|
||||||
|
|
||||||
namespace
|
MOCK_CLASS(my_class)
|
||||||
{
|
{
|
||||||
MOCK_CLASS( my_class )
|
MOCK_METHOD_EXT(my_method, 1, void(int), my_method)
|
||||||
{
|
};
|
||||||
MOCK_METHOD_EXT( my_method, 1, void( int ), my_method )
|
bool constraint(int, int) { return true; }
|
||||||
};
|
|
||||||
bool constraint( int, int );
|
|
||||||
|
|
||||||
void test_case()
|
void test_case()
|
||||||
{
|
{
|
||||||
my_class c;
|
my_class c;
|
||||||
MOCK_EXPECT( c.my_method ).with( &constraint );
|
MOCK_EXPECT(c.my_method).with(&constraint);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,15 +8,12 @@
|
||||||
|
|
||||||
#include <turtle/mock.hpp>
|
#include <turtle/mock.hpp>
|
||||||
|
|
||||||
namespace
|
MOCK_CLASS( my_class )
|
||||||
{
|
{
|
||||||
MOCK_CLASS( my_class )
|
|
||||||
{
|
|
||||||
MOCK_METHOD_EXT( my_method, 1, void( int ), my_method )
|
MOCK_METHOD_EXT( my_method, 1, void( int ), my_method )
|
||||||
};
|
};
|
||||||
void test_case()
|
void test_case()
|
||||||
{
|
{
|
||||||
my_class c;
|
my_class c;
|
||||||
MOCK_EXPECT( c.my_method ).with( "42" );
|
MOCK_EXPECT( c.my_method ).with( "42" );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,15 +8,12 @@
|
||||||
|
|
||||||
#include <turtle/mock.hpp>
|
#include <turtle/mock.hpp>
|
||||||
|
|
||||||
namespace
|
MOCK_CLASS( my_class )
|
||||||
{
|
{
|
||||||
MOCK_CLASS( my_class )
|
|
||||||
{
|
|
||||||
MOCK_METHOD_EXT( my_method, 1, void( int ), my_method )
|
MOCK_METHOD_EXT( my_method, 1, void( int ), my_method )
|
||||||
};
|
};
|
||||||
void test_case()
|
void test_case()
|
||||||
{
|
{
|
||||||
my_class c;
|
my_class c;
|
||||||
MOCK_EXPECT( c.my_method ).with( mock::equal( "42" ) );
|
MOCK_EXPECT( c.my_method ).with( mock::equal( "42" ) );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,15 +8,12 @@
|
||||||
|
|
||||||
#include <turtle/mock.hpp>
|
#include <turtle/mock.hpp>
|
||||||
|
|
||||||
namespace
|
MOCK_CLASS( my_class )
|
||||||
{
|
{
|
||||||
MOCK_CLASS( my_class )
|
|
||||||
{
|
|
||||||
MOCK_METHOD_EXT( my_method, 0, int(), my_method )
|
MOCK_METHOD_EXT( my_method, 0, int(), my_method )
|
||||||
};
|
};
|
||||||
void test_case()
|
void test_case()
|
||||||
{
|
{
|
||||||
my_class c;
|
my_class c;
|
||||||
MOCK_EXPECT( c.my_method ).returns( std::string() );
|
MOCK_EXPECT( c.my_method ).returns( std::string() );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,15 +8,12 @@
|
||||||
|
|
||||||
#include <turtle/mock.hpp>
|
#include <turtle/mock.hpp>
|
||||||
|
|
||||||
namespace
|
MOCK_CLASS( my_class )
|
||||||
{
|
{
|
||||||
MOCK_CLASS( my_class )
|
|
||||||
{
|
|
||||||
MOCK_METHOD_EXT( my_method, 0, std::string(), my_method )
|
MOCK_METHOD_EXT( my_method, 0, std::string(), my_method )
|
||||||
};
|
};
|
||||||
void test_case()
|
void test_case()
|
||||||
{
|
{
|
||||||
my_class c;
|
my_class c;
|
||||||
MOCK_EXPECT( c.my_method ).returns( 42 );
|
MOCK_EXPECT( c.my_method ).returns( 42 );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,15 +8,12 @@
|
||||||
|
|
||||||
#include <turtle/mock.hpp>
|
#include <turtle/mock.hpp>
|
||||||
|
|
||||||
namespace
|
MOCK_CLASS( my_class )
|
||||||
{
|
{
|
||||||
MOCK_CLASS( my_class )
|
|
||||||
{
|
|
||||||
MOCK_METHOD_EXT( my_method, 0, void(), my_method )
|
MOCK_METHOD_EXT( my_method, 0, void(), my_method )
|
||||||
};
|
};
|
||||||
void test_case()
|
void test_case()
|
||||||
{
|
{
|
||||||
my_class c;
|
my_class c;
|
||||||
MOCK_EXPECT( c.my_method ).returns( "42" );
|
MOCK_EXPECT( c.my_method ).returns( "42" );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,15 +8,12 @@
|
||||||
|
|
||||||
#include <turtle/mock.hpp>
|
#include <turtle/mock.hpp>
|
||||||
|
|
||||||
namespace
|
MOCK_CLASS( my_class )
|
||||||
{
|
{
|
||||||
MOCK_CLASS( my_class )
|
|
||||||
{
|
|
||||||
MOCK_METHOD_EXT( my_method, 1, void( int ), my_method )
|
MOCK_METHOD_EXT( my_method, 1, void( int ), my_method )
|
||||||
};
|
};
|
||||||
void test_case()
|
void test_case()
|
||||||
{
|
{
|
||||||
my_class c;
|
my_class c;
|
||||||
MOCK_EXPECT( c.my_method ).with( 42, 42 );
|
MOCK_EXPECT( c.my_method ).with( 42, 42 );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue