Skip to content

Commit

Permalink
More very minor changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
FranckRJ committed May 12, 2024
1 parent 6438b95 commit 2bc4623
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/mockutils/gcc/VirtualTable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ namespace fakeit {

private:
static void **buildVTArray() {
int size = VTUtils::getVTSize<C>();
unsigned int size = VTUtils::getVTSize<C>();
auto array = new void *[size + 2 + numOfCookies]{};
array += numOfCookies; // skip cookies
array++; // skip top_offset
Expand Down
2 changes: 0 additions & 2 deletions tests/multiple_translation_units_stub.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ namespace multiple_tu {
struct SomeInterface {
virtual int func() = 0;
virtual std::string func2() = 0;
virtual int funcOverloaded(int) = 0;
virtual int funcOverloaded(double) = 0;
};

void stubFunc(fakeit::Mock<SomeInterface>& mock);
Expand Down
7 changes: 5 additions & 2 deletions tests/multiple_translation_units_stub_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ struct MultipleTranslationUnitsStub : tpunit::TestFixture {
{
}

// TODO: more tests to be sure I didn't broke something by changing stuff (alterning mocked func with when and func).
// TODO: more tests to be sure I didn't broke something by changing stuff:
// - alterning mocked func with when and func.
// - testing return value.
// - multiple mocks on same method.
// - etc ?

void NoCollidingIds() {
Mock<SomeInterface> mock;

stubFunc(mock);
When(Method(mock, func2)).Return("Something");
When(OverloadedMethod(mock, funcOverloaded, int(int))).Return(5);

SomeInterface &i = mock.get();

Expand Down

0 comments on commit 2bc4623

Please sign in to comment.