c++ - Reference to an array parameter in google test/mock framework -
I have a member function with reference to an array output parameter and I would like to use it in Google's fake, but this work does not.
class:
class squared {// return: number of elements rewritten in array int foo (Structure (& amp; bar) [ArraySize]); };
Mock Class:
class mock class: public class {MOCK_CONST_METHOD1 (Fu, Int (Strait (and Anjyue) [Arresijh])); };
When I want to use it I want to write the following:
ON_CALL (mMockClass, foo (_)) .WillByDefault (DOALL (SetArgReferee & LT; 0> (MBR), returns (5)));
MBR is a proper array of stratus ( Strawberte amber [arrays]]
). When I compile it, I get the following error message:
.. / .. / .. / ... vendor / gmock-1.7.0 / include / gmock / gmock-more -actions .h: In the member function, typename testing: internal :: function & lt; F> :: Results Test :: Set ARGRIIFAAPPP & lt; K, value_type & gt; Gmock_impl & lt; F & gt; :: gmock_PerformImpl (Const Taipanam testing :: internal :: function & lt; F & gt; :: ArgumentTuple & amp;, arg0_type, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, arg9_type) constants [arg0_type with = Struct (& amp;) [32], arg1_type = test :: internal :: ExcessiveArg, arg2_type = test :: internal :: ExcessiveArg, arg3_type = test :: internal :: ExcessiveArg, arg4_type = test :: internal :: ExcessiveArg, arg5_type = test :: internal :: ExcessiveArg, arg6_type = test :: internal :: ExcessiveArg, arg7_type = test :: internal :: ExcessiveArg, arg8_type = test :: internal :: ExcessiveArg, arg9_type = test :: Intra A: ExcessiveArg, F = Void (struct (& amp;) [32]), int k = 0, Value_type = Structure *] ': ../../../../vendor/gmock-1.7. 0 / include / gmock / gmock-generated-actions.h: 655: 'Static Results Testing: Internal :: ActionHelper & lt; Results from Immediate, Results, Imple & gt; :: (Empl *, Constrode :: Tr 1 :: Tuple & Lt; A & gt; & amp;) [A = Stroke (& amp;) [32] with Result = Blank, Imple = Test :: Set ARGRAFreeActionP & lt; 0, Stret * & Gt; :: gmock_impl & lt; Void (Structure (& amp;) [32]) & gt;] '../../../../vandor/gmock-1.7.0/include/gmock/gmock-more-Actions.h: 170 : 'Typename testing :: internal :: function & lt; F> :: Results Test :: SetArgRefereeActionP & lt; K, value_type & gt; :: gmock_impl & lt; F> :: display (const typename testing :: internal :: function & lt; F & gt;: Logic stepple & amp;) [F = zero (with structure (& amp;) [32]), int k = 0 , Value_type = Structure *] Some tests CPP: 120: From here instant ../........./vendor/gmock-1.7.0/include/gmock/gmock-more-actions.h:177: error : Create 'Struct * Construction' incompatible in the assignment of 'Structure [32]': *** [Somestest] Error 1
I apologize for the error message format as far as I think the compiler's problem is the same. Considers the terms of leading, but also get a pointer to what happened to me? Update
Update: Solution
To pass parameter parameter SetArrayArgument & lt; N & gt; (First, last)
should be used.
The copy of the elements in the source range [first, last] is the N-th (0-based) logic, which can be either an indicator or an Iterator. Does not take ownership
More on the Google C ++ Mocking Framework [here] [1]
Comments
Post a Comment