mirror of
https://github.com/meekrosoft/fff
synced 2026-01-23 08:25:59 +01:00
Clear argument history when RESET_FAKE called
This commit is contained in:
@@ -142,6 +142,7 @@ def output_reset_function(arg_count, is_value_function)
|
||||
puts " void FUNCNAME##_reset(){ \\"
|
||||
arg_count.times { |i|
|
||||
puts " FUNCNAME##_arg#{i}_val = (ARG#{i}_TYPE) 0; \\"
|
||||
puts " memset(FUNCNAME##_arg#{i}_history, 0, sizeof(FUNCNAME##_arg#{i}_history)); \\"
|
||||
}
|
||||
puts " FUNCNAME##_call_count = 0; \\"
|
||||
puts " FUNCNAME##_return_val = 0; \\" unless not is_value_function
|
||||
|
||||
180
fff.h
180
fff.h
@@ -68,6 +68,7 @@ extern "C"{ \
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
} \
|
||||
} \
|
||||
@@ -101,7 +102,9 @@ extern "C"{ \
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
} \
|
||||
} \
|
||||
@@ -141,8 +144,11 @@ extern "C"{ \
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
} \
|
||||
} \
|
||||
@@ -188,9 +194,13 @@ extern "C"{ \
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
} \
|
||||
} \
|
||||
@@ -242,10 +252,15 @@ extern "C"{ \
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_arg4_val = (ARG4_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg4_history, 0, sizeof(FUNCNAME##_arg4_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
} \
|
||||
} \
|
||||
@@ -303,11 +318,17 @@ extern "C"{ \
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_arg4_val = (ARG4_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg4_history, 0, sizeof(FUNCNAME##_arg4_history)); \
|
||||
FUNCNAME##_arg5_val = (ARG5_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg5_history, 0, sizeof(FUNCNAME##_arg5_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
} \
|
||||
} \
|
||||
@@ -371,12 +392,19 @@ extern "C"{ \
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_arg4_val = (ARG4_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg4_history, 0, sizeof(FUNCNAME##_arg4_history)); \
|
||||
FUNCNAME##_arg5_val = (ARG5_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg5_history, 0, sizeof(FUNCNAME##_arg5_history)); \
|
||||
FUNCNAME##_arg6_val = (ARG6_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg6_history, 0, sizeof(FUNCNAME##_arg6_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
} \
|
||||
} \
|
||||
@@ -446,13 +474,21 @@ extern "C"{ \
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_arg4_val = (ARG4_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg4_history, 0, sizeof(FUNCNAME##_arg4_history)); \
|
||||
FUNCNAME##_arg5_val = (ARG5_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg5_history, 0, sizeof(FUNCNAME##_arg5_history)); \
|
||||
FUNCNAME##_arg6_val = (ARG6_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg6_history, 0, sizeof(FUNCNAME##_arg6_history)); \
|
||||
FUNCNAME##_arg7_val = (ARG7_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg7_history, 0, sizeof(FUNCNAME##_arg7_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
} \
|
||||
} \
|
||||
@@ -528,14 +564,23 @@ extern "C"{ \
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_arg4_val = (ARG4_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg4_history, 0, sizeof(FUNCNAME##_arg4_history)); \
|
||||
FUNCNAME##_arg5_val = (ARG5_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg5_history, 0, sizeof(FUNCNAME##_arg5_history)); \
|
||||
FUNCNAME##_arg6_val = (ARG6_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg6_history, 0, sizeof(FUNCNAME##_arg6_history)); \
|
||||
FUNCNAME##_arg7_val = (ARG7_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg7_history, 0, sizeof(FUNCNAME##_arg7_history)); \
|
||||
FUNCNAME##_arg8_val = (ARG8_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg8_history, 0, sizeof(FUNCNAME##_arg8_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
} \
|
||||
} \
|
||||
@@ -588,6 +633,7 @@ extern "C"{ \
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
FUNCNAME##_return_val = 0; \
|
||||
} \
|
||||
@@ -624,7 +670,9 @@ extern "C"{ \
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
FUNCNAME##_return_val = 0; \
|
||||
} \
|
||||
@@ -667,8 +715,11 @@ extern "C"{ \
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
FUNCNAME##_return_val = 0; \
|
||||
} \
|
||||
@@ -717,9 +768,13 @@ extern "C"{ \
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
FUNCNAME##_return_val = 0; \
|
||||
} \
|
||||
@@ -774,10 +829,15 @@ extern "C"{ \
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_arg4_val = (ARG4_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg4_history, 0, sizeof(FUNCNAME##_arg4_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
FUNCNAME##_return_val = 0; \
|
||||
} \
|
||||
@@ -838,11 +898,17 @@ extern "C"{ \
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_arg4_val = (ARG4_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg4_history, 0, sizeof(FUNCNAME##_arg4_history)); \
|
||||
FUNCNAME##_arg5_val = (ARG5_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg5_history, 0, sizeof(FUNCNAME##_arg5_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
FUNCNAME##_return_val = 0; \
|
||||
} \
|
||||
@@ -909,12 +975,19 @@ extern "C"{ \
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_arg4_val = (ARG4_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg4_history, 0, sizeof(FUNCNAME##_arg4_history)); \
|
||||
FUNCNAME##_arg5_val = (ARG5_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg5_history, 0, sizeof(FUNCNAME##_arg5_history)); \
|
||||
FUNCNAME##_arg6_val = (ARG6_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg6_history, 0, sizeof(FUNCNAME##_arg6_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
FUNCNAME##_return_val = 0; \
|
||||
} \
|
||||
@@ -987,13 +1060,21 @@ extern "C"{ \
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_arg4_val = (ARG4_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg4_history, 0, sizeof(FUNCNAME##_arg4_history)); \
|
||||
FUNCNAME##_arg5_val = (ARG5_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg5_history, 0, sizeof(FUNCNAME##_arg5_history)); \
|
||||
FUNCNAME##_arg6_val = (ARG6_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg6_history, 0, sizeof(FUNCNAME##_arg6_history)); \
|
||||
FUNCNAME##_arg7_val = (ARG7_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg7_history, 0, sizeof(FUNCNAME##_arg7_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
FUNCNAME##_return_val = 0; \
|
||||
} \
|
||||
@@ -1072,14 +1153,23 @@ extern "C"{ \
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_arg4_val = (ARG4_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg4_history, 0, sizeof(FUNCNAME##_arg4_history)); \
|
||||
FUNCNAME##_arg5_val = (ARG5_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg5_history, 0, sizeof(FUNCNAME##_arg5_history)); \
|
||||
FUNCNAME##_arg6_val = (ARG6_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg6_history, 0, sizeof(FUNCNAME##_arg6_history)); \
|
||||
FUNCNAME##_arg7_val = (ARG7_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg7_history, 0, sizeof(FUNCNAME##_arg7_history)); \
|
||||
FUNCNAME##_arg8_val = (ARG8_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg8_history, 0, sizeof(FUNCNAME##_arg8_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
FUNCNAME##_return_val = 0; \
|
||||
} \
|
||||
@@ -1139,6 +1229,7 @@ void RESET_HISTORY() {
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
} \
|
||||
|
||||
@@ -1169,7 +1260,9 @@ void RESET_HISTORY() {
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
} \
|
||||
|
||||
@@ -1206,8 +1299,11 @@ void RESET_HISTORY() {
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
} \
|
||||
|
||||
@@ -1250,9 +1346,13 @@ void RESET_HISTORY() {
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
} \
|
||||
|
||||
@@ -1301,10 +1401,15 @@ void RESET_HISTORY() {
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_arg4_val = (ARG4_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg4_history, 0, sizeof(FUNCNAME##_arg4_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
} \
|
||||
|
||||
@@ -1359,11 +1464,17 @@ void RESET_HISTORY() {
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_arg4_val = (ARG4_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg4_history, 0, sizeof(FUNCNAME##_arg4_history)); \
|
||||
FUNCNAME##_arg5_val = (ARG5_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg5_history, 0, sizeof(FUNCNAME##_arg5_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
} \
|
||||
|
||||
@@ -1424,12 +1535,19 @@ void RESET_HISTORY() {
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_arg4_val = (ARG4_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg4_history, 0, sizeof(FUNCNAME##_arg4_history)); \
|
||||
FUNCNAME##_arg5_val = (ARG5_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg5_history, 0, sizeof(FUNCNAME##_arg5_history)); \
|
||||
FUNCNAME##_arg6_val = (ARG6_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg6_history, 0, sizeof(FUNCNAME##_arg6_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
} \
|
||||
|
||||
@@ -1496,13 +1614,21 @@ void RESET_HISTORY() {
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_arg4_val = (ARG4_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg4_history, 0, sizeof(FUNCNAME##_arg4_history)); \
|
||||
FUNCNAME##_arg5_val = (ARG5_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg5_history, 0, sizeof(FUNCNAME##_arg5_history)); \
|
||||
FUNCNAME##_arg6_val = (ARG6_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg6_history, 0, sizeof(FUNCNAME##_arg6_history)); \
|
||||
FUNCNAME##_arg7_val = (ARG7_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg7_history, 0, sizeof(FUNCNAME##_arg7_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
} \
|
||||
|
||||
@@ -1575,14 +1701,23 @@ void RESET_HISTORY() {
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_arg4_val = (ARG4_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg4_history, 0, sizeof(FUNCNAME##_arg4_history)); \
|
||||
FUNCNAME##_arg5_val = (ARG5_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg5_history, 0, sizeof(FUNCNAME##_arg5_history)); \
|
||||
FUNCNAME##_arg6_val = (ARG6_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg6_history, 0, sizeof(FUNCNAME##_arg6_history)); \
|
||||
FUNCNAME##_arg7_val = (ARG7_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg7_history, 0, sizeof(FUNCNAME##_arg7_history)); \
|
||||
FUNCNAME##_arg8_val = (ARG8_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg8_history, 0, sizeof(FUNCNAME##_arg8_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
} \
|
||||
|
||||
@@ -1629,6 +1764,7 @@ void RESET_HISTORY() {
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
FUNCNAME##_return_val = 0; \
|
||||
} \
|
||||
@@ -1662,7 +1798,9 @@ void RESET_HISTORY() {
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
FUNCNAME##_return_val = 0; \
|
||||
} \
|
||||
@@ -1702,8 +1840,11 @@ void RESET_HISTORY() {
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
FUNCNAME##_return_val = 0; \
|
||||
} \
|
||||
@@ -1749,9 +1890,13 @@ void RESET_HISTORY() {
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
FUNCNAME##_return_val = 0; \
|
||||
} \
|
||||
@@ -1803,10 +1948,15 @@ void RESET_HISTORY() {
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_arg4_val = (ARG4_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg4_history, 0, sizeof(FUNCNAME##_arg4_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
FUNCNAME##_return_val = 0; \
|
||||
} \
|
||||
@@ -1864,11 +2014,17 @@ void RESET_HISTORY() {
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_arg4_val = (ARG4_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg4_history, 0, sizeof(FUNCNAME##_arg4_history)); \
|
||||
FUNCNAME##_arg5_val = (ARG5_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg5_history, 0, sizeof(FUNCNAME##_arg5_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
FUNCNAME##_return_val = 0; \
|
||||
} \
|
||||
@@ -1932,12 +2088,19 @@ void RESET_HISTORY() {
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_arg4_val = (ARG4_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg4_history, 0, sizeof(FUNCNAME##_arg4_history)); \
|
||||
FUNCNAME##_arg5_val = (ARG5_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg5_history, 0, sizeof(FUNCNAME##_arg5_history)); \
|
||||
FUNCNAME##_arg6_val = (ARG6_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg6_history, 0, sizeof(FUNCNAME##_arg6_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
FUNCNAME##_return_val = 0; \
|
||||
} \
|
||||
@@ -2007,13 +2170,21 @@ void RESET_HISTORY() {
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_arg4_val = (ARG4_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg4_history, 0, sizeof(FUNCNAME##_arg4_history)); \
|
||||
FUNCNAME##_arg5_val = (ARG5_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg5_history, 0, sizeof(FUNCNAME##_arg5_history)); \
|
||||
FUNCNAME##_arg6_val = (ARG6_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg6_history, 0, sizeof(FUNCNAME##_arg6_history)); \
|
||||
FUNCNAME##_arg7_val = (ARG7_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg7_history, 0, sizeof(FUNCNAME##_arg7_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
FUNCNAME##_return_val = 0; \
|
||||
} \
|
||||
@@ -2089,14 +2260,23 @@ void RESET_HISTORY() {
|
||||
} \
|
||||
void FUNCNAME##_reset(){ \
|
||||
FUNCNAME##_arg0_val = (ARG0_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg0_history, 0, sizeof(FUNCNAME##_arg0_history)); \
|
||||
FUNCNAME##_arg1_val = (ARG1_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg1_history, 0, sizeof(FUNCNAME##_arg1_history)); \
|
||||
FUNCNAME##_arg2_val = (ARG2_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg2_history, 0, sizeof(FUNCNAME##_arg2_history)); \
|
||||
FUNCNAME##_arg3_val = (ARG3_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg3_history, 0, sizeof(FUNCNAME##_arg3_history)); \
|
||||
FUNCNAME##_arg4_val = (ARG4_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg4_history, 0, sizeof(FUNCNAME##_arg4_history)); \
|
||||
FUNCNAME##_arg5_val = (ARG5_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg5_history, 0, sizeof(FUNCNAME##_arg5_history)); \
|
||||
FUNCNAME##_arg6_val = (ARG6_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg6_history, 0, sizeof(FUNCNAME##_arg6_history)); \
|
||||
FUNCNAME##_arg7_val = (ARG7_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg7_history, 0, sizeof(FUNCNAME##_arg7_history)); \
|
||||
FUNCNAME##_arg8_val = (ARG8_TYPE) 0; \
|
||||
memset(FUNCNAME##_arg8_history, 0, sizeof(FUNCNAME##_arg8_history)); \
|
||||
FUNCNAME##_call_count = 0; \
|
||||
FUNCNAME##_return_val = 0; \
|
||||
} \
|
||||
|
||||
@@ -88,20 +88,33 @@ TEST_F(FFFTestSuite, when_void_func_with_2_char_args_called_and_reset_then_captu
|
||||
|
||||
|
||||
// Argument history
|
||||
TEST_F(FFFTestSuite, when_void_func_with_2_char_args_created_default_history_is_ten_calls)
|
||||
TEST_F(FFFTestSuite, when_fake_func_created_default_history_is_ten_calls)
|
||||
{
|
||||
ASSERT_EQ(10u, (sizeof voidfunc2_arg0_history) / (sizeof voidfunc2_arg0_history[0]));
|
||||
ASSERT_EQ(10u, (sizeof voidfunc2_arg1_history) / (sizeof voidfunc2_arg1_history[0]));
|
||||
}
|
||||
|
||||
TEST_F(FFFTestSuite, when_void_func_with_2_char_args_called_then_arguments_captured_in_history)
|
||||
TEST_F(FFFTestSuite, when_fake_func_called_then_arguments_captured_in_history)
|
||||
{
|
||||
voidfunc2('g', 'h');
|
||||
ASSERT_EQ('g', voidfunc2_arg0_history[0]);
|
||||
ASSERT_EQ('h', voidfunc2_arg1_history[0]);
|
||||
}
|
||||
|
||||
TEST_F(FFFTestSuite, when_void_func_with_2_char_args_called_max_times_then_no_argument_histories_dropped)
|
||||
TEST_F(FFFTestSuite, argument_history_is_reset_when_RESET_FAKE_called)
|
||||
{
|
||||
//given
|
||||
voidfunc2('g', 'h');
|
||||
ASSERT_EQ('g', voidfunc2_arg0_history[0]);
|
||||
ASSERT_EQ('h', voidfunc2_arg1_history[0]);
|
||||
//when
|
||||
RESET_FAKE(voidfunc2);
|
||||
//then
|
||||
ASSERT_EQ('\0', voidfunc2_arg0_history[0]);
|
||||
ASSERT_EQ('\0', voidfunc2_arg1_history[0]);
|
||||
}
|
||||
|
||||
TEST_F(FFFTestSuite, when_fake_func_called_max_times_then_no_argument_histories_dropped)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; i < 10; i++)
|
||||
@@ -111,7 +124,7 @@ TEST_F(FFFTestSuite, when_void_func_with_2_char_args_called_max_times_then_no_ar
|
||||
ASSERT_EQ(0u, voidfunc2_arg_histories_dropped);
|
||||
}
|
||||
|
||||
TEST_F(FFFTestSuite, when_void_func_with_2_char_args_called_max_times_plus_one_then_one_argument_history_dropped)
|
||||
TEST_F(FFFTestSuite, when_fake_func_called_max_times_plus_one_then_one_argument_history_dropped)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; i < 10; i++)
|
||||
@@ -206,10 +219,11 @@ int main()
|
||||
RUN_TEST(FFFTestSuite, when_void_func_with_2_char_args_called_twice_then_last_args_captured);
|
||||
RUN_TEST(FFFTestSuite, when_void_func_with_2_char_args_called_and_reset_then_captured_arg_is_zero);
|
||||
|
||||
RUN_TEST(FFFTestSuite, when_void_func_with_2_char_args_created_default_history_is_ten_calls);
|
||||
RUN_TEST(FFFTestSuite, when_void_func_with_2_char_args_called_then_arguments_captured_in_history);
|
||||
RUN_TEST(FFFTestSuite, when_void_func_with_2_char_args_called_max_times_then_no_argument_histories_dropped);
|
||||
RUN_TEST(FFFTestSuite, when_void_func_with_2_char_args_called_max_times_plus_one_then_one_argument_history_dropped);
|
||||
RUN_TEST(FFFTestSuite, when_fake_func_created_default_history_is_ten_calls);
|
||||
RUN_TEST(FFFTestSuite, when_fake_func_called_then_arguments_captured_in_history);
|
||||
RUN_TEST(FFFTestSuite, argument_history_is_reset_when_RESET_FAKE_called);
|
||||
RUN_TEST(FFFTestSuite, when_fake_func_called_max_times_then_no_argument_histories_dropped);
|
||||
RUN_TEST(FFFTestSuite, when_fake_func_called_max_times_plus_one_then_one_argument_history_dropped);
|
||||
|
||||
RUN_TEST(FFFTestSuite, value_func_will_return_zero_by_default);
|
||||
RUN_TEST(FFFTestSuite, value_func_will_return_value_given);
|
||||
|
||||
@@ -89,20 +89,33 @@ TEST_F(FFFTestSuite, when_void_func_with_2_char_args_called_and_reset_then_captu
|
||||
|
||||
|
||||
// Argument history
|
||||
TEST_F(FFFTestSuite, when_void_func_with_2_char_args_created_default_history_is_ten_calls)
|
||||
TEST_F(FFFTestSuite, when_fake_func_created_default_history_is_ten_calls)
|
||||
{
|
||||
ASSERT_EQ(10u, (sizeof voidfunc2_arg0_history) / (sizeof voidfunc2_arg0_history[0]));
|
||||
ASSERT_EQ(10u, (sizeof voidfunc2_arg1_history) / (sizeof voidfunc2_arg1_history[0]));
|
||||
}
|
||||
|
||||
TEST_F(FFFTestSuite, when_void_func_with_2_char_args_called_then_arguments_captured_in_history)
|
||||
TEST_F(FFFTestSuite, when_fake_func_called_then_arguments_captured_in_history)
|
||||
{
|
||||
voidfunc2('g', 'h');
|
||||
ASSERT_EQ('g', voidfunc2_arg0_history[0]);
|
||||
ASSERT_EQ('h', voidfunc2_arg1_history[0]);
|
||||
}
|
||||
|
||||
TEST_F(FFFTestSuite, when_void_func_with_2_char_args_called_max_times_then_no_argument_histories_dropped)
|
||||
TEST_F(FFFTestSuite, argument_history_is_reset_when_RESET_FAKE_called)
|
||||
{
|
||||
//given
|
||||
voidfunc2('g', 'h');
|
||||
ASSERT_EQ('g', voidfunc2_arg0_history[0]);
|
||||
ASSERT_EQ('h', voidfunc2_arg1_history[0]);
|
||||
//when
|
||||
RESET_FAKE(voidfunc2);
|
||||
//then
|
||||
ASSERT_EQ('\0', voidfunc2_arg0_history[0]);
|
||||
ASSERT_EQ('\0', voidfunc2_arg1_history[0]);
|
||||
}
|
||||
|
||||
TEST_F(FFFTestSuite, when_fake_func_called_max_times_then_no_argument_histories_dropped)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; i < 10; i++)
|
||||
@@ -112,7 +125,7 @@ TEST_F(FFFTestSuite, when_void_func_with_2_char_args_called_max_times_then_no_ar
|
||||
ASSERT_EQ(0u, voidfunc2_arg_histories_dropped);
|
||||
}
|
||||
|
||||
TEST_F(FFFTestSuite, when_void_func_with_2_char_args_called_max_times_plus_one_then_one_argument_history_dropped)
|
||||
TEST_F(FFFTestSuite, when_fake_func_called_max_times_plus_one_then_one_argument_history_dropped)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; i < 10; i++)
|
||||
|
||||
Reference in New Issue
Block a user