From 2bc46238fa79ee93d5932255a0adcc60c5a4b8d5 Mon Sep 17 00:00:00 2001 From: FranckRJ Date: Sun, 12 May 2024 19:06:36 +0200 Subject: [PATCH] More very minor changes. --- include/mockutils/gcc/VirtualTable.hpp | 2 +- tests/multiple_translation_units_stub.h | 2 -- tests/multiple_translation_units_stub_test.cpp | 7 +++++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/mockutils/gcc/VirtualTable.hpp b/include/mockutils/gcc/VirtualTable.hpp index 03891818..1ed85f7d 100644 --- a/include/mockutils/gcc/VirtualTable.hpp +++ b/include/mockutils/gcc/VirtualTable.hpp @@ -131,7 +131,7 @@ namespace fakeit { private: static void **buildVTArray() { - int size = VTUtils::getVTSize(); + unsigned int size = VTUtils::getVTSize(); auto array = new void *[size + 2 + numOfCookies]{}; array += numOfCookies; // skip cookies array++; // skip top_offset diff --git a/tests/multiple_translation_units_stub.h b/tests/multiple_translation_units_stub.h index bb75bbc5..747a4f41 100644 --- a/tests/multiple_translation_units_stub.h +++ b/tests/multiple_translation_units_stub.h @@ -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& mock); diff --git a/tests/multiple_translation_units_stub_test.cpp b/tests/multiple_translation_units_stub_test.cpp index 89a19d42..88a3c519 100644 --- a/tests/multiple_translation_units_stub_test.cpp +++ b/tests/multiple_translation_units_stub_test.cpp @@ -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 mock; stubFunc(mock); When(Method(mock, func2)).Return("Something"); - When(OverloadedMethod(mock, funcOverloaded, int(int))).Return(5); SomeInterface &i = mock.get();