mirror of
https://github.com/meekrosoft/fff
synced 2026-01-23 00:15:59 +01:00
Add overrides for argument and call histories
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
|
||||
// Want to keep the argument history for 13 calls
|
||||
#define OVERRIDE_ARG_HIST_LEN 13u
|
||||
#define FFF_ARG_HISTORY_LEN OVERRIDE_ARG_HIST_LEN
|
||||
// Want to keep the call sequence history for 17 function calls
|
||||
#define OVERRIDE_CALL_HIST_LEN 17u
|
||||
#define FFF_CALL_HISTORY_LEN OVERRIDE_CALL_HIST_LEN
|
||||
|
||||
#include "../fff.h"
|
||||
|
||||
#include <assert.h>
|
||||
@@ -239,6 +247,12 @@ TEST_F(FFFTestSuite, return_value_sequences_reset)
|
||||
ASSERT_EQ(0, longfunc0());
|
||||
}
|
||||
|
||||
TEST_F(FFFTestSuite, default_constants_can_be_overridden)
|
||||
{
|
||||
unsigned sizeCallHistory = (sizeof call_history) / (sizeof call_history[0]);
|
||||
ASSERT_EQ(OVERRIDE_CALL_HIST_LEN, sizeCallHistory);
|
||||
ASSERT_EQ(OVERRIDE_ARG_HIST_LEN, voidfunc2_arg_history_len);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -276,6 +290,7 @@ int main()
|
||||
|
||||
RUN_TEST(FFFTestSuite, return_value_sequences_not_exhausted);
|
||||
RUN_TEST(FFFTestSuite, return_value_sequences_exhausted);
|
||||
RUN_TEST(FFFTestSuite, default_constants_can_be_overridden);
|
||||
|
||||
printf("\n-------------\n");
|
||||
printf("Complete\n");
|
||||
|
||||
@@ -5,6 +5,13 @@
|
||||
* Author: mlong
|
||||
*/
|
||||
|
||||
// Want to keep the argument history for 13 calls
|
||||
#define OVERRIDE_ARG_HIST_LEN 13u
|
||||
#define FFF_ARG_HISTORY_LEN OVERRIDE_ARG_HIST_LEN
|
||||
// Want to keep the call sequence history for 17 function calls
|
||||
#define OVERRIDE_CALL_HIST_LEN 17u
|
||||
#define FFF_CALL_HISTORY_LEN OVERRIDE_CALL_HIST_LEN
|
||||
|
||||
#include "../fff.h"
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
@@ -227,3 +234,11 @@ TEST_F(FFFTestSuite, return_value_sequences_reset)
|
||||
ASSERT_EQ(0, longfunc0());
|
||||
}
|
||||
|
||||
|
||||
TEST_F(FFFTestSuite, default_constants_can_be_overridden)
|
||||
{
|
||||
unsigned sizeCallHistory = (sizeof call_history) / (sizeof call_history[0]);
|
||||
ASSERT_EQ(OVERRIDE_CALL_HIST_LEN, sizeCallHistory);
|
||||
ASSERT_EQ(OVERRIDE_ARG_HIST_LEN, voidfunc2_arg_history_len);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user