mock_pb_decode.c 137 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393
  1. /*lint -e???? -save */
  2. /* AUTOGENERATED FILE. DO NOT EDIT. */
  3. #include <string.h>
  4. #include <stdlib.h>
  5. #include <setjmp.h>
  6. #include "unity.h"
  7. #include "cmock.h"
  8. #include "mock_pb_decode.h"
  9. typedef struct _CMOCK_pb_decode_CALL_INSTANCE
  10. {
  11. UNITY_LINE_TYPE LineNumber;
  12. bool ReturnVal;
  13. int CallOrder;
  14. pb_istream_t* Expected_stream;
  15. pb_field_t* Expected_fields;
  16. void* Expected_dest_struct;
  17. int Expected_stream_Depth;
  18. int Expected_fields_Depth;
  19. int Expected_dest_struct_Depth;
  20. int ReturnThruPtr_stream_Used;
  21. pb_istream_t* ReturnThruPtr_stream_Val;
  22. int ReturnThruPtr_stream_Size;
  23. int ReturnThruPtr_dest_struct_Used;
  24. void* ReturnThruPtr_dest_struct_Val;
  25. int ReturnThruPtr_dest_struct_Size;
  26. int IgnoreArg_stream;
  27. int IgnoreArg_fields;
  28. int IgnoreArg_dest_struct;
  29. } CMOCK_pb_decode_CALL_INSTANCE;
  30. typedef struct _CMOCK_pb_decode_noinit_CALL_INSTANCE
  31. {
  32. UNITY_LINE_TYPE LineNumber;
  33. bool ReturnVal;
  34. int CallOrder;
  35. pb_istream_t* Expected_stream;
  36. pb_field_t* Expected_fields;
  37. void* Expected_dest_struct;
  38. int Expected_stream_Depth;
  39. int Expected_fields_Depth;
  40. int Expected_dest_struct_Depth;
  41. int ReturnThruPtr_stream_Used;
  42. pb_istream_t* ReturnThruPtr_stream_Val;
  43. int ReturnThruPtr_stream_Size;
  44. int ReturnThruPtr_dest_struct_Used;
  45. void* ReturnThruPtr_dest_struct_Val;
  46. int ReturnThruPtr_dest_struct_Size;
  47. int IgnoreArg_stream;
  48. int IgnoreArg_fields;
  49. int IgnoreArg_dest_struct;
  50. } CMOCK_pb_decode_noinit_CALL_INSTANCE;
  51. typedef struct _CMOCK_pb_decode_delimited_CALL_INSTANCE
  52. {
  53. UNITY_LINE_TYPE LineNumber;
  54. bool ReturnVal;
  55. int CallOrder;
  56. pb_istream_t* Expected_stream;
  57. pb_field_t* Expected_fields;
  58. void* Expected_dest_struct;
  59. int Expected_stream_Depth;
  60. int Expected_fields_Depth;
  61. int Expected_dest_struct_Depth;
  62. int ReturnThruPtr_stream_Used;
  63. pb_istream_t* ReturnThruPtr_stream_Val;
  64. int ReturnThruPtr_stream_Size;
  65. int ReturnThruPtr_dest_struct_Used;
  66. void* ReturnThruPtr_dest_struct_Val;
  67. int ReturnThruPtr_dest_struct_Size;
  68. int IgnoreArg_stream;
  69. int IgnoreArg_fields;
  70. int IgnoreArg_dest_struct;
  71. } CMOCK_pb_decode_delimited_CALL_INSTANCE;
  72. typedef struct _CMOCK_pb_release_CALL_INSTANCE
  73. {
  74. UNITY_LINE_TYPE LineNumber;
  75. int CallOrder;
  76. pb_field_t* Expected_fields;
  77. void* Expected_dest_struct;
  78. int Expected_fields_Depth;
  79. int Expected_dest_struct_Depth;
  80. int ReturnThruPtr_dest_struct_Used;
  81. void* ReturnThruPtr_dest_struct_Val;
  82. int ReturnThruPtr_dest_struct_Size;
  83. int IgnoreArg_fields;
  84. int IgnoreArg_dest_struct;
  85. } CMOCK_pb_release_CALL_INSTANCE;
  86. typedef struct _CMOCK_pb_istream_from_buffer_CALL_INSTANCE
  87. {
  88. UNITY_LINE_TYPE LineNumber;
  89. pb_istream_t ReturnVal;
  90. int CallOrder;
  91. pb_byte_t* Expected_buf;
  92. size_t Expected_bufsize;
  93. int Expected_buf_Depth;
  94. int IgnoreArg_buf;
  95. int IgnoreArg_bufsize;
  96. } CMOCK_pb_istream_from_buffer_CALL_INSTANCE;
  97. typedef struct _CMOCK_pb_read_CALL_INSTANCE
  98. {
  99. UNITY_LINE_TYPE LineNumber;
  100. bool ReturnVal;
  101. int CallOrder;
  102. pb_istream_t* Expected_stream;
  103. pb_byte_t* Expected_buf;
  104. size_t Expected_count;
  105. int Expected_stream_Depth;
  106. int Expected_buf_Depth;
  107. int ReturnThruPtr_stream_Used;
  108. pb_istream_t* ReturnThruPtr_stream_Val;
  109. int ReturnThruPtr_stream_Size;
  110. int ReturnThruPtr_buf_Used;
  111. pb_byte_t* ReturnThruPtr_buf_Val;
  112. int ReturnThruPtr_buf_Size;
  113. int IgnoreArg_stream;
  114. int IgnoreArg_buf;
  115. int IgnoreArg_count;
  116. } CMOCK_pb_read_CALL_INSTANCE;
  117. typedef struct _CMOCK_pb_decode_tag_CALL_INSTANCE
  118. {
  119. UNITY_LINE_TYPE LineNumber;
  120. bool ReturnVal;
  121. int CallOrder;
  122. pb_istream_t* Expected_stream;
  123. pb_wire_type_t* Expected_wire_type;
  124. uint32_t* Expected_tag;
  125. bool* Expected_eof;
  126. int Expected_stream_Depth;
  127. int Expected_wire_type_Depth;
  128. int Expected_tag_Depth;
  129. int Expected_eof_Depth;
  130. int ReturnThruPtr_stream_Used;
  131. pb_istream_t* ReturnThruPtr_stream_Val;
  132. int ReturnThruPtr_stream_Size;
  133. int ReturnThruPtr_wire_type_Used;
  134. pb_wire_type_t* ReturnThruPtr_wire_type_Val;
  135. int ReturnThruPtr_wire_type_Size;
  136. int ReturnThruPtr_tag_Used;
  137. uint32_t* ReturnThruPtr_tag_Val;
  138. int ReturnThruPtr_tag_Size;
  139. int ReturnThruPtr_eof_Used;
  140. bool* ReturnThruPtr_eof_Val;
  141. int ReturnThruPtr_eof_Size;
  142. int IgnoreArg_stream;
  143. int IgnoreArg_wire_type;
  144. int IgnoreArg_tag;
  145. int IgnoreArg_eof;
  146. } CMOCK_pb_decode_tag_CALL_INSTANCE;
  147. typedef struct _CMOCK_pb_skip_field_CALL_INSTANCE
  148. {
  149. UNITY_LINE_TYPE LineNumber;
  150. bool ReturnVal;
  151. int CallOrder;
  152. pb_istream_t* Expected_stream;
  153. pb_wire_type_t Expected_wire_type;
  154. int Expected_stream_Depth;
  155. int ReturnThruPtr_stream_Used;
  156. pb_istream_t* ReturnThruPtr_stream_Val;
  157. int ReturnThruPtr_stream_Size;
  158. int IgnoreArg_stream;
  159. int IgnoreArg_wire_type;
  160. } CMOCK_pb_skip_field_CALL_INSTANCE;
  161. typedef struct _CMOCK_pb_decode_varint_CALL_INSTANCE
  162. {
  163. UNITY_LINE_TYPE LineNumber;
  164. bool ReturnVal;
  165. int CallOrder;
  166. pb_istream_t* Expected_stream;
  167. uint64_t* Expected_dest;
  168. int Expected_stream_Depth;
  169. int Expected_dest_Depth;
  170. int ReturnThruPtr_stream_Used;
  171. pb_istream_t* ReturnThruPtr_stream_Val;
  172. int ReturnThruPtr_stream_Size;
  173. int ReturnThruPtr_dest_Used;
  174. uint64_t* ReturnThruPtr_dest_Val;
  175. int ReturnThruPtr_dest_Size;
  176. int IgnoreArg_stream;
  177. int IgnoreArg_dest;
  178. } CMOCK_pb_decode_varint_CALL_INSTANCE;
  179. typedef struct _CMOCK_pb_decode_svarint_CALL_INSTANCE
  180. {
  181. UNITY_LINE_TYPE LineNumber;
  182. bool ReturnVal;
  183. int CallOrder;
  184. pb_istream_t* Expected_stream;
  185. int64_t* Expected_dest;
  186. int Expected_stream_Depth;
  187. int Expected_dest_Depth;
  188. int ReturnThruPtr_stream_Used;
  189. pb_istream_t* ReturnThruPtr_stream_Val;
  190. int ReturnThruPtr_stream_Size;
  191. int ReturnThruPtr_dest_Used;
  192. int64_t* ReturnThruPtr_dest_Val;
  193. int ReturnThruPtr_dest_Size;
  194. int IgnoreArg_stream;
  195. int IgnoreArg_dest;
  196. } CMOCK_pb_decode_svarint_CALL_INSTANCE;
  197. typedef struct _CMOCK_pb_decode_fixed32_CALL_INSTANCE
  198. {
  199. UNITY_LINE_TYPE LineNumber;
  200. bool ReturnVal;
  201. int CallOrder;
  202. pb_istream_t* Expected_stream;
  203. void* Expected_dest;
  204. int Expected_stream_Depth;
  205. int Expected_dest_Depth;
  206. int ReturnThruPtr_stream_Used;
  207. pb_istream_t* ReturnThruPtr_stream_Val;
  208. int ReturnThruPtr_stream_Size;
  209. int ReturnThruPtr_dest_Used;
  210. void* ReturnThruPtr_dest_Val;
  211. int ReturnThruPtr_dest_Size;
  212. int IgnoreArg_stream;
  213. int IgnoreArg_dest;
  214. } CMOCK_pb_decode_fixed32_CALL_INSTANCE;
  215. typedef struct _CMOCK_pb_decode_fixed64_CALL_INSTANCE
  216. {
  217. UNITY_LINE_TYPE LineNumber;
  218. bool ReturnVal;
  219. int CallOrder;
  220. pb_istream_t* Expected_stream;
  221. void* Expected_dest;
  222. int Expected_stream_Depth;
  223. int Expected_dest_Depth;
  224. int ReturnThruPtr_stream_Used;
  225. pb_istream_t* ReturnThruPtr_stream_Val;
  226. int ReturnThruPtr_stream_Size;
  227. int ReturnThruPtr_dest_Used;
  228. void* ReturnThruPtr_dest_Val;
  229. int ReturnThruPtr_dest_Size;
  230. int IgnoreArg_stream;
  231. int IgnoreArg_dest;
  232. } CMOCK_pb_decode_fixed64_CALL_INSTANCE;
  233. typedef struct _CMOCK_pb_make_string_substream_CALL_INSTANCE
  234. {
  235. UNITY_LINE_TYPE LineNumber;
  236. bool ReturnVal;
  237. int CallOrder;
  238. pb_istream_t* Expected_stream;
  239. pb_istream_t* Expected_substream;
  240. int Expected_stream_Depth;
  241. int Expected_substream_Depth;
  242. int ReturnThruPtr_stream_Used;
  243. pb_istream_t* ReturnThruPtr_stream_Val;
  244. int ReturnThruPtr_stream_Size;
  245. int ReturnThruPtr_substream_Used;
  246. pb_istream_t* ReturnThruPtr_substream_Val;
  247. int ReturnThruPtr_substream_Size;
  248. int IgnoreArg_stream;
  249. int IgnoreArg_substream;
  250. } CMOCK_pb_make_string_substream_CALL_INSTANCE;
  251. typedef struct _CMOCK_pb_close_string_substream_CALL_INSTANCE
  252. {
  253. UNITY_LINE_TYPE LineNumber;
  254. int CallOrder;
  255. pb_istream_t* Expected_stream;
  256. pb_istream_t* Expected_substream;
  257. int Expected_stream_Depth;
  258. int Expected_substream_Depth;
  259. int ReturnThruPtr_stream_Used;
  260. pb_istream_t* ReturnThruPtr_stream_Val;
  261. int ReturnThruPtr_stream_Size;
  262. int ReturnThruPtr_substream_Used;
  263. pb_istream_t* ReturnThruPtr_substream_Val;
  264. int ReturnThruPtr_substream_Size;
  265. int IgnoreArg_stream;
  266. int IgnoreArg_substream;
  267. } CMOCK_pb_close_string_substream_CALL_INSTANCE;
  268. static struct mock_pb_decodeInstance
  269. {
  270. int pb_decode_IgnoreBool;
  271. bool pb_decode_FinalReturn;
  272. CMOCK_pb_decode_CALLBACK pb_decode_CallbackFunctionPointer;
  273. int pb_decode_CallbackCalls;
  274. CMOCK_MEM_INDEX_TYPE pb_decode_CallInstance;
  275. int pb_decode_noinit_IgnoreBool;
  276. bool pb_decode_noinit_FinalReturn;
  277. CMOCK_pb_decode_noinit_CALLBACK pb_decode_noinit_CallbackFunctionPointer;
  278. int pb_decode_noinit_CallbackCalls;
  279. CMOCK_MEM_INDEX_TYPE pb_decode_noinit_CallInstance;
  280. int pb_decode_delimited_IgnoreBool;
  281. bool pb_decode_delimited_FinalReturn;
  282. CMOCK_pb_decode_delimited_CALLBACK pb_decode_delimited_CallbackFunctionPointer;
  283. int pb_decode_delimited_CallbackCalls;
  284. CMOCK_MEM_INDEX_TYPE pb_decode_delimited_CallInstance;
  285. int pb_release_IgnoreBool;
  286. CMOCK_pb_release_CALLBACK pb_release_CallbackFunctionPointer;
  287. int pb_release_CallbackCalls;
  288. CMOCK_MEM_INDEX_TYPE pb_release_CallInstance;
  289. int pb_istream_from_buffer_IgnoreBool;
  290. pb_istream_t pb_istream_from_buffer_FinalReturn;
  291. CMOCK_pb_istream_from_buffer_CALLBACK pb_istream_from_buffer_CallbackFunctionPointer;
  292. int pb_istream_from_buffer_CallbackCalls;
  293. CMOCK_MEM_INDEX_TYPE pb_istream_from_buffer_CallInstance;
  294. int pb_read_IgnoreBool;
  295. bool pb_read_FinalReturn;
  296. CMOCK_pb_read_CALLBACK pb_read_CallbackFunctionPointer;
  297. int pb_read_CallbackCalls;
  298. CMOCK_MEM_INDEX_TYPE pb_read_CallInstance;
  299. int pb_decode_tag_IgnoreBool;
  300. bool pb_decode_tag_FinalReturn;
  301. CMOCK_pb_decode_tag_CALLBACK pb_decode_tag_CallbackFunctionPointer;
  302. int pb_decode_tag_CallbackCalls;
  303. CMOCK_MEM_INDEX_TYPE pb_decode_tag_CallInstance;
  304. int pb_skip_field_IgnoreBool;
  305. bool pb_skip_field_FinalReturn;
  306. CMOCK_pb_skip_field_CALLBACK pb_skip_field_CallbackFunctionPointer;
  307. int pb_skip_field_CallbackCalls;
  308. CMOCK_MEM_INDEX_TYPE pb_skip_field_CallInstance;
  309. int pb_decode_varint_IgnoreBool;
  310. bool pb_decode_varint_FinalReturn;
  311. CMOCK_pb_decode_varint_CALLBACK pb_decode_varint_CallbackFunctionPointer;
  312. int pb_decode_varint_CallbackCalls;
  313. CMOCK_MEM_INDEX_TYPE pb_decode_varint_CallInstance;
  314. int pb_decode_svarint_IgnoreBool;
  315. bool pb_decode_svarint_FinalReturn;
  316. CMOCK_pb_decode_svarint_CALLBACK pb_decode_svarint_CallbackFunctionPointer;
  317. int pb_decode_svarint_CallbackCalls;
  318. CMOCK_MEM_INDEX_TYPE pb_decode_svarint_CallInstance;
  319. int pb_decode_fixed32_IgnoreBool;
  320. bool pb_decode_fixed32_FinalReturn;
  321. CMOCK_pb_decode_fixed32_CALLBACK pb_decode_fixed32_CallbackFunctionPointer;
  322. int pb_decode_fixed32_CallbackCalls;
  323. CMOCK_MEM_INDEX_TYPE pb_decode_fixed32_CallInstance;
  324. int pb_decode_fixed64_IgnoreBool;
  325. bool pb_decode_fixed64_FinalReturn;
  326. CMOCK_pb_decode_fixed64_CALLBACK pb_decode_fixed64_CallbackFunctionPointer;
  327. int pb_decode_fixed64_CallbackCalls;
  328. CMOCK_MEM_INDEX_TYPE pb_decode_fixed64_CallInstance;
  329. int pb_make_string_substream_IgnoreBool;
  330. bool pb_make_string_substream_FinalReturn;
  331. CMOCK_pb_make_string_substream_CALLBACK pb_make_string_substream_CallbackFunctionPointer;
  332. int pb_make_string_substream_CallbackCalls;
  333. CMOCK_MEM_INDEX_TYPE pb_make_string_substream_CallInstance;
  334. int pb_close_string_substream_IgnoreBool;
  335. CMOCK_pb_close_string_substream_CALLBACK pb_close_string_substream_CallbackFunctionPointer;
  336. int pb_close_string_substream_CallbackCalls;
  337. CMOCK_MEM_INDEX_TYPE pb_close_string_substream_CallInstance;
  338. } Mock;
  339. extern jmp_buf AbortFrame;
  340. extern int GlobalExpectCount;
  341. extern int GlobalVerifyOrder;
  342. void mock_pb_decode_Verify(void)
  343. {
  344. UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  345. UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == Mock.pb_decode_CallInstance, cmock_line, "Function 'pb_decode' called less times than expected.");
  346. if (Mock.pb_decode_CallbackFunctionPointer != NULL)
  347. Mock.pb_decode_CallInstance = CMOCK_GUTS_NONE;
  348. UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == Mock.pb_decode_noinit_CallInstance, cmock_line, "Function 'pb_decode_noinit' called less times than expected.");
  349. if (Mock.pb_decode_noinit_CallbackFunctionPointer != NULL)
  350. Mock.pb_decode_noinit_CallInstance = CMOCK_GUTS_NONE;
  351. UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == Mock.pb_decode_delimited_CallInstance, cmock_line, "Function 'pb_decode_delimited' called less times than expected.");
  352. if (Mock.pb_decode_delimited_CallbackFunctionPointer != NULL)
  353. Mock.pb_decode_delimited_CallInstance = CMOCK_GUTS_NONE;
  354. UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == Mock.pb_release_CallInstance, cmock_line, "Function 'pb_release' called less times than expected.");
  355. if (Mock.pb_release_CallbackFunctionPointer != NULL)
  356. Mock.pb_release_CallInstance = CMOCK_GUTS_NONE;
  357. UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == Mock.pb_istream_from_buffer_CallInstance, cmock_line, "Function 'pb_istream_from_buffer' called less times than expected.");
  358. if (Mock.pb_istream_from_buffer_CallbackFunctionPointer != NULL)
  359. Mock.pb_istream_from_buffer_CallInstance = CMOCK_GUTS_NONE;
  360. UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == Mock.pb_read_CallInstance, cmock_line, "Function 'pb_read' called less times than expected.");
  361. if (Mock.pb_read_CallbackFunctionPointer != NULL)
  362. Mock.pb_read_CallInstance = CMOCK_GUTS_NONE;
  363. UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == Mock.pb_decode_tag_CallInstance, cmock_line, "Function 'pb_decode_tag' called less times than expected.");
  364. if (Mock.pb_decode_tag_CallbackFunctionPointer != NULL)
  365. Mock.pb_decode_tag_CallInstance = CMOCK_GUTS_NONE;
  366. UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == Mock.pb_skip_field_CallInstance, cmock_line, "Function 'pb_skip_field' called less times than expected.");
  367. if (Mock.pb_skip_field_CallbackFunctionPointer != NULL)
  368. Mock.pb_skip_field_CallInstance = CMOCK_GUTS_NONE;
  369. UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == Mock.pb_decode_varint_CallInstance, cmock_line, "Function 'pb_decode_varint' called less times than expected.");
  370. if (Mock.pb_decode_varint_CallbackFunctionPointer != NULL)
  371. Mock.pb_decode_varint_CallInstance = CMOCK_GUTS_NONE;
  372. UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == Mock.pb_decode_svarint_CallInstance, cmock_line, "Function 'pb_decode_svarint' called less times than expected.");
  373. if (Mock.pb_decode_svarint_CallbackFunctionPointer != NULL)
  374. Mock.pb_decode_svarint_CallInstance = CMOCK_GUTS_NONE;
  375. UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == Mock.pb_decode_fixed32_CallInstance, cmock_line, "Function 'pb_decode_fixed32' called less times than expected.");
  376. if (Mock.pb_decode_fixed32_CallbackFunctionPointer != NULL)
  377. Mock.pb_decode_fixed32_CallInstance = CMOCK_GUTS_NONE;
  378. UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == Mock.pb_decode_fixed64_CallInstance, cmock_line, "Function 'pb_decode_fixed64' called less times than expected.");
  379. if (Mock.pb_decode_fixed64_CallbackFunctionPointer != NULL)
  380. Mock.pb_decode_fixed64_CallInstance = CMOCK_GUTS_NONE;
  381. UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == Mock.pb_make_string_substream_CallInstance, cmock_line, "Function 'pb_make_string_substream' called less times than expected.");
  382. if (Mock.pb_make_string_substream_CallbackFunctionPointer != NULL)
  383. Mock.pb_make_string_substream_CallInstance = CMOCK_GUTS_NONE;
  384. UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == Mock.pb_close_string_substream_CallInstance, cmock_line, "Function 'pb_close_string_substream' called less times than expected.");
  385. if (Mock.pb_close_string_substream_CallbackFunctionPointer != NULL)
  386. Mock.pb_close_string_substream_CallInstance = CMOCK_GUTS_NONE;
  387. }
  388. void mock_pb_decode_Init(void)
  389. {
  390. mock_pb_decode_Destroy();
  391. }
  392. void mock_pb_decode_Destroy(void)
  393. {
  394. CMock_Guts_MemFreeAll();
  395. memset(&Mock, 0, sizeof(Mock));
  396. Mock.pb_decode_CallbackFunctionPointer = NULL;
  397. Mock.pb_decode_CallbackCalls = 0;
  398. Mock.pb_decode_noinit_CallbackFunctionPointer = NULL;
  399. Mock.pb_decode_noinit_CallbackCalls = 0;
  400. Mock.pb_decode_delimited_CallbackFunctionPointer = NULL;
  401. Mock.pb_decode_delimited_CallbackCalls = 0;
  402. Mock.pb_release_CallbackFunctionPointer = NULL;
  403. Mock.pb_release_CallbackCalls = 0;
  404. Mock.pb_istream_from_buffer_CallbackFunctionPointer = NULL;
  405. Mock.pb_istream_from_buffer_CallbackCalls = 0;
  406. Mock.pb_read_CallbackFunctionPointer = NULL;
  407. Mock.pb_read_CallbackCalls = 0;
  408. Mock.pb_decode_tag_CallbackFunctionPointer = NULL;
  409. Mock.pb_decode_tag_CallbackCalls = 0;
  410. Mock.pb_skip_field_CallbackFunctionPointer = NULL;
  411. Mock.pb_skip_field_CallbackCalls = 0;
  412. Mock.pb_decode_varint_CallbackFunctionPointer = NULL;
  413. Mock.pb_decode_varint_CallbackCalls = 0;
  414. Mock.pb_decode_svarint_CallbackFunctionPointer = NULL;
  415. Mock.pb_decode_svarint_CallbackCalls = 0;
  416. Mock.pb_decode_fixed32_CallbackFunctionPointer = NULL;
  417. Mock.pb_decode_fixed32_CallbackCalls = 0;
  418. Mock.pb_decode_fixed64_CallbackFunctionPointer = NULL;
  419. Mock.pb_decode_fixed64_CallbackCalls = 0;
  420. Mock.pb_make_string_substream_CallbackFunctionPointer = NULL;
  421. Mock.pb_make_string_substream_CallbackCalls = 0;
  422. Mock.pb_close_string_substream_CallbackFunctionPointer = NULL;
  423. Mock.pb_close_string_substream_CallbackCalls = 0;
  424. GlobalExpectCount = 0;
  425. GlobalVerifyOrder = 0;
  426. }
  427. bool pb_decode(pb_istream_t* stream, const pb_field_t* fields, void* dest_struct)
  428. {
  429. UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  430. CMOCK_pb_decode_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.pb_decode_CallInstance);
  431. Mock.pb_decode_CallInstance = CMock_Guts_MemNext(Mock.pb_decode_CallInstance);
  432. if (Mock.pb_decode_IgnoreBool)
  433. {
  434. if (cmock_call_instance == NULL)
  435. return Mock.pb_decode_FinalReturn;
  436. Mock.pb_decode_FinalReturn = cmock_call_instance->ReturnVal;
  437. return cmock_call_instance->ReturnVal;
  438. }
  439. if (Mock.pb_decode_CallbackFunctionPointer != NULL)
  440. {
  441. return Mock.pb_decode_CallbackFunctionPointer(stream, fields, dest_struct, Mock.pb_decode_CallbackCalls++);
  442. }
  443. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'pb_decode' called more times than expected.");
  444. cmock_line = cmock_call_instance->LineNumber;
  445. if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
  446. UNITY_TEST_FAIL(cmock_line, "Function 'pb_decode' called earlier than expected.");
  447. if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
  448. UNITY_TEST_FAIL(cmock_line, "Function 'pb_decode' called later than expected.");
  449. if (!cmock_call_instance->IgnoreArg_stream)
  450. {
  451. if (cmock_call_instance->Expected_stream == NULL)
  452. { UNITY_TEST_ASSERT_NULL(stream, cmock_line, "Expected NULL. Function 'pb_decode' called with unexpected value for argument 'stream'."); }
  453. else if (cmock_call_instance->Expected_stream_Depth == 0)
  454. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_stream, stream, cmock_line, "Function 'pb_decode' called with unexpected value for argument 'stream'."); }
  455. else
  456. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_stream), (void*)(stream), sizeof(pb_istream_t), cmock_call_instance->Expected_stream_Depth, cmock_line, "Function 'pb_decode' called with unexpected value for argument 'stream'."); }
  457. }
  458. if (!cmock_call_instance->IgnoreArg_fields)
  459. {
  460. if (cmock_call_instance->Expected_fields == NULL)
  461. { UNITY_TEST_ASSERT_NULL(fields, cmock_line, "Expected NULL. Function 'pb_decode' called with unexpected value for argument 'fields'."); }
  462. else if (cmock_call_instance->Expected_fields_Depth == 0)
  463. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_fields, fields, cmock_line, "Function 'pb_decode' called with unexpected value for argument 'fields'."); }
  464. else
  465. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_fields), (void*)(fields), sizeof(pb_field_t), cmock_call_instance->Expected_fields_Depth, cmock_line, "Function 'pb_decode' called with unexpected value for argument 'fields'."); }
  466. }
  467. if (!cmock_call_instance->IgnoreArg_dest_struct)
  468. {
  469. UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_dest_struct, dest_struct, cmock_line, "Function 'pb_decode' called with unexpected value for argument 'dest_struct'.");
  470. }
  471. if (cmock_call_instance->ReturnThruPtr_stream_Used)
  472. {
  473. memcpy((void*)stream, (void*)cmock_call_instance->ReturnThruPtr_stream_Val,
  474. cmock_call_instance->ReturnThruPtr_stream_Size);
  475. }
  476. if (cmock_call_instance->ReturnThruPtr_dest_struct_Used)
  477. {
  478. memcpy((void*)dest_struct, (void*)cmock_call_instance->ReturnThruPtr_dest_struct_Val,
  479. cmock_call_instance->ReturnThruPtr_dest_struct_Size);
  480. }
  481. return cmock_call_instance->ReturnVal;
  482. }
  483. void CMockExpectParameters_pb_decode(CMOCK_pb_decode_CALL_INSTANCE* cmock_call_instance, pb_istream_t* stream, int stream_Depth, const pb_field_t* fields, int fields_Depth, void* dest_struct, int dest_struct_Depth)
  484. {
  485. cmock_call_instance->Expected_stream = stream;
  486. cmock_call_instance->Expected_stream_Depth = stream_Depth;
  487. cmock_call_instance->IgnoreArg_stream = 0;
  488. cmock_call_instance->ReturnThruPtr_stream_Used = 0;
  489. cmock_call_instance->Expected_fields = (pb_field_t*)fields;
  490. cmock_call_instance->Expected_fields_Depth = fields_Depth;
  491. cmock_call_instance->IgnoreArg_fields = 0;
  492. cmock_call_instance->Expected_dest_struct = dest_struct;
  493. cmock_call_instance->Expected_dest_struct_Depth = dest_struct_Depth;
  494. cmock_call_instance->IgnoreArg_dest_struct = 0;
  495. cmock_call_instance->ReturnThruPtr_dest_struct_Used = 0;
  496. }
  497. void pb_decode_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, bool cmock_to_return)
  498. {
  499. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_CALL_INSTANCE));
  500. CMOCK_pb_decode_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  501. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  502. Mock.pb_decode_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_CallInstance, cmock_guts_index);
  503. cmock_call_instance->LineNumber = cmock_line;
  504. cmock_call_instance->ReturnVal = cmock_to_return;
  505. Mock.pb_decode_IgnoreBool = (int)1;
  506. }
  507. void pb_decode_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, const pb_field_t* fields, void* dest_struct, bool cmock_to_return)
  508. {
  509. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_CALL_INSTANCE));
  510. CMOCK_pb_decode_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  511. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  512. Mock.pb_decode_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_CallInstance, cmock_guts_index);
  513. cmock_call_instance->LineNumber = cmock_line;
  514. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  515. CMockExpectParameters_pb_decode(cmock_call_instance, stream, 0, fields, 0, dest_struct, 0);
  516. cmock_call_instance->ReturnVal = cmock_to_return;
  517. }
  518. void pb_decode_StubWithCallback(CMOCK_pb_decode_CALLBACK Callback)
  519. {
  520. Mock.pb_decode_CallbackFunctionPointer = Callback;
  521. }
  522. void pb_decode_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int stream_Depth, pb_field_t* fields, int fields_Depth, void* dest_struct, int dest_struct_Depth, bool cmock_to_return)
  523. {
  524. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_CALL_INSTANCE));
  525. CMOCK_pb_decode_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  526. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  527. Mock.pb_decode_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_CallInstance, cmock_guts_index);
  528. cmock_call_instance->LineNumber = cmock_line;
  529. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  530. CMockExpectParameters_pb_decode(cmock_call_instance, stream, stream_Depth, fields, fields_Depth, dest_struct, dest_struct_Depth);
  531. cmock_call_instance->ReturnVal = cmock_to_return;
  532. }
  533. void pb_decode_CMockReturnMemThruPtr_stream(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int cmock_size)
  534. {
  535. CMOCK_pb_decode_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_CallInstance));
  536. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream ReturnThruPtr called before Expect on 'pb_decode'.");
  537. cmock_call_instance->ReturnThruPtr_stream_Used = 1;
  538. cmock_call_instance->ReturnThruPtr_stream_Val = stream;
  539. cmock_call_instance->ReturnThruPtr_stream_Size = cmock_size;
  540. }
  541. void pb_decode_CMockReturnMemThruPtr_dest_struct(UNITY_LINE_TYPE cmock_line, void* dest_struct, int cmock_size)
  542. {
  543. CMOCK_pb_decode_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_CallInstance));
  544. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "dest_struct ReturnThruPtr called before Expect on 'pb_decode'.");
  545. cmock_call_instance->ReturnThruPtr_dest_struct_Used = 1;
  546. cmock_call_instance->ReturnThruPtr_dest_struct_Val = dest_struct;
  547. cmock_call_instance->ReturnThruPtr_dest_struct_Size = cmock_size;
  548. }
  549. void pb_decode_CMockIgnoreArg_stream(UNITY_LINE_TYPE cmock_line)
  550. {
  551. CMOCK_pb_decode_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_CallInstance));
  552. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream IgnoreArg called before Expect on 'pb_decode'.");
  553. cmock_call_instance->IgnoreArg_stream = 1;
  554. }
  555. void pb_decode_CMockIgnoreArg_fields(UNITY_LINE_TYPE cmock_line)
  556. {
  557. CMOCK_pb_decode_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_CallInstance));
  558. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "fields IgnoreArg called before Expect on 'pb_decode'.");
  559. cmock_call_instance->IgnoreArg_fields = 1;
  560. }
  561. void pb_decode_CMockIgnoreArg_dest_struct(UNITY_LINE_TYPE cmock_line)
  562. {
  563. CMOCK_pb_decode_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_CallInstance));
  564. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "dest_struct IgnoreArg called before Expect on 'pb_decode'.");
  565. cmock_call_instance->IgnoreArg_dest_struct = 1;
  566. }
  567. bool pb_decode_noinit(pb_istream_t* stream, const pb_field_t* fields, void* dest_struct)
  568. {
  569. UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  570. CMOCK_pb_decode_noinit_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_noinit_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.pb_decode_noinit_CallInstance);
  571. Mock.pb_decode_noinit_CallInstance = CMock_Guts_MemNext(Mock.pb_decode_noinit_CallInstance);
  572. if (Mock.pb_decode_noinit_IgnoreBool)
  573. {
  574. if (cmock_call_instance == NULL)
  575. return Mock.pb_decode_noinit_FinalReturn;
  576. Mock.pb_decode_noinit_FinalReturn = cmock_call_instance->ReturnVal;
  577. return cmock_call_instance->ReturnVal;
  578. }
  579. if (Mock.pb_decode_noinit_CallbackFunctionPointer != NULL)
  580. {
  581. return Mock.pb_decode_noinit_CallbackFunctionPointer(stream, fields, dest_struct, Mock.pb_decode_noinit_CallbackCalls++);
  582. }
  583. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'pb_decode_noinit' called more times than expected.");
  584. cmock_line = cmock_call_instance->LineNumber;
  585. if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
  586. UNITY_TEST_FAIL(cmock_line, "Function 'pb_decode_noinit' called earlier than expected.");
  587. if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
  588. UNITY_TEST_FAIL(cmock_line, "Function 'pb_decode_noinit' called later than expected.");
  589. if (!cmock_call_instance->IgnoreArg_stream)
  590. {
  591. if (cmock_call_instance->Expected_stream == NULL)
  592. { UNITY_TEST_ASSERT_NULL(stream, cmock_line, "Expected NULL. Function 'pb_decode_noinit' called with unexpected value for argument 'stream'."); }
  593. else if (cmock_call_instance->Expected_stream_Depth == 0)
  594. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_stream, stream, cmock_line, "Function 'pb_decode_noinit' called with unexpected value for argument 'stream'."); }
  595. else
  596. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_stream), (void*)(stream), sizeof(pb_istream_t), cmock_call_instance->Expected_stream_Depth, cmock_line, "Function 'pb_decode_noinit' called with unexpected value for argument 'stream'."); }
  597. }
  598. if (!cmock_call_instance->IgnoreArg_fields)
  599. {
  600. if (cmock_call_instance->Expected_fields == NULL)
  601. { UNITY_TEST_ASSERT_NULL(fields, cmock_line, "Expected NULL. Function 'pb_decode_noinit' called with unexpected value for argument 'fields'."); }
  602. else if (cmock_call_instance->Expected_fields_Depth == 0)
  603. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_fields, fields, cmock_line, "Function 'pb_decode_noinit' called with unexpected value for argument 'fields'."); }
  604. else
  605. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_fields), (void*)(fields), sizeof(pb_field_t), cmock_call_instance->Expected_fields_Depth, cmock_line, "Function 'pb_decode_noinit' called with unexpected value for argument 'fields'."); }
  606. }
  607. if (!cmock_call_instance->IgnoreArg_dest_struct)
  608. {
  609. UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_dest_struct, dest_struct, cmock_line, "Function 'pb_decode_noinit' called with unexpected value for argument 'dest_struct'.");
  610. }
  611. if (cmock_call_instance->ReturnThruPtr_stream_Used)
  612. {
  613. memcpy((void*)stream, (void*)cmock_call_instance->ReturnThruPtr_stream_Val,
  614. cmock_call_instance->ReturnThruPtr_stream_Size);
  615. }
  616. if (cmock_call_instance->ReturnThruPtr_dest_struct_Used)
  617. {
  618. memcpy((void*)dest_struct, (void*)cmock_call_instance->ReturnThruPtr_dest_struct_Val,
  619. cmock_call_instance->ReturnThruPtr_dest_struct_Size);
  620. }
  621. return cmock_call_instance->ReturnVal;
  622. }
  623. void CMockExpectParameters_pb_decode_noinit(CMOCK_pb_decode_noinit_CALL_INSTANCE* cmock_call_instance, pb_istream_t* stream, int stream_Depth, const pb_field_t* fields, int fields_Depth, void* dest_struct, int dest_struct_Depth)
  624. {
  625. cmock_call_instance->Expected_stream = stream;
  626. cmock_call_instance->Expected_stream_Depth = stream_Depth;
  627. cmock_call_instance->IgnoreArg_stream = 0;
  628. cmock_call_instance->ReturnThruPtr_stream_Used = 0;
  629. cmock_call_instance->Expected_fields = (pb_field_t*)fields;
  630. cmock_call_instance->Expected_fields_Depth = fields_Depth;
  631. cmock_call_instance->IgnoreArg_fields = 0;
  632. cmock_call_instance->Expected_dest_struct = dest_struct;
  633. cmock_call_instance->Expected_dest_struct_Depth = dest_struct_Depth;
  634. cmock_call_instance->IgnoreArg_dest_struct = 0;
  635. cmock_call_instance->ReturnThruPtr_dest_struct_Used = 0;
  636. }
  637. void pb_decode_noinit_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, bool cmock_to_return)
  638. {
  639. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_noinit_CALL_INSTANCE));
  640. CMOCK_pb_decode_noinit_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_noinit_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  641. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  642. Mock.pb_decode_noinit_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_noinit_CallInstance, cmock_guts_index);
  643. cmock_call_instance->LineNumber = cmock_line;
  644. cmock_call_instance->ReturnVal = cmock_to_return;
  645. Mock.pb_decode_noinit_IgnoreBool = (int)1;
  646. }
  647. void pb_decode_noinit_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, const pb_field_t* fields, void* dest_struct, bool cmock_to_return)
  648. {
  649. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_noinit_CALL_INSTANCE));
  650. CMOCK_pb_decode_noinit_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_noinit_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  651. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  652. Mock.pb_decode_noinit_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_noinit_CallInstance, cmock_guts_index);
  653. cmock_call_instance->LineNumber = cmock_line;
  654. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  655. CMockExpectParameters_pb_decode_noinit(cmock_call_instance, stream, 0, fields, 0, dest_struct, 0);
  656. cmock_call_instance->ReturnVal = cmock_to_return;
  657. }
  658. void pb_decode_noinit_StubWithCallback(CMOCK_pb_decode_noinit_CALLBACK Callback)
  659. {
  660. Mock.pb_decode_noinit_CallbackFunctionPointer = Callback;
  661. }
  662. void pb_decode_noinit_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int stream_Depth, pb_field_t* fields, int fields_Depth, void* dest_struct, int dest_struct_Depth, bool cmock_to_return)
  663. {
  664. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_noinit_CALL_INSTANCE));
  665. CMOCK_pb_decode_noinit_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_noinit_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  666. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  667. Mock.pb_decode_noinit_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_noinit_CallInstance, cmock_guts_index);
  668. cmock_call_instance->LineNumber = cmock_line;
  669. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  670. CMockExpectParameters_pb_decode_noinit(cmock_call_instance, stream, stream_Depth, fields, fields_Depth, dest_struct, dest_struct_Depth);
  671. cmock_call_instance->ReturnVal = cmock_to_return;
  672. }
  673. void pb_decode_noinit_CMockReturnMemThruPtr_stream(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int cmock_size)
  674. {
  675. CMOCK_pb_decode_noinit_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_noinit_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_noinit_CallInstance));
  676. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream ReturnThruPtr called before Expect on 'pb_decode_noinit'.");
  677. cmock_call_instance->ReturnThruPtr_stream_Used = 1;
  678. cmock_call_instance->ReturnThruPtr_stream_Val = stream;
  679. cmock_call_instance->ReturnThruPtr_stream_Size = cmock_size;
  680. }
  681. void pb_decode_noinit_CMockReturnMemThruPtr_dest_struct(UNITY_LINE_TYPE cmock_line, void* dest_struct, int cmock_size)
  682. {
  683. CMOCK_pb_decode_noinit_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_noinit_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_noinit_CallInstance));
  684. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "dest_struct ReturnThruPtr called before Expect on 'pb_decode_noinit'.");
  685. cmock_call_instance->ReturnThruPtr_dest_struct_Used = 1;
  686. cmock_call_instance->ReturnThruPtr_dest_struct_Val = dest_struct;
  687. cmock_call_instance->ReturnThruPtr_dest_struct_Size = cmock_size;
  688. }
  689. void pb_decode_noinit_CMockIgnoreArg_stream(UNITY_LINE_TYPE cmock_line)
  690. {
  691. CMOCK_pb_decode_noinit_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_noinit_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_noinit_CallInstance));
  692. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream IgnoreArg called before Expect on 'pb_decode_noinit'.");
  693. cmock_call_instance->IgnoreArg_stream = 1;
  694. }
  695. void pb_decode_noinit_CMockIgnoreArg_fields(UNITY_LINE_TYPE cmock_line)
  696. {
  697. CMOCK_pb_decode_noinit_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_noinit_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_noinit_CallInstance));
  698. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "fields IgnoreArg called before Expect on 'pb_decode_noinit'.");
  699. cmock_call_instance->IgnoreArg_fields = 1;
  700. }
  701. void pb_decode_noinit_CMockIgnoreArg_dest_struct(UNITY_LINE_TYPE cmock_line)
  702. {
  703. CMOCK_pb_decode_noinit_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_noinit_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_noinit_CallInstance));
  704. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "dest_struct IgnoreArg called before Expect on 'pb_decode_noinit'.");
  705. cmock_call_instance->IgnoreArg_dest_struct = 1;
  706. }
  707. bool pb_decode_delimited(pb_istream_t* stream, const pb_field_t* fields, void* dest_struct)
  708. {
  709. UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  710. CMOCK_pb_decode_delimited_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_delimited_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.pb_decode_delimited_CallInstance);
  711. Mock.pb_decode_delimited_CallInstance = CMock_Guts_MemNext(Mock.pb_decode_delimited_CallInstance);
  712. if (Mock.pb_decode_delimited_IgnoreBool)
  713. {
  714. if (cmock_call_instance == NULL)
  715. return Mock.pb_decode_delimited_FinalReturn;
  716. Mock.pb_decode_delimited_FinalReturn = cmock_call_instance->ReturnVal;
  717. return cmock_call_instance->ReturnVal;
  718. }
  719. if (Mock.pb_decode_delimited_CallbackFunctionPointer != NULL)
  720. {
  721. return Mock.pb_decode_delimited_CallbackFunctionPointer(stream, fields, dest_struct, Mock.pb_decode_delimited_CallbackCalls++);
  722. }
  723. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'pb_decode_delimited' called more times than expected.");
  724. cmock_line = cmock_call_instance->LineNumber;
  725. if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
  726. UNITY_TEST_FAIL(cmock_line, "Function 'pb_decode_delimited' called earlier than expected.");
  727. if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
  728. UNITY_TEST_FAIL(cmock_line, "Function 'pb_decode_delimited' called later than expected.");
  729. if (!cmock_call_instance->IgnoreArg_stream)
  730. {
  731. if (cmock_call_instance->Expected_stream == NULL)
  732. { UNITY_TEST_ASSERT_NULL(stream, cmock_line, "Expected NULL. Function 'pb_decode_delimited' called with unexpected value for argument 'stream'."); }
  733. else if (cmock_call_instance->Expected_stream_Depth == 0)
  734. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_stream, stream, cmock_line, "Function 'pb_decode_delimited' called with unexpected value for argument 'stream'."); }
  735. else
  736. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_stream), (void*)(stream), sizeof(pb_istream_t), cmock_call_instance->Expected_stream_Depth, cmock_line, "Function 'pb_decode_delimited' called with unexpected value for argument 'stream'."); }
  737. }
  738. if (!cmock_call_instance->IgnoreArg_fields)
  739. {
  740. if (cmock_call_instance->Expected_fields == NULL)
  741. { UNITY_TEST_ASSERT_NULL(fields, cmock_line, "Expected NULL. Function 'pb_decode_delimited' called with unexpected value for argument 'fields'."); }
  742. else if (cmock_call_instance->Expected_fields_Depth == 0)
  743. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_fields, fields, cmock_line, "Function 'pb_decode_delimited' called with unexpected value for argument 'fields'."); }
  744. else
  745. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_fields), (void*)(fields), sizeof(pb_field_t), cmock_call_instance->Expected_fields_Depth, cmock_line, "Function 'pb_decode_delimited' called with unexpected value for argument 'fields'."); }
  746. }
  747. if (!cmock_call_instance->IgnoreArg_dest_struct)
  748. {
  749. UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_dest_struct, dest_struct, cmock_line, "Function 'pb_decode_delimited' called with unexpected value for argument 'dest_struct'.");
  750. }
  751. if (cmock_call_instance->ReturnThruPtr_stream_Used)
  752. {
  753. memcpy((void*)stream, (void*)cmock_call_instance->ReturnThruPtr_stream_Val,
  754. cmock_call_instance->ReturnThruPtr_stream_Size);
  755. }
  756. if (cmock_call_instance->ReturnThruPtr_dest_struct_Used)
  757. {
  758. memcpy((void*)dest_struct, (void*)cmock_call_instance->ReturnThruPtr_dest_struct_Val,
  759. cmock_call_instance->ReturnThruPtr_dest_struct_Size);
  760. }
  761. return cmock_call_instance->ReturnVal;
  762. }
  763. void CMockExpectParameters_pb_decode_delimited(CMOCK_pb_decode_delimited_CALL_INSTANCE* cmock_call_instance, pb_istream_t* stream, int stream_Depth, const pb_field_t* fields, int fields_Depth, void* dest_struct, int dest_struct_Depth)
  764. {
  765. cmock_call_instance->Expected_stream = stream;
  766. cmock_call_instance->Expected_stream_Depth = stream_Depth;
  767. cmock_call_instance->IgnoreArg_stream = 0;
  768. cmock_call_instance->ReturnThruPtr_stream_Used = 0;
  769. cmock_call_instance->Expected_fields = (pb_field_t*)fields;
  770. cmock_call_instance->Expected_fields_Depth = fields_Depth;
  771. cmock_call_instance->IgnoreArg_fields = 0;
  772. cmock_call_instance->Expected_dest_struct = dest_struct;
  773. cmock_call_instance->Expected_dest_struct_Depth = dest_struct_Depth;
  774. cmock_call_instance->IgnoreArg_dest_struct = 0;
  775. cmock_call_instance->ReturnThruPtr_dest_struct_Used = 0;
  776. }
  777. void pb_decode_delimited_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, bool cmock_to_return)
  778. {
  779. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_delimited_CALL_INSTANCE));
  780. CMOCK_pb_decode_delimited_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_delimited_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  781. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  782. Mock.pb_decode_delimited_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_delimited_CallInstance, cmock_guts_index);
  783. cmock_call_instance->LineNumber = cmock_line;
  784. cmock_call_instance->ReturnVal = cmock_to_return;
  785. Mock.pb_decode_delimited_IgnoreBool = (int)1;
  786. }
  787. void pb_decode_delimited_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, const pb_field_t* fields, void* dest_struct, bool cmock_to_return)
  788. {
  789. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_delimited_CALL_INSTANCE));
  790. CMOCK_pb_decode_delimited_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_delimited_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  791. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  792. Mock.pb_decode_delimited_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_delimited_CallInstance, cmock_guts_index);
  793. cmock_call_instance->LineNumber = cmock_line;
  794. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  795. CMockExpectParameters_pb_decode_delimited(cmock_call_instance, stream, 0, fields, 0, dest_struct, 0);
  796. cmock_call_instance->ReturnVal = cmock_to_return;
  797. }
  798. void pb_decode_delimited_StubWithCallback(CMOCK_pb_decode_delimited_CALLBACK Callback)
  799. {
  800. Mock.pb_decode_delimited_CallbackFunctionPointer = Callback;
  801. }
  802. void pb_decode_delimited_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int stream_Depth, pb_field_t* fields, int fields_Depth, void* dest_struct, int dest_struct_Depth, bool cmock_to_return)
  803. {
  804. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_delimited_CALL_INSTANCE));
  805. CMOCK_pb_decode_delimited_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_delimited_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  806. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  807. Mock.pb_decode_delimited_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_delimited_CallInstance, cmock_guts_index);
  808. cmock_call_instance->LineNumber = cmock_line;
  809. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  810. CMockExpectParameters_pb_decode_delimited(cmock_call_instance, stream, stream_Depth, fields, fields_Depth, dest_struct, dest_struct_Depth);
  811. cmock_call_instance->ReturnVal = cmock_to_return;
  812. }
  813. void pb_decode_delimited_CMockReturnMemThruPtr_stream(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int cmock_size)
  814. {
  815. CMOCK_pb_decode_delimited_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_delimited_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_delimited_CallInstance));
  816. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream ReturnThruPtr called before Expect on 'pb_decode_delimited'.");
  817. cmock_call_instance->ReturnThruPtr_stream_Used = 1;
  818. cmock_call_instance->ReturnThruPtr_stream_Val = stream;
  819. cmock_call_instance->ReturnThruPtr_stream_Size = cmock_size;
  820. }
  821. void pb_decode_delimited_CMockReturnMemThruPtr_dest_struct(UNITY_LINE_TYPE cmock_line, void* dest_struct, int cmock_size)
  822. {
  823. CMOCK_pb_decode_delimited_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_delimited_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_delimited_CallInstance));
  824. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "dest_struct ReturnThruPtr called before Expect on 'pb_decode_delimited'.");
  825. cmock_call_instance->ReturnThruPtr_dest_struct_Used = 1;
  826. cmock_call_instance->ReturnThruPtr_dest_struct_Val = dest_struct;
  827. cmock_call_instance->ReturnThruPtr_dest_struct_Size = cmock_size;
  828. }
  829. void pb_decode_delimited_CMockIgnoreArg_stream(UNITY_LINE_TYPE cmock_line)
  830. {
  831. CMOCK_pb_decode_delimited_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_delimited_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_delimited_CallInstance));
  832. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream IgnoreArg called before Expect on 'pb_decode_delimited'.");
  833. cmock_call_instance->IgnoreArg_stream = 1;
  834. }
  835. void pb_decode_delimited_CMockIgnoreArg_fields(UNITY_LINE_TYPE cmock_line)
  836. {
  837. CMOCK_pb_decode_delimited_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_delimited_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_delimited_CallInstance));
  838. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "fields IgnoreArg called before Expect on 'pb_decode_delimited'.");
  839. cmock_call_instance->IgnoreArg_fields = 1;
  840. }
  841. void pb_decode_delimited_CMockIgnoreArg_dest_struct(UNITY_LINE_TYPE cmock_line)
  842. {
  843. CMOCK_pb_decode_delimited_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_delimited_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_delimited_CallInstance));
  844. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "dest_struct IgnoreArg called before Expect on 'pb_decode_delimited'.");
  845. cmock_call_instance->IgnoreArg_dest_struct = 1;
  846. }
  847. void pb_release(const pb_field_t* fields, void* dest_struct)
  848. {
  849. UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  850. CMOCK_pb_release_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_release_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.pb_release_CallInstance);
  851. Mock.pb_release_CallInstance = CMock_Guts_MemNext(Mock.pb_release_CallInstance);
  852. if (Mock.pb_release_IgnoreBool)
  853. {
  854. return;
  855. }
  856. if (Mock.pb_release_CallbackFunctionPointer != NULL)
  857. {
  858. Mock.pb_release_CallbackFunctionPointer(fields, dest_struct, Mock.pb_release_CallbackCalls++);
  859. return;
  860. }
  861. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'pb_release' called more times than expected.");
  862. cmock_line = cmock_call_instance->LineNumber;
  863. if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
  864. UNITY_TEST_FAIL(cmock_line, "Function 'pb_release' called earlier than expected.");
  865. if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
  866. UNITY_TEST_FAIL(cmock_line, "Function 'pb_release' called later than expected.");
  867. if (!cmock_call_instance->IgnoreArg_fields)
  868. {
  869. if (cmock_call_instance->Expected_fields == NULL)
  870. { UNITY_TEST_ASSERT_NULL(fields, cmock_line, "Expected NULL. Function 'pb_release' called with unexpected value for argument 'fields'."); }
  871. else if (cmock_call_instance->Expected_fields_Depth == 0)
  872. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_fields, fields, cmock_line, "Function 'pb_release' called with unexpected value for argument 'fields'."); }
  873. else
  874. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_fields), (void*)(fields), sizeof(pb_field_t), cmock_call_instance->Expected_fields_Depth, cmock_line, "Function 'pb_release' called with unexpected value for argument 'fields'."); }
  875. }
  876. if (!cmock_call_instance->IgnoreArg_dest_struct)
  877. {
  878. UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_dest_struct, dest_struct, cmock_line, "Function 'pb_release' called with unexpected value for argument 'dest_struct'.");
  879. }
  880. if (cmock_call_instance->ReturnThruPtr_dest_struct_Used)
  881. {
  882. memcpy((void*)dest_struct, (void*)cmock_call_instance->ReturnThruPtr_dest_struct_Val,
  883. cmock_call_instance->ReturnThruPtr_dest_struct_Size);
  884. }
  885. }
  886. void CMockExpectParameters_pb_release(CMOCK_pb_release_CALL_INSTANCE* cmock_call_instance, const pb_field_t* fields, int fields_Depth, void* dest_struct, int dest_struct_Depth)
  887. {
  888. cmock_call_instance->Expected_fields = (pb_field_t*)fields;
  889. cmock_call_instance->Expected_fields_Depth = fields_Depth;
  890. cmock_call_instance->IgnoreArg_fields = 0;
  891. cmock_call_instance->Expected_dest_struct = dest_struct;
  892. cmock_call_instance->Expected_dest_struct_Depth = dest_struct_Depth;
  893. cmock_call_instance->IgnoreArg_dest_struct = 0;
  894. cmock_call_instance->ReturnThruPtr_dest_struct_Used = 0;
  895. }
  896. void pb_release_CMockIgnore(void)
  897. {
  898. Mock.pb_release_IgnoreBool = (int)1;
  899. }
  900. void pb_release_CMockExpect(UNITY_LINE_TYPE cmock_line, const pb_field_t* fields, void* dest_struct)
  901. {
  902. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_release_CALL_INSTANCE));
  903. CMOCK_pb_release_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_release_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  904. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  905. Mock.pb_release_CallInstance = CMock_Guts_MemChain(Mock.pb_release_CallInstance, cmock_guts_index);
  906. cmock_call_instance->LineNumber = cmock_line;
  907. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  908. CMockExpectParameters_pb_release(cmock_call_instance, fields, 0, dest_struct, 0);
  909. }
  910. void pb_release_StubWithCallback(CMOCK_pb_release_CALLBACK Callback)
  911. {
  912. Mock.pb_release_CallbackFunctionPointer = Callback;
  913. }
  914. void pb_release_CMockExpectWithArray(UNITY_LINE_TYPE cmock_line, pb_field_t* fields, int fields_Depth, void* dest_struct, int dest_struct_Depth)
  915. {
  916. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_release_CALL_INSTANCE));
  917. CMOCK_pb_release_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_release_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  918. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  919. Mock.pb_release_CallInstance = CMock_Guts_MemChain(Mock.pb_release_CallInstance, cmock_guts_index);
  920. cmock_call_instance->LineNumber = cmock_line;
  921. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  922. CMockExpectParameters_pb_release(cmock_call_instance, fields, fields_Depth, dest_struct, dest_struct_Depth);
  923. }
  924. void pb_release_CMockReturnMemThruPtr_dest_struct(UNITY_LINE_TYPE cmock_line, void* dest_struct, int cmock_size)
  925. {
  926. CMOCK_pb_release_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_release_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_release_CallInstance));
  927. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "dest_struct ReturnThruPtr called before Expect on 'pb_release'.");
  928. cmock_call_instance->ReturnThruPtr_dest_struct_Used = 1;
  929. cmock_call_instance->ReturnThruPtr_dest_struct_Val = dest_struct;
  930. cmock_call_instance->ReturnThruPtr_dest_struct_Size = cmock_size;
  931. }
  932. void pb_release_CMockIgnoreArg_fields(UNITY_LINE_TYPE cmock_line)
  933. {
  934. CMOCK_pb_release_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_release_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_release_CallInstance));
  935. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "fields IgnoreArg called before Expect on 'pb_release'.");
  936. cmock_call_instance->IgnoreArg_fields = 1;
  937. }
  938. void pb_release_CMockIgnoreArg_dest_struct(UNITY_LINE_TYPE cmock_line)
  939. {
  940. CMOCK_pb_release_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_release_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_release_CallInstance));
  941. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "dest_struct IgnoreArg called before Expect on 'pb_release'.");
  942. cmock_call_instance->IgnoreArg_dest_struct = 1;
  943. }
  944. pb_istream_t pb_istream_from_buffer(const pb_byte_t* buf, size_t bufsize)
  945. {
  946. UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  947. CMOCK_pb_istream_from_buffer_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_istream_from_buffer_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.pb_istream_from_buffer_CallInstance);
  948. Mock.pb_istream_from_buffer_CallInstance = CMock_Guts_MemNext(Mock.pb_istream_from_buffer_CallInstance);
  949. if (Mock.pb_istream_from_buffer_IgnoreBool)
  950. {
  951. if (cmock_call_instance == NULL)
  952. return Mock.pb_istream_from_buffer_FinalReturn;
  953. memcpy(&Mock.pb_istream_from_buffer_FinalReturn, &cmock_call_instance->ReturnVal, sizeof(pb_istream_t));
  954. return cmock_call_instance->ReturnVal;
  955. }
  956. if (Mock.pb_istream_from_buffer_CallbackFunctionPointer != NULL)
  957. {
  958. return Mock.pb_istream_from_buffer_CallbackFunctionPointer(buf, bufsize, Mock.pb_istream_from_buffer_CallbackCalls++);
  959. }
  960. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'pb_istream_from_buffer' called more times than expected.");
  961. cmock_line = cmock_call_instance->LineNumber;
  962. if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
  963. UNITY_TEST_FAIL(cmock_line, "Function 'pb_istream_from_buffer' called earlier than expected.");
  964. if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
  965. UNITY_TEST_FAIL(cmock_line, "Function 'pb_istream_from_buffer' called later than expected.");
  966. if (!cmock_call_instance->IgnoreArg_buf)
  967. {
  968. if (cmock_call_instance->Expected_buf == NULL)
  969. { UNITY_TEST_ASSERT_NULL(buf, cmock_line, "Expected NULL. Function 'pb_istream_from_buffer' called with unexpected value for argument 'buf'."); }
  970. else if (cmock_call_instance->Expected_buf_Depth == 0)
  971. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_buf, buf, cmock_line, "Function 'pb_istream_from_buffer' called with unexpected value for argument 'buf'."); }
  972. else
  973. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_buf), (void*)(buf), sizeof(pb_byte_t), cmock_call_instance->Expected_buf_Depth, cmock_line, "Function 'pb_istream_from_buffer' called with unexpected value for argument 'buf'."); }
  974. }
  975. if (!cmock_call_instance->IgnoreArg_bufsize)
  976. {
  977. UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_bufsize), (void*)(&bufsize), sizeof(size_t), cmock_line, "Function 'pb_istream_from_buffer' called with unexpected value for argument 'bufsize'.");
  978. }
  979. return cmock_call_instance->ReturnVal;
  980. }
  981. void CMockExpectParameters_pb_istream_from_buffer(CMOCK_pb_istream_from_buffer_CALL_INSTANCE* cmock_call_instance, const pb_byte_t* buf, int buf_Depth, size_t bufsize)
  982. {
  983. cmock_call_instance->Expected_buf = (pb_byte_t*)buf;
  984. cmock_call_instance->Expected_buf_Depth = buf_Depth;
  985. cmock_call_instance->IgnoreArg_buf = 0;
  986. memcpy(&cmock_call_instance->Expected_bufsize, &bufsize, sizeof(size_t));
  987. cmock_call_instance->IgnoreArg_bufsize = 0;
  988. }
  989. void pb_istream_from_buffer_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t cmock_to_return)
  990. {
  991. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_istream_from_buffer_CALL_INSTANCE));
  992. CMOCK_pb_istream_from_buffer_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_istream_from_buffer_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  993. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  994. Mock.pb_istream_from_buffer_CallInstance = CMock_Guts_MemChain(Mock.pb_istream_from_buffer_CallInstance, cmock_guts_index);
  995. cmock_call_instance->LineNumber = cmock_line;
  996. cmock_call_instance->ReturnVal = cmock_to_return;
  997. Mock.pb_istream_from_buffer_IgnoreBool = (int)1;
  998. }
  999. void pb_istream_from_buffer_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, const pb_byte_t* buf, size_t bufsize, pb_istream_t cmock_to_return)
  1000. {
  1001. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_istream_from_buffer_CALL_INSTANCE));
  1002. CMOCK_pb_istream_from_buffer_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_istream_from_buffer_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1003. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1004. Mock.pb_istream_from_buffer_CallInstance = CMock_Guts_MemChain(Mock.pb_istream_from_buffer_CallInstance, cmock_guts_index);
  1005. cmock_call_instance->LineNumber = cmock_line;
  1006. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  1007. CMockExpectParameters_pb_istream_from_buffer(cmock_call_instance, buf, 0, bufsize);
  1008. memcpy(&cmock_call_instance->ReturnVal, &cmock_to_return, sizeof(pb_istream_t));
  1009. }
  1010. void pb_istream_from_buffer_StubWithCallback(CMOCK_pb_istream_from_buffer_CALLBACK Callback)
  1011. {
  1012. Mock.pb_istream_from_buffer_CallbackFunctionPointer = Callback;
  1013. }
  1014. void pb_istream_from_buffer_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, pb_byte_t* buf, int buf_Depth, size_t bufsize, pb_istream_t cmock_to_return)
  1015. {
  1016. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_istream_from_buffer_CALL_INSTANCE));
  1017. CMOCK_pb_istream_from_buffer_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_istream_from_buffer_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1018. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1019. Mock.pb_istream_from_buffer_CallInstance = CMock_Guts_MemChain(Mock.pb_istream_from_buffer_CallInstance, cmock_guts_index);
  1020. cmock_call_instance->LineNumber = cmock_line;
  1021. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  1022. CMockExpectParameters_pb_istream_from_buffer(cmock_call_instance, buf, buf_Depth, bufsize);
  1023. cmock_call_instance->ReturnVal = cmock_to_return;
  1024. }
  1025. void pb_istream_from_buffer_CMockIgnoreArg_buf(UNITY_LINE_TYPE cmock_line)
  1026. {
  1027. CMOCK_pb_istream_from_buffer_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_istream_from_buffer_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_istream_from_buffer_CallInstance));
  1028. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "buf IgnoreArg called before Expect on 'pb_istream_from_buffer'.");
  1029. cmock_call_instance->IgnoreArg_buf = 1;
  1030. }
  1031. void pb_istream_from_buffer_CMockIgnoreArg_bufsize(UNITY_LINE_TYPE cmock_line)
  1032. {
  1033. CMOCK_pb_istream_from_buffer_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_istream_from_buffer_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_istream_from_buffer_CallInstance));
  1034. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "bufsize IgnoreArg called before Expect on 'pb_istream_from_buffer'.");
  1035. cmock_call_instance->IgnoreArg_bufsize = 1;
  1036. }
  1037. bool pb_read(pb_istream_t* stream, pb_byte_t* buf, size_t count)
  1038. {
  1039. UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  1040. CMOCK_pb_read_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_read_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.pb_read_CallInstance);
  1041. Mock.pb_read_CallInstance = CMock_Guts_MemNext(Mock.pb_read_CallInstance);
  1042. if (Mock.pb_read_IgnoreBool)
  1043. {
  1044. if (cmock_call_instance == NULL)
  1045. return Mock.pb_read_FinalReturn;
  1046. Mock.pb_read_FinalReturn = cmock_call_instance->ReturnVal;
  1047. return cmock_call_instance->ReturnVal;
  1048. }
  1049. if (Mock.pb_read_CallbackFunctionPointer != NULL)
  1050. {
  1051. return Mock.pb_read_CallbackFunctionPointer(stream, buf, count, Mock.pb_read_CallbackCalls++);
  1052. }
  1053. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'pb_read' called more times than expected.");
  1054. cmock_line = cmock_call_instance->LineNumber;
  1055. if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
  1056. UNITY_TEST_FAIL(cmock_line, "Function 'pb_read' called earlier than expected.");
  1057. if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
  1058. UNITY_TEST_FAIL(cmock_line, "Function 'pb_read' called later than expected.");
  1059. if (!cmock_call_instance->IgnoreArg_stream)
  1060. {
  1061. if (cmock_call_instance->Expected_stream == NULL)
  1062. { UNITY_TEST_ASSERT_NULL(stream, cmock_line, "Expected NULL. Function 'pb_read' called with unexpected value for argument 'stream'."); }
  1063. else if (cmock_call_instance->Expected_stream_Depth == 0)
  1064. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_stream, stream, cmock_line, "Function 'pb_read' called with unexpected value for argument 'stream'."); }
  1065. else
  1066. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_stream), (void*)(stream), sizeof(pb_istream_t), cmock_call_instance->Expected_stream_Depth, cmock_line, "Function 'pb_read' called with unexpected value for argument 'stream'."); }
  1067. }
  1068. if (!cmock_call_instance->IgnoreArg_buf)
  1069. {
  1070. if (cmock_call_instance->Expected_buf == NULL)
  1071. { UNITY_TEST_ASSERT_NULL(buf, cmock_line, "Expected NULL. Function 'pb_read' called with unexpected value for argument 'buf'."); }
  1072. else if (cmock_call_instance->Expected_buf_Depth == 0)
  1073. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_buf, buf, cmock_line, "Function 'pb_read' called with unexpected value for argument 'buf'."); }
  1074. else
  1075. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_buf), (void*)(buf), sizeof(pb_byte_t), cmock_call_instance->Expected_buf_Depth, cmock_line, "Function 'pb_read' called with unexpected value for argument 'buf'."); }
  1076. }
  1077. if (!cmock_call_instance->IgnoreArg_count)
  1078. {
  1079. UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_count), (void*)(&count), sizeof(size_t), cmock_line, "Function 'pb_read' called with unexpected value for argument 'count'.");
  1080. }
  1081. if (cmock_call_instance->ReturnThruPtr_stream_Used)
  1082. {
  1083. memcpy((void*)stream, (void*)cmock_call_instance->ReturnThruPtr_stream_Val,
  1084. cmock_call_instance->ReturnThruPtr_stream_Size);
  1085. }
  1086. if (cmock_call_instance->ReturnThruPtr_buf_Used)
  1087. {
  1088. memcpy((void*)buf, (void*)cmock_call_instance->ReturnThruPtr_buf_Val,
  1089. cmock_call_instance->ReturnThruPtr_buf_Size);
  1090. }
  1091. return cmock_call_instance->ReturnVal;
  1092. }
  1093. void CMockExpectParameters_pb_read(CMOCK_pb_read_CALL_INSTANCE* cmock_call_instance, pb_istream_t* stream, int stream_Depth, pb_byte_t* buf, int buf_Depth, size_t count)
  1094. {
  1095. cmock_call_instance->Expected_stream = stream;
  1096. cmock_call_instance->Expected_stream_Depth = stream_Depth;
  1097. cmock_call_instance->IgnoreArg_stream = 0;
  1098. cmock_call_instance->ReturnThruPtr_stream_Used = 0;
  1099. cmock_call_instance->Expected_buf = buf;
  1100. cmock_call_instance->Expected_buf_Depth = buf_Depth;
  1101. cmock_call_instance->IgnoreArg_buf = 0;
  1102. cmock_call_instance->ReturnThruPtr_buf_Used = 0;
  1103. memcpy(&cmock_call_instance->Expected_count, &count, sizeof(size_t));
  1104. cmock_call_instance->IgnoreArg_count = 0;
  1105. }
  1106. void pb_read_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, bool cmock_to_return)
  1107. {
  1108. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_read_CALL_INSTANCE));
  1109. CMOCK_pb_read_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_read_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1110. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1111. Mock.pb_read_CallInstance = CMock_Guts_MemChain(Mock.pb_read_CallInstance, cmock_guts_index);
  1112. cmock_call_instance->LineNumber = cmock_line;
  1113. cmock_call_instance->ReturnVal = cmock_to_return;
  1114. Mock.pb_read_IgnoreBool = (int)1;
  1115. }
  1116. void pb_read_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, pb_byte_t* buf, size_t count, bool cmock_to_return)
  1117. {
  1118. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_read_CALL_INSTANCE));
  1119. CMOCK_pb_read_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_read_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1120. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1121. Mock.pb_read_CallInstance = CMock_Guts_MemChain(Mock.pb_read_CallInstance, cmock_guts_index);
  1122. cmock_call_instance->LineNumber = cmock_line;
  1123. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  1124. CMockExpectParameters_pb_read(cmock_call_instance, stream, 0, buf, 0, count);
  1125. cmock_call_instance->ReturnVal = cmock_to_return;
  1126. }
  1127. void pb_read_StubWithCallback(CMOCK_pb_read_CALLBACK Callback)
  1128. {
  1129. Mock.pb_read_CallbackFunctionPointer = Callback;
  1130. }
  1131. void pb_read_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int stream_Depth, pb_byte_t* buf, int buf_Depth, size_t count, bool cmock_to_return)
  1132. {
  1133. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_read_CALL_INSTANCE));
  1134. CMOCK_pb_read_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_read_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1135. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1136. Mock.pb_read_CallInstance = CMock_Guts_MemChain(Mock.pb_read_CallInstance, cmock_guts_index);
  1137. cmock_call_instance->LineNumber = cmock_line;
  1138. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  1139. CMockExpectParameters_pb_read(cmock_call_instance, stream, stream_Depth, buf, buf_Depth, count);
  1140. cmock_call_instance->ReturnVal = cmock_to_return;
  1141. }
  1142. void pb_read_CMockReturnMemThruPtr_stream(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int cmock_size)
  1143. {
  1144. CMOCK_pb_read_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_read_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_read_CallInstance));
  1145. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream ReturnThruPtr called before Expect on 'pb_read'.");
  1146. cmock_call_instance->ReturnThruPtr_stream_Used = 1;
  1147. cmock_call_instance->ReturnThruPtr_stream_Val = stream;
  1148. cmock_call_instance->ReturnThruPtr_stream_Size = cmock_size;
  1149. }
  1150. void pb_read_CMockReturnMemThruPtr_buf(UNITY_LINE_TYPE cmock_line, pb_byte_t* buf, int cmock_size)
  1151. {
  1152. CMOCK_pb_read_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_read_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_read_CallInstance));
  1153. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "buf ReturnThruPtr called before Expect on 'pb_read'.");
  1154. cmock_call_instance->ReturnThruPtr_buf_Used = 1;
  1155. cmock_call_instance->ReturnThruPtr_buf_Val = buf;
  1156. cmock_call_instance->ReturnThruPtr_buf_Size = cmock_size;
  1157. }
  1158. void pb_read_CMockIgnoreArg_stream(UNITY_LINE_TYPE cmock_line)
  1159. {
  1160. CMOCK_pb_read_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_read_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_read_CallInstance));
  1161. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream IgnoreArg called before Expect on 'pb_read'.");
  1162. cmock_call_instance->IgnoreArg_stream = 1;
  1163. }
  1164. void pb_read_CMockIgnoreArg_buf(UNITY_LINE_TYPE cmock_line)
  1165. {
  1166. CMOCK_pb_read_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_read_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_read_CallInstance));
  1167. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "buf IgnoreArg called before Expect on 'pb_read'.");
  1168. cmock_call_instance->IgnoreArg_buf = 1;
  1169. }
  1170. void pb_read_CMockIgnoreArg_count(UNITY_LINE_TYPE cmock_line)
  1171. {
  1172. CMOCK_pb_read_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_read_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_read_CallInstance));
  1173. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "count IgnoreArg called before Expect on 'pb_read'.");
  1174. cmock_call_instance->IgnoreArg_count = 1;
  1175. }
  1176. bool pb_decode_tag(pb_istream_t* stream, pb_wire_type_t* wire_type, uint32_t* tag, bool* eof)
  1177. {
  1178. UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  1179. CMOCK_pb_decode_tag_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_tag_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.pb_decode_tag_CallInstance);
  1180. Mock.pb_decode_tag_CallInstance = CMock_Guts_MemNext(Mock.pb_decode_tag_CallInstance);
  1181. if (Mock.pb_decode_tag_IgnoreBool)
  1182. {
  1183. if (cmock_call_instance == NULL)
  1184. return Mock.pb_decode_tag_FinalReturn;
  1185. Mock.pb_decode_tag_FinalReturn = cmock_call_instance->ReturnVal;
  1186. return cmock_call_instance->ReturnVal;
  1187. }
  1188. if (Mock.pb_decode_tag_CallbackFunctionPointer != NULL)
  1189. {
  1190. return Mock.pb_decode_tag_CallbackFunctionPointer(stream, wire_type, tag, eof, Mock.pb_decode_tag_CallbackCalls++);
  1191. }
  1192. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'pb_decode_tag' called more times than expected.");
  1193. cmock_line = cmock_call_instance->LineNumber;
  1194. if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
  1195. UNITY_TEST_FAIL(cmock_line, "Function 'pb_decode_tag' called earlier than expected.");
  1196. if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
  1197. UNITY_TEST_FAIL(cmock_line, "Function 'pb_decode_tag' called later than expected.");
  1198. if (!cmock_call_instance->IgnoreArg_stream)
  1199. {
  1200. if (cmock_call_instance->Expected_stream == NULL)
  1201. { UNITY_TEST_ASSERT_NULL(stream, cmock_line, "Expected NULL. Function 'pb_decode_tag' called with unexpected value for argument 'stream'."); }
  1202. else if (cmock_call_instance->Expected_stream_Depth == 0)
  1203. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_stream, stream, cmock_line, "Function 'pb_decode_tag' called with unexpected value for argument 'stream'."); }
  1204. else
  1205. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_stream), (void*)(stream), sizeof(pb_istream_t), cmock_call_instance->Expected_stream_Depth, cmock_line, "Function 'pb_decode_tag' called with unexpected value for argument 'stream'."); }
  1206. }
  1207. if (!cmock_call_instance->IgnoreArg_wire_type)
  1208. {
  1209. if (cmock_call_instance->Expected_wire_type == NULL)
  1210. { UNITY_TEST_ASSERT_NULL(wire_type, cmock_line, "Expected NULL. Function 'pb_decode_tag' called with unexpected value for argument 'wire_type'."); }
  1211. else if (cmock_call_instance->Expected_wire_type_Depth == 0)
  1212. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_wire_type, wire_type, cmock_line, "Function 'pb_decode_tag' called with unexpected value for argument 'wire_type'."); }
  1213. else
  1214. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_wire_type), (void*)(wire_type), sizeof(pb_wire_type_t), cmock_call_instance->Expected_wire_type_Depth, cmock_line, "Function 'pb_decode_tag' called with unexpected value for argument 'wire_type'."); }
  1215. }
  1216. if (!cmock_call_instance->IgnoreArg_tag)
  1217. {
  1218. if (cmock_call_instance->Expected_tag == NULL)
  1219. { UNITY_TEST_ASSERT_NULL(tag, cmock_line, "Expected NULL. Function 'pb_decode_tag' called with unexpected value for argument 'tag'."); }
  1220. else if (cmock_call_instance->Expected_tag_Depth == 0)
  1221. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_tag, tag, cmock_line, "Function 'pb_decode_tag' called with unexpected value for argument 'tag'."); }
  1222. else
  1223. { UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY(cmock_call_instance->Expected_tag, tag, cmock_call_instance->Expected_tag_Depth, cmock_line, "Function 'pb_decode_tag' called with unexpected value for argument 'tag'."); }
  1224. }
  1225. if (!cmock_call_instance->IgnoreArg_eof)
  1226. {
  1227. if (cmock_call_instance->Expected_eof == NULL)
  1228. { UNITY_TEST_ASSERT_NULL(eof, cmock_line, "Expected NULL. Function 'pb_decode_tag' called with unexpected value for argument 'eof'."); }
  1229. else if (cmock_call_instance->Expected_eof_Depth == 0)
  1230. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_eof, eof, cmock_line, "Function 'pb_decode_tag' called with unexpected value for argument 'eof'."); }
  1231. else
  1232. { UNITY_TEST_ASSERT_EQUAL_INT_ARRAY(cmock_call_instance->Expected_eof, eof, cmock_call_instance->Expected_eof_Depth, cmock_line, "Function 'pb_decode_tag' called with unexpected value for argument 'eof'."); }
  1233. }
  1234. if (cmock_call_instance->ReturnThruPtr_stream_Used)
  1235. {
  1236. memcpy((void*)stream, (void*)cmock_call_instance->ReturnThruPtr_stream_Val,
  1237. cmock_call_instance->ReturnThruPtr_stream_Size);
  1238. }
  1239. if (cmock_call_instance->ReturnThruPtr_wire_type_Used)
  1240. {
  1241. memcpy((void*)wire_type, (void*)cmock_call_instance->ReturnThruPtr_wire_type_Val,
  1242. cmock_call_instance->ReturnThruPtr_wire_type_Size);
  1243. }
  1244. if (cmock_call_instance->ReturnThruPtr_tag_Used)
  1245. {
  1246. memcpy((void*)tag, (void*)cmock_call_instance->ReturnThruPtr_tag_Val,
  1247. cmock_call_instance->ReturnThruPtr_tag_Size);
  1248. }
  1249. if (cmock_call_instance->ReturnThruPtr_eof_Used)
  1250. {
  1251. memcpy((void*)eof, (void*)cmock_call_instance->ReturnThruPtr_eof_Val,
  1252. cmock_call_instance->ReturnThruPtr_eof_Size);
  1253. }
  1254. return cmock_call_instance->ReturnVal;
  1255. }
  1256. void CMockExpectParameters_pb_decode_tag(CMOCK_pb_decode_tag_CALL_INSTANCE* cmock_call_instance, pb_istream_t* stream, int stream_Depth, pb_wire_type_t* wire_type, int wire_type_Depth, uint32_t* tag, int tag_Depth, bool* eof, int eof_Depth)
  1257. {
  1258. cmock_call_instance->Expected_stream = stream;
  1259. cmock_call_instance->Expected_stream_Depth = stream_Depth;
  1260. cmock_call_instance->IgnoreArg_stream = 0;
  1261. cmock_call_instance->ReturnThruPtr_stream_Used = 0;
  1262. cmock_call_instance->Expected_wire_type = wire_type;
  1263. cmock_call_instance->Expected_wire_type_Depth = wire_type_Depth;
  1264. cmock_call_instance->IgnoreArg_wire_type = 0;
  1265. cmock_call_instance->ReturnThruPtr_wire_type_Used = 0;
  1266. cmock_call_instance->Expected_tag = tag;
  1267. cmock_call_instance->Expected_tag_Depth = tag_Depth;
  1268. cmock_call_instance->IgnoreArg_tag = 0;
  1269. cmock_call_instance->ReturnThruPtr_tag_Used = 0;
  1270. cmock_call_instance->Expected_eof = eof;
  1271. cmock_call_instance->Expected_eof_Depth = eof_Depth;
  1272. cmock_call_instance->IgnoreArg_eof = 0;
  1273. cmock_call_instance->ReturnThruPtr_eof_Used = 0;
  1274. }
  1275. void pb_decode_tag_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, bool cmock_to_return)
  1276. {
  1277. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_tag_CALL_INSTANCE));
  1278. CMOCK_pb_decode_tag_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_tag_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1279. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1280. Mock.pb_decode_tag_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_tag_CallInstance, cmock_guts_index);
  1281. cmock_call_instance->LineNumber = cmock_line;
  1282. cmock_call_instance->ReturnVal = cmock_to_return;
  1283. Mock.pb_decode_tag_IgnoreBool = (int)1;
  1284. }
  1285. void pb_decode_tag_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, pb_wire_type_t* wire_type, uint32_t* tag, bool* eof, bool cmock_to_return)
  1286. {
  1287. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_tag_CALL_INSTANCE));
  1288. CMOCK_pb_decode_tag_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_tag_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1289. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1290. Mock.pb_decode_tag_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_tag_CallInstance, cmock_guts_index);
  1291. cmock_call_instance->LineNumber = cmock_line;
  1292. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  1293. CMockExpectParameters_pb_decode_tag(cmock_call_instance, stream, 0, wire_type, 0, tag, 0, eof, 0);
  1294. cmock_call_instance->ReturnVal = cmock_to_return;
  1295. }
  1296. void pb_decode_tag_StubWithCallback(CMOCK_pb_decode_tag_CALLBACK Callback)
  1297. {
  1298. Mock.pb_decode_tag_CallbackFunctionPointer = Callback;
  1299. }
  1300. void pb_decode_tag_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int stream_Depth, pb_wire_type_t* wire_type, int wire_type_Depth, uint32_t* tag, int tag_Depth, bool* eof, int eof_Depth, bool cmock_to_return)
  1301. {
  1302. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_tag_CALL_INSTANCE));
  1303. CMOCK_pb_decode_tag_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_tag_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1304. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1305. Mock.pb_decode_tag_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_tag_CallInstance, cmock_guts_index);
  1306. cmock_call_instance->LineNumber = cmock_line;
  1307. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  1308. CMockExpectParameters_pb_decode_tag(cmock_call_instance, stream, stream_Depth, wire_type, wire_type_Depth, tag, tag_Depth, eof, eof_Depth);
  1309. cmock_call_instance->ReturnVal = cmock_to_return;
  1310. }
  1311. void pb_decode_tag_CMockReturnMemThruPtr_stream(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int cmock_size)
  1312. {
  1313. CMOCK_pb_decode_tag_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_tag_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_tag_CallInstance));
  1314. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream ReturnThruPtr called before Expect on 'pb_decode_tag'.");
  1315. cmock_call_instance->ReturnThruPtr_stream_Used = 1;
  1316. cmock_call_instance->ReturnThruPtr_stream_Val = stream;
  1317. cmock_call_instance->ReturnThruPtr_stream_Size = cmock_size;
  1318. }
  1319. void pb_decode_tag_CMockReturnMemThruPtr_wire_type(UNITY_LINE_TYPE cmock_line, pb_wire_type_t* wire_type, int cmock_size)
  1320. {
  1321. CMOCK_pb_decode_tag_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_tag_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_tag_CallInstance));
  1322. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "wire_type ReturnThruPtr called before Expect on 'pb_decode_tag'.");
  1323. cmock_call_instance->ReturnThruPtr_wire_type_Used = 1;
  1324. cmock_call_instance->ReturnThruPtr_wire_type_Val = wire_type;
  1325. cmock_call_instance->ReturnThruPtr_wire_type_Size = cmock_size;
  1326. }
  1327. void pb_decode_tag_CMockReturnMemThruPtr_tag(UNITY_LINE_TYPE cmock_line, uint32_t* tag, int cmock_size)
  1328. {
  1329. CMOCK_pb_decode_tag_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_tag_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_tag_CallInstance));
  1330. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "tag ReturnThruPtr called before Expect on 'pb_decode_tag'.");
  1331. cmock_call_instance->ReturnThruPtr_tag_Used = 1;
  1332. cmock_call_instance->ReturnThruPtr_tag_Val = tag;
  1333. cmock_call_instance->ReturnThruPtr_tag_Size = cmock_size;
  1334. }
  1335. void pb_decode_tag_CMockReturnMemThruPtr_eof(UNITY_LINE_TYPE cmock_line, bool* eof, int cmock_size)
  1336. {
  1337. CMOCK_pb_decode_tag_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_tag_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_tag_CallInstance));
  1338. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "eof ReturnThruPtr called before Expect on 'pb_decode_tag'.");
  1339. cmock_call_instance->ReturnThruPtr_eof_Used = 1;
  1340. cmock_call_instance->ReturnThruPtr_eof_Val = eof;
  1341. cmock_call_instance->ReturnThruPtr_eof_Size = cmock_size;
  1342. }
  1343. void pb_decode_tag_CMockIgnoreArg_stream(UNITY_LINE_TYPE cmock_line)
  1344. {
  1345. CMOCK_pb_decode_tag_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_tag_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_tag_CallInstance));
  1346. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream IgnoreArg called before Expect on 'pb_decode_tag'.");
  1347. cmock_call_instance->IgnoreArg_stream = 1;
  1348. }
  1349. void pb_decode_tag_CMockIgnoreArg_wire_type(UNITY_LINE_TYPE cmock_line)
  1350. {
  1351. CMOCK_pb_decode_tag_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_tag_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_tag_CallInstance));
  1352. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "wire_type IgnoreArg called before Expect on 'pb_decode_tag'.");
  1353. cmock_call_instance->IgnoreArg_wire_type = 1;
  1354. }
  1355. void pb_decode_tag_CMockIgnoreArg_tag(UNITY_LINE_TYPE cmock_line)
  1356. {
  1357. CMOCK_pb_decode_tag_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_tag_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_tag_CallInstance));
  1358. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "tag IgnoreArg called before Expect on 'pb_decode_tag'.");
  1359. cmock_call_instance->IgnoreArg_tag = 1;
  1360. }
  1361. void pb_decode_tag_CMockIgnoreArg_eof(UNITY_LINE_TYPE cmock_line)
  1362. {
  1363. CMOCK_pb_decode_tag_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_tag_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_tag_CallInstance));
  1364. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "eof IgnoreArg called before Expect on 'pb_decode_tag'.");
  1365. cmock_call_instance->IgnoreArg_eof = 1;
  1366. }
  1367. bool pb_skip_field(pb_istream_t* stream, pb_wire_type_t wire_type)
  1368. {
  1369. UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  1370. CMOCK_pb_skip_field_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_skip_field_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.pb_skip_field_CallInstance);
  1371. Mock.pb_skip_field_CallInstance = CMock_Guts_MemNext(Mock.pb_skip_field_CallInstance);
  1372. if (Mock.pb_skip_field_IgnoreBool)
  1373. {
  1374. if (cmock_call_instance == NULL)
  1375. return Mock.pb_skip_field_FinalReturn;
  1376. Mock.pb_skip_field_FinalReturn = cmock_call_instance->ReturnVal;
  1377. return cmock_call_instance->ReturnVal;
  1378. }
  1379. if (Mock.pb_skip_field_CallbackFunctionPointer != NULL)
  1380. {
  1381. return Mock.pb_skip_field_CallbackFunctionPointer(stream, wire_type, Mock.pb_skip_field_CallbackCalls++);
  1382. }
  1383. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'pb_skip_field' called more times than expected.");
  1384. cmock_line = cmock_call_instance->LineNumber;
  1385. if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
  1386. UNITY_TEST_FAIL(cmock_line, "Function 'pb_skip_field' called earlier than expected.");
  1387. if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
  1388. UNITY_TEST_FAIL(cmock_line, "Function 'pb_skip_field' called later than expected.");
  1389. if (!cmock_call_instance->IgnoreArg_stream)
  1390. {
  1391. if (cmock_call_instance->Expected_stream == NULL)
  1392. { UNITY_TEST_ASSERT_NULL(stream, cmock_line, "Expected NULL. Function 'pb_skip_field' called with unexpected value for argument 'stream'."); }
  1393. else if (cmock_call_instance->Expected_stream_Depth == 0)
  1394. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_stream, stream, cmock_line, "Function 'pb_skip_field' called with unexpected value for argument 'stream'."); }
  1395. else
  1396. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_stream), (void*)(stream), sizeof(pb_istream_t), cmock_call_instance->Expected_stream_Depth, cmock_line, "Function 'pb_skip_field' called with unexpected value for argument 'stream'."); }
  1397. }
  1398. if (!cmock_call_instance->IgnoreArg_wire_type)
  1399. {
  1400. UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_wire_type), (void*)(&wire_type), sizeof(pb_wire_type_t), cmock_line, "Function 'pb_skip_field' called with unexpected value for argument 'wire_type'.");
  1401. }
  1402. if (cmock_call_instance->ReturnThruPtr_stream_Used)
  1403. {
  1404. memcpy((void*)stream, (void*)cmock_call_instance->ReturnThruPtr_stream_Val,
  1405. cmock_call_instance->ReturnThruPtr_stream_Size);
  1406. }
  1407. return cmock_call_instance->ReturnVal;
  1408. }
  1409. void CMockExpectParameters_pb_skip_field(CMOCK_pb_skip_field_CALL_INSTANCE* cmock_call_instance, pb_istream_t* stream, int stream_Depth, pb_wire_type_t wire_type)
  1410. {
  1411. cmock_call_instance->Expected_stream = stream;
  1412. cmock_call_instance->Expected_stream_Depth = stream_Depth;
  1413. cmock_call_instance->IgnoreArg_stream = 0;
  1414. cmock_call_instance->ReturnThruPtr_stream_Used = 0;
  1415. memcpy(&cmock_call_instance->Expected_wire_type, &wire_type, sizeof(pb_wire_type_t));
  1416. cmock_call_instance->IgnoreArg_wire_type = 0;
  1417. }
  1418. void pb_skip_field_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, bool cmock_to_return)
  1419. {
  1420. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_skip_field_CALL_INSTANCE));
  1421. CMOCK_pb_skip_field_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_skip_field_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1422. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1423. Mock.pb_skip_field_CallInstance = CMock_Guts_MemChain(Mock.pb_skip_field_CallInstance, cmock_guts_index);
  1424. cmock_call_instance->LineNumber = cmock_line;
  1425. cmock_call_instance->ReturnVal = cmock_to_return;
  1426. Mock.pb_skip_field_IgnoreBool = (int)1;
  1427. }
  1428. void pb_skip_field_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, pb_wire_type_t wire_type, bool cmock_to_return)
  1429. {
  1430. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_skip_field_CALL_INSTANCE));
  1431. CMOCK_pb_skip_field_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_skip_field_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1432. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1433. Mock.pb_skip_field_CallInstance = CMock_Guts_MemChain(Mock.pb_skip_field_CallInstance, cmock_guts_index);
  1434. cmock_call_instance->LineNumber = cmock_line;
  1435. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  1436. CMockExpectParameters_pb_skip_field(cmock_call_instance, stream, 0, wire_type);
  1437. cmock_call_instance->ReturnVal = cmock_to_return;
  1438. }
  1439. void pb_skip_field_StubWithCallback(CMOCK_pb_skip_field_CALLBACK Callback)
  1440. {
  1441. Mock.pb_skip_field_CallbackFunctionPointer = Callback;
  1442. }
  1443. void pb_skip_field_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int stream_Depth, pb_wire_type_t wire_type, bool cmock_to_return)
  1444. {
  1445. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_skip_field_CALL_INSTANCE));
  1446. CMOCK_pb_skip_field_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_skip_field_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1447. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1448. Mock.pb_skip_field_CallInstance = CMock_Guts_MemChain(Mock.pb_skip_field_CallInstance, cmock_guts_index);
  1449. cmock_call_instance->LineNumber = cmock_line;
  1450. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  1451. CMockExpectParameters_pb_skip_field(cmock_call_instance, stream, stream_Depth, wire_type);
  1452. cmock_call_instance->ReturnVal = cmock_to_return;
  1453. }
  1454. void pb_skip_field_CMockReturnMemThruPtr_stream(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int cmock_size)
  1455. {
  1456. CMOCK_pb_skip_field_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_skip_field_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_skip_field_CallInstance));
  1457. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream ReturnThruPtr called before Expect on 'pb_skip_field'.");
  1458. cmock_call_instance->ReturnThruPtr_stream_Used = 1;
  1459. cmock_call_instance->ReturnThruPtr_stream_Val = stream;
  1460. cmock_call_instance->ReturnThruPtr_stream_Size = cmock_size;
  1461. }
  1462. void pb_skip_field_CMockIgnoreArg_stream(UNITY_LINE_TYPE cmock_line)
  1463. {
  1464. CMOCK_pb_skip_field_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_skip_field_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_skip_field_CallInstance));
  1465. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream IgnoreArg called before Expect on 'pb_skip_field'.");
  1466. cmock_call_instance->IgnoreArg_stream = 1;
  1467. }
  1468. void pb_skip_field_CMockIgnoreArg_wire_type(UNITY_LINE_TYPE cmock_line)
  1469. {
  1470. CMOCK_pb_skip_field_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_skip_field_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_skip_field_CallInstance));
  1471. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "wire_type IgnoreArg called before Expect on 'pb_skip_field'.");
  1472. cmock_call_instance->IgnoreArg_wire_type = 1;
  1473. }
  1474. bool pb_decode_varint(pb_istream_t* stream, uint64_t* dest)
  1475. {
  1476. UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  1477. CMOCK_pb_decode_varint_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_varint_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.pb_decode_varint_CallInstance);
  1478. Mock.pb_decode_varint_CallInstance = CMock_Guts_MemNext(Mock.pb_decode_varint_CallInstance);
  1479. if (Mock.pb_decode_varint_IgnoreBool)
  1480. {
  1481. if (cmock_call_instance == NULL)
  1482. return Mock.pb_decode_varint_FinalReturn;
  1483. Mock.pb_decode_varint_FinalReturn = cmock_call_instance->ReturnVal;
  1484. return cmock_call_instance->ReturnVal;
  1485. }
  1486. if (Mock.pb_decode_varint_CallbackFunctionPointer != NULL)
  1487. {
  1488. return Mock.pb_decode_varint_CallbackFunctionPointer(stream, dest, Mock.pb_decode_varint_CallbackCalls++);
  1489. }
  1490. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'pb_decode_varint' called more times than expected.");
  1491. cmock_line = cmock_call_instance->LineNumber;
  1492. if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
  1493. UNITY_TEST_FAIL(cmock_line, "Function 'pb_decode_varint' called earlier than expected.");
  1494. if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
  1495. UNITY_TEST_FAIL(cmock_line, "Function 'pb_decode_varint' called later than expected.");
  1496. if (!cmock_call_instance->IgnoreArg_stream)
  1497. {
  1498. if (cmock_call_instance->Expected_stream == NULL)
  1499. { UNITY_TEST_ASSERT_NULL(stream, cmock_line, "Expected NULL. Function 'pb_decode_varint' called with unexpected value for argument 'stream'."); }
  1500. else if (cmock_call_instance->Expected_stream_Depth == 0)
  1501. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_stream, stream, cmock_line, "Function 'pb_decode_varint' called with unexpected value for argument 'stream'."); }
  1502. else
  1503. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_stream), (void*)(stream), sizeof(pb_istream_t), cmock_call_instance->Expected_stream_Depth, cmock_line, "Function 'pb_decode_varint' called with unexpected value for argument 'stream'."); }
  1504. }
  1505. if (!cmock_call_instance->IgnoreArg_dest)
  1506. {
  1507. if (cmock_call_instance->Expected_dest == NULL)
  1508. { UNITY_TEST_ASSERT_NULL(dest, cmock_line, "Expected NULL. Function 'pb_decode_varint' called with unexpected value for argument 'dest'."); }
  1509. else if (cmock_call_instance->Expected_dest_Depth == 0)
  1510. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_dest, dest, cmock_line, "Function 'pb_decode_varint' called with unexpected value for argument 'dest'."); }
  1511. else
  1512. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_dest), (void*)(dest), sizeof(uint64_t), cmock_call_instance->Expected_dest_Depth, cmock_line, "Function 'pb_decode_varint' called with unexpected value for argument 'dest'."); }
  1513. }
  1514. if (cmock_call_instance->ReturnThruPtr_stream_Used)
  1515. {
  1516. memcpy((void*)stream, (void*)cmock_call_instance->ReturnThruPtr_stream_Val,
  1517. cmock_call_instance->ReturnThruPtr_stream_Size);
  1518. }
  1519. if (cmock_call_instance->ReturnThruPtr_dest_Used)
  1520. {
  1521. memcpy((void*)dest, (void*)cmock_call_instance->ReturnThruPtr_dest_Val,
  1522. cmock_call_instance->ReturnThruPtr_dest_Size);
  1523. }
  1524. return cmock_call_instance->ReturnVal;
  1525. }
  1526. void CMockExpectParameters_pb_decode_varint(CMOCK_pb_decode_varint_CALL_INSTANCE* cmock_call_instance, pb_istream_t* stream, int stream_Depth, uint64_t* dest, int dest_Depth)
  1527. {
  1528. cmock_call_instance->Expected_stream = stream;
  1529. cmock_call_instance->Expected_stream_Depth = stream_Depth;
  1530. cmock_call_instance->IgnoreArg_stream = 0;
  1531. cmock_call_instance->ReturnThruPtr_stream_Used = 0;
  1532. cmock_call_instance->Expected_dest = dest;
  1533. cmock_call_instance->Expected_dest_Depth = dest_Depth;
  1534. cmock_call_instance->IgnoreArg_dest = 0;
  1535. cmock_call_instance->ReturnThruPtr_dest_Used = 0;
  1536. }
  1537. void pb_decode_varint_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, bool cmock_to_return)
  1538. {
  1539. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_varint_CALL_INSTANCE));
  1540. CMOCK_pb_decode_varint_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_varint_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1541. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1542. Mock.pb_decode_varint_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_varint_CallInstance, cmock_guts_index);
  1543. cmock_call_instance->LineNumber = cmock_line;
  1544. cmock_call_instance->ReturnVal = cmock_to_return;
  1545. Mock.pb_decode_varint_IgnoreBool = (int)1;
  1546. }
  1547. void pb_decode_varint_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, uint64_t* dest, bool cmock_to_return)
  1548. {
  1549. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_varint_CALL_INSTANCE));
  1550. CMOCK_pb_decode_varint_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_varint_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1551. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1552. Mock.pb_decode_varint_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_varint_CallInstance, cmock_guts_index);
  1553. cmock_call_instance->LineNumber = cmock_line;
  1554. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  1555. CMockExpectParameters_pb_decode_varint(cmock_call_instance, stream, 0, dest, 0);
  1556. cmock_call_instance->ReturnVal = cmock_to_return;
  1557. }
  1558. void pb_decode_varint_StubWithCallback(CMOCK_pb_decode_varint_CALLBACK Callback)
  1559. {
  1560. Mock.pb_decode_varint_CallbackFunctionPointer = Callback;
  1561. }
  1562. void pb_decode_varint_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int stream_Depth, uint64_t* dest, int dest_Depth, bool cmock_to_return)
  1563. {
  1564. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_varint_CALL_INSTANCE));
  1565. CMOCK_pb_decode_varint_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_varint_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1566. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1567. Mock.pb_decode_varint_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_varint_CallInstance, cmock_guts_index);
  1568. cmock_call_instance->LineNumber = cmock_line;
  1569. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  1570. CMockExpectParameters_pb_decode_varint(cmock_call_instance, stream, stream_Depth, dest, dest_Depth);
  1571. cmock_call_instance->ReturnVal = cmock_to_return;
  1572. }
  1573. void pb_decode_varint_CMockReturnMemThruPtr_stream(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int cmock_size)
  1574. {
  1575. CMOCK_pb_decode_varint_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_varint_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_varint_CallInstance));
  1576. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream ReturnThruPtr called before Expect on 'pb_decode_varint'.");
  1577. cmock_call_instance->ReturnThruPtr_stream_Used = 1;
  1578. cmock_call_instance->ReturnThruPtr_stream_Val = stream;
  1579. cmock_call_instance->ReturnThruPtr_stream_Size = cmock_size;
  1580. }
  1581. void pb_decode_varint_CMockReturnMemThruPtr_dest(UNITY_LINE_TYPE cmock_line, uint64_t* dest, int cmock_size)
  1582. {
  1583. CMOCK_pb_decode_varint_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_varint_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_varint_CallInstance));
  1584. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "dest ReturnThruPtr called before Expect on 'pb_decode_varint'.");
  1585. cmock_call_instance->ReturnThruPtr_dest_Used = 1;
  1586. cmock_call_instance->ReturnThruPtr_dest_Val = dest;
  1587. cmock_call_instance->ReturnThruPtr_dest_Size = cmock_size;
  1588. }
  1589. void pb_decode_varint_CMockIgnoreArg_stream(UNITY_LINE_TYPE cmock_line)
  1590. {
  1591. CMOCK_pb_decode_varint_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_varint_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_varint_CallInstance));
  1592. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream IgnoreArg called before Expect on 'pb_decode_varint'.");
  1593. cmock_call_instance->IgnoreArg_stream = 1;
  1594. }
  1595. void pb_decode_varint_CMockIgnoreArg_dest(UNITY_LINE_TYPE cmock_line)
  1596. {
  1597. CMOCK_pb_decode_varint_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_varint_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_varint_CallInstance));
  1598. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "dest IgnoreArg called before Expect on 'pb_decode_varint'.");
  1599. cmock_call_instance->IgnoreArg_dest = 1;
  1600. }
  1601. bool pb_decode_svarint(pb_istream_t* stream, int64_t* dest)
  1602. {
  1603. UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  1604. CMOCK_pb_decode_svarint_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_svarint_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.pb_decode_svarint_CallInstance);
  1605. Mock.pb_decode_svarint_CallInstance = CMock_Guts_MemNext(Mock.pb_decode_svarint_CallInstance);
  1606. if (Mock.pb_decode_svarint_IgnoreBool)
  1607. {
  1608. if (cmock_call_instance == NULL)
  1609. return Mock.pb_decode_svarint_FinalReturn;
  1610. Mock.pb_decode_svarint_FinalReturn = cmock_call_instance->ReturnVal;
  1611. return cmock_call_instance->ReturnVal;
  1612. }
  1613. if (Mock.pb_decode_svarint_CallbackFunctionPointer != NULL)
  1614. {
  1615. return Mock.pb_decode_svarint_CallbackFunctionPointer(stream, dest, Mock.pb_decode_svarint_CallbackCalls++);
  1616. }
  1617. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'pb_decode_svarint' called more times than expected.");
  1618. cmock_line = cmock_call_instance->LineNumber;
  1619. if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
  1620. UNITY_TEST_FAIL(cmock_line, "Function 'pb_decode_svarint' called earlier than expected.");
  1621. if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
  1622. UNITY_TEST_FAIL(cmock_line, "Function 'pb_decode_svarint' called later than expected.");
  1623. if (!cmock_call_instance->IgnoreArg_stream)
  1624. {
  1625. if (cmock_call_instance->Expected_stream == NULL)
  1626. { UNITY_TEST_ASSERT_NULL(stream, cmock_line, "Expected NULL. Function 'pb_decode_svarint' called with unexpected value for argument 'stream'."); }
  1627. else if (cmock_call_instance->Expected_stream_Depth == 0)
  1628. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_stream, stream, cmock_line, "Function 'pb_decode_svarint' called with unexpected value for argument 'stream'."); }
  1629. else
  1630. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_stream), (void*)(stream), sizeof(pb_istream_t), cmock_call_instance->Expected_stream_Depth, cmock_line, "Function 'pb_decode_svarint' called with unexpected value for argument 'stream'."); }
  1631. }
  1632. if (!cmock_call_instance->IgnoreArg_dest)
  1633. {
  1634. if (cmock_call_instance->Expected_dest == NULL)
  1635. { UNITY_TEST_ASSERT_NULL(dest, cmock_line, "Expected NULL. Function 'pb_decode_svarint' called with unexpected value for argument 'dest'."); }
  1636. else if (cmock_call_instance->Expected_dest_Depth == 0)
  1637. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_dest, dest, cmock_line, "Function 'pb_decode_svarint' called with unexpected value for argument 'dest'."); }
  1638. else
  1639. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_dest), (void*)(dest), sizeof(int64_t), cmock_call_instance->Expected_dest_Depth, cmock_line, "Function 'pb_decode_svarint' called with unexpected value for argument 'dest'."); }
  1640. }
  1641. if (cmock_call_instance->ReturnThruPtr_stream_Used)
  1642. {
  1643. memcpy((void*)stream, (void*)cmock_call_instance->ReturnThruPtr_stream_Val,
  1644. cmock_call_instance->ReturnThruPtr_stream_Size);
  1645. }
  1646. if (cmock_call_instance->ReturnThruPtr_dest_Used)
  1647. {
  1648. memcpy((void*)dest, (void*)cmock_call_instance->ReturnThruPtr_dest_Val,
  1649. cmock_call_instance->ReturnThruPtr_dest_Size);
  1650. }
  1651. return cmock_call_instance->ReturnVal;
  1652. }
  1653. void CMockExpectParameters_pb_decode_svarint(CMOCK_pb_decode_svarint_CALL_INSTANCE* cmock_call_instance, pb_istream_t* stream, int stream_Depth, int64_t* dest, int dest_Depth)
  1654. {
  1655. cmock_call_instance->Expected_stream = stream;
  1656. cmock_call_instance->Expected_stream_Depth = stream_Depth;
  1657. cmock_call_instance->IgnoreArg_stream = 0;
  1658. cmock_call_instance->ReturnThruPtr_stream_Used = 0;
  1659. cmock_call_instance->Expected_dest = dest;
  1660. cmock_call_instance->Expected_dest_Depth = dest_Depth;
  1661. cmock_call_instance->IgnoreArg_dest = 0;
  1662. cmock_call_instance->ReturnThruPtr_dest_Used = 0;
  1663. }
  1664. void pb_decode_svarint_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, bool cmock_to_return)
  1665. {
  1666. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_svarint_CALL_INSTANCE));
  1667. CMOCK_pb_decode_svarint_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_svarint_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1668. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1669. Mock.pb_decode_svarint_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_svarint_CallInstance, cmock_guts_index);
  1670. cmock_call_instance->LineNumber = cmock_line;
  1671. cmock_call_instance->ReturnVal = cmock_to_return;
  1672. Mock.pb_decode_svarint_IgnoreBool = (int)1;
  1673. }
  1674. void pb_decode_svarint_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int64_t* dest, bool cmock_to_return)
  1675. {
  1676. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_svarint_CALL_INSTANCE));
  1677. CMOCK_pb_decode_svarint_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_svarint_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1678. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1679. Mock.pb_decode_svarint_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_svarint_CallInstance, cmock_guts_index);
  1680. cmock_call_instance->LineNumber = cmock_line;
  1681. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  1682. CMockExpectParameters_pb_decode_svarint(cmock_call_instance, stream, 0, dest, 0);
  1683. cmock_call_instance->ReturnVal = cmock_to_return;
  1684. }
  1685. void pb_decode_svarint_StubWithCallback(CMOCK_pb_decode_svarint_CALLBACK Callback)
  1686. {
  1687. Mock.pb_decode_svarint_CallbackFunctionPointer = Callback;
  1688. }
  1689. void pb_decode_svarint_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int stream_Depth, int64_t* dest, int dest_Depth, bool cmock_to_return)
  1690. {
  1691. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_svarint_CALL_INSTANCE));
  1692. CMOCK_pb_decode_svarint_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_svarint_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1693. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1694. Mock.pb_decode_svarint_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_svarint_CallInstance, cmock_guts_index);
  1695. cmock_call_instance->LineNumber = cmock_line;
  1696. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  1697. CMockExpectParameters_pb_decode_svarint(cmock_call_instance, stream, stream_Depth, dest, dest_Depth);
  1698. cmock_call_instance->ReturnVal = cmock_to_return;
  1699. }
  1700. void pb_decode_svarint_CMockReturnMemThruPtr_stream(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int cmock_size)
  1701. {
  1702. CMOCK_pb_decode_svarint_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_svarint_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_svarint_CallInstance));
  1703. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream ReturnThruPtr called before Expect on 'pb_decode_svarint'.");
  1704. cmock_call_instance->ReturnThruPtr_stream_Used = 1;
  1705. cmock_call_instance->ReturnThruPtr_stream_Val = stream;
  1706. cmock_call_instance->ReturnThruPtr_stream_Size = cmock_size;
  1707. }
  1708. void pb_decode_svarint_CMockReturnMemThruPtr_dest(UNITY_LINE_TYPE cmock_line, int64_t* dest, int cmock_size)
  1709. {
  1710. CMOCK_pb_decode_svarint_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_svarint_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_svarint_CallInstance));
  1711. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "dest ReturnThruPtr called before Expect on 'pb_decode_svarint'.");
  1712. cmock_call_instance->ReturnThruPtr_dest_Used = 1;
  1713. cmock_call_instance->ReturnThruPtr_dest_Val = dest;
  1714. cmock_call_instance->ReturnThruPtr_dest_Size = cmock_size;
  1715. }
  1716. void pb_decode_svarint_CMockIgnoreArg_stream(UNITY_LINE_TYPE cmock_line)
  1717. {
  1718. CMOCK_pb_decode_svarint_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_svarint_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_svarint_CallInstance));
  1719. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream IgnoreArg called before Expect on 'pb_decode_svarint'.");
  1720. cmock_call_instance->IgnoreArg_stream = 1;
  1721. }
  1722. void pb_decode_svarint_CMockIgnoreArg_dest(UNITY_LINE_TYPE cmock_line)
  1723. {
  1724. CMOCK_pb_decode_svarint_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_svarint_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_svarint_CallInstance));
  1725. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "dest IgnoreArg called before Expect on 'pb_decode_svarint'.");
  1726. cmock_call_instance->IgnoreArg_dest = 1;
  1727. }
  1728. bool pb_decode_fixed32(pb_istream_t* stream, void* dest)
  1729. {
  1730. UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  1731. CMOCK_pb_decode_fixed32_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_fixed32_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.pb_decode_fixed32_CallInstance);
  1732. Mock.pb_decode_fixed32_CallInstance = CMock_Guts_MemNext(Mock.pb_decode_fixed32_CallInstance);
  1733. if (Mock.pb_decode_fixed32_IgnoreBool)
  1734. {
  1735. if (cmock_call_instance == NULL)
  1736. return Mock.pb_decode_fixed32_FinalReturn;
  1737. Mock.pb_decode_fixed32_FinalReturn = cmock_call_instance->ReturnVal;
  1738. return cmock_call_instance->ReturnVal;
  1739. }
  1740. if (Mock.pb_decode_fixed32_CallbackFunctionPointer != NULL)
  1741. {
  1742. return Mock.pb_decode_fixed32_CallbackFunctionPointer(stream, dest, Mock.pb_decode_fixed32_CallbackCalls++);
  1743. }
  1744. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'pb_decode_fixed32' called more times than expected.");
  1745. cmock_line = cmock_call_instance->LineNumber;
  1746. if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
  1747. UNITY_TEST_FAIL(cmock_line, "Function 'pb_decode_fixed32' called earlier than expected.");
  1748. if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
  1749. UNITY_TEST_FAIL(cmock_line, "Function 'pb_decode_fixed32' called later than expected.");
  1750. if (!cmock_call_instance->IgnoreArg_stream)
  1751. {
  1752. if (cmock_call_instance->Expected_stream == NULL)
  1753. { UNITY_TEST_ASSERT_NULL(stream, cmock_line, "Expected NULL. Function 'pb_decode_fixed32' called with unexpected value for argument 'stream'."); }
  1754. else if (cmock_call_instance->Expected_stream_Depth == 0)
  1755. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_stream, stream, cmock_line, "Function 'pb_decode_fixed32' called with unexpected value for argument 'stream'."); }
  1756. else
  1757. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_stream), (void*)(stream), sizeof(pb_istream_t), cmock_call_instance->Expected_stream_Depth, cmock_line, "Function 'pb_decode_fixed32' called with unexpected value for argument 'stream'."); }
  1758. }
  1759. if (!cmock_call_instance->IgnoreArg_dest)
  1760. {
  1761. UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_dest, dest, cmock_line, "Function 'pb_decode_fixed32' called with unexpected value for argument 'dest'.");
  1762. }
  1763. if (cmock_call_instance->ReturnThruPtr_stream_Used)
  1764. {
  1765. memcpy((void*)stream, (void*)cmock_call_instance->ReturnThruPtr_stream_Val,
  1766. cmock_call_instance->ReturnThruPtr_stream_Size);
  1767. }
  1768. if (cmock_call_instance->ReturnThruPtr_dest_Used)
  1769. {
  1770. memcpy((void*)dest, (void*)cmock_call_instance->ReturnThruPtr_dest_Val,
  1771. cmock_call_instance->ReturnThruPtr_dest_Size);
  1772. }
  1773. return cmock_call_instance->ReturnVal;
  1774. }
  1775. void CMockExpectParameters_pb_decode_fixed32(CMOCK_pb_decode_fixed32_CALL_INSTANCE* cmock_call_instance, pb_istream_t* stream, int stream_Depth, void* dest, int dest_Depth)
  1776. {
  1777. cmock_call_instance->Expected_stream = stream;
  1778. cmock_call_instance->Expected_stream_Depth = stream_Depth;
  1779. cmock_call_instance->IgnoreArg_stream = 0;
  1780. cmock_call_instance->ReturnThruPtr_stream_Used = 0;
  1781. cmock_call_instance->Expected_dest = dest;
  1782. cmock_call_instance->Expected_dest_Depth = dest_Depth;
  1783. cmock_call_instance->IgnoreArg_dest = 0;
  1784. cmock_call_instance->ReturnThruPtr_dest_Used = 0;
  1785. }
  1786. void pb_decode_fixed32_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, bool cmock_to_return)
  1787. {
  1788. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_fixed32_CALL_INSTANCE));
  1789. CMOCK_pb_decode_fixed32_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_fixed32_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1790. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1791. Mock.pb_decode_fixed32_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_fixed32_CallInstance, cmock_guts_index);
  1792. cmock_call_instance->LineNumber = cmock_line;
  1793. cmock_call_instance->ReturnVal = cmock_to_return;
  1794. Mock.pb_decode_fixed32_IgnoreBool = (int)1;
  1795. }
  1796. void pb_decode_fixed32_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, void* dest, bool cmock_to_return)
  1797. {
  1798. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_fixed32_CALL_INSTANCE));
  1799. CMOCK_pb_decode_fixed32_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_fixed32_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1800. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1801. Mock.pb_decode_fixed32_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_fixed32_CallInstance, cmock_guts_index);
  1802. cmock_call_instance->LineNumber = cmock_line;
  1803. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  1804. CMockExpectParameters_pb_decode_fixed32(cmock_call_instance, stream, 0, dest, 0);
  1805. cmock_call_instance->ReturnVal = cmock_to_return;
  1806. }
  1807. void pb_decode_fixed32_StubWithCallback(CMOCK_pb_decode_fixed32_CALLBACK Callback)
  1808. {
  1809. Mock.pb_decode_fixed32_CallbackFunctionPointer = Callback;
  1810. }
  1811. void pb_decode_fixed32_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int stream_Depth, void* dest, int dest_Depth, bool cmock_to_return)
  1812. {
  1813. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_fixed32_CALL_INSTANCE));
  1814. CMOCK_pb_decode_fixed32_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_fixed32_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1815. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1816. Mock.pb_decode_fixed32_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_fixed32_CallInstance, cmock_guts_index);
  1817. cmock_call_instance->LineNumber = cmock_line;
  1818. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  1819. CMockExpectParameters_pb_decode_fixed32(cmock_call_instance, stream, stream_Depth, dest, dest_Depth);
  1820. cmock_call_instance->ReturnVal = cmock_to_return;
  1821. }
  1822. void pb_decode_fixed32_CMockReturnMemThruPtr_stream(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int cmock_size)
  1823. {
  1824. CMOCK_pb_decode_fixed32_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_fixed32_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_fixed32_CallInstance));
  1825. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream ReturnThruPtr called before Expect on 'pb_decode_fixed32'.");
  1826. cmock_call_instance->ReturnThruPtr_stream_Used = 1;
  1827. cmock_call_instance->ReturnThruPtr_stream_Val = stream;
  1828. cmock_call_instance->ReturnThruPtr_stream_Size = cmock_size;
  1829. }
  1830. void pb_decode_fixed32_CMockReturnMemThruPtr_dest(UNITY_LINE_TYPE cmock_line, void* dest, int cmock_size)
  1831. {
  1832. CMOCK_pb_decode_fixed32_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_fixed32_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_fixed32_CallInstance));
  1833. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "dest ReturnThruPtr called before Expect on 'pb_decode_fixed32'.");
  1834. cmock_call_instance->ReturnThruPtr_dest_Used = 1;
  1835. cmock_call_instance->ReturnThruPtr_dest_Val = dest;
  1836. cmock_call_instance->ReturnThruPtr_dest_Size = cmock_size;
  1837. }
  1838. void pb_decode_fixed32_CMockIgnoreArg_stream(UNITY_LINE_TYPE cmock_line)
  1839. {
  1840. CMOCK_pb_decode_fixed32_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_fixed32_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_fixed32_CallInstance));
  1841. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream IgnoreArg called before Expect on 'pb_decode_fixed32'.");
  1842. cmock_call_instance->IgnoreArg_stream = 1;
  1843. }
  1844. void pb_decode_fixed32_CMockIgnoreArg_dest(UNITY_LINE_TYPE cmock_line)
  1845. {
  1846. CMOCK_pb_decode_fixed32_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_fixed32_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_fixed32_CallInstance));
  1847. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "dest IgnoreArg called before Expect on 'pb_decode_fixed32'.");
  1848. cmock_call_instance->IgnoreArg_dest = 1;
  1849. }
  1850. bool pb_decode_fixed64(pb_istream_t* stream, void* dest)
  1851. {
  1852. UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  1853. CMOCK_pb_decode_fixed64_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_fixed64_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.pb_decode_fixed64_CallInstance);
  1854. Mock.pb_decode_fixed64_CallInstance = CMock_Guts_MemNext(Mock.pb_decode_fixed64_CallInstance);
  1855. if (Mock.pb_decode_fixed64_IgnoreBool)
  1856. {
  1857. if (cmock_call_instance == NULL)
  1858. return Mock.pb_decode_fixed64_FinalReturn;
  1859. Mock.pb_decode_fixed64_FinalReturn = cmock_call_instance->ReturnVal;
  1860. return cmock_call_instance->ReturnVal;
  1861. }
  1862. if (Mock.pb_decode_fixed64_CallbackFunctionPointer != NULL)
  1863. {
  1864. return Mock.pb_decode_fixed64_CallbackFunctionPointer(stream, dest, Mock.pb_decode_fixed64_CallbackCalls++);
  1865. }
  1866. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'pb_decode_fixed64' called more times than expected.");
  1867. cmock_line = cmock_call_instance->LineNumber;
  1868. if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
  1869. UNITY_TEST_FAIL(cmock_line, "Function 'pb_decode_fixed64' called earlier than expected.");
  1870. if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
  1871. UNITY_TEST_FAIL(cmock_line, "Function 'pb_decode_fixed64' called later than expected.");
  1872. if (!cmock_call_instance->IgnoreArg_stream)
  1873. {
  1874. if (cmock_call_instance->Expected_stream == NULL)
  1875. { UNITY_TEST_ASSERT_NULL(stream, cmock_line, "Expected NULL. Function 'pb_decode_fixed64' called with unexpected value for argument 'stream'."); }
  1876. else if (cmock_call_instance->Expected_stream_Depth == 0)
  1877. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_stream, stream, cmock_line, "Function 'pb_decode_fixed64' called with unexpected value for argument 'stream'."); }
  1878. else
  1879. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_stream), (void*)(stream), sizeof(pb_istream_t), cmock_call_instance->Expected_stream_Depth, cmock_line, "Function 'pb_decode_fixed64' called with unexpected value for argument 'stream'."); }
  1880. }
  1881. if (!cmock_call_instance->IgnoreArg_dest)
  1882. {
  1883. UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_dest, dest, cmock_line, "Function 'pb_decode_fixed64' called with unexpected value for argument 'dest'.");
  1884. }
  1885. if (cmock_call_instance->ReturnThruPtr_stream_Used)
  1886. {
  1887. memcpy((void*)stream, (void*)cmock_call_instance->ReturnThruPtr_stream_Val,
  1888. cmock_call_instance->ReturnThruPtr_stream_Size);
  1889. }
  1890. if (cmock_call_instance->ReturnThruPtr_dest_Used)
  1891. {
  1892. memcpy((void*)dest, (void*)cmock_call_instance->ReturnThruPtr_dest_Val,
  1893. cmock_call_instance->ReturnThruPtr_dest_Size);
  1894. }
  1895. return cmock_call_instance->ReturnVal;
  1896. }
  1897. void CMockExpectParameters_pb_decode_fixed64(CMOCK_pb_decode_fixed64_CALL_INSTANCE* cmock_call_instance, pb_istream_t* stream, int stream_Depth, void* dest, int dest_Depth)
  1898. {
  1899. cmock_call_instance->Expected_stream = stream;
  1900. cmock_call_instance->Expected_stream_Depth = stream_Depth;
  1901. cmock_call_instance->IgnoreArg_stream = 0;
  1902. cmock_call_instance->ReturnThruPtr_stream_Used = 0;
  1903. cmock_call_instance->Expected_dest = dest;
  1904. cmock_call_instance->Expected_dest_Depth = dest_Depth;
  1905. cmock_call_instance->IgnoreArg_dest = 0;
  1906. cmock_call_instance->ReturnThruPtr_dest_Used = 0;
  1907. }
  1908. void pb_decode_fixed64_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, bool cmock_to_return)
  1909. {
  1910. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_fixed64_CALL_INSTANCE));
  1911. CMOCK_pb_decode_fixed64_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_fixed64_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1912. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1913. Mock.pb_decode_fixed64_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_fixed64_CallInstance, cmock_guts_index);
  1914. cmock_call_instance->LineNumber = cmock_line;
  1915. cmock_call_instance->ReturnVal = cmock_to_return;
  1916. Mock.pb_decode_fixed64_IgnoreBool = (int)1;
  1917. }
  1918. void pb_decode_fixed64_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, void* dest, bool cmock_to_return)
  1919. {
  1920. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_fixed64_CALL_INSTANCE));
  1921. CMOCK_pb_decode_fixed64_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_fixed64_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1922. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1923. Mock.pb_decode_fixed64_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_fixed64_CallInstance, cmock_guts_index);
  1924. cmock_call_instance->LineNumber = cmock_line;
  1925. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  1926. CMockExpectParameters_pb_decode_fixed64(cmock_call_instance, stream, 0, dest, 0);
  1927. cmock_call_instance->ReturnVal = cmock_to_return;
  1928. }
  1929. void pb_decode_fixed64_StubWithCallback(CMOCK_pb_decode_fixed64_CALLBACK Callback)
  1930. {
  1931. Mock.pb_decode_fixed64_CallbackFunctionPointer = Callback;
  1932. }
  1933. void pb_decode_fixed64_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int stream_Depth, void* dest, int dest_Depth, bool cmock_to_return)
  1934. {
  1935. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_decode_fixed64_CALL_INSTANCE));
  1936. CMOCK_pb_decode_fixed64_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_decode_fixed64_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  1937. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  1938. Mock.pb_decode_fixed64_CallInstance = CMock_Guts_MemChain(Mock.pb_decode_fixed64_CallInstance, cmock_guts_index);
  1939. cmock_call_instance->LineNumber = cmock_line;
  1940. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  1941. CMockExpectParameters_pb_decode_fixed64(cmock_call_instance, stream, stream_Depth, dest, dest_Depth);
  1942. cmock_call_instance->ReturnVal = cmock_to_return;
  1943. }
  1944. void pb_decode_fixed64_CMockReturnMemThruPtr_stream(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int cmock_size)
  1945. {
  1946. CMOCK_pb_decode_fixed64_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_fixed64_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_fixed64_CallInstance));
  1947. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream ReturnThruPtr called before Expect on 'pb_decode_fixed64'.");
  1948. cmock_call_instance->ReturnThruPtr_stream_Used = 1;
  1949. cmock_call_instance->ReturnThruPtr_stream_Val = stream;
  1950. cmock_call_instance->ReturnThruPtr_stream_Size = cmock_size;
  1951. }
  1952. void pb_decode_fixed64_CMockReturnMemThruPtr_dest(UNITY_LINE_TYPE cmock_line, void* dest, int cmock_size)
  1953. {
  1954. CMOCK_pb_decode_fixed64_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_fixed64_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_fixed64_CallInstance));
  1955. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "dest ReturnThruPtr called before Expect on 'pb_decode_fixed64'.");
  1956. cmock_call_instance->ReturnThruPtr_dest_Used = 1;
  1957. cmock_call_instance->ReturnThruPtr_dest_Val = dest;
  1958. cmock_call_instance->ReturnThruPtr_dest_Size = cmock_size;
  1959. }
  1960. void pb_decode_fixed64_CMockIgnoreArg_stream(UNITY_LINE_TYPE cmock_line)
  1961. {
  1962. CMOCK_pb_decode_fixed64_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_fixed64_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_fixed64_CallInstance));
  1963. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream IgnoreArg called before Expect on 'pb_decode_fixed64'.");
  1964. cmock_call_instance->IgnoreArg_stream = 1;
  1965. }
  1966. void pb_decode_fixed64_CMockIgnoreArg_dest(UNITY_LINE_TYPE cmock_line)
  1967. {
  1968. CMOCK_pb_decode_fixed64_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_decode_fixed64_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_decode_fixed64_CallInstance));
  1969. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "dest IgnoreArg called before Expect on 'pb_decode_fixed64'.");
  1970. cmock_call_instance->IgnoreArg_dest = 1;
  1971. }
  1972. bool pb_make_string_substream(pb_istream_t* stream, pb_istream_t* substream)
  1973. {
  1974. UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  1975. CMOCK_pb_make_string_substream_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_make_string_substream_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.pb_make_string_substream_CallInstance);
  1976. Mock.pb_make_string_substream_CallInstance = CMock_Guts_MemNext(Mock.pb_make_string_substream_CallInstance);
  1977. if (Mock.pb_make_string_substream_IgnoreBool)
  1978. {
  1979. if (cmock_call_instance == NULL)
  1980. return Mock.pb_make_string_substream_FinalReturn;
  1981. Mock.pb_make_string_substream_FinalReturn = cmock_call_instance->ReturnVal;
  1982. return cmock_call_instance->ReturnVal;
  1983. }
  1984. if (Mock.pb_make_string_substream_CallbackFunctionPointer != NULL)
  1985. {
  1986. return Mock.pb_make_string_substream_CallbackFunctionPointer(stream, substream, Mock.pb_make_string_substream_CallbackCalls++);
  1987. }
  1988. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'pb_make_string_substream' called more times than expected.");
  1989. cmock_line = cmock_call_instance->LineNumber;
  1990. if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
  1991. UNITY_TEST_FAIL(cmock_line, "Function 'pb_make_string_substream' called earlier than expected.");
  1992. if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
  1993. UNITY_TEST_FAIL(cmock_line, "Function 'pb_make_string_substream' called later than expected.");
  1994. if (!cmock_call_instance->IgnoreArg_stream)
  1995. {
  1996. if (cmock_call_instance->Expected_stream == NULL)
  1997. { UNITY_TEST_ASSERT_NULL(stream, cmock_line, "Expected NULL. Function 'pb_make_string_substream' called with unexpected value for argument 'stream'."); }
  1998. else if (cmock_call_instance->Expected_stream_Depth == 0)
  1999. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_stream, stream, cmock_line, "Function 'pb_make_string_substream' called with unexpected value for argument 'stream'."); }
  2000. else
  2001. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_stream), (void*)(stream), sizeof(pb_istream_t), cmock_call_instance->Expected_stream_Depth, cmock_line, "Function 'pb_make_string_substream' called with unexpected value for argument 'stream'."); }
  2002. }
  2003. if (!cmock_call_instance->IgnoreArg_substream)
  2004. {
  2005. if (cmock_call_instance->Expected_substream == NULL)
  2006. { UNITY_TEST_ASSERT_NULL(substream, cmock_line, "Expected NULL. Function 'pb_make_string_substream' called with unexpected value for argument 'substream'."); }
  2007. else if (cmock_call_instance->Expected_substream_Depth == 0)
  2008. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_substream, substream, cmock_line, "Function 'pb_make_string_substream' called with unexpected value for argument 'substream'."); }
  2009. else
  2010. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_substream), (void*)(substream), sizeof(pb_istream_t), cmock_call_instance->Expected_substream_Depth, cmock_line, "Function 'pb_make_string_substream' called with unexpected value for argument 'substream'."); }
  2011. }
  2012. if (cmock_call_instance->ReturnThruPtr_stream_Used)
  2013. {
  2014. memcpy((void*)stream, (void*)cmock_call_instance->ReturnThruPtr_stream_Val,
  2015. cmock_call_instance->ReturnThruPtr_stream_Size);
  2016. }
  2017. if (cmock_call_instance->ReturnThruPtr_substream_Used)
  2018. {
  2019. memcpy((void*)substream, (void*)cmock_call_instance->ReturnThruPtr_substream_Val,
  2020. cmock_call_instance->ReturnThruPtr_substream_Size);
  2021. }
  2022. return cmock_call_instance->ReturnVal;
  2023. }
  2024. void CMockExpectParameters_pb_make_string_substream(CMOCK_pb_make_string_substream_CALL_INSTANCE* cmock_call_instance, pb_istream_t* stream, int stream_Depth, pb_istream_t* substream, int substream_Depth)
  2025. {
  2026. cmock_call_instance->Expected_stream = stream;
  2027. cmock_call_instance->Expected_stream_Depth = stream_Depth;
  2028. cmock_call_instance->IgnoreArg_stream = 0;
  2029. cmock_call_instance->ReturnThruPtr_stream_Used = 0;
  2030. cmock_call_instance->Expected_substream = substream;
  2031. cmock_call_instance->Expected_substream_Depth = substream_Depth;
  2032. cmock_call_instance->IgnoreArg_substream = 0;
  2033. cmock_call_instance->ReturnThruPtr_substream_Used = 0;
  2034. }
  2035. void pb_make_string_substream_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, bool cmock_to_return)
  2036. {
  2037. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_make_string_substream_CALL_INSTANCE));
  2038. CMOCK_pb_make_string_substream_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_make_string_substream_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  2039. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  2040. Mock.pb_make_string_substream_CallInstance = CMock_Guts_MemChain(Mock.pb_make_string_substream_CallInstance, cmock_guts_index);
  2041. cmock_call_instance->LineNumber = cmock_line;
  2042. cmock_call_instance->ReturnVal = cmock_to_return;
  2043. Mock.pb_make_string_substream_IgnoreBool = (int)1;
  2044. }
  2045. void pb_make_string_substream_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, pb_istream_t* substream, bool cmock_to_return)
  2046. {
  2047. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_make_string_substream_CALL_INSTANCE));
  2048. CMOCK_pb_make_string_substream_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_make_string_substream_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  2049. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  2050. Mock.pb_make_string_substream_CallInstance = CMock_Guts_MemChain(Mock.pb_make_string_substream_CallInstance, cmock_guts_index);
  2051. cmock_call_instance->LineNumber = cmock_line;
  2052. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  2053. CMockExpectParameters_pb_make_string_substream(cmock_call_instance, stream, 0, substream, 0);
  2054. cmock_call_instance->ReturnVal = cmock_to_return;
  2055. }
  2056. void pb_make_string_substream_StubWithCallback(CMOCK_pb_make_string_substream_CALLBACK Callback)
  2057. {
  2058. Mock.pb_make_string_substream_CallbackFunctionPointer = Callback;
  2059. }
  2060. void pb_make_string_substream_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int stream_Depth, pb_istream_t* substream, int substream_Depth, bool cmock_to_return)
  2061. {
  2062. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_make_string_substream_CALL_INSTANCE));
  2063. CMOCK_pb_make_string_substream_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_make_string_substream_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  2064. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  2065. Mock.pb_make_string_substream_CallInstance = CMock_Guts_MemChain(Mock.pb_make_string_substream_CallInstance, cmock_guts_index);
  2066. cmock_call_instance->LineNumber = cmock_line;
  2067. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  2068. CMockExpectParameters_pb_make_string_substream(cmock_call_instance, stream, stream_Depth, substream, substream_Depth);
  2069. cmock_call_instance->ReturnVal = cmock_to_return;
  2070. }
  2071. void pb_make_string_substream_CMockReturnMemThruPtr_stream(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int cmock_size)
  2072. {
  2073. CMOCK_pb_make_string_substream_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_make_string_substream_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_make_string_substream_CallInstance));
  2074. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream ReturnThruPtr called before Expect on 'pb_make_string_substream'.");
  2075. cmock_call_instance->ReturnThruPtr_stream_Used = 1;
  2076. cmock_call_instance->ReturnThruPtr_stream_Val = stream;
  2077. cmock_call_instance->ReturnThruPtr_stream_Size = cmock_size;
  2078. }
  2079. void pb_make_string_substream_CMockReturnMemThruPtr_substream(UNITY_LINE_TYPE cmock_line, pb_istream_t* substream, int cmock_size)
  2080. {
  2081. CMOCK_pb_make_string_substream_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_make_string_substream_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_make_string_substream_CallInstance));
  2082. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "substream ReturnThruPtr called before Expect on 'pb_make_string_substream'.");
  2083. cmock_call_instance->ReturnThruPtr_substream_Used = 1;
  2084. cmock_call_instance->ReturnThruPtr_substream_Val = substream;
  2085. cmock_call_instance->ReturnThruPtr_substream_Size = cmock_size;
  2086. }
  2087. void pb_make_string_substream_CMockIgnoreArg_stream(UNITY_LINE_TYPE cmock_line)
  2088. {
  2089. CMOCK_pb_make_string_substream_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_make_string_substream_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_make_string_substream_CallInstance));
  2090. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream IgnoreArg called before Expect on 'pb_make_string_substream'.");
  2091. cmock_call_instance->IgnoreArg_stream = 1;
  2092. }
  2093. void pb_make_string_substream_CMockIgnoreArg_substream(UNITY_LINE_TYPE cmock_line)
  2094. {
  2095. CMOCK_pb_make_string_substream_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_make_string_substream_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_make_string_substream_CallInstance));
  2096. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "substream IgnoreArg called before Expect on 'pb_make_string_substream'.");
  2097. cmock_call_instance->IgnoreArg_substream = 1;
  2098. }
  2099. void pb_close_string_substream(pb_istream_t* stream, pb_istream_t* substream)
  2100. {
  2101. UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  2102. CMOCK_pb_close_string_substream_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_close_string_substream_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.pb_close_string_substream_CallInstance);
  2103. Mock.pb_close_string_substream_CallInstance = CMock_Guts_MemNext(Mock.pb_close_string_substream_CallInstance);
  2104. if (Mock.pb_close_string_substream_IgnoreBool)
  2105. {
  2106. return;
  2107. }
  2108. if (Mock.pb_close_string_substream_CallbackFunctionPointer != NULL)
  2109. {
  2110. Mock.pb_close_string_substream_CallbackFunctionPointer(stream, substream, Mock.pb_close_string_substream_CallbackCalls++);
  2111. return;
  2112. }
  2113. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'pb_close_string_substream' called more times than expected.");
  2114. cmock_line = cmock_call_instance->LineNumber;
  2115. if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
  2116. UNITY_TEST_FAIL(cmock_line, "Function 'pb_close_string_substream' called earlier than expected.");
  2117. if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
  2118. UNITY_TEST_FAIL(cmock_line, "Function 'pb_close_string_substream' called later than expected.");
  2119. if (!cmock_call_instance->IgnoreArg_stream)
  2120. {
  2121. if (cmock_call_instance->Expected_stream == NULL)
  2122. { UNITY_TEST_ASSERT_NULL(stream, cmock_line, "Expected NULL. Function 'pb_close_string_substream' called with unexpected value for argument 'stream'."); }
  2123. else if (cmock_call_instance->Expected_stream_Depth == 0)
  2124. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_stream, stream, cmock_line, "Function 'pb_close_string_substream' called with unexpected value for argument 'stream'."); }
  2125. else
  2126. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_stream), (void*)(stream), sizeof(pb_istream_t), cmock_call_instance->Expected_stream_Depth, cmock_line, "Function 'pb_close_string_substream' called with unexpected value for argument 'stream'."); }
  2127. }
  2128. if (!cmock_call_instance->IgnoreArg_substream)
  2129. {
  2130. if (cmock_call_instance->Expected_substream == NULL)
  2131. { UNITY_TEST_ASSERT_NULL(substream, cmock_line, "Expected NULL. Function 'pb_close_string_substream' called with unexpected value for argument 'substream'."); }
  2132. else if (cmock_call_instance->Expected_substream_Depth == 0)
  2133. { UNITY_TEST_ASSERT_EQUAL_PTR(cmock_call_instance->Expected_substream, substream, cmock_line, "Function 'pb_close_string_substream' called with unexpected value for argument 'substream'."); }
  2134. else
  2135. { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_substream), (void*)(substream), sizeof(pb_istream_t), cmock_call_instance->Expected_substream_Depth, cmock_line, "Function 'pb_close_string_substream' called with unexpected value for argument 'substream'."); }
  2136. }
  2137. if (cmock_call_instance->ReturnThruPtr_stream_Used)
  2138. {
  2139. memcpy((void*)stream, (void*)cmock_call_instance->ReturnThruPtr_stream_Val,
  2140. cmock_call_instance->ReturnThruPtr_stream_Size);
  2141. }
  2142. if (cmock_call_instance->ReturnThruPtr_substream_Used)
  2143. {
  2144. memcpy((void*)substream, (void*)cmock_call_instance->ReturnThruPtr_substream_Val,
  2145. cmock_call_instance->ReturnThruPtr_substream_Size);
  2146. }
  2147. }
  2148. void CMockExpectParameters_pb_close_string_substream(CMOCK_pb_close_string_substream_CALL_INSTANCE* cmock_call_instance, pb_istream_t* stream, int stream_Depth, pb_istream_t* substream, int substream_Depth)
  2149. {
  2150. cmock_call_instance->Expected_stream = stream;
  2151. cmock_call_instance->Expected_stream_Depth = stream_Depth;
  2152. cmock_call_instance->IgnoreArg_stream = 0;
  2153. cmock_call_instance->ReturnThruPtr_stream_Used = 0;
  2154. cmock_call_instance->Expected_substream = substream;
  2155. cmock_call_instance->Expected_substream_Depth = substream_Depth;
  2156. cmock_call_instance->IgnoreArg_substream = 0;
  2157. cmock_call_instance->ReturnThruPtr_substream_Used = 0;
  2158. }
  2159. void pb_close_string_substream_CMockIgnore(void)
  2160. {
  2161. Mock.pb_close_string_substream_IgnoreBool = (int)1;
  2162. }
  2163. void pb_close_string_substream_CMockExpect(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, pb_istream_t* substream)
  2164. {
  2165. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_close_string_substream_CALL_INSTANCE));
  2166. CMOCK_pb_close_string_substream_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_close_string_substream_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  2167. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  2168. Mock.pb_close_string_substream_CallInstance = CMock_Guts_MemChain(Mock.pb_close_string_substream_CallInstance, cmock_guts_index);
  2169. cmock_call_instance->LineNumber = cmock_line;
  2170. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  2171. CMockExpectParameters_pb_close_string_substream(cmock_call_instance, stream, 0, substream, 0);
  2172. }
  2173. void pb_close_string_substream_StubWithCallback(CMOCK_pb_close_string_substream_CALLBACK Callback)
  2174. {
  2175. Mock.pb_close_string_substream_CallbackFunctionPointer = Callback;
  2176. }
  2177. void pb_close_string_substream_CMockExpectWithArray(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int stream_Depth, pb_istream_t* substream, int substream_Depth)
  2178. {
  2179. CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_pb_close_string_substream_CALL_INSTANCE));
  2180. CMOCK_pb_close_string_substream_CALL_INSTANCE* cmock_call_instance = (CMOCK_pb_close_string_substream_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  2181. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  2182. Mock.pb_close_string_substream_CallInstance = CMock_Guts_MemChain(Mock.pb_close_string_substream_CallInstance, cmock_guts_index);
  2183. cmock_call_instance->LineNumber = cmock_line;
  2184. cmock_call_instance->CallOrder = ++GlobalExpectCount;
  2185. CMockExpectParameters_pb_close_string_substream(cmock_call_instance, stream, stream_Depth, substream, substream_Depth);
  2186. }
  2187. void pb_close_string_substream_CMockReturnMemThruPtr_stream(UNITY_LINE_TYPE cmock_line, pb_istream_t* stream, int cmock_size)
  2188. {
  2189. CMOCK_pb_close_string_substream_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_close_string_substream_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_close_string_substream_CallInstance));
  2190. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream ReturnThruPtr called before Expect on 'pb_close_string_substream'.");
  2191. cmock_call_instance->ReturnThruPtr_stream_Used = 1;
  2192. cmock_call_instance->ReturnThruPtr_stream_Val = stream;
  2193. cmock_call_instance->ReturnThruPtr_stream_Size = cmock_size;
  2194. }
  2195. void pb_close_string_substream_CMockReturnMemThruPtr_substream(UNITY_LINE_TYPE cmock_line, pb_istream_t* substream, int cmock_size)
  2196. {
  2197. CMOCK_pb_close_string_substream_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_close_string_substream_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_close_string_substream_CallInstance));
  2198. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "substream ReturnThruPtr called before Expect on 'pb_close_string_substream'.");
  2199. cmock_call_instance->ReturnThruPtr_substream_Used = 1;
  2200. cmock_call_instance->ReturnThruPtr_substream_Val = substream;
  2201. cmock_call_instance->ReturnThruPtr_substream_Size = cmock_size;
  2202. }
  2203. void pb_close_string_substream_CMockIgnoreArg_stream(UNITY_LINE_TYPE cmock_line)
  2204. {
  2205. CMOCK_pb_close_string_substream_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_close_string_substream_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_close_string_substream_CallInstance));
  2206. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "stream IgnoreArg called before Expect on 'pb_close_string_substream'.");
  2207. cmock_call_instance->IgnoreArg_stream = 1;
  2208. }
  2209. void pb_close_string_substream_CMockIgnoreArg_substream(UNITY_LINE_TYPE cmock_line)
  2210. {
  2211. CMOCK_pb_close_string_substream_CALL_INSTANCE* cmock_call_instance = cmock_call_instance = (CMOCK_pb_close_string_substream_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.pb_close_string_substream_CallInstance));
  2212. UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "substream IgnoreArg called before Expect on 'pb_close_string_substream'.");
  2213. cmock_call_instance->IgnoreArg_substream = 1;
  2214. }
  2215. /* lint -restore */