mammoth_generated_test.go 150 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515
  1. // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
  2. // Use of this source code is governed by a MIT license found in the LICENSE file.
  3. // Code generated from mammoth-test.go.tmpl - DO NOT EDIT.
  4. package codec
  5. import "testing"
  6. import "fmt"
  7. // TestMammoth has all the different paths optimized in fast-path
  8. // It has all the primitives, slices and maps.
  9. //
  10. // For each of those types, it has a pointer and a non-pointer field.
  11. func init() { _ = fmt.Printf } // so we can include fmt as needed
  12. type TestMammoth struct {
  13. FIntf interface{}
  14. FptrIntf *interface{}
  15. FString string
  16. FptrString *string
  17. FBytes []byte
  18. FptrBytes *[]byte
  19. FFloat32 float32
  20. FptrFloat32 *float32
  21. FFloat64 float64
  22. FptrFloat64 *float64
  23. FUint uint
  24. FptrUint *uint
  25. FUint8 uint8
  26. FptrUint8 *uint8
  27. FUint16 uint16
  28. FptrUint16 *uint16
  29. FUint32 uint32
  30. FptrUint32 *uint32
  31. FUint64 uint64
  32. FptrUint64 *uint64
  33. FUintptr uintptr
  34. FptrUintptr *uintptr
  35. FInt int
  36. FptrInt *int
  37. FInt8 int8
  38. FptrInt8 *int8
  39. FInt16 int16
  40. FptrInt16 *int16
  41. FInt32 int32
  42. FptrInt32 *int32
  43. FInt64 int64
  44. FptrInt64 *int64
  45. FBool bool
  46. FptrBool *bool
  47. FSliceIntf []interface{}
  48. FptrSliceIntf *[]interface{}
  49. FSliceString []string
  50. FptrSliceString *[]string
  51. FSliceBytes [][]byte
  52. FptrSliceBytes *[][]byte
  53. FSliceFloat32 []float32
  54. FptrSliceFloat32 *[]float32
  55. FSliceFloat64 []float64
  56. FptrSliceFloat64 *[]float64
  57. FSliceUint []uint
  58. FptrSliceUint *[]uint
  59. FSliceUint16 []uint16
  60. FptrSliceUint16 *[]uint16
  61. FSliceUint32 []uint32
  62. FptrSliceUint32 *[]uint32
  63. FSliceUint64 []uint64
  64. FptrSliceUint64 *[]uint64
  65. FSliceInt []int
  66. FptrSliceInt *[]int
  67. FSliceInt8 []int8
  68. FptrSliceInt8 *[]int8
  69. FSliceInt16 []int16
  70. FptrSliceInt16 *[]int16
  71. FSliceInt32 []int32
  72. FptrSliceInt32 *[]int32
  73. FSliceInt64 []int64
  74. FptrSliceInt64 *[]int64
  75. FSliceBool []bool
  76. FptrSliceBool *[]bool
  77. FMapStringIntf map[string]interface{}
  78. FptrMapStringIntf *map[string]interface{}
  79. FMapStringString map[string]string
  80. FptrMapStringString *map[string]string
  81. FMapStringBytes map[string][]byte
  82. FptrMapStringBytes *map[string][]byte
  83. FMapStringUint map[string]uint
  84. FptrMapStringUint *map[string]uint
  85. FMapStringUint8 map[string]uint8
  86. FptrMapStringUint8 *map[string]uint8
  87. FMapStringUint64 map[string]uint64
  88. FptrMapStringUint64 *map[string]uint64
  89. FMapStringInt map[string]int
  90. FptrMapStringInt *map[string]int
  91. FMapStringInt64 map[string]int64
  92. FptrMapStringInt64 *map[string]int64
  93. FMapStringFloat32 map[string]float32
  94. FptrMapStringFloat32 *map[string]float32
  95. FMapStringFloat64 map[string]float64
  96. FptrMapStringFloat64 *map[string]float64
  97. FMapStringBool map[string]bool
  98. FptrMapStringBool *map[string]bool
  99. FMapUintIntf map[uint]interface{}
  100. FptrMapUintIntf *map[uint]interface{}
  101. FMapUintString map[uint]string
  102. FptrMapUintString *map[uint]string
  103. FMapUintBytes map[uint][]byte
  104. FptrMapUintBytes *map[uint][]byte
  105. FMapUintUint map[uint]uint
  106. FptrMapUintUint *map[uint]uint
  107. FMapUintUint8 map[uint]uint8
  108. FptrMapUintUint8 *map[uint]uint8
  109. FMapUintUint64 map[uint]uint64
  110. FptrMapUintUint64 *map[uint]uint64
  111. FMapUintInt map[uint]int
  112. FptrMapUintInt *map[uint]int
  113. FMapUintInt64 map[uint]int64
  114. FptrMapUintInt64 *map[uint]int64
  115. FMapUintFloat32 map[uint]float32
  116. FptrMapUintFloat32 *map[uint]float32
  117. FMapUintFloat64 map[uint]float64
  118. FptrMapUintFloat64 *map[uint]float64
  119. FMapUintBool map[uint]bool
  120. FptrMapUintBool *map[uint]bool
  121. FMapUint8Intf map[uint8]interface{}
  122. FptrMapUint8Intf *map[uint8]interface{}
  123. FMapUint8String map[uint8]string
  124. FptrMapUint8String *map[uint8]string
  125. FMapUint8Bytes map[uint8][]byte
  126. FptrMapUint8Bytes *map[uint8][]byte
  127. FMapUint8Uint map[uint8]uint
  128. FptrMapUint8Uint *map[uint8]uint
  129. FMapUint8Uint8 map[uint8]uint8
  130. FptrMapUint8Uint8 *map[uint8]uint8
  131. FMapUint8Uint64 map[uint8]uint64
  132. FptrMapUint8Uint64 *map[uint8]uint64
  133. FMapUint8Int map[uint8]int
  134. FptrMapUint8Int *map[uint8]int
  135. FMapUint8Int64 map[uint8]int64
  136. FptrMapUint8Int64 *map[uint8]int64
  137. FMapUint8Float32 map[uint8]float32
  138. FptrMapUint8Float32 *map[uint8]float32
  139. FMapUint8Float64 map[uint8]float64
  140. FptrMapUint8Float64 *map[uint8]float64
  141. FMapUint8Bool map[uint8]bool
  142. FptrMapUint8Bool *map[uint8]bool
  143. FMapUint64Intf map[uint64]interface{}
  144. FptrMapUint64Intf *map[uint64]interface{}
  145. FMapUint64String map[uint64]string
  146. FptrMapUint64String *map[uint64]string
  147. FMapUint64Bytes map[uint64][]byte
  148. FptrMapUint64Bytes *map[uint64][]byte
  149. FMapUint64Uint map[uint64]uint
  150. FptrMapUint64Uint *map[uint64]uint
  151. FMapUint64Uint8 map[uint64]uint8
  152. FptrMapUint64Uint8 *map[uint64]uint8
  153. FMapUint64Uint64 map[uint64]uint64
  154. FptrMapUint64Uint64 *map[uint64]uint64
  155. FMapUint64Int map[uint64]int
  156. FptrMapUint64Int *map[uint64]int
  157. FMapUint64Int64 map[uint64]int64
  158. FptrMapUint64Int64 *map[uint64]int64
  159. FMapUint64Float32 map[uint64]float32
  160. FptrMapUint64Float32 *map[uint64]float32
  161. FMapUint64Float64 map[uint64]float64
  162. FptrMapUint64Float64 *map[uint64]float64
  163. FMapUint64Bool map[uint64]bool
  164. FptrMapUint64Bool *map[uint64]bool
  165. FMapIntIntf map[int]interface{}
  166. FptrMapIntIntf *map[int]interface{}
  167. FMapIntString map[int]string
  168. FptrMapIntString *map[int]string
  169. FMapIntBytes map[int][]byte
  170. FptrMapIntBytes *map[int][]byte
  171. FMapIntUint map[int]uint
  172. FptrMapIntUint *map[int]uint
  173. FMapIntUint8 map[int]uint8
  174. FptrMapIntUint8 *map[int]uint8
  175. FMapIntUint64 map[int]uint64
  176. FptrMapIntUint64 *map[int]uint64
  177. FMapIntInt map[int]int
  178. FptrMapIntInt *map[int]int
  179. FMapIntInt64 map[int]int64
  180. FptrMapIntInt64 *map[int]int64
  181. FMapIntFloat32 map[int]float32
  182. FptrMapIntFloat32 *map[int]float32
  183. FMapIntFloat64 map[int]float64
  184. FptrMapIntFloat64 *map[int]float64
  185. FMapIntBool map[int]bool
  186. FptrMapIntBool *map[int]bool
  187. FMapInt64Intf map[int64]interface{}
  188. FptrMapInt64Intf *map[int64]interface{}
  189. FMapInt64String map[int64]string
  190. FptrMapInt64String *map[int64]string
  191. FMapInt64Bytes map[int64][]byte
  192. FptrMapInt64Bytes *map[int64][]byte
  193. FMapInt64Uint map[int64]uint
  194. FptrMapInt64Uint *map[int64]uint
  195. FMapInt64Uint8 map[int64]uint8
  196. FptrMapInt64Uint8 *map[int64]uint8
  197. FMapInt64Uint64 map[int64]uint64
  198. FptrMapInt64Uint64 *map[int64]uint64
  199. FMapInt64Int map[int64]int
  200. FptrMapInt64Int *map[int64]int
  201. FMapInt64Int64 map[int64]int64
  202. FptrMapInt64Int64 *map[int64]int64
  203. FMapInt64Float32 map[int64]float32
  204. FptrMapInt64Float32 *map[int64]float32
  205. FMapInt64Float64 map[int64]float64
  206. FptrMapInt64Float64 *map[int64]float64
  207. FMapInt64Bool map[int64]bool
  208. FptrMapInt64Bool *map[int64]bool
  209. }
  210. type typMbsSliceIntf []interface{}
  211. func (_ typMbsSliceIntf) MapBySlice() {}
  212. type typMbsSliceString []string
  213. func (_ typMbsSliceString) MapBySlice() {}
  214. type typMbsSliceBytes [][]byte
  215. func (_ typMbsSliceBytes) MapBySlice() {}
  216. type typMbsSliceFloat32 []float32
  217. func (_ typMbsSliceFloat32) MapBySlice() {}
  218. type typMbsSliceFloat64 []float64
  219. func (_ typMbsSliceFloat64) MapBySlice() {}
  220. type typMbsSliceUint []uint
  221. func (_ typMbsSliceUint) MapBySlice() {}
  222. type typMbsSliceUint16 []uint16
  223. func (_ typMbsSliceUint16) MapBySlice() {}
  224. type typMbsSliceUint32 []uint32
  225. func (_ typMbsSliceUint32) MapBySlice() {}
  226. type typMbsSliceUint64 []uint64
  227. func (_ typMbsSliceUint64) MapBySlice() {}
  228. type typMbsSliceInt []int
  229. func (_ typMbsSliceInt) MapBySlice() {}
  230. type typMbsSliceInt8 []int8
  231. func (_ typMbsSliceInt8) MapBySlice() {}
  232. type typMbsSliceInt16 []int16
  233. func (_ typMbsSliceInt16) MapBySlice() {}
  234. type typMbsSliceInt32 []int32
  235. func (_ typMbsSliceInt32) MapBySlice() {}
  236. type typMbsSliceInt64 []int64
  237. func (_ typMbsSliceInt64) MapBySlice() {}
  238. type typMbsSliceBool []bool
  239. func (_ typMbsSliceBool) MapBySlice() {}
  240. type typMapMapStringIntf map[string]interface{}
  241. type typMapMapStringString map[string]string
  242. type typMapMapStringBytes map[string][]byte
  243. type typMapMapStringUint map[string]uint
  244. type typMapMapStringUint8 map[string]uint8
  245. type typMapMapStringUint64 map[string]uint64
  246. type typMapMapStringInt map[string]int
  247. type typMapMapStringInt64 map[string]int64
  248. type typMapMapStringFloat32 map[string]float32
  249. type typMapMapStringFloat64 map[string]float64
  250. type typMapMapStringBool map[string]bool
  251. type typMapMapUintIntf map[uint]interface{}
  252. type typMapMapUintString map[uint]string
  253. type typMapMapUintBytes map[uint][]byte
  254. type typMapMapUintUint map[uint]uint
  255. type typMapMapUintUint8 map[uint]uint8
  256. type typMapMapUintUint64 map[uint]uint64
  257. type typMapMapUintInt map[uint]int
  258. type typMapMapUintInt64 map[uint]int64
  259. type typMapMapUintFloat32 map[uint]float32
  260. type typMapMapUintFloat64 map[uint]float64
  261. type typMapMapUintBool map[uint]bool
  262. type typMapMapUint8Intf map[uint8]interface{}
  263. type typMapMapUint8String map[uint8]string
  264. type typMapMapUint8Bytes map[uint8][]byte
  265. type typMapMapUint8Uint map[uint8]uint
  266. type typMapMapUint8Uint8 map[uint8]uint8
  267. type typMapMapUint8Uint64 map[uint8]uint64
  268. type typMapMapUint8Int map[uint8]int
  269. type typMapMapUint8Int64 map[uint8]int64
  270. type typMapMapUint8Float32 map[uint8]float32
  271. type typMapMapUint8Float64 map[uint8]float64
  272. type typMapMapUint8Bool map[uint8]bool
  273. type typMapMapUint64Intf map[uint64]interface{}
  274. type typMapMapUint64String map[uint64]string
  275. type typMapMapUint64Bytes map[uint64][]byte
  276. type typMapMapUint64Uint map[uint64]uint
  277. type typMapMapUint64Uint8 map[uint64]uint8
  278. type typMapMapUint64Uint64 map[uint64]uint64
  279. type typMapMapUint64Int map[uint64]int
  280. type typMapMapUint64Int64 map[uint64]int64
  281. type typMapMapUint64Float32 map[uint64]float32
  282. type typMapMapUint64Float64 map[uint64]float64
  283. type typMapMapUint64Bool map[uint64]bool
  284. type typMapMapIntIntf map[int]interface{}
  285. type typMapMapIntString map[int]string
  286. type typMapMapIntBytes map[int][]byte
  287. type typMapMapIntUint map[int]uint
  288. type typMapMapIntUint8 map[int]uint8
  289. type typMapMapIntUint64 map[int]uint64
  290. type typMapMapIntInt map[int]int
  291. type typMapMapIntInt64 map[int]int64
  292. type typMapMapIntFloat32 map[int]float32
  293. type typMapMapIntFloat64 map[int]float64
  294. type typMapMapIntBool map[int]bool
  295. type typMapMapInt64Intf map[int64]interface{}
  296. type typMapMapInt64String map[int64]string
  297. type typMapMapInt64Bytes map[int64][]byte
  298. type typMapMapInt64Uint map[int64]uint
  299. type typMapMapInt64Uint8 map[int64]uint8
  300. type typMapMapInt64Uint64 map[int64]uint64
  301. type typMapMapInt64Int map[int64]int
  302. type typMapMapInt64Int64 map[int64]int64
  303. type typMapMapInt64Float32 map[int64]float32
  304. type typMapMapInt64Float64 map[int64]float64
  305. type typMapMapInt64Bool map[int64]bool
  306. func doTestMammothSlices(t *testing.T, h Handle) {
  307. var v17va [8]interface{}
  308. for _, v := range [][]interface{}{nil, {}, {"string-is-an-interface-2", nil, nil, "string-is-an-interface-3"}} {
  309. var v17v1, v17v2 []interface{}
  310. var bs17 []byte
  311. v17v1 = v
  312. bs17 = testMarshalErr(v17v1, h, t, "enc-slice-v17")
  313. if v != nil {
  314. if v == nil {
  315. v17v2 = nil
  316. } else {
  317. v17v2 = make([]interface{}, len(v))
  318. }
  319. testUnmarshalErr(v17v2, bs17, h, t, "dec-slice-v17")
  320. testDeepEqualErr(v17v1, v17v2, t, "equal-slice-v17")
  321. if v == nil {
  322. v17v2 = nil
  323. } else {
  324. v17v2 = make([]interface{}, len(v))
  325. }
  326. testUnmarshalErr(rv4i(v17v2), bs17, h, t, "dec-slice-v17-noaddr") // non-addressable value
  327. testDeepEqualErr(v17v1, v17v2, t, "equal-slice-v17-noaddr")
  328. }
  329. // ...
  330. bs17 = testMarshalErr(&v17v1, h, t, "enc-slice-v17-p")
  331. v17v2 = nil
  332. testUnmarshalErr(&v17v2, bs17, h, t, "dec-slice-v17-p")
  333. testDeepEqualErr(v17v1, v17v2, t, "equal-slice-v17-p")
  334. v17va = [8]interface{}{} // clear the array
  335. v17v2 = v17va[:1:1]
  336. testUnmarshalErr(&v17v2, bs17, h, t, "dec-slice-v17-p-1")
  337. testDeepEqualErr(v17v1, v17v2, t, "equal-slice-v17-p-1")
  338. v17va = [8]interface{}{} // clear the array
  339. v17v2 = v17va[:len(v17v1):len(v17v1)]
  340. testUnmarshalErr(&v17v2, bs17, h, t, "dec-slice-v17-p-len")
  341. testDeepEqualErr(v17v1, v17v2, t, "equal-slice-v17-p-len")
  342. v17va = [8]interface{}{} // clear the array
  343. v17v2 = v17va[:]
  344. testUnmarshalErr(&v17v2, bs17, h, t, "dec-slice-v17-p-cap")
  345. testDeepEqualErr(v17v1, v17v2, t, "equal-slice-v17-p-cap")
  346. if len(v17v1) > 1 {
  347. v17va = [8]interface{}{} // clear the array
  348. testUnmarshalErr((&v17va)[:len(v17v1)], bs17, h, t, "dec-slice-v17-p-len-noaddr")
  349. testDeepEqualErr(v17v1, v17va[:len(v17v1)], t, "equal-slice-v17-p-len-noaddr")
  350. v17va = [8]interface{}{} // clear the array
  351. testUnmarshalErr((&v17va)[:], bs17, h, t, "dec-slice-v17-p-cap-noaddr")
  352. testDeepEqualErr(v17v1, v17va[:len(v17v1)], t, "equal-slice-v17-p-cap-noaddr")
  353. }
  354. // ...
  355. var v17v3, v17v4 typMbsSliceIntf
  356. v17v2 = nil
  357. if v != nil {
  358. v17v2 = make([]interface{}, len(v))
  359. }
  360. v17v3 = typMbsSliceIntf(v17v1)
  361. v17v4 = typMbsSliceIntf(v17v2)
  362. if v != nil {
  363. bs17 = testMarshalErr(v17v3, h, t, "enc-slice-v17-custom")
  364. testUnmarshalErr(v17v4, bs17, h, t, "dec-slice-v17-custom")
  365. testDeepEqualErr(v17v3, v17v4, t, "equal-slice-v17-custom")
  366. }
  367. bs17 = testMarshalErr(&v17v3, h, t, "enc-slice-v17-custom-p")
  368. v17v2 = nil
  369. v17v4 = typMbsSliceIntf(v17v2)
  370. testUnmarshalErr(&v17v4, bs17, h, t, "dec-slice-v17-custom-p")
  371. testDeepEqualErr(v17v3, v17v4, t, "equal-slice-v17-custom-p")
  372. }
  373. var v18va [8]string
  374. for _, v := range [][]string{nil, {}, {"some-string-2", "", "", "some-string-3"}} {
  375. var v18v1, v18v2 []string
  376. var bs18 []byte
  377. v18v1 = v
  378. bs18 = testMarshalErr(v18v1, h, t, "enc-slice-v18")
  379. if v != nil {
  380. if v == nil {
  381. v18v2 = nil
  382. } else {
  383. v18v2 = make([]string, len(v))
  384. }
  385. testUnmarshalErr(v18v2, bs18, h, t, "dec-slice-v18")
  386. testDeepEqualErr(v18v1, v18v2, t, "equal-slice-v18")
  387. if v == nil {
  388. v18v2 = nil
  389. } else {
  390. v18v2 = make([]string, len(v))
  391. }
  392. testUnmarshalErr(rv4i(v18v2), bs18, h, t, "dec-slice-v18-noaddr") // non-addressable value
  393. testDeepEqualErr(v18v1, v18v2, t, "equal-slice-v18-noaddr")
  394. }
  395. // ...
  396. bs18 = testMarshalErr(&v18v1, h, t, "enc-slice-v18-p")
  397. v18v2 = nil
  398. testUnmarshalErr(&v18v2, bs18, h, t, "dec-slice-v18-p")
  399. testDeepEqualErr(v18v1, v18v2, t, "equal-slice-v18-p")
  400. v18va = [8]string{} // clear the array
  401. v18v2 = v18va[:1:1]
  402. testUnmarshalErr(&v18v2, bs18, h, t, "dec-slice-v18-p-1")
  403. testDeepEqualErr(v18v1, v18v2, t, "equal-slice-v18-p-1")
  404. v18va = [8]string{} // clear the array
  405. v18v2 = v18va[:len(v18v1):len(v18v1)]
  406. testUnmarshalErr(&v18v2, bs18, h, t, "dec-slice-v18-p-len")
  407. testDeepEqualErr(v18v1, v18v2, t, "equal-slice-v18-p-len")
  408. v18va = [8]string{} // clear the array
  409. v18v2 = v18va[:]
  410. testUnmarshalErr(&v18v2, bs18, h, t, "dec-slice-v18-p-cap")
  411. testDeepEqualErr(v18v1, v18v2, t, "equal-slice-v18-p-cap")
  412. if len(v18v1) > 1 {
  413. v18va = [8]string{} // clear the array
  414. testUnmarshalErr((&v18va)[:len(v18v1)], bs18, h, t, "dec-slice-v18-p-len-noaddr")
  415. testDeepEqualErr(v18v1, v18va[:len(v18v1)], t, "equal-slice-v18-p-len-noaddr")
  416. v18va = [8]string{} // clear the array
  417. testUnmarshalErr((&v18va)[:], bs18, h, t, "dec-slice-v18-p-cap-noaddr")
  418. testDeepEqualErr(v18v1, v18va[:len(v18v1)], t, "equal-slice-v18-p-cap-noaddr")
  419. }
  420. // ...
  421. var v18v3, v18v4 typMbsSliceString
  422. v18v2 = nil
  423. if v != nil {
  424. v18v2 = make([]string, len(v))
  425. }
  426. v18v3 = typMbsSliceString(v18v1)
  427. v18v4 = typMbsSliceString(v18v2)
  428. if v != nil {
  429. bs18 = testMarshalErr(v18v3, h, t, "enc-slice-v18-custom")
  430. testUnmarshalErr(v18v4, bs18, h, t, "dec-slice-v18-custom")
  431. testDeepEqualErr(v18v3, v18v4, t, "equal-slice-v18-custom")
  432. }
  433. bs18 = testMarshalErr(&v18v3, h, t, "enc-slice-v18-custom-p")
  434. v18v2 = nil
  435. v18v4 = typMbsSliceString(v18v2)
  436. testUnmarshalErr(&v18v4, bs18, h, t, "dec-slice-v18-custom-p")
  437. testDeepEqualErr(v18v3, v18v4, t, "equal-slice-v18-custom-p")
  438. }
  439. var v19va [8][]byte
  440. for _, v := range [][][]byte{nil, {}, {[]byte("some-string-2"), nil, nil, []byte("some-string-3")}} {
  441. var v19v1, v19v2 [][]byte
  442. var bs19 []byte
  443. v19v1 = v
  444. bs19 = testMarshalErr(v19v1, h, t, "enc-slice-v19")
  445. if v != nil {
  446. if v == nil {
  447. v19v2 = nil
  448. } else {
  449. v19v2 = make([][]byte, len(v))
  450. }
  451. testUnmarshalErr(v19v2, bs19, h, t, "dec-slice-v19")
  452. testDeepEqualErr(v19v1, v19v2, t, "equal-slice-v19")
  453. if v == nil {
  454. v19v2 = nil
  455. } else {
  456. v19v2 = make([][]byte, len(v))
  457. }
  458. testUnmarshalErr(rv4i(v19v2), bs19, h, t, "dec-slice-v19-noaddr") // non-addressable value
  459. testDeepEqualErr(v19v1, v19v2, t, "equal-slice-v19-noaddr")
  460. }
  461. // ...
  462. bs19 = testMarshalErr(&v19v1, h, t, "enc-slice-v19-p")
  463. v19v2 = nil
  464. testUnmarshalErr(&v19v2, bs19, h, t, "dec-slice-v19-p")
  465. testDeepEqualErr(v19v1, v19v2, t, "equal-slice-v19-p")
  466. v19va = [8][]byte{} // clear the array
  467. v19v2 = v19va[:1:1]
  468. testUnmarshalErr(&v19v2, bs19, h, t, "dec-slice-v19-p-1")
  469. testDeepEqualErr(v19v1, v19v2, t, "equal-slice-v19-p-1")
  470. v19va = [8][]byte{} // clear the array
  471. v19v2 = v19va[:len(v19v1):len(v19v1)]
  472. testUnmarshalErr(&v19v2, bs19, h, t, "dec-slice-v19-p-len")
  473. testDeepEqualErr(v19v1, v19v2, t, "equal-slice-v19-p-len")
  474. v19va = [8][]byte{} // clear the array
  475. v19v2 = v19va[:]
  476. testUnmarshalErr(&v19v2, bs19, h, t, "dec-slice-v19-p-cap")
  477. testDeepEqualErr(v19v1, v19v2, t, "equal-slice-v19-p-cap")
  478. if len(v19v1) > 1 {
  479. v19va = [8][]byte{} // clear the array
  480. testUnmarshalErr((&v19va)[:len(v19v1)], bs19, h, t, "dec-slice-v19-p-len-noaddr")
  481. testDeepEqualErr(v19v1, v19va[:len(v19v1)], t, "equal-slice-v19-p-len-noaddr")
  482. v19va = [8][]byte{} // clear the array
  483. testUnmarshalErr((&v19va)[:], bs19, h, t, "dec-slice-v19-p-cap-noaddr")
  484. testDeepEqualErr(v19v1, v19va[:len(v19v1)], t, "equal-slice-v19-p-cap-noaddr")
  485. }
  486. // ...
  487. var v19v3, v19v4 typMbsSliceBytes
  488. v19v2 = nil
  489. if v != nil {
  490. v19v2 = make([][]byte, len(v))
  491. }
  492. v19v3 = typMbsSliceBytes(v19v1)
  493. v19v4 = typMbsSliceBytes(v19v2)
  494. if v != nil {
  495. bs19 = testMarshalErr(v19v3, h, t, "enc-slice-v19-custom")
  496. testUnmarshalErr(v19v4, bs19, h, t, "dec-slice-v19-custom")
  497. testDeepEqualErr(v19v3, v19v4, t, "equal-slice-v19-custom")
  498. }
  499. bs19 = testMarshalErr(&v19v3, h, t, "enc-slice-v19-custom-p")
  500. v19v2 = nil
  501. v19v4 = typMbsSliceBytes(v19v2)
  502. testUnmarshalErr(&v19v4, bs19, h, t, "dec-slice-v19-custom-p")
  503. testDeepEqualErr(v19v3, v19v4, t, "equal-slice-v19-custom-p")
  504. }
  505. var v20va [8]float32
  506. for _, v := range [][]float32{nil, {}, {22.2, 0, 0, 33.3e3}} {
  507. var v20v1, v20v2 []float32
  508. var bs20 []byte
  509. v20v1 = v
  510. bs20 = testMarshalErr(v20v1, h, t, "enc-slice-v20")
  511. if v != nil {
  512. if v == nil {
  513. v20v2 = nil
  514. } else {
  515. v20v2 = make([]float32, len(v))
  516. }
  517. testUnmarshalErr(v20v2, bs20, h, t, "dec-slice-v20")
  518. testDeepEqualErr(v20v1, v20v2, t, "equal-slice-v20")
  519. if v == nil {
  520. v20v2 = nil
  521. } else {
  522. v20v2 = make([]float32, len(v))
  523. }
  524. testUnmarshalErr(rv4i(v20v2), bs20, h, t, "dec-slice-v20-noaddr") // non-addressable value
  525. testDeepEqualErr(v20v1, v20v2, t, "equal-slice-v20-noaddr")
  526. }
  527. // ...
  528. bs20 = testMarshalErr(&v20v1, h, t, "enc-slice-v20-p")
  529. v20v2 = nil
  530. testUnmarshalErr(&v20v2, bs20, h, t, "dec-slice-v20-p")
  531. testDeepEqualErr(v20v1, v20v2, t, "equal-slice-v20-p")
  532. v20va = [8]float32{} // clear the array
  533. v20v2 = v20va[:1:1]
  534. testUnmarshalErr(&v20v2, bs20, h, t, "dec-slice-v20-p-1")
  535. testDeepEqualErr(v20v1, v20v2, t, "equal-slice-v20-p-1")
  536. v20va = [8]float32{} // clear the array
  537. v20v2 = v20va[:len(v20v1):len(v20v1)]
  538. testUnmarshalErr(&v20v2, bs20, h, t, "dec-slice-v20-p-len")
  539. testDeepEqualErr(v20v1, v20v2, t, "equal-slice-v20-p-len")
  540. v20va = [8]float32{} // clear the array
  541. v20v2 = v20va[:]
  542. testUnmarshalErr(&v20v2, bs20, h, t, "dec-slice-v20-p-cap")
  543. testDeepEqualErr(v20v1, v20v2, t, "equal-slice-v20-p-cap")
  544. if len(v20v1) > 1 {
  545. v20va = [8]float32{} // clear the array
  546. testUnmarshalErr((&v20va)[:len(v20v1)], bs20, h, t, "dec-slice-v20-p-len-noaddr")
  547. testDeepEqualErr(v20v1, v20va[:len(v20v1)], t, "equal-slice-v20-p-len-noaddr")
  548. v20va = [8]float32{} // clear the array
  549. testUnmarshalErr((&v20va)[:], bs20, h, t, "dec-slice-v20-p-cap-noaddr")
  550. testDeepEqualErr(v20v1, v20va[:len(v20v1)], t, "equal-slice-v20-p-cap-noaddr")
  551. }
  552. // ...
  553. var v20v3, v20v4 typMbsSliceFloat32
  554. v20v2 = nil
  555. if v != nil {
  556. v20v2 = make([]float32, len(v))
  557. }
  558. v20v3 = typMbsSliceFloat32(v20v1)
  559. v20v4 = typMbsSliceFloat32(v20v2)
  560. if v != nil {
  561. bs20 = testMarshalErr(v20v3, h, t, "enc-slice-v20-custom")
  562. testUnmarshalErr(v20v4, bs20, h, t, "dec-slice-v20-custom")
  563. testDeepEqualErr(v20v3, v20v4, t, "equal-slice-v20-custom")
  564. }
  565. bs20 = testMarshalErr(&v20v3, h, t, "enc-slice-v20-custom-p")
  566. v20v2 = nil
  567. v20v4 = typMbsSliceFloat32(v20v2)
  568. testUnmarshalErr(&v20v4, bs20, h, t, "dec-slice-v20-custom-p")
  569. testDeepEqualErr(v20v3, v20v4, t, "equal-slice-v20-custom-p")
  570. }
  571. var v21va [8]float64
  572. for _, v := range [][]float64{nil, {}, {11.1, 0, 0, 22.2}} {
  573. var v21v1, v21v2 []float64
  574. var bs21 []byte
  575. v21v1 = v
  576. bs21 = testMarshalErr(v21v1, h, t, "enc-slice-v21")
  577. if v != nil {
  578. if v == nil {
  579. v21v2 = nil
  580. } else {
  581. v21v2 = make([]float64, len(v))
  582. }
  583. testUnmarshalErr(v21v2, bs21, h, t, "dec-slice-v21")
  584. testDeepEqualErr(v21v1, v21v2, t, "equal-slice-v21")
  585. if v == nil {
  586. v21v2 = nil
  587. } else {
  588. v21v2 = make([]float64, len(v))
  589. }
  590. testUnmarshalErr(rv4i(v21v2), bs21, h, t, "dec-slice-v21-noaddr") // non-addressable value
  591. testDeepEqualErr(v21v1, v21v2, t, "equal-slice-v21-noaddr")
  592. }
  593. // ...
  594. bs21 = testMarshalErr(&v21v1, h, t, "enc-slice-v21-p")
  595. v21v2 = nil
  596. testUnmarshalErr(&v21v2, bs21, h, t, "dec-slice-v21-p")
  597. testDeepEqualErr(v21v1, v21v2, t, "equal-slice-v21-p")
  598. v21va = [8]float64{} // clear the array
  599. v21v2 = v21va[:1:1]
  600. testUnmarshalErr(&v21v2, bs21, h, t, "dec-slice-v21-p-1")
  601. testDeepEqualErr(v21v1, v21v2, t, "equal-slice-v21-p-1")
  602. v21va = [8]float64{} // clear the array
  603. v21v2 = v21va[:len(v21v1):len(v21v1)]
  604. testUnmarshalErr(&v21v2, bs21, h, t, "dec-slice-v21-p-len")
  605. testDeepEqualErr(v21v1, v21v2, t, "equal-slice-v21-p-len")
  606. v21va = [8]float64{} // clear the array
  607. v21v2 = v21va[:]
  608. testUnmarshalErr(&v21v2, bs21, h, t, "dec-slice-v21-p-cap")
  609. testDeepEqualErr(v21v1, v21v2, t, "equal-slice-v21-p-cap")
  610. if len(v21v1) > 1 {
  611. v21va = [8]float64{} // clear the array
  612. testUnmarshalErr((&v21va)[:len(v21v1)], bs21, h, t, "dec-slice-v21-p-len-noaddr")
  613. testDeepEqualErr(v21v1, v21va[:len(v21v1)], t, "equal-slice-v21-p-len-noaddr")
  614. v21va = [8]float64{} // clear the array
  615. testUnmarshalErr((&v21va)[:], bs21, h, t, "dec-slice-v21-p-cap-noaddr")
  616. testDeepEqualErr(v21v1, v21va[:len(v21v1)], t, "equal-slice-v21-p-cap-noaddr")
  617. }
  618. // ...
  619. var v21v3, v21v4 typMbsSliceFloat64
  620. v21v2 = nil
  621. if v != nil {
  622. v21v2 = make([]float64, len(v))
  623. }
  624. v21v3 = typMbsSliceFloat64(v21v1)
  625. v21v4 = typMbsSliceFloat64(v21v2)
  626. if v != nil {
  627. bs21 = testMarshalErr(v21v3, h, t, "enc-slice-v21-custom")
  628. testUnmarshalErr(v21v4, bs21, h, t, "dec-slice-v21-custom")
  629. testDeepEqualErr(v21v3, v21v4, t, "equal-slice-v21-custom")
  630. }
  631. bs21 = testMarshalErr(&v21v3, h, t, "enc-slice-v21-custom-p")
  632. v21v2 = nil
  633. v21v4 = typMbsSliceFloat64(v21v2)
  634. testUnmarshalErr(&v21v4, bs21, h, t, "dec-slice-v21-custom-p")
  635. testDeepEqualErr(v21v3, v21v4, t, "equal-slice-v21-custom-p")
  636. }
  637. var v22va [8]uint
  638. for _, v := range [][]uint{nil, {}, {77, 0, 0, 127}} {
  639. var v22v1, v22v2 []uint
  640. var bs22 []byte
  641. v22v1 = v
  642. bs22 = testMarshalErr(v22v1, h, t, "enc-slice-v22")
  643. if v != nil {
  644. if v == nil {
  645. v22v2 = nil
  646. } else {
  647. v22v2 = make([]uint, len(v))
  648. }
  649. testUnmarshalErr(v22v2, bs22, h, t, "dec-slice-v22")
  650. testDeepEqualErr(v22v1, v22v2, t, "equal-slice-v22")
  651. if v == nil {
  652. v22v2 = nil
  653. } else {
  654. v22v2 = make([]uint, len(v))
  655. }
  656. testUnmarshalErr(rv4i(v22v2), bs22, h, t, "dec-slice-v22-noaddr") // non-addressable value
  657. testDeepEqualErr(v22v1, v22v2, t, "equal-slice-v22-noaddr")
  658. }
  659. // ...
  660. bs22 = testMarshalErr(&v22v1, h, t, "enc-slice-v22-p")
  661. v22v2 = nil
  662. testUnmarshalErr(&v22v2, bs22, h, t, "dec-slice-v22-p")
  663. testDeepEqualErr(v22v1, v22v2, t, "equal-slice-v22-p")
  664. v22va = [8]uint{} // clear the array
  665. v22v2 = v22va[:1:1]
  666. testUnmarshalErr(&v22v2, bs22, h, t, "dec-slice-v22-p-1")
  667. testDeepEqualErr(v22v1, v22v2, t, "equal-slice-v22-p-1")
  668. v22va = [8]uint{} // clear the array
  669. v22v2 = v22va[:len(v22v1):len(v22v1)]
  670. testUnmarshalErr(&v22v2, bs22, h, t, "dec-slice-v22-p-len")
  671. testDeepEqualErr(v22v1, v22v2, t, "equal-slice-v22-p-len")
  672. v22va = [8]uint{} // clear the array
  673. v22v2 = v22va[:]
  674. testUnmarshalErr(&v22v2, bs22, h, t, "dec-slice-v22-p-cap")
  675. testDeepEqualErr(v22v1, v22v2, t, "equal-slice-v22-p-cap")
  676. if len(v22v1) > 1 {
  677. v22va = [8]uint{} // clear the array
  678. testUnmarshalErr((&v22va)[:len(v22v1)], bs22, h, t, "dec-slice-v22-p-len-noaddr")
  679. testDeepEqualErr(v22v1, v22va[:len(v22v1)], t, "equal-slice-v22-p-len-noaddr")
  680. v22va = [8]uint{} // clear the array
  681. testUnmarshalErr((&v22va)[:], bs22, h, t, "dec-slice-v22-p-cap-noaddr")
  682. testDeepEqualErr(v22v1, v22va[:len(v22v1)], t, "equal-slice-v22-p-cap-noaddr")
  683. }
  684. // ...
  685. var v22v3, v22v4 typMbsSliceUint
  686. v22v2 = nil
  687. if v != nil {
  688. v22v2 = make([]uint, len(v))
  689. }
  690. v22v3 = typMbsSliceUint(v22v1)
  691. v22v4 = typMbsSliceUint(v22v2)
  692. if v != nil {
  693. bs22 = testMarshalErr(v22v3, h, t, "enc-slice-v22-custom")
  694. testUnmarshalErr(v22v4, bs22, h, t, "dec-slice-v22-custom")
  695. testDeepEqualErr(v22v3, v22v4, t, "equal-slice-v22-custom")
  696. }
  697. bs22 = testMarshalErr(&v22v3, h, t, "enc-slice-v22-custom-p")
  698. v22v2 = nil
  699. v22v4 = typMbsSliceUint(v22v2)
  700. testUnmarshalErr(&v22v4, bs22, h, t, "dec-slice-v22-custom-p")
  701. testDeepEqualErr(v22v3, v22v4, t, "equal-slice-v22-custom-p")
  702. }
  703. var v23va [8]uint16
  704. for _, v := range [][]uint16{nil, {}, {111, 0, 0, 77}} {
  705. var v23v1, v23v2 []uint16
  706. var bs23 []byte
  707. v23v1 = v
  708. bs23 = testMarshalErr(v23v1, h, t, "enc-slice-v23")
  709. if v != nil {
  710. if v == nil {
  711. v23v2 = nil
  712. } else {
  713. v23v2 = make([]uint16, len(v))
  714. }
  715. testUnmarshalErr(v23v2, bs23, h, t, "dec-slice-v23")
  716. testDeepEqualErr(v23v1, v23v2, t, "equal-slice-v23")
  717. if v == nil {
  718. v23v2 = nil
  719. } else {
  720. v23v2 = make([]uint16, len(v))
  721. }
  722. testUnmarshalErr(rv4i(v23v2), bs23, h, t, "dec-slice-v23-noaddr") // non-addressable value
  723. testDeepEqualErr(v23v1, v23v2, t, "equal-slice-v23-noaddr")
  724. }
  725. // ...
  726. bs23 = testMarshalErr(&v23v1, h, t, "enc-slice-v23-p")
  727. v23v2 = nil
  728. testUnmarshalErr(&v23v2, bs23, h, t, "dec-slice-v23-p")
  729. testDeepEqualErr(v23v1, v23v2, t, "equal-slice-v23-p")
  730. v23va = [8]uint16{} // clear the array
  731. v23v2 = v23va[:1:1]
  732. testUnmarshalErr(&v23v2, bs23, h, t, "dec-slice-v23-p-1")
  733. testDeepEqualErr(v23v1, v23v2, t, "equal-slice-v23-p-1")
  734. v23va = [8]uint16{} // clear the array
  735. v23v2 = v23va[:len(v23v1):len(v23v1)]
  736. testUnmarshalErr(&v23v2, bs23, h, t, "dec-slice-v23-p-len")
  737. testDeepEqualErr(v23v1, v23v2, t, "equal-slice-v23-p-len")
  738. v23va = [8]uint16{} // clear the array
  739. v23v2 = v23va[:]
  740. testUnmarshalErr(&v23v2, bs23, h, t, "dec-slice-v23-p-cap")
  741. testDeepEqualErr(v23v1, v23v2, t, "equal-slice-v23-p-cap")
  742. if len(v23v1) > 1 {
  743. v23va = [8]uint16{} // clear the array
  744. testUnmarshalErr((&v23va)[:len(v23v1)], bs23, h, t, "dec-slice-v23-p-len-noaddr")
  745. testDeepEqualErr(v23v1, v23va[:len(v23v1)], t, "equal-slice-v23-p-len-noaddr")
  746. v23va = [8]uint16{} // clear the array
  747. testUnmarshalErr((&v23va)[:], bs23, h, t, "dec-slice-v23-p-cap-noaddr")
  748. testDeepEqualErr(v23v1, v23va[:len(v23v1)], t, "equal-slice-v23-p-cap-noaddr")
  749. }
  750. // ...
  751. var v23v3, v23v4 typMbsSliceUint16
  752. v23v2 = nil
  753. if v != nil {
  754. v23v2 = make([]uint16, len(v))
  755. }
  756. v23v3 = typMbsSliceUint16(v23v1)
  757. v23v4 = typMbsSliceUint16(v23v2)
  758. if v != nil {
  759. bs23 = testMarshalErr(v23v3, h, t, "enc-slice-v23-custom")
  760. testUnmarshalErr(v23v4, bs23, h, t, "dec-slice-v23-custom")
  761. testDeepEqualErr(v23v3, v23v4, t, "equal-slice-v23-custom")
  762. }
  763. bs23 = testMarshalErr(&v23v3, h, t, "enc-slice-v23-custom-p")
  764. v23v2 = nil
  765. v23v4 = typMbsSliceUint16(v23v2)
  766. testUnmarshalErr(&v23v4, bs23, h, t, "dec-slice-v23-custom-p")
  767. testDeepEqualErr(v23v3, v23v4, t, "equal-slice-v23-custom-p")
  768. }
  769. var v24va [8]uint32
  770. for _, v := range [][]uint32{nil, {}, {127, 0, 0, 111}} {
  771. var v24v1, v24v2 []uint32
  772. var bs24 []byte
  773. v24v1 = v
  774. bs24 = testMarshalErr(v24v1, h, t, "enc-slice-v24")
  775. if v != nil {
  776. if v == nil {
  777. v24v2 = nil
  778. } else {
  779. v24v2 = make([]uint32, len(v))
  780. }
  781. testUnmarshalErr(v24v2, bs24, h, t, "dec-slice-v24")
  782. testDeepEqualErr(v24v1, v24v2, t, "equal-slice-v24")
  783. if v == nil {
  784. v24v2 = nil
  785. } else {
  786. v24v2 = make([]uint32, len(v))
  787. }
  788. testUnmarshalErr(rv4i(v24v2), bs24, h, t, "dec-slice-v24-noaddr") // non-addressable value
  789. testDeepEqualErr(v24v1, v24v2, t, "equal-slice-v24-noaddr")
  790. }
  791. // ...
  792. bs24 = testMarshalErr(&v24v1, h, t, "enc-slice-v24-p")
  793. v24v2 = nil
  794. testUnmarshalErr(&v24v2, bs24, h, t, "dec-slice-v24-p")
  795. testDeepEqualErr(v24v1, v24v2, t, "equal-slice-v24-p")
  796. v24va = [8]uint32{} // clear the array
  797. v24v2 = v24va[:1:1]
  798. testUnmarshalErr(&v24v2, bs24, h, t, "dec-slice-v24-p-1")
  799. testDeepEqualErr(v24v1, v24v2, t, "equal-slice-v24-p-1")
  800. v24va = [8]uint32{} // clear the array
  801. v24v2 = v24va[:len(v24v1):len(v24v1)]
  802. testUnmarshalErr(&v24v2, bs24, h, t, "dec-slice-v24-p-len")
  803. testDeepEqualErr(v24v1, v24v2, t, "equal-slice-v24-p-len")
  804. v24va = [8]uint32{} // clear the array
  805. v24v2 = v24va[:]
  806. testUnmarshalErr(&v24v2, bs24, h, t, "dec-slice-v24-p-cap")
  807. testDeepEqualErr(v24v1, v24v2, t, "equal-slice-v24-p-cap")
  808. if len(v24v1) > 1 {
  809. v24va = [8]uint32{} // clear the array
  810. testUnmarshalErr((&v24va)[:len(v24v1)], bs24, h, t, "dec-slice-v24-p-len-noaddr")
  811. testDeepEqualErr(v24v1, v24va[:len(v24v1)], t, "equal-slice-v24-p-len-noaddr")
  812. v24va = [8]uint32{} // clear the array
  813. testUnmarshalErr((&v24va)[:], bs24, h, t, "dec-slice-v24-p-cap-noaddr")
  814. testDeepEqualErr(v24v1, v24va[:len(v24v1)], t, "equal-slice-v24-p-cap-noaddr")
  815. }
  816. // ...
  817. var v24v3, v24v4 typMbsSliceUint32
  818. v24v2 = nil
  819. if v != nil {
  820. v24v2 = make([]uint32, len(v))
  821. }
  822. v24v3 = typMbsSliceUint32(v24v1)
  823. v24v4 = typMbsSliceUint32(v24v2)
  824. if v != nil {
  825. bs24 = testMarshalErr(v24v3, h, t, "enc-slice-v24-custom")
  826. testUnmarshalErr(v24v4, bs24, h, t, "dec-slice-v24-custom")
  827. testDeepEqualErr(v24v3, v24v4, t, "equal-slice-v24-custom")
  828. }
  829. bs24 = testMarshalErr(&v24v3, h, t, "enc-slice-v24-custom-p")
  830. v24v2 = nil
  831. v24v4 = typMbsSliceUint32(v24v2)
  832. testUnmarshalErr(&v24v4, bs24, h, t, "dec-slice-v24-custom-p")
  833. testDeepEqualErr(v24v3, v24v4, t, "equal-slice-v24-custom-p")
  834. }
  835. var v25va [8]uint64
  836. for _, v := range [][]uint64{nil, {}, {77, 0, 0, 127}} {
  837. var v25v1, v25v2 []uint64
  838. var bs25 []byte
  839. v25v1 = v
  840. bs25 = testMarshalErr(v25v1, h, t, "enc-slice-v25")
  841. if v != nil {
  842. if v == nil {
  843. v25v2 = nil
  844. } else {
  845. v25v2 = make([]uint64, len(v))
  846. }
  847. testUnmarshalErr(v25v2, bs25, h, t, "dec-slice-v25")
  848. testDeepEqualErr(v25v1, v25v2, t, "equal-slice-v25")
  849. if v == nil {
  850. v25v2 = nil
  851. } else {
  852. v25v2 = make([]uint64, len(v))
  853. }
  854. testUnmarshalErr(rv4i(v25v2), bs25, h, t, "dec-slice-v25-noaddr") // non-addressable value
  855. testDeepEqualErr(v25v1, v25v2, t, "equal-slice-v25-noaddr")
  856. }
  857. // ...
  858. bs25 = testMarshalErr(&v25v1, h, t, "enc-slice-v25-p")
  859. v25v2 = nil
  860. testUnmarshalErr(&v25v2, bs25, h, t, "dec-slice-v25-p")
  861. testDeepEqualErr(v25v1, v25v2, t, "equal-slice-v25-p")
  862. v25va = [8]uint64{} // clear the array
  863. v25v2 = v25va[:1:1]
  864. testUnmarshalErr(&v25v2, bs25, h, t, "dec-slice-v25-p-1")
  865. testDeepEqualErr(v25v1, v25v2, t, "equal-slice-v25-p-1")
  866. v25va = [8]uint64{} // clear the array
  867. v25v2 = v25va[:len(v25v1):len(v25v1)]
  868. testUnmarshalErr(&v25v2, bs25, h, t, "dec-slice-v25-p-len")
  869. testDeepEqualErr(v25v1, v25v2, t, "equal-slice-v25-p-len")
  870. v25va = [8]uint64{} // clear the array
  871. v25v2 = v25va[:]
  872. testUnmarshalErr(&v25v2, bs25, h, t, "dec-slice-v25-p-cap")
  873. testDeepEqualErr(v25v1, v25v2, t, "equal-slice-v25-p-cap")
  874. if len(v25v1) > 1 {
  875. v25va = [8]uint64{} // clear the array
  876. testUnmarshalErr((&v25va)[:len(v25v1)], bs25, h, t, "dec-slice-v25-p-len-noaddr")
  877. testDeepEqualErr(v25v1, v25va[:len(v25v1)], t, "equal-slice-v25-p-len-noaddr")
  878. v25va = [8]uint64{} // clear the array
  879. testUnmarshalErr((&v25va)[:], bs25, h, t, "dec-slice-v25-p-cap-noaddr")
  880. testDeepEqualErr(v25v1, v25va[:len(v25v1)], t, "equal-slice-v25-p-cap-noaddr")
  881. }
  882. // ...
  883. var v25v3, v25v4 typMbsSliceUint64
  884. v25v2 = nil
  885. if v != nil {
  886. v25v2 = make([]uint64, len(v))
  887. }
  888. v25v3 = typMbsSliceUint64(v25v1)
  889. v25v4 = typMbsSliceUint64(v25v2)
  890. if v != nil {
  891. bs25 = testMarshalErr(v25v3, h, t, "enc-slice-v25-custom")
  892. testUnmarshalErr(v25v4, bs25, h, t, "dec-slice-v25-custom")
  893. testDeepEqualErr(v25v3, v25v4, t, "equal-slice-v25-custom")
  894. }
  895. bs25 = testMarshalErr(&v25v3, h, t, "enc-slice-v25-custom-p")
  896. v25v2 = nil
  897. v25v4 = typMbsSliceUint64(v25v2)
  898. testUnmarshalErr(&v25v4, bs25, h, t, "dec-slice-v25-custom-p")
  899. testDeepEqualErr(v25v3, v25v4, t, "equal-slice-v25-custom-p")
  900. }
  901. var v26va [8]int
  902. for _, v := range [][]int{nil, {}, {111, 0, 0, 77}} {
  903. var v26v1, v26v2 []int
  904. var bs26 []byte
  905. v26v1 = v
  906. bs26 = testMarshalErr(v26v1, h, t, "enc-slice-v26")
  907. if v != nil {
  908. if v == nil {
  909. v26v2 = nil
  910. } else {
  911. v26v2 = make([]int, len(v))
  912. }
  913. testUnmarshalErr(v26v2, bs26, h, t, "dec-slice-v26")
  914. testDeepEqualErr(v26v1, v26v2, t, "equal-slice-v26")
  915. if v == nil {
  916. v26v2 = nil
  917. } else {
  918. v26v2 = make([]int, len(v))
  919. }
  920. testUnmarshalErr(rv4i(v26v2), bs26, h, t, "dec-slice-v26-noaddr") // non-addressable value
  921. testDeepEqualErr(v26v1, v26v2, t, "equal-slice-v26-noaddr")
  922. }
  923. // ...
  924. bs26 = testMarshalErr(&v26v1, h, t, "enc-slice-v26-p")
  925. v26v2 = nil
  926. testUnmarshalErr(&v26v2, bs26, h, t, "dec-slice-v26-p")
  927. testDeepEqualErr(v26v1, v26v2, t, "equal-slice-v26-p")
  928. v26va = [8]int{} // clear the array
  929. v26v2 = v26va[:1:1]
  930. testUnmarshalErr(&v26v2, bs26, h, t, "dec-slice-v26-p-1")
  931. testDeepEqualErr(v26v1, v26v2, t, "equal-slice-v26-p-1")
  932. v26va = [8]int{} // clear the array
  933. v26v2 = v26va[:len(v26v1):len(v26v1)]
  934. testUnmarshalErr(&v26v2, bs26, h, t, "dec-slice-v26-p-len")
  935. testDeepEqualErr(v26v1, v26v2, t, "equal-slice-v26-p-len")
  936. v26va = [8]int{} // clear the array
  937. v26v2 = v26va[:]
  938. testUnmarshalErr(&v26v2, bs26, h, t, "dec-slice-v26-p-cap")
  939. testDeepEqualErr(v26v1, v26v2, t, "equal-slice-v26-p-cap")
  940. if len(v26v1) > 1 {
  941. v26va = [8]int{} // clear the array
  942. testUnmarshalErr((&v26va)[:len(v26v1)], bs26, h, t, "dec-slice-v26-p-len-noaddr")
  943. testDeepEqualErr(v26v1, v26va[:len(v26v1)], t, "equal-slice-v26-p-len-noaddr")
  944. v26va = [8]int{} // clear the array
  945. testUnmarshalErr((&v26va)[:], bs26, h, t, "dec-slice-v26-p-cap-noaddr")
  946. testDeepEqualErr(v26v1, v26va[:len(v26v1)], t, "equal-slice-v26-p-cap-noaddr")
  947. }
  948. // ...
  949. var v26v3, v26v4 typMbsSliceInt
  950. v26v2 = nil
  951. if v != nil {
  952. v26v2 = make([]int, len(v))
  953. }
  954. v26v3 = typMbsSliceInt(v26v1)
  955. v26v4 = typMbsSliceInt(v26v2)
  956. if v != nil {
  957. bs26 = testMarshalErr(v26v3, h, t, "enc-slice-v26-custom")
  958. testUnmarshalErr(v26v4, bs26, h, t, "dec-slice-v26-custom")
  959. testDeepEqualErr(v26v3, v26v4, t, "equal-slice-v26-custom")
  960. }
  961. bs26 = testMarshalErr(&v26v3, h, t, "enc-slice-v26-custom-p")
  962. v26v2 = nil
  963. v26v4 = typMbsSliceInt(v26v2)
  964. testUnmarshalErr(&v26v4, bs26, h, t, "dec-slice-v26-custom-p")
  965. testDeepEqualErr(v26v3, v26v4, t, "equal-slice-v26-custom-p")
  966. }
  967. var v27va [8]int8
  968. for _, v := range [][]int8{nil, {}, {127, 0, 0, 111}} {
  969. var v27v1, v27v2 []int8
  970. var bs27 []byte
  971. v27v1 = v
  972. bs27 = testMarshalErr(v27v1, h, t, "enc-slice-v27")
  973. if v != nil {
  974. if v == nil {
  975. v27v2 = nil
  976. } else {
  977. v27v2 = make([]int8, len(v))
  978. }
  979. testUnmarshalErr(v27v2, bs27, h, t, "dec-slice-v27")
  980. testDeepEqualErr(v27v1, v27v2, t, "equal-slice-v27")
  981. if v == nil {
  982. v27v2 = nil
  983. } else {
  984. v27v2 = make([]int8, len(v))
  985. }
  986. testUnmarshalErr(rv4i(v27v2), bs27, h, t, "dec-slice-v27-noaddr") // non-addressable value
  987. testDeepEqualErr(v27v1, v27v2, t, "equal-slice-v27-noaddr")
  988. }
  989. // ...
  990. bs27 = testMarshalErr(&v27v1, h, t, "enc-slice-v27-p")
  991. v27v2 = nil
  992. testUnmarshalErr(&v27v2, bs27, h, t, "dec-slice-v27-p")
  993. testDeepEqualErr(v27v1, v27v2, t, "equal-slice-v27-p")
  994. v27va = [8]int8{} // clear the array
  995. v27v2 = v27va[:1:1]
  996. testUnmarshalErr(&v27v2, bs27, h, t, "dec-slice-v27-p-1")
  997. testDeepEqualErr(v27v1, v27v2, t, "equal-slice-v27-p-1")
  998. v27va = [8]int8{} // clear the array
  999. v27v2 = v27va[:len(v27v1):len(v27v1)]
  1000. testUnmarshalErr(&v27v2, bs27, h, t, "dec-slice-v27-p-len")
  1001. testDeepEqualErr(v27v1, v27v2, t, "equal-slice-v27-p-len")
  1002. v27va = [8]int8{} // clear the array
  1003. v27v2 = v27va[:]
  1004. testUnmarshalErr(&v27v2, bs27, h, t, "dec-slice-v27-p-cap")
  1005. testDeepEqualErr(v27v1, v27v2, t, "equal-slice-v27-p-cap")
  1006. if len(v27v1) > 1 {
  1007. v27va = [8]int8{} // clear the array
  1008. testUnmarshalErr((&v27va)[:len(v27v1)], bs27, h, t, "dec-slice-v27-p-len-noaddr")
  1009. testDeepEqualErr(v27v1, v27va[:len(v27v1)], t, "equal-slice-v27-p-len-noaddr")
  1010. v27va = [8]int8{} // clear the array
  1011. testUnmarshalErr((&v27va)[:], bs27, h, t, "dec-slice-v27-p-cap-noaddr")
  1012. testDeepEqualErr(v27v1, v27va[:len(v27v1)], t, "equal-slice-v27-p-cap-noaddr")
  1013. }
  1014. // ...
  1015. var v27v3, v27v4 typMbsSliceInt8
  1016. v27v2 = nil
  1017. if v != nil {
  1018. v27v2 = make([]int8, len(v))
  1019. }
  1020. v27v3 = typMbsSliceInt8(v27v1)
  1021. v27v4 = typMbsSliceInt8(v27v2)
  1022. if v != nil {
  1023. bs27 = testMarshalErr(v27v3, h, t, "enc-slice-v27-custom")
  1024. testUnmarshalErr(v27v4, bs27, h, t, "dec-slice-v27-custom")
  1025. testDeepEqualErr(v27v3, v27v4, t, "equal-slice-v27-custom")
  1026. }
  1027. bs27 = testMarshalErr(&v27v3, h, t, "enc-slice-v27-custom-p")
  1028. v27v2 = nil
  1029. v27v4 = typMbsSliceInt8(v27v2)
  1030. testUnmarshalErr(&v27v4, bs27, h, t, "dec-slice-v27-custom-p")
  1031. testDeepEqualErr(v27v3, v27v4, t, "equal-slice-v27-custom-p")
  1032. }
  1033. var v28va [8]int16
  1034. for _, v := range [][]int16{nil, {}, {77, 0, 0, 127}} {
  1035. var v28v1, v28v2 []int16
  1036. var bs28 []byte
  1037. v28v1 = v
  1038. bs28 = testMarshalErr(v28v1, h, t, "enc-slice-v28")
  1039. if v != nil {
  1040. if v == nil {
  1041. v28v2 = nil
  1042. } else {
  1043. v28v2 = make([]int16, len(v))
  1044. }
  1045. testUnmarshalErr(v28v2, bs28, h, t, "dec-slice-v28")
  1046. testDeepEqualErr(v28v1, v28v2, t, "equal-slice-v28")
  1047. if v == nil {
  1048. v28v2 = nil
  1049. } else {
  1050. v28v2 = make([]int16, len(v))
  1051. }
  1052. testUnmarshalErr(rv4i(v28v2), bs28, h, t, "dec-slice-v28-noaddr") // non-addressable value
  1053. testDeepEqualErr(v28v1, v28v2, t, "equal-slice-v28-noaddr")
  1054. }
  1055. // ...
  1056. bs28 = testMarshalErr(&v28v1, h, t, "enc-slice-v28-p")
  1057. v28v2 = nil
  1058. testUnmarshalErr(&v28v2, bs28, h, t, "dec-slice-v28-p")
  1059. testDeepEqualErr(v28v1, v28v2, t, "equal-slice-v28-p")
  1060. v28va = [8]int16{} // clear the array
  1061. v28v2 = v28va[:1:1]
  1062. testUnmarshalErr(&v28v2, bs28, h, t, "dec-slice-v28-p-1")
  1063. testDeepEqualErr(v28v1, v28v2, t, "equal-slice-v28-p-1")
  1064. v28va = [8]int16{} // clear the array
  1065. v28v2 = v28va[:len(v28v1):len(v28v1)]
  1066. testUnmarshalErr(&v28v2, bs28, h, t, "dec-slice-v28-p-len")
  1067. testDeepEqualErr(v28v1, v28v2, t, "equal-slice-v28-p-len")
  1068. v28va = [8]int16{} // clear the array
  1069. v28v2 = v28va[:]
  1070. testUnmarshalErr(&v28v2, bs28, h, t, "dec-slice-v28-p-cap")
  1071. testDeepEqualErr(v28v1, v28v2, t, "equal-slice-v28-p-cap")
  1072. if len(v28v1) > 1 {
  1073. v28va = [8]int16{} // clear the array
  1074. testUnmarshalErr((&v28va)[:len(v28v1)], bs28, h, t, "dec-slice-v28-p-len-noaddr")
  1075. testDeepEqualErr(v28v1, v28va[:len(v28v1)], t, "equal-slice-v28-p-len-noaddr")
  1076. v28va = [8]int16{} // clear the array
  1077. testUnmarshalErr((&v28va)[:], bs28, h, t, "dec-slice-v28-p-cap-noaddr")
  1078. testDeepEqualErr(v28v1, v28va[:len(v28v1)], t, "equal-slice-v28-p-cap-noaddr")
  1079. }
  1080. // ...
  1081. var v28v3, v28v4 typMbsSliceInt16
  1082. v28v2 = nil
  1083. if v != nil {
  1084. v28v2 = make([]int16, len(v))
  1085. }
  1086. v28v3 = typMbsSliceInt16(v28v1)
  1087. v28v4 = typMbsSliceInt16(v28v2)
  1088. if v != nil {
  1089. bs28 = testMarshalErr(v28v3, h, t, "enc-slice-v28-custom")
  1090. testUnmarshalErr(v28v4, bs28, h, t, "dec-slice-v28-custom")
  1091. testDeepEqualErr(v28v3, v28v4, t, "equal-slice-v28-custom")
  1092. }
  1093. bs28 = testMarshalErr(&v28v3, h, t, "enc-slice-v28-custom-p")
  1094. v28v2 = nil
  1095. v28v4 = typMbsSliceInt16(v28v2)
  1096. testUnmarshalErr(&v28v4, bs28, h, t, "dec-slice-v28-custom-p")
  1097. testDeepEqualErr(v28v3, v28v4, t, "equal-slice-v28-custom-p")
  1098. }
  1099. var v29va [8]int32
  1100. for _, v := range [][]int32{nil, {}, {111, 0, 0, 77}} {
  1101. var v29v1, v29v2 []int32
  1102. var bs29 []byte
  1103. v29v1 = v
  1104. bs29 = testMarshalErr(v29v1, h, t, "enc-slice-v29")
  1105. if v != nil {
  1106. if v == nil {
  1107. v29v2 = nil
  1108. } else {
  1109. v29v2 = make([]int32, len(v))
  1110. }
  1111. testUnmarshalErr(v29v2, bs29, h, t, "dec-slice-v29")
  1112. testDeepEqualErr(v29v1, v29v2, t, "equal-slice-v29")
  1113. if v == nil {
  1114. v29v2 = nil
  1115. } else {
  1116. v29v2 = make([]int32, len(v))
  1117. }
  1118. testUnmarshalErr(rv4i(v29v2), bs29, h, t, "dec-slice-v29-noaddr") // non-addressable value
  1119. testDeepEqualErr(v29v1, v29v2, t, "equal-slice-v29-noaddr")
  1120. }
  1121. // ...
  1122. bs29 = testMarshalErr(&v29v1, h, t, "enc-slice-v29-p")
  1123. v29v2 = nil
  1124. testUnmarshalErr(&v29v2, bs29, h, t, "dec-slice-v29-p")
  1125. testDeepEqualErr(v29v1, v29v2, t, "equal-slice-v29-p")
  1126. v29va = [8]int32{} // clear the array
  1127. v29v2 = v29va[:1:1]
  1128. testUnmarshalErr(&v29v2, bs29, h, t, "dec-slice-v29-p-1")
  1129. testDeepEqualErr(v29v1, v29v2, t, "equal-slice-v29-p-1")
  1130. v29va = [8]int32{} // clear the array
  1131. v29v2 = v29va[:len(v29v1):len(v29v1)]
  1132. testUnmarshalErr(&v29v2, bs29, h, t, "dec-slice-v29-p-len")
  1133. testDeepEqualErr(v29v1, v29v2, t, "equal-slice-v29-p-len")
  1134. v29va = [8]int32{} // clear the array
  1135. v29v2 = v29va[:]
  1136. testUnmarshalErr(&v29v2, bs29, h, t, "dec-slice-v29-p-cap")
  1137. testDeepEqualErr(v29v1, v29v2, t, "equal-slice-v29-p-cap")
  1138. if len(v29v1) > 1 {
  1139. v29va = [8]int32{} // clear the array
  1140. testUnmarshalErr((&v29va)[:len(v29v1)], bs29, h, t, "dec-slice-v29-p-len-noaddr")
  1141. testDeepEqualErr(v29v1, v29va[:len(v29v1)], t, "equal-slice-v29-p-len-noaddr")
  1142. v29va = [8]int32{} // clear the array
  1143. testUnmarshalErr((&v29va)[:], bs29, h, t, "dec-slice-v29-p-cap-noaddr")
  1144. testDeepEqualErr(v29v1, v29va[:len(v29v1)], t, "equal-slice-v29-p-cap-noaddr")
  1145. }
  1146. // ...
  1147. var v29v3, v29v4 typMbsSliceInt32
  1148. v29v2 = nil
  1149. if v != nil {
  1150. v29v2 = make([]int32, len(v))
  1151. }
  1152. v29v3 = typMbsSliceInt32(v29v1)
  1153. v29v4 = typMbsSliceInt32(v29v2)
  1154. if v != nil {
  1155. bs29 = testMarshalErr(v29v3, h, t, "enc-slice-v29-custom")
  1156. testUnmarshalErr(v29v4, bs29, h, t, "dec-slice-v29-custom")
  1157. testDeepEqualErr(v29v3, v29v4, t, "equal-slice-v29-custom")
  1158. }
  1159. bs29 = testMarshalErr(&v29v3, h, t, "enc-slice-v29-custom-p")
  1160. v29v2 = nil
  1161. v29v4 = typMbsSliceInt32(v29v2)
  1162. testUnmarshalErr(&v29v4, bs29, h, t, "dec-slice-v29-custom-p")
  1163. testDeepEqualErr(v29v3, v29v4, t, "equal-slice-v29-custom-p")
  1164. }
  1165. var v30va [8]int64
  1166. for _, v := range [][]int64{nil, {}, {127, 0, 0, 111}} {
  1167. var v30v1, v30v2 []int64
  1168. var bs30 []byte
  1169. v30v1 = v
  1170. bs30 = testMarshalErr(v30v1, h, t, "enc-slice-v30")
  1171. if v != nil {
  1172. if v == nil {
  1173. v30v2 = nil
  1174. } else {
  1175. v30v2 = make([]int64, len(v))
  1176. }
  1177. testUnmarshalErr(v30v2, bs30, h, t, "dec-slice-v30")
  1178. testDeepEqualErr(v30v1, v30v2, t, "equal-slice-v30")
  1179. if v == nil {
  1180. v30v2 = nil
  1181. } else {
  1182. v30v2 = make([]int64, len(v))
  1183. }
  1184. testUnmarshalErr(rv4i(v30v2), bs30, h, t, "dec-slice-v30-noaddr") // non-addressable value
  1185. testDeepEqualErr(v30v1, v30v2, t, "equal-slice-v30-noaddr")
  1186. }
  1187. // ...
  1188. bs30 = testMarshalErr(&v30v1, h, t, "enc-slice-v30-p")
  1189. v30v2 = nil
  1190. testUnmarshalErr(&v30v2, bs30, h, t, "dec-slice-v30-p")
  1191. testDeepEqualErr(v30v1, v30v2, t, "equal-slice-v30-p")
  1192. v30va = [8]int64{} // clear the array
  1193. v30v2 = v30va[:1:1]
  1194. testUnmarshalErr(&v30v2, bs30, h, t, "dec-slice-v30-p-1")
  1195. testDeepEqualErr(v30v1, v30v2, t, "equal-slice-v30-p-1")
  1196. v30va = [8]int64{} // clear the array
  1197. v30v2 = v30va[:len(v30v1):len(v30v1)]
  1198. testUnmarshalErr(&v30v2, bs30, h, t, "dec-slice-v30-p-len")
  1199. testDeepEqualErr(v30v1, v30v2, t, "equal-slice-v30-p-len")
  1200. v30va = [8]int64{} // clear the array
  1201. v30v2 = v30va[:]
  1202. testUnmarshalErr(&v30v2, bs30, h, t, "dec-slice-v30-p-cap")
  1203. testDeepEqualErr(v30v1, v30v2, t, "equal-slice-v30-p-cap")
  1204. if len(v30v1) > 1 {
  1205. v30va = [8]int64{} // clear the array
  1206. testUnmarshalErr((&v30va)[:len(v30v1)], bs30, h, t, "dec-slice-v30-p-len-noaddr")
  1207. testDeepEqualErr(v30v1, v30va[:len(v30v1)], t, "equal-slice-v30-p-len-noaddr")
  1208. v30va = [8]int64{} // clear the array
  1209. testUnmarshalErr((&v30va)[:], bs30, h, t, "dec-slice-v30-p-cap-noaddr")
  1210. testDeepEqualErr(v30v1, v30va[:len(v30v1)], t, "equal-slice-v30-p-cap-noaddr")
  1211. }
  1212. // ...
  1213. var v30v3, v30v4 typMbsSliceInt64
  1214. v30v2 = nil
  1215. if v != nil {
  1216. v30v2 = make([]int64, len(v))
  1217. }
  1218. v30v3 = typMbsSliceInt64(v30v1)
  1219. v30v4 = typMbsSliceInt64(v30v2)
  1220. if v != nil {
  1221. bs30 = testMarshalErr(v30v3, h, t, "enc-slice-v30-custom")
  1222. testUnmarshalErr(v30v4, bs30, h, t, "dec-slice-v30-custom")
  1223. testDeepEqualErr(v30v3, v30v4, t, "equal-slice-v30-custom")
  1224. }
  1225. bs30 = testMarshalErr(&v30v3, h, t, "enc-slice-v30-custom-p")
  1226. v30v2 = nil
  1227. v30v4 = typMbsSliceInt64(v30v2)
  1228. testUnmarshalErr(&v30v4, bs30, h, t, "dec-slice-v30-custom-p")
  1229. testDeepEqualErr(v30v3, v30v4, t, "equal-slice-v30-custom-p")
  1230. }
  1231. var v31va [8]bool
  1232. for _, v := range [][]bool{nil, {}, {false, false, false, true}} {
  1233. var v31v1, v31v2 []bool
  1234. var bs31 []byte
  1235. v31v1 = v
  1236. bs31 = testMarshalErr(v31v1, h, t, "enc-slice-v31")
  1237. if v != nil {
  1238. if v == nil {
  1239. v31v2 = nil
  1240. } else {
  1241. v31v2 = make([]bool, len(v))
  1242. }
  1243. testUnmarshalErr(v31v2, bs31, h, t, "dec-slice-v31")
  1244. testDeepEqualErr(v31v1, v31v2, t, "equal-slice-v31")
  1245. if v == nil {
  1246. v31v2 = nil
  1247. } else {
  1248. v31v2 = make([]bool, len(v))
  1249. }
  1250. testUnmarshalErr(rv4i(v31v2), bs31, h, t, "dec-slice-v31-noaddr") // non-addressable value
  1251. testDeepEqualErr(v31v1, v31v2, t, "equal-slice-v31-noaddr")
  1252. }
  1253. // ...
  1254. bs31 = testMarshalErr(&v31v1, h, t, "enc-slice-v31-p")
  1255. v31v2 = nil
  1256. testUnmarshalErr(&v31v2, bs31, h, t, "dec-slice-v31-p")
  1257. testDeepEqualErr(v31v1, v31v2, t, "equal-slice-v31-p")
  1258. v31va = [8]bool{} // clear the array
  1259. v31v2 = v31va[:1:1]
  1260. testUnmarshalErr(&v31v2, bs31, h, t, "dec-slice-v31-p-1")
  1261. testDeepEqualErr(v31v1, v31v2, t, "equal-slice-v31-p-1")
  1262. v31va = [8]bool{} // clear the array
  1263. v31v2 = v31va[:len(v31v1):len(v31v1)]
  1264. testUnmarshalErr(&v31v2, bs31, h, t, "dec-slice-v31-p-len")
  1265. testDeepEqualErr(v31v1, v31v2, t, "equal-slice-v31-p-len")
  1266. v31va = [8]bool{} // clear the array
  1267. v31v2 = v31va[:]
  1268. testUnmarshalErr(&v31v2, bs31, h, t, "dec-slice-v31-p-cap")
  1269. testDeepEqualErr(v31v1, v31v2, t, "equal-slice-v31-p-cap")
  1270. if len(v31v1) > 1 {
  1271. v31va = [8]bool{} // clear the array
  1272. testUnmarshalErr((&v31va)[:len(v31v1)], bs31, h, t, "dec-slice-v31-p-len-noaddr")
  1273. testDeepEqualErr(v31v1, v31va[:len(v31v1)], t, "equal-slice-v31-p-len-noaddr")
  1274. v31va = [8]bool{} // clear the array
  1275. testUnmarshalErr((&v31va)[:], bs31, h, t, "dec-slice-v31-p-cap-noaddr")
  1276. testDeepEqualErr(v31v1, v31va[:len(v31v1)], t, "equal-slice-v31-p-cap-noaddr")
  1277. }
  1278. // ...
  1279. var v31v3, v31v4 typMbsSliceBool
  1280. v31v2 = nil
  1281. if v != nil {
  1282. v31v2 = make([]bool, len(v))
  1283. }
  1284. v31v3 = typMbsSliceBool(v31v1)
  1285. v31v4 = typMbsSliceBool(v31v2)
  1286. if v != nil {
  1287. bs31 = testMarshalErr(v31v3, h, t, "enc-slice-v31-custom")
  1288. testUnmarshalErr(v31v4, bs31, h, t, "dec-slice-v31-custom")
  1289. testDeepEqualErr(v31v3, v31v4, t, "equal-slice-v31-custom")
  1290. }
  1291. bs31 = testMarshalErr(&v31v3, h, t, "enc-slice-v31-custom-p")
  1292. v31v2 = nil
  1293. v31v4 = typMbsSliceBool(v31v2)
  1294. testUnmarshalErr(&v31v4, bs31, h, t, "dec-slice-v31-custom-p")
  1295. testDeepEqualErr(v31v3, v31v4, t, "equal-slice-v31-custom-p")
  1296. }
  1297. }
  1298. func doTestMammothMaps(t *testing.T, h Handle) {
  1299. for _, v := range []map[string]interface{}{nil, {}, {"some-string-1": nil, "some-string-2": "string-is-an-interface-1"}} {
  1300. // fmt.Printf(">>>> running mammoth map v32: %v\n", v)
  1301. var v32v1, v32v2 map[string]interface{}
  1302. var bs32 []byte
  1303. v32v1 = v
  1304. bs32 = testMarshalErr(v32v1, h, t, "enc-map-v32")
  1305. if v != nil {
  1306. if v == nil {
  1307. v32v2 = nil
  1308. } else {
  1309. v32v2 = make(map[string]interface{}, len(v))
  1310. } // reset map
  1311. testUnmarshalErr(v32v2, bs32, h, t, "dec-map-v32")
  1312. testDeepEqualErr(v32v1, v32v2, t, "equal-map-v32")
  1313. if v == nil {
  1314. v32v2 = nil
  1315. } else {
  1316. v32v2 = make(map[string]interface{}, len(v))
  1317. } // reset map
  1318. testUnmarshalErr(rv4i(v32v2), bs32, h, t, "dec-map-v32-noaddr") // decode into non-addressable map value
  1319. testDeepEqualErr(v32v1, v32v2, t, "equal-map-v32-noaddr")
  1320. }
  1321. if v == nil {
  1322. v32v2 = nil
  1323. } else {
  1324. v32v2 = make(map[string]interface{}, len(v))
  1325. } // reset map
  1326. testUnmarshalErr(&v32v2, bs32, h, t, "dec-map-v32-p-len")
  1327. testDeepEqualErr(v32v1, v32v2, t, "equal-map-v32-p-len")
  1328. bs32 = testMarshalErr(&v32v1, h, t, "enc-map-v32-p")
  1329. v32v2 = nil
  1330. testUnmarshalErr(&v32v2, bs32, h, t, "dec-map-v32-p-nil")
  1331. testDeepEqualErr(v32v1, v32v2, t, "equal-map-v32-p-nil")
  1332. // ...
  1333. if v == nil {
  1334. v32v2 = nil
  1335. } else {
  1336. v32v2 = make(map[string]interface{}, len(v))
  1337. } // reset map
  1338. var v32v3, v32v4 typMapMapStringIntf
  1339. v32v3 = typMapMapStringIntf(v32v1)
  1340. v32v4 = typMapMapStringIntf(v32v2)
  1341. if v != nil {
  1342. bs32 = testMarshalErr(v32v3, h, t, "enc-map-v32-custom")
  1343. testUnmarshalErr(v32v4, bs32, h, t, "dec-map-v32-p-len")
  1344. testDeepEqualErr(v32v3, v32v4, t, "equal-map-v32-p-len")
  1345. }
  1346. }
  1347. for _, v := range []map[string]string{nil, {}, {"some-string-3": "", "some-string-1": "some-string-2"}} {
  1348. // fmt.Printf(">>>> running mammoth map v33: %v\n", v)
  1349. var v33v1, v33v2 map[string]string
  1350. var bs33 []byte
  1351. v33v1 = v
  1352. bs33 = testMarshalErr(v33v1, h, t, "enc-map-v33")
  1353. if v != nil {
  1354. if v == nil {
  1355. v33v2 = nil
  1356. } else {
  1357. v33v2 = make(map[string]string, len(v))
  1358. } // reset map
  1359. testUnmarshalErr(v33v2, bs33, h, t, "dec-map-v33")
  1360. testDeepEqualErr(v33v1, v33v2, t, "equal-map-v33")
  1361. if v == nil {
  1362. v33v2 = nil
  1363. } else {
  1364. v33v2 = make(map[string]string, len(v))
  1365. } // reset map
  1366. testUnmarshalErr(rv4i(v33v2), bs33, h, t, "dec-map-v33-noaddr") // decode into non-addressable map value
  1367. testDeepEqualErr(v33v1, v33v2, t, "equal-map-v33-noaddr")
  1368. }
  1369. if v == nil {
  1370. v33v2 = nil
  1371. } else {
  1372. v33v2 = make(map[string]string, len(v))
  1373. } // reset map
  1374. testUnmarshalErr(&v33v2, bs33, h, t, "dec-map-v33-p-len")
  1375. testDeepEqualErr(v33v1, v33v2, t, "equal-map-v33-p-len")
  1376. bs33 = testMarshalErr(&v33v1, h, t, "enc-map-v33-p")
  1377. v33v2 = nil
  1378. testUnmarshalErr(&v33v2, bs33, h, t, "dec-map-v33-p-nil")
  1379. testDeepEqualErr(v33v1, v33v2, t, "equal-map-v33-p-nil")
  1380. // ...
  1381. if v == nil {
  1382. v33v2 = nil
  1383. } else {
  1384. v33v2 = make(map[string]string, len(v))
  1385. } // reset map
  1386. var v33v3, v33v4 typMapMapStringString
  1387. v33v3 = typMapMapStringString(v33v1)
  1388. v33v4 = typMapMapStringString(v33v2)
  1389. if v != nil {
  1390. bs33 = testMarshalErr(v33v3, h, t, "enc-map-v33-custom")
  1391. testUnmarshalErr(v33v4, bs33, h, t, "dec-map-v33-p-len")
  1392. testDeepEqualErr(v33v3, v33v4, t, "equal-map-v33-p-len")
  1393. }
  1394. }
  1395. for _, v := range []map[string][]byte{nil, {}, {"some-string-3": nil, "some-string-1": []byte("some-string-1")}} {
  1396. // fmt.Printf(">>>> running mammoth map v34: %v\n", v)
  1397. var v34v1, v34v2 map[string][]byte
  1398. var bs34 []byte
  1399. v34v1 = v
  1400. bs34 = testMarshalErr(v34v1, h, t, "enc-map-v34")
  1401. if v != nil {
  1402. if v == nil {
  1403. v34v2 = nil
  1404. } else {
  1405. v34v2 = make(map[string][]byte, len(v))
  1406. } // reset map
  1407. testUnmarshalErr(v34v2, bs34, h, t, "dec-map-v34")
  1408. testDeepEqualErr(v34v1, v34v2, t, "equal-map-v34")
  1409. if v == nil {
  1410. v34v2 = nil
  1411. } else {
  1412. v34v2 = make(map[string][]byte, len(v))
  1413. } // reset map
  1414. testUnmarshalErr(rv4i(v34v2), bs34, h, t, "dec-map-v34-noaddr") // decode into non-addressable map value
  1415. testDeepEqualErr(v34v1, v34v2, t, "equal-map-v34-noaddr")
  1416. }
  1417. if v == nil {
  1418. v34v2 = nil
  1419. } else {
  1420. v34v2 = make(map[string][]byte, len(v))
  1421. } // reset map
  1422. testUnmarshalErr(&v34v2, bs34, h, t, "dec-map-v34-p-len")
  1423. testDeepEqualErr(v34v1, v34v2, t, "equal-map-v34-p-len")
  1424. bs34 = testMarshalErr(&v34v1, h, t, "enc-map-v34-p")
  1425. v34v2 = nil
  1426. testUnmarshalErr(&v34v2, bs34, h, t, "dec-map-v34-p-nil")
  1427. testDeepEqualErr(v34v1, v34v2, t, "equal-map-v34-p-nil")
  1428. // ...
  1429. if v == nil {
  1430. v34v2 = nil
  1431. } else {
  1432. v34v2 = make(map[string][]byte, len(v))
  1433. } // reset map
  1434. var v34v3, v34v4 typMapMapStringBytes
  1435. v34v3 = typMapMapStringBytes(v34v1)
  1436. v34v4 = typMapMapStringBytes(v34v2)
  1437. if v != nil {
  1438. bs34 = testMarshalErr(v34v3, h, t, "enc-map-v34-custom")
  1439. testUnmarshalErr(v34v4, bs34, h, t, "dec-map-v34-p-len")
  1440. testDeepEqualErr(v34v3, v34v4, t, "equal-map-v34-p-len")
  1441. }
  1442. }
  1443. for _, v := range []map[string]uint{nil, {}, {"some-string-2": 0, "some-string-3": 77}} {
  1444. // fmt.Printf(">>>> running mammoth map v35: %v\n", v)
  1445. var v35v1, v35v2 map[string]uint
  1446. var bs35 []byte
  1447. v35v1 = v
  1448. bs35 = testMarshalErr(v35v1, h, t, "enc-map-v35")
  1449. if v != nil {
  1450. if v == nil {
  1451. v35v2 = nil
  1452. } else {
  1453. v35v2 = make(map[string]uint, len(v))
  1454. } // reset map
  1455. testUnmarshalErr(v35v2, bs35, h, t, "dec-map-v35")
  1456. testDeepEqualErr(v35v1, v35v2, t, "equal-map-v35")
  1457. if v == nil {
  1458. v35v2 = nil
  1459. } else {
  1460. v35v2 = make(map[string]uint, len(v))
  1461. } // reset map
  1462. testUnmarshalErr(rv4i(v35v2), bs35, h, t, "dec-map-v35-noaddr") // decode into non-addressable map value
  1463. testDeepEqualErr(v35v1, v35v2, t, "equal-map-v35-noaddr")
  1464. }
  1465. if v == nil {
  1466. v35v2 = nil
  1467. } else {
  1468. v35v2 = make(map[string]uint, len(v))
  1469. } // reset map
  1470. testUnmarshalErr(&v35v2, bs35, h, t, "dec-map-v35-p-len")
  1471. testDeepEqualErr(v35v1, v35v2, t, "equal-map-v35-p-len")
  1472. bs35 = testMarshalErr(&v35v1, h, t, "enc-map-v35-p")
  1473. v35v2 = nil
  1474. testUnmarshalErr(&v35v2, bs35, h, t, "dec-map-v35-p-nil")
  1475. testDeepEqualErr(v35v1, v35v2, t, "equal-map-v35-p-nil")
  1476. // ...
  1477. if v == nil {
  1478. v35v2 = nil
  1479. } else {
  1480. v35v2 = make(map[string]uint, len(v))
  1481. } // reset map
  1482. var v35v3, v35v4 typMapMapStringUint
  1483. v35v3 = typMapMapStringUint(v35v1)
  1484. v35v4 = typMapMapStringUint(v35v2)
  1485. if v != nil {
  1486. bs35 = testMarshalErr(v35v3, h, t, "enc-map-v35-custom")
  1487. testUnmarshalErr(v35v4, bs35, h, t, "dec-map-v35-p-len")
  1488. testDeepEqualErr(v35v3, v35v4, t, "equal-map-v35-p-len")
  1489. }
  1490. }
  1491. for _, v := range []map[string]uint8{nil, {}, {"some-string-1": 0, "some-string-2": 127}} {
  1492. // fmt.Printf(">>>> running mammoth map v36: %v\n", v)
  1493. var v36v1, v36v2 map[string]uint8
  1494. var bs36 []byte
  1495. v36v1 = v
  1496. bs36 = testMarshalErr(v36v1, h, t, "enc-map-v36")
  1497. if v != nil {
  1498. if v == nil {
  1499. v36v2 = nil
  1500. } else {
  1501. v36v2 = make(map[string]uint8, len(v))
  1502. } // reset map
  1503. testUnmarshalErr(v36v2, bs36, h, t, "dec-map-v36")
  1504. testDeepEqualErr(v36v1, v36v2, t, "equal-map-v36")
  1505. if v == nil {
  1506. v36v2 = nil
  1507. } else {
  1508. v36v2 = make(map[string]uint8, len(v))
  1509. } // reset map
  1510. testUnmarshalErr(rv4i(v36v2), bs36, h, t, "dec-map-v36-noaddr") // decode into non-addressable map value
  1511. testDeepEqualErr(v36v1, v36v2, t, "equal-map-v36-noaddr")
  1512. }
  1513. if v == nil {
  1514. v36v2 = nil
  1515. } else {
  1516. v36v2 = make(map[string]uint8, len(v))
  1517. } // reset map
  1518. testUnmarshalErr(&v36v2, bs36, h, t, "dec-map-v36-p-len")
  1519. testDeepEqualErr(v36v1, v36v2, t, "equal-map-v36-p-len")
  1520. bs36 = testMarshalErr(&v36v1, h, t, "enc-map-v36-p")
  1521. v36v2 = nil
  1522. testUnmarshalErr(&v36v2, bs36, h, t, "dec-map-v36-p-nil")
  1523. testDeepEqualErr(v36v1, v36v2, t, "equal-map-v36-p-nil")
  1524. // ...
  1525. if v == nil {
  1526. v36v2 = nil
  1527. } else {
  1528. v36v2 = make(map[string]uint8, len(v))
  1529. } // reset map
  1530. var v36v3, v36v4 typMapMapStringUint8
  1531. v36v3 = typMapMapStringUint8(v36v1)
  1532. v36v4 = typMapMapStringUint8(v36v2)
  1533. if v != nil {
  1534. bs36 = testMarshalErr(v36v3, h, t, "enc-map-v36-custom")
  1535. testUnmarshalErr(v36v4, bs36, h, t, "dec-map-v36-p-len")
  1536. testDeepEqualErr(v36v3, v36v4, t, "equal-map-v36-p-len")
  1537. }
  1538. }
  1539. for _, v := range []map[string]uint64{nil, {}, {"some-string-3": 0, "some-string-1": 111}} {
  1540. // fmt.Printf(">>>> running mammoth map v37: %v\n", v)
  1541. var v37v1, v37v2 map[string]uint64
  1542. var bs37 []byte
  1543. v37v1 = v
  1544. bs37 = testMarshalErr(v37v1, h, t, "enc-map-v37")
  1545. if v != nil {
  1546. if v == nil {
  1547. v37v2 = nil
  1548. } else {
  1549. v37v2 = make(map[string]uint64, len(v))
  1550. } // reset map
  1551. testUnmarshalErr(v37v2, bs37, h, t, "dec-map-v37")
  1552. testDeepEqualErr(v37v1, v37v2, t, "equal-map-v37")
  1553. if v == nil {
  1554. v37v2 = nil
  1555. } else {
  1556. v37v2 = make(map[string]uint64, len(v))
  1557. } // reset map
  1558. testUnmarshalErr(rv4i(v37v2), bs37, h, t, "dec-map-v37-noaddr") // decode into non-addressable map value
  1559. testDeepEqualErr(v37v1, v37v2, t, "equal-map-v37-noaddr")
  1560. }
  1561. if v == nil {
  1562. v37v2 = nil
  1563. } else {
  1564. v37v2 = make(map[string]uint64, len(v))
  1565. } // reset map
  1566. testUnmarshalErr(&v37v2, bs37, h, t, "dec-map-v37-p-len")
  1567. testDeepEqualErr(v37v1, v37v2, t, "equal-map-v37-p-len")
  1568. bs37 = testMarshalErr(&v37v1, h, t, "enc-map-v37-p")
  1569. v37v2 = nil
  1570. testUnmarshalErr(&v37v2, bs37, h, t, "dec-map-v37-p-nil")
  1571. testDeepEqualErr(v37v1, v37v2, t, "equal-map-v37-p-nil")
  1572. // ...
  1573. if v == nil {
  1574. v37v2 = nil
  1575. } else {
  1576. v37v2 = make(map[string]uint64, len(v))
  1577. } // reset map
  1578. var v37v3, v37v4 typMapMapStringUint64
  1579. v37v3 = typMapMapStringUint64(v37v1)
  1580. v37v4 = typMapMapStringUint64(v37v2)
  1581. if v != nil {
  1582. bs37 = testMarshalErr(v37v3, h, t, "enc-map-v37-custom")
  1583. testUnmarshalErr(v37v4, bs37, h, t, "dec-map-v37-p-len")
  1584. testDeepEqualErr(v37v3, v37v4, t, "equal-map-v37-p-len")
  1585. }
  1586. }
  1587. for _, v := range []map[string]int{nil, {}, {"some-string-2": 0, "some-string-3": 77}} {
  1588. // fmt.Printf(">>>> running mammoth map v38: %v\n", v)
  1589. var v38v1, v38v2 map[string]int
  1590. var bs38 []byte
  1591. v38v1 = v
  1592. bs38 = testMarshalErr(v38v1, h, t, "enc-map-v38")
  1593. if v != nil {
  1594. if v == nil {
  1595. v38v2 = nil
  1596. } else {
  1597. v38v2 = make(map[string]int, len(v))
  1598. } // reset map
  1599. testUnmarshalErr(v38v2, bs38, h, t, "dec-map-v38")
  1600. testDeepEqualErr(v38v1, v38v2, t, "equal-map-v38")
  1601. if v == nil {
  1602. v38v2 = nil
  1603. } else {
  1604. v38v2 = make(map[string]int, len(v))
  1605. } // reset map
  1606. testUnmarshalErr(rv4i(v38v2), bs38, h, t, "dec-map-v38-noaddr") // decode into non-addressable map value
  1607. testDeepEqualErr(v38v1, v38v2, t, "equal-map-v38-noaddr")
  1608. }
  1609. if v == nil {
  1610. v38v2 = nil
  1611. } else {
  1612. v38v2 = make(map[string]int, len(v))
  1613. } // reset map
  1614. testUnmarshalErr(&v38v2, bs38, h, t, "dec-map-v38-p-len")
  1615. testDeepEqualErr(v38v1, v38v2, t, "equal-map-v38-p-len")
  1616. bs38 = testMarshalErr(&v38v1, h, t, "enc-map-v38-p")
  1617. v38v2 = nil
  1618. testUnmarshalErr(&v38v2, bs38, h, t, "dec-map-v38-p-nil")
  1619. testDeepEqualErr(v38v1, v38v2, t, "equal-map-v38-p-nil")
  1620. // ...
  1621. if v == nil {
  1622. v38v2 = nil
  1623. } else {
  1624. v38v2 = make(map[string]int, len(v))
  1625. } // reset map
  1626. var v38v3, v38v4 typMapMapStringInt
  1627. v38v3 = typMapMapStringInt(v38v1)
  1628. v38v4 = typMapMapStringInt(v38v2)
  1629. if v != nil {
  1630. bs38 = testMarshalErr(v38v3, h, t, "enc-map-v38-custom")
  1631. testUnmarshalErr(v38v4, bs38, h, t, "dec-map-v38-p-len")
  1632. testDeepEqualErr(v38v3, v38v4, t, "equal-map-v38-p-len")
  1633. }
  1634. }
  1635. for _, v := range []map[string]int64{nil, {}, {"some-string-1": 0, "some-string-2": 127}} {
  1636. // fmt.Printf(">>>> running mammoth map v39: %v\n", v)
  1637. var v39v1, v39v2 map[string]int64
  1638. var bs39 []byte
  1639. v39v1 = v
  1640. bs39 = testMarshalErr(v39v1, h, t, "enc-map-v39")
  1641. if v != nil {
  1642. if v == nil {
  1643. v39v2 = nil
  1644. } else {
  1645. v39v2 = make(map[string]int64, len(v))
  1646. } // reset map
  1647. testUnmarshalErr(v39v2, bs39, h, t, "dec-map-v39")
  1648. testDeepEqualErr(v39v1, v39v2, t, "equal-map-v39")
  1649. if v == nil {
  1650. v39v2 = nil
  1651. } else {
  1652. v39v2 = make(map[string]int64, len(v))
  1653. } // reset map
  1654. testUnmarshalErr(rv4i(v39v2), bs39, h, t, "dec-map-v39-noaddr") // decode into non-addressable map value
  1655. testDeepEqualErr(v39v1, v39v2, t, "equal-map-v39-noaddr")
  1656. }
  1657. if v == nil {
  1658. v39v2 = nil
  1659. } else {
  1660. v39v2 = make(map[string]int64, len(v))
  1661. } // reset map
  1662. testUnmarshalErr(&v39v2, bs39, h, t, "dec-map-v39-p-len")
  1663. testDeepEqualErr(v39v1, v39v2, t, "equal-map-v39-p-len")
  1664. bs39 = testMarshalErr(&v39v1, h, t, "enc-map-v39-p")
  1665. v39v2 = nil
  1666. testUnmarshalErr(&v39v2, bs39, h, t, "dec-map-v39-p-nil")
  1667. testDeepEqualErr(v39v1, v39v2, t, "equal-map-v39-p-nil")
  1668. // ...
  1669. if v == nil {
  1670. v39v2 = nil
  1671. } else {
  1672. v39v2 = make(map[string]int64, len(v))
  1673. } // reset map
  1674. var v39v3, v39v4 typMapMapStringInt64
  1675. v39v3 = typMapMapStringInt64(v39v1)
  1676. v39v4 = typMapMapStringInt64(v39v2)
  1677. if v != nil {
  1678. bs39 = testMarshalErr(v39v3, h, t, "enc-map-v39-custom")
  1679. testUnmarshalErr(v39v4, bs39, h, t, "dec-map-v39-p-len")
  1680. testDeepEqualErr(v39v3, v39v4, t, "equal-map-v39-p-len")
  1681. }
  1682. }
  1683. for _, v := range []map[string]float32{nil, {}, {"some-string-3": 0, "some-string-1": 33.3e3}} {
  1684. // fmt.Printf(">>>> running mammoth map v40: %v\n", v)
  1685. var v40v1, v40v2 map[string]float32
  1686. var bs40 []byte
  1687. v40v1 = v
  1688. bs40 = testMarshalErr(v40v1, h, t, "enc-map-v40")
  1689. if v != nil {
  1690. if v == nil {
  1691. v40v2 = nil
  1692. } else {
  1693. v40v2 = make(map[string]float32, len(v))
  1694. } // reset map
  1695. testUnmarshalErr(v40v2, bs40, h, t, "dec-map-v40")
  1696. testDeepEqualErr(v40v1, v40v2, t, "equal-map-v40")
  1697. if v == nil {
  1698. v40v2 = nil
  1699. } else {
  1700. v40v2 = make(map[string]float32, len(v))
  1701. } // reset map
  1702. testUnmarshalErr(rv4i(v40v2), bs40, h, t, "dec-map-v40-noaddr") // decode into non-addressable map value
  1703. testDeepEqualErr(v40v1, v40v2, t, "equal-map-v40-noaddr")
  1704. }
  1705. if v == nil {
  1706. v40v2 = nil
  1707. } else {
  1708. v40v2 = make(map[string]float32, len(v))
  1709. } // reset map
  1710. testUnmarshalErr(&v40v2, bs40, h, t, "dec-map-v40-p-len")
  1711. testDeepEqualErr(v40v1, v40v2, t, "equal-map-v40-p-len")
  1712. bs40 = testMarshalErr(&v40v1, h, t, "enc-map-v40-p")
  1713. v40v2 = nil
  1714. testUnmarshalErr(&v40v2, bs40, h, t, "dec-map-v40-p-nil")
  1715. testDeepEqualErr(v40v1, v40v2, t, "equal-map-v40-p-nil")
  1716. // ...
  1717. if v == nil {
  1718. v40v2 = nil
  1719. } else {
  1720. v40v2 = make(map[string]float32, len(v))
  1721. } // reset map
  1722. var v40v3, v40v4 typMapMapStringFloat32
  1723. v40v3 = typMapMapStringFloat32(v40v1)
  1724. v40v4 = typMapMapStringFloat32(v40v2)
  1725. if v != nil {
  1726. bs40 = testMarshalErr(v40v3, h, t, "enc-map-v40-custom")
  1727. testUnmarshalErr(v40v4, bs40, h, t, "dec-map-v40-p-len")
  1728. testDeepEqualErr(v40v3, v40v4, t, "equal-map-v40-p-len")
  1729. }
  1730. }
  1731. for _, v := range []map[string]float64{nil, {}, {"some-string-2": 0, "some-string-3": 11.1}} {
  1732. // fmt.Printf(">>>> running mammoth map v41: %v\n", v)
  1733. var v41v1, v41v2 map[string]float64
  1734. var bs41 []byte
  1735. v41v1 = v
  1736. bs41 = testMarshalErr(v41v1, h, t, "enc-map-v41")
  1737. if v != nil {
  1738. if v == nil {
  1739. v41v2 = nil
  1740. } else {
  1741. v41v2 = make(map[string]float64, len(v))
  1742. } // reset map
  1743. testUnmarshalErr(v41v2, bs41, h, t, "dec-map-v41")
  1744. testDeepEqualErr(v41v1, v41v2, t, "equal-map-v41")
  1745. if v == nil {
  1746. v41v2 = nil
  1747. } else {
  1748. v41v2 = make(map[string]float64, len(v))
  1749. } // reset map
  1750. testUnmarshalErr(rv4i(v41v2), bs41, h, t, "dec-map-v41-noaddr") // decode into non-addressable map value
  1751. testDeepEqualErr(v41v1, v41v2, t, "equal-map-v41-noaddr")
  1752. }
  1753. if v == nil {
  1754. v41v2 = nil
  1755. } else {
  1756. v41v2 = make(map[string]float64, len(v))
  1757. } // reset map
  1758. testUnmarshalErr(&v41v2, bs41, h, t, "dec-map-v41-p-len")
  1759. testDeepEqualErr(v41v1, v41v2, t, "equal-map-v41-p-len")
  1760. bs41 = testMarshalErr(&v41v1, h, t, "enc-map-v41-p")
  1761. v41v2 = nil
  1762. testUnmarshalErr(&v41v2, bs41, h, t, "dec-map-v41-p-nil")
  1763. testDeepEqualErr(v41v1, v41v2, t, "equal-map-v41-p-nil")
  1764. // ...
  1765. if v == nil {
  1766. v41v2 = nil
  1767. } else {
  1768. v41v2 = make(map[string]float64, len(v))
  1769. } // reset map
  1770. var v41v3, v41v4 typMapMapStringFloat64
  1771. v41v3 = typMapMapStringFloat64(v41v1)
  1772. v41v4 = typMapMapStringFloat64(v41v2)
  1773. if v != nil {
  1774. bs41 = testMarshalErr(v41v3, h, t, "enc-map-v41-custom")
  1775. testUnmarshalErr(v41v4, bs41, h, t, "dec-map-v41-p-len")
  1776. testDeepEqualErr(v41v3, v41v4, t, "equal-map-v41-p-len")
  1777. }
  1778. }
  1779. for _, v := range []map[string]bool{nil, {}, {"some-string-1": false, "some-string-2": true}} {
  1780. // fmt.Printf(">>>> running mammoth map v42: %v\n", v)
  1781. var v42v1, v42v2 map[string]bool
  1782. var bs42 []byte
  1783. v42v1 = v
  1784. bs42 = testMarshalErr(v42v1, h, t, "enc-map-v42")
  1785. if v != nil {
  1786. if v == nil {
  1787. v42v2 = nil
  1788. } else {
  1789. v42v2 = make(map[string]bool, len(v))
  1790. } // reset map
  1791. testUnmarshalErr(v42v2, bs42, h, t, "dec-map-v42")
  1792. testDeepEqualErr(v42v1, v42v2, t, "equal-map-v42")
  1793. if v == nil {
  1794. v42v2 = nil
  1795. } else {
  1796. v42v2 = make(map[string]bool, len(v))
  1797. } // reset map
  1798. testUnmarshalErr(rv4i(v42v2), bs42, h, t, "dec-map-v42-noaddr") // decode into non-addressable map value
  1799. testDeepEqualErr(v42v1, v42v2, t, "equal-map-v42-noaddr")
  1800. }
  1801. if v == nil {
  1802. v42v2 = nil
  1803. } else {
  1804. v42v2 = make(map[string]bool, len(v))
  1805. } // reset map
  1806. testUnmarshalErr(&v42v2, bs42, h, t, "dec-map-v42-p-len")
  1807. testDeepEqualErr(v42v1, v42v2, t, "equal-map-v42-p-len")
  1808. bs42 = testMarshalErr(&v42v1, h, t, "enc-map-v42-p")
  1809. v42v2 = nil
  1810. testUnmarshalErr(&v42v2, bs42, h, t, "dec-map-v42-p-nil")
  1811. testDeepEqualErr(v42v1, v42v2, t, "equal-map-v42-p-nil")
  1812. // ...
  1813. if v == nil {
  1814. v42v2 = nil
  1815. } else {
  1816. v42v2 = make(map[string]bool, len(v))
  1817. } // reset map
  1818. var v42v3, v42v4 typMapMapStringBool
  1819. v42v3 = typMapMapStringBool(v42v1)
  1820. v42v4 = typMapMapStringBool(v42v2)
  1821. if v != nil {
  1822. bs42 = testMarshalErr(v42v3, h, t, "enc-map-v42-custom")
  1823. testUnmarshalErr(v42v4, bs42, h, t, "dec-map-v42-p-len")
  1824. testDeepEqualErr(v42v3, v42v4, t, "equal-map-v42-p-len")
  1825. }
  1826. }
  1827. for _, v := range []map[uint]interface{}{nil, {}, {111: nil, 77: "string-is-an-interface-2"}} {
  1828. // fmt.Printf(">>>> running mammoth map v43: %v\n", v)
  1829. var v43v1, v43v2 map[uint]interface{}
  1830. var bs43 []byte
  1831. v43v1 = v
  1832. bs43 = testMarshalErr(v43v1, h, t, "enc-map-v43")
  1833. if v != nil {
  1834. if v == nil {
  1835. v43v2 = nil
  1836. } else {
  1837. v43v2 = make(map[uint]interface{}, len(v))
  1838. } // reset map
  1839. testUnmarshalErr(v43v2, bs43, h, t, "dec-map-v43")
  1840. testDeepEqualErr(v43v1, v43v2, t, "equal-map-v43")
  1841. if v == nil {
  1842. v43v2 = nil
  1843. } else {
  1844. v43v2 = make(map[uint]interface{}, len(v))
  1845. } // reset map
  1846. testUnmarshalErr(rv4i(v43v2), bs43, h, t, "dec-map-v43-noaddr") // decode into non-addressable map value
  1847. testDeepEqualErr(v43v1, v43v2, t, "equal-map-v43-noaddr")
  1848. }
  1849. if v == nil {
  1850. v43v2 = nil
  1851. } else {
  1852. v43v2 = make(map[uint]interface{}, len(v))
  1853. } // reset map
  1854. testUnmarshalErr(&v43v2, bs43, h, t, "dec-map-v43-p-len")
  1855. testDeepEqualErr(v43v1, v43v2, t, "equal-map-v43-p-len")
  1856. bs43 = testMarshalErr(&v43v1, h, t, "enc-map-v43-p")
  1857. v43v2 = nil
  1858. testUnmarshalErr(&v43v2, bs43, h, t, "dec-map-v43-p-nil")
  1859. testDeepEqualErr(v43v1, v43v2, t, "equal-map-v43-p-nil")
  1860. // ...
  1861. if v == nil {
  1862. v43v2 = nil
  1863. } else {
  1864. v43v2 = make(map[uint]interface{}, len(v))
  1865. } // reset map
  1866. var v43v3, v43v4 typMapMapUintIntf
  1867. v43v3 = typMapMapUintIntf(v43v1)
  1868. v43v4 = typMapMapUintIntf(v43v2)
  1869. if v != nil {
  1870. bs43 = testMarshalErr(v43v3, h, t, "enc-map-v43-custom")
  1871. testUnmarshalErr(v43v4, bs43, h, t, "dec-map-v43-p-len")
  1872. testDeepEqualErr(v43v3, v43v4, t, "equal-map-v43-p-len")
  1873. }
  1874. }
  1875. for _, v := range []map[uint]string{nil, {}, {127: "", 111: "some-string-3"}} {
  1876. // fmt.Printf(">>>> running mammoth map v44: %v\n", v)
  1877. var v44v1, v44v2 map[uint]string
  1878. var bs44 []byte
  1879. v44v1 = v
  1880. bs44 = testMarshalErr(v44v1, h, t, "enc-map-v44")
  1881. if v != nil {
  1882. if v == nil {
  1883. v44v2 = nil
  1884. } else {
  1885. v44v2 = make(map[uint]string, len(v))
  1886. } // reset map
  1887. testUnmarshalErr(v44v2, bs44, h, t, "dec-map-v44")
  1888. testDeepEqualErr(v44v1, v44v2, t, "equal-map-v44")
  1889. if v == nil {
  1890. v44v2 = nil
  1891. } else {
  1892. v44v2 = make(map[uint]string, len(v))
  1893. } // reset map
  1894. testUnmarshalErr(rv4i(v44v2), bs44, h, t, "dec-map-v44-noaddr") // decode into non-addressable map value
  1895. testDeepEqualErr(v44v1, v44v2, t, "equal-map-v44-noaddr")
  1896. }
  1897. if v == nil {
  1898. v44v2 = nil
  1899. } else {
  1900. v44v2 = make(map[uint]string, len(v))
  1901. } // reset map
  1902. testUnmarshalErr(&v44v2, bs44, h, t, "dec-map-v44-p-len")
  1903. testDeepEqualErr(v44v1, v44v2, t, "equal-map-v44-p-len")
  1904. bs44 = testMarshalErr(&v44v1, h, t, "enc-map-v44-p")
  1905. v44v2 = nil
  1906. testUnmarshalErr(&v44v2, bs44, h, t, "dec-map-v44-p-nil")
  1907. testDeepEqualErr(v44v1, v44v2, t, "equal-map-v44-p-nil")
  1908. // ...
  1909. if v == nil {
  1910. v44v2 = nil
  1911. } else {
  1912. v44v2 = make(map[uint]string, len(v))
  1913. } // reset map
  1914. var v44v3, v44v4 typMapMapUintString
  1915. v44v3 = typMapMapUintString(v44v1)
  1916. v44v4 = typMapMapUintString(v44v2)
  1917. if v != nil {
  1918. bs44 = testMarshalErr(v44v3, h, t, "enc-map-v44-custom")
  1919. testUnmarshalErr(v44v4, bs44, h, t, "dec-map-v44-p-len")
  1920. testDeepEqualErr(v44v3, v44v4, t, "equal-map-v44-p-len")
  1921. }
  1922. }
  1923. for _, v := range []map[uint][]byte{nil, {}, {77: nil, 127: []byte("some-string-2")}} {
  1924. // fmt.Printf(">>>> running mammoth map v45: %v\n", v)
  1925. var v45v1, v45v2 map[uint][]byte
  1926. var bs45 []byte
  1927. v45v1 = v
  1928. bs45 = testMarshalErr(v45v1, h, t, "enc-map-v45")
  1929. if v != nil {
  1930. if v == nil {
  1931. v45v2 = nil
  1932. } else {
  1933. v45v2 = make(map[uint][]byte, len(v))
  1934. } // reset map
  1935. testUnmarshalErr(v45v2, bs45, h, t, "dec-map-v45")
  1936. testDeepEqualErr(v45v1, v45v2, t, "equal-map-v45")
  1937. if v == nil {
  1938. v45v2 = nil
  1939. } else {
  1940. v45v2 = make(map[uint][]byte, len(v))
  1941. } // reset map
  1942. testUnmarshalErr(rv4i(v45v2), bs45, h, t, "dec-map-v45-noaddr") // decode into non-addressable map value
  1943. testDeepEqualErr(v45v1, v45v2, t, "equal-map-v45-noaddr")
  1944. }
  1945. if v == nil {
  1946. v45v2 = nil
  1947. } else {
  1948. v45v2 = make(map[uint][]byte, len(v))
  1949. } // reset map
  1950. testUnmarshalErr(&v45v2, bs45, h, t, "dec-map-v45-p-len")
  1951. testDeepEqualErr(v45v1, v45v2, t, "equal-map-v45-p-len")
  1952. bs45 = testMarshalErr(&v45v1, h, t, "enc-map-v45-p")
  1953. v45v2 = nil
  1954. testUnmarshalErr(&v45v2, bs45, h, t, "dec-map-v45-p-nil")
  1955. testDeepEqualErr(v45v1, v45v2, t, "equal-map-v45-p-nil")
  1956. // ...
  1957. if v == nil {
  1958. v45v2 = nil
  1959. } else {
  1960. v45v2 = make(map[uint][]byte, len(v))
  1961. } // reset map
  1962. var v45v3, v45v4 typMapMapUintBytes
  1963. v45v3 = typMapMapUintBytes(v45v1)
  1964. v45v4 = typMapMapUintBytes(v45v2)
  1965. if v != nil {
  1966. bs45 = testMarshalErr(v45v3, h, t, "enc-map-v45-custom")
  1967. testUnmarshalErr(v45v4, bs45, h, t, "dec-map-v45-p-len")
  1968. testDeepEqualErr(v45v3, v45v4, t, "equal-map-v45-p-len")
  1969. }
  1970. }
  1971. for _, v := range []map[uint]uint{nil, {}, {111: 0, 77: 127}} {
  1972. // fmt.Printf(">>>> running mammoth map v46: %v\n", v)
  1973. var v46v1, v46v2 map[uint]uint
  1974. var bs46 []byte
  1975. v46v1 = v
  1976. bs46 = testMarshalErr(v46v1, h, t, "enc-map-v46")
  1977. if v != nil {
  1978. if v == nil {
  1979. v46v2 = nil
  1980. } else {
  1981. v46v2 = make(map[uint]uint, len(v))
  1982. } // reset map
  1983. testUnmarshalErr(v46v2, bs46, h, t, "dec-map-v46")
  1984. testDeepEqualErr(v46v1, v46v2, t, "equal-map-v46")
  1985. if v == nil {
  1986. v46v2 = nil
  1987. } else {
  1988. v46v2 = make(map[uint]uint, len(v))
  1989. } // reset map
  1990. testUnmarshalErr(rv4i(v46v2), bs46, h, t, "dec-map-v46-noaddr") // decode into non-addressable map value
  1991. testDeepEqualErr(v46v1, v46v2, t, "equal-map-v46-noaddr")
  1992. }
  1993. if v == nil {
  1994. v46v2 = nil
  1995. } else {
  1996. v46v2 = make(map[uint]uint, len(v))
  1997. } // reset map
  1998. testUnmarshalErr(&v46v2, bs46, h, t, "dec-map-v46-p-len")
  1999. testDeepEqualErr(v46v1, v46v2, t, "equal-map-v46-p-len")
  2000. bs46 = testMarshalErr(&v46v1, h, t, "enc-map-v46-p")
  2001. v46v2 = nil
  2002. testUnmarshalErr(&v46v2, bs46, h, t, "dec-map-v46-p-nil")
  2003. testDeepEqualErr(v46v1, v46v2, t, "equal-map-v46-p-nil")
  2004. // ...
  2005. if v == nil {
  2006. v46v2 = nil
  2007. } else {
  2008. v46v2 = make(map[uint]uint, len(v))
  2009. } // reset map
  2010. var v46v3, v46v4 typMapMapUintUint
  2011. v46v3 = typMapMapUintUint(v46v1)
  2012. v46v4 = typMapMapUintUint(v46v2)
  2013. if v != nil {
  2014. bs46 = testMarshalErr(v46v3, h, t, "enc-map-v46-custom")
  2015. testUnmarshalErr(v46v4, bs46, h, t, "dec-map-v46-p-len")
  2016. testDeepEqualErr(v46v3, v46v4, t, "equal-map-v46-p-len")
  2017. }
  2018. }
  2019. for _, v := range []map[uint]uint8{nil, {}, {111: 0, 77: 127}} {
  2020. // fmt.Printf(">>>> running mammoth map v47: %v\n", v)
  2021. var v47v1, v47v2 map[uint]uint8
  2022. var bs47 []byte
  2023. v47v1 = v
  2024. bs47 = testMarshalErr(v47v1, h, t, "enc-map-v47")
  2025. if v != nil {
  2026. if v == nil {
  2027. v47v2 = nil
  2028. } else {
  2029. v47v2 = make(map[uint]uint8, len(v))
  2030. } // reset map
  2031. testUnmarshalErr(v47v2, bs47, h, t, "dec-map-v47")
  2032. testDeepEqualErr(v47v1, v47v2, t, "equal-map-v47")
  2033. if v == nil {
  2034. v47v2 = nil
  2035. } else {
  2036. v47v2 = make(map[uint]uint8, len(v))
  2037. } // reset map
  2038. testUnmarshalErr(rv4i(v47v2), bs47, h, t, "dec-map-v47-noaddr") // decode into non-addressable map value
  2039. testDeepEqualErr(v47v1, v47v2, t, "equal-map-v47-noaddr")
  2040. }
  2041. if v == nil {
  2042. v47v2 = nil
  2043. } else {
  2044. v47v2 = make(map[uint]uint8, len(v))
  2045. } // reset map
  2046. testUnmarshalErr(&v47v2, bs47, h, t, "dec-map-v47-p-len")
  2047. testDeepEqualErr(v47v1, v47v2, t, "equal-map-v47-p-len")
  2048. bs47 = testMarshalErr(&v47v1, h, t, "enc-map-v47-p")
  2049. v47v2 = nil
  2050. testUnmarshalErr(&v47v2, bs47, h, t, "dec-map-v47-p-nil")
  2051. testDeepEqualErr(v47v1, v47v2, t, "equal-map-v47-p-nil")
  2052. // ...
  2053. if v == nil {
  2054. v47v2 = nil
  2055. } else {
  2056. v47v2 = make(map[uint]uint8, len(v))
  2057. } // reset map
  2058. var v47v3, v47v4 typMapMapUintUint8
  2059. v47v3 = typMapMapUintUint8(v47v1)
  2060. v47v4 = typMapMapUintUint8(v47v2)
  2061. if v != nil {
  2062. bs47 = testMarshalErr(v47v3, h, t, "enc-map-v47-custom")
  2063. testUnmarshalErr(v47v4, bs47, h, t, "dec-map-v47-p-len")
  2064. testDeepEqualErr(v47v3, v47v4, t, "equal-map-v47-p-len")
  2065. }
  2066. }
  2067. for _, v := range []map[uint]uint64{nil, {}, {111: 0, 77: 127}} {
  2068. // fmt.Printf(">>>> running mammoth map v48: %v\n", v)
  2069. var v48v1, v48v2 map[uint]uint64
  2070. var bs48 []byte
  2071. v48v1 = v
  2072. bs48 = testMarshalErr(v48v1, h, t, "enc-map-v48")
  2073. if v != nil {
  2074. if v == nil {
  2075. v48v2 = nil
  2076. } else {
  2077. v48v2 = make(map[uint]uint64, len(v))
  2078. } // reset map
  2079. testUnmarshalErr(v48v2, bs48, h, t, "dec-map-v48")
  2080. testDeepEqualErr(v48v1, v48v2, t, "equal-map-v48")
  2081. if v == nil {
  2082. v48v2 = nil
  2083. } else {
  2084. v48v2 = make(map[uint]uint64, len(v))
  2085. } // reset map
  2086. testUnmarshalErr(rv4i(v48v2), bs48, h, t, "dec-map-v48-noaddr") // decode into non-addressable map value
  2087. testDeepEqualErr(v48v1, v48v2, t, "equal-map-v48-noaddr")
  2088. }
  2089. if v == nil {
  2090. v48v2 = nil
  2091. } else {
  2092. v48v2 = make(map[uint]uint64, len(v))
  2093. } // reset map
  2094. testUnmarshalErr(&v48v2, bs48, h, t, "dec-map-v48-p-len")
  2095. testDeepEqualErr(v48v1, v48v2, t, "equal-map-v48-p-len")
  2096. bs48 = testMarshalErr(&v48v1, h, t, "enc-map-v48-p")
  2097. v48v2 = nil
  2098. testUnmarshalErr(&v48v2, bs48, h, t, "dec-map-v48-p-nil")
  2099. testDeepEqualErr(v48v1, v48v2, t, "equal-map-v48-p-nil")
  2100. // ...
  2101. if v == nil {
  2102. v48v2 = nil
  2103. } else {
  2104. v48v2 = make(map[uint]uint64, len(v))
  2105. } // reset map
  2106. var v48v3, v48v4 typMapMapUintUint64
  2107. v48v3 = typMapMapUintUint64(v48v1)
  2108. v48v4 = typMapMapUintUint64(v48v2)
  2109. if v != nil {
  2110. bs48 = testMarshalErr(v48v3, h, t, "enc-map-v48-custom")
  2111. testUnmarshalErr(v48v4, bs48, h, t, "dec-map-v48-p-len")
  2112. testDeepEqualErr(v48v3, v48v4, t, "equal-map-v48-p-len")
  2113. }
  2114. }
  2115. for _, v := range []map[uint]int{nil, {}, {111: 0, 77: 127}} {
  2116. // fmt.Printf(">>>> running mammoth map v49: %v\n", v)
  2117. var v49v1, v49v2 map[uint]int
  2118. var bs49 []byte
  2119. v49v1 = v
  2120. bs49 = testMarshalErr(v49v1, h, t, "enc-map-v49")
  2121. if v != nil {
  2122. if v == nil {
  2123. v49v2 = nil
  2124. } else {
  2125. v49v2 = make(map[uint]int, len(v))
  2126. } // reset map
  2127. testUnmarshalErr(v49v2, bs49, h, t, "dec-map-v49")
  2128. testDeepEqualErr(v49v1, v49v2, t, "equal-map-v49")
  2129. if v == nil {
  2130. v49v2 = nil
  2131. } else {
  2132. v49v2 = make(map[uint]int, len(v))
  2133. } // reset map
  2134. testUnmarshalErr(rv4i(v49v2), bs49, h, t, "dec-map-v49-noaddr") // decode into non-addressable map value
  2135. testDeepEqualErr(v49v1, v49v2, t, "equal-map-v49-noaddr")
  2136. }
  2137. if v == nil {
  2138. v49v2 = nil
  2139. } else {
  2140. v49v2 = make(map[uint]int, len(v))
  2141. } // reset map
  2142. testUnmarshalErr(&v49v2, bs49, h, t, "dec-map-v49-p-len")
  2143. testDeepEqualErr(v49v1, v49v2, t, "equal-map-v49-p-len")
  2144. bs49 = testMarshalErr(&v49v1, h, t, "enc-map-v49-p")
  2145. v49v2 = nil
  2146. testUnmarshalErr(&v49v2, bs49, h, t, "dec-map-v49-p-nil")
  2147. testDeepEqualErr(v49v1, v49v2, t, "equal-map-v49-p-nil")
  2148. // ...
  2149. if v == nil {
  2150. v49v2 = nil
  2151. } else {
  2152. v49v2 = make(map[uint]int, len(v))
  2153. } // reset map
  2154. var v49v3, v49v4 typMapMapUintInt
  2155. v49v3 = typMapMapUintInt(v49v1)
  2156. v49v4 = typMapMapUintInt(v49v2)
  2157. if v != nil {
  2158. bs49 = testMarshalErr(v49v3, h, t, "enc-map-v49-custom")
  2159. testUnmarshalErr(v49v4, bs49, h, t, "dec-map-v49-p-len")
  2160. testDeepEqualErr(v49v3, v49v4, t, "equal-map-v49-p-len")
  2161. }
  2162. }
  2163. for _, v := range []map[uint]int64{nil, {}, {111: 0, 77: 127}} {
  2164. // fmt.Printf(">>>> running mammoth map v50: %v\n", v)
  2165. var v50v1, v50v2 map[uint]int64
  2166. var bs50 []byte
  2167. v50v1 = v
  2168. bs50 = testMarshalErr(v50v1, h, t, "enc-map-v50")
  2169. if v != nil {
  2170. if v == nil {
  2171. v50v2 = nil
  2172. } else {
  2173. v50v2 = make(map[uint]int64, len(v))
  2174. } // reset map
  2175. testUnmarshalErr(v50v2, bs50, h, t, "dec-map-v50")
  2176. testDeepEqualErr(v50v1, v50v2, t, "equal-map-v50")
  2177. if v == nil {
  2178. v50v2 = nil
  2179. } else {
  2180. v50v2 = make(map[uint]int64, len(v))
  2181. } // reset map
  2182. testUnmarshalErr(rv4i(v50v2), bs50, h, t, "dec-map-v50-noaddr") // decode into non-addressable map value
  2183. testDeepEqualErr(v50v1, v50v2, t, "equal-map-v50-noaddr")
  2184. }
  2185. if v == nil {
  2186. v50v2 = nil
  2187. } else {
  2188. v50v2 = make(map[uint]int64, len(v))
  2189. } // reset map
  2190. testUnmarshalErr(&v50v2, bs50, h, t, "dec-map-v50-p-len")
  2191. testDeepEqualErr(v50v1, v50v2, t, "equal-map-v50-p-len")
  2192. bs50 = testMarshalErr(&v50v1, h, t, "enc-map-v50-p")
  2193. v50v2 = nil
  2194. testUnmarshalErr(&v50v2, bs50, h, t, "dec-map-v50-p-nil")
  2195. testDeepEqualErr(v50v1, v50v2, t, "equal-map-v50-p-nil")
  2196. // ...
  2197. if v == nil {
  2198. v50v2 = nil
  2199. } else {
  2200. v50v2 = make(map[uint]int64, len(v))
  2201. } // reset map
  2202. var v50v3, v50v4 typMapMapUintInt64
  2203. v50v3 = typMapMapUintInt64(v50v1)
  2204. v50v4 = typMapMapUintInt64(v50v2)
  2205. if v != nil {
  2206. bs50 = testMarshalErr(v50v3, h, t, "enc-map-v50-custom")
  2207. testUnmarshalErr(v50v4, bs50, h, t, "dec-map-v50-p-len")
  2208. testDeepEqualErr(v50v3, v50v4, t, "equal-map-v50-p-len")
  2209. }
  2210. }
  2211. for _, v := range []map[uint]float32{nil, {}, {111: 0, 77: 22.2}} {
  2212. // fmt.Printf(">>>> running mammoth map v51: %v\n", v)
  2213. var v51v1, v51v2 map[uint]float32
  2214. var bs51 []byte
  2215. v51v1 = v
  2216. bs51 = testMarshalErr(v51v1, h, t, "enc-map-v51")
  2217. if v != nil {
  2218. if v == nil {
  2219. v51v2 = nil
  2220. } else {
  2221. v51v2 = make(map[uint]float32, len(v))
  2222. } // reset map
  2223. testUnmarshalErr(v51v2, bs51, h, t, "dec-map-v51")
  2224. testDeepEqualErr(v51v1, v51v2, t, "equal-map-v51")
  2225. if v == nil {
  2226. v51v2 = nil
  2227. } else {
  2228. v51v2 = make(map[uint]float32, len(v))
  2229. } // reset map
  2230. testUnmarshalErr(rv4i(v51v2), bs51, h, t, "dec-map-v51-noaddr") // decode into non-addressable map value
  2231. testDeepEqualErr(v51v1, v51v2, t, "equal-map-v51-noaddr")
  2232. }
  2233. if v == nil {
  2234. v51v2 = nil
  2235. } else {
  2236. v51v2 = make(map[uint]float32, len(v))
  2237. } // reset map
  2238. testUnmarshalErr(&v51v2, bs51, h, t, "dec-map-v51-p-len")
  2239. testDeepEqualErr(v51v1, v51v2, t, "equal-map-v51-p-len")
  2240. bs51 = testMarshalErr(&v51v1, h, t, "enc-map-v51-p")
  2241. v51v2 = nil
  2242. testUnmarshalErr(&v51v2, bs51, h, t, "dec-map-v51-p-nil")
  2243. testDeepEqualErr(v51v1, v51v2, t, "equal-map-v51-p-nil")
  2244. // ...
  2245. if v == nil {
  2246. v51v2 = nil
  2247. } else {
  2248. v51v2 = make(map[uint]float32, len(v))
  2249. } // reset map
  2250. var v51v3, v51v4 typMapMapUintFloat32
  2251. v51v3 = typMapMapUintFloat32(v51v1)
  2252. v51v4 = typMapMapUintFloat32(v51v2)
  2253. if v != nil {
  2254. bs51 = testMarshalErr(v51v3, h, t, "enc-map-v51-custom")
  2255. testUnmarshalErr(v51v4, bs51, h, t, "dec-map-v51-p-len")
  2256. testDeepEqualErr(v51v3, v51v4, t, "equal-map-v51-p-len")
  2257. }
  2258. }
  2259. for _, v := range []map[uint]float64{nil, {}, {127: 0, 111: 33.3e3}} {
  2260. // fmt.Printf(">>>> running mammoth map v52: %v\n", v)
  2261. var v52v1, v52v2 map[uint]float64
  2262. var bs52 []byte
  2263. v52v1 = v
  2264. bs52 = testMarshalErr(v52v1, h, t, "enc-map-v52")
  2265. if v != nil {
  2266. if v == nil {
  2267. v52v2 = nil
  2268. } else {
  2269. v52v2 = make(map[uint]float64, len(v))
  2270. } // reset map
  2271. testUnmarshalErr(v52v2, bs52, h, t, "dec-map-v52")
  2272. testDeepEqualErr(v52v1, v52v2, t, "equal-map-v52")
  2273. if v == nil {
  2274. v52v2 = nil
  2275. } else {
  2276. v52v2 = make(map[uint]float64, len(v))
  2277. } // reset map
  2278. testUnmarshalErr(rv4i(v52v2), bs52, h, t, "dec-map-v52-noaddr") // decode into non-addressable map value
  2279. testDeepEqualErr(v52v1, v52v2, t, "equal-map-v52-noaddr")
  2280. }
  2281. if v == nil {
  2282. v52v2 = nil
  2283. } else {
  2284. v52v2 = make(map[uint]float64, len(v))
  2285. } // reset map
  2286. testUnmarshalErr(&v52v2, bs52, h, t, "dec-map-v52-p-len")
  2287. testDeepEqualErr(v52v1, v52v2, t, "equal-map-v52-p-len")
  2288. bs52 = testMarshalErr(&v52v1, h, t, "enc-map-v52-p")
  2289. v52v2 = nil
  2290. testUnmarshalErr(&v52v2, bs52, h, t, "dec-map-v52-p-nil")
  2291. testDeepEqualErr(v52v1, v52v2, t, "equal-map-v52-p-nil")
  2292. // ...
  2293. if v == nil {
  2294. v52v2 = nil
  2295. } else {
  2296. v52v2 = make(map[uint]float64, len(v))
  2297. } // reset map
  2298. var v52v3, v52v4 typMapMapUintFloat64
  2299. v52v3 = typMapMapUintFloat64(v52v1)
  2300. v52v4 = typMapMapUintFloat64(v52v2)
  2301. if v != nil {
  2302. bs52 = testMarshalErr(v52v3, h, t, "enc-map-v52-custom")
  2303. testUnmarshalErr(v52v4, bs52, h, t, "dec-map-v52-p-len")
  2304. testDeepEqualErr(v52v3, v52v4, t, "equal-map-v52-p-len")
  2305. }
  2306. }
  2307. for _, v := range []map[uint]bool{nil, {}, {77: false, 127: false}} {
  2308. // fmt.Printf(">>>> running mammoth map v53: %v\n", v)
  2309. var v53v1, v53v2 map[uint]bool
  2310. var bs53 []byte
  2311. v53v1 = v
  2312. bs53 = testMarshalErr(v53v1, h, t, "enc-map-v53")
  2313. if v != nil {
  2314. if v == nil {
  2315. v53v2 = nil
  2316. } else {
  2317. v53v2 = make(map[uint]bool, len(v))
  2318. } // reset map
  2319. testUnmarshalErr(v53v2, bs53, h, t, "dec-map-v53")
  2320. testDeepEqualErr(v53v1, v53v2, t, "equal-map-v53")
  2321. if v == nil {
  2322. v53v2 = nil
  2323. } else {
  2324. v53v2 = make(map[uint]bool, len(v))
  2325. } // reset map
  2326. testUnmarshalErr(rv4i(v53v2), bs53, h, t, "dec-map-v53-noaddr") // decode into non-addressable map value
  2327. testDeepEqualErr(v53v1, v53v2, t, "equal-map-v53-noaddr")
  2328. }
  2329. if v == nil {
  2330. v53v2 = nil
  2331. } else {
  2332. v53v2 = make(map[uint]bool, len(v))
  2333. } // reset map
  2334. testUnmarshalErr(&v53v2, bs53, h, t, "dec-map-v53-p-len")
  2335. testDeepEqualErr(v53v1, v53v2, t, "equal-map-v53-p-len")
  2336. bs53 = testMarshalErr(&v53v1, h, t, "enc-map-v53-p")
  2337. v53v2 = nil
  2338. testUnmarshalErr(&v53v2, bs53, h, t, "dec-map-v53-p-nil")
  2339. testDeepEqualErr(v53v1, v53v2, t, "equal-map-v53-p-nil")
  2340. // ...
  2341. if v == nil {
  2342. v53v2 = nil
  2343. } else {
  2344. v53v2 = make(map[uint]bool, len(v))
  2345. } // reset map
  2346. var v53v3, v53v4 typMapMapUintBool
  2347. v53v3 = typMapMapUintBool(v53v1)
  2348. v53v4 = typMapMapUintBool(v53v2)
  2349. if v != nil {
  2350. bs53 = testMarshalErr(v53v3, h, t, "enc-map-v53-custom")
  2351. testUnmarshalErr(v53v4, bs53, h, t, "dec-map-v53-p-len")
  2352. testDeepEqualErr(v53v3, v53v4, t, "equal-map-v53-p-len")
  2353. }
  2354. }
  2355. for _, v := range []map[uint8]interface{}{nil, {}, {111: nil, 77: "string-is-an-interface-3"}} {
  2356. // fmt.Printf(">>>> running mammoth map v54: %v\n", v)
  2357. var v54v1, v54v2 map[uint8]interface{}
  2358. var bs54 []byte
  2359. v54v1 = v
  2360. bs54 = testMarshalErr(v54v1, h, t, "enc-map-v54")
  2361. if v != nil {
  2362. if v == nil {
  2363. v54v2 = nil
  2364. } else {
  2365. v54v2 = make(map[uint8]interface{}, len(v))
  2366. } // reset map
  2367. testUnmarshalErr(v54v2, bs54, h, t, "dec-map-v54")
  2368. testDeepEqualErr(v54v1, v54v2, t, "equal-map-v54")
  2369. if v == nil {
  2370. v54v2 = nil
  2371. } else {
  2372. v54v2 = make(map[uint8]interface{}, len(v))
  2373. } // reset map
  2374. testUnmarshalErr(rv4i(v54v2), bs54, h, t, "dec-map-v54-noaddr") // decode into non-addressable map value
  2375. testDeepEqualErr(v54v1, v54v2, t, "equal-map-v54-noaddr")
  2376. }
  2377. if v == nil {
  2378. v54v2 = nil
  2379. } else {
  2380. v54v2 = make(map[uint8]interface{}, len(v))
  2381. } // reset map
  2382. testUnmarshalErr(&v54v2, bs54, h, t, "dec-map-v54-p-len")
  2383. testDeepEqualErr(v54v1, v54v2, t, "equal-map-v54-p-len")
  2384. bs54 = testMarshalErr(&v54v1, h, t, "enc-map-v54-p")
  2385. v54v2 = nil
  2386. testUnmarshalErr(&v54v2, bs54, h, t, "dec-map-v54-p-nil")
  2387. testDeepEqualErr(v54v1, v54v2, t, "equal-map-v54-p-nil")
  2388. // ...
  2389. if v == nil {
  2390. v54v2 = nil
  2391. } else {
  2392. v54v2 = make(map[uint8]interface{}, len(v))
  2393. } // reset map
  2394. var v54v3, v54v4 typMapMapUint8Intf
  2395. v54v3 = typMapMapUint8Intf(v54v1)
  2396. v54v4 = typMapMapUint8Intf(v54v2)
  2397. if v != nil {
  2398. bs54 = testMarshalErr(v54v3, h, t, "enc-map-v54-custom")
  2399. testUnmarshalErr(v54v4, bs54, h, t, "dec-map-v54-p-len")
  2400. testDeepEqualErr(v54v3, v54v4, t, "equal-map-v54-p-len")
  2401. }
  2402. }
  2403. for _, v := range []map[uint8]string{nil, {}, {127: "", 111: "some-string-1"}} {
  2404. // fmt.Printf(">>>> running mammoth map v55: %v\n", v)
  2405. var v55v1, v55v2 map[uint8]string
  2406. var bs55 []byte
  2407. v55v1 = v
  2408. bs55 = testMarshalErr(v55v1, h, t, "enc-map-v55")
  2409. if v != nil {
  2410. if v == nil {
  2411. v55v2 = nil
  2412. } else {
  2413. v55v2 = make(map[uint8]string, len(v))
  2414. } // reset map
  2415. testUnmarshalErr(v55v2, bs55, h, t, "dec-map-v55")
  2416. testDeepEqualErr(v55v1, v55v2, t, "equal-map-v55")
  2417. if v == nil {
  2418. v55v2 = nil
  2419. } else {
  2420. v55v2 = make(map[uint8]string, len(v))
  2421. } // reset map
  2422. testUnmarshalErr(rv4i(v55v2), bs55, h, t, "dec-map-v55-noaddr") // decode into non-addressable map value
  2423. testDeepEqualErr(v55v1, v55v2, t, "equal-map-v55-noaddr")
  2424. }
  2425. if v == nil {
  2426. v55v2 = nil
  2427. } else {
  2428. v55v2 = make(map[uint8]string, len(v))
  2429. } // reset map
  2430. testUnmarshalErr(&v55v2, bs55, h, t, "dec-map-v55-p-len")
  2431. testDeepEqualErr(v55v1, v55v2, t, "equal-map-v55-p-len")
  2432. bs55 = testMarshalErr(&v55v1, h, t, "enc-map-v55-p")
  2433. v55v2 = nil
  2434. testUnmarshalErr(&v55v2, bs55, h, t, "dec-map-v55-p-nil")
  2435. testDeepEqualErr(v55v1, v55v2, t, "equal-map-v55-p-nil")
  2436. // ...
  2437. if v == nil {
  2438. v55v2 = nil
  2439. } else {
  2440. v55v2 = make(map[uint8]string, len(v))
  2441. } // reset map
  2442. var v55v3, v55v4 typMapMapUint8String
  2443. v55v3 = typMapMapUint8String(v55v1)
  2444. v55v4 = typMapMapUint8String(v55v2)
  2445. if v != nil {
  2446. bs55 = testMarshalErr(v55v3, h, t, "enc-map-v55-custom")
  2447. testUnmarshalErr(v55v4, bs55, h, t, "dec-map-v55-p-len")
  2448. testDeepEqualErr(v55v3, v55v4, t, "equal-map-v55-p-len")
  2449. }
  2450. }
  2451. for _, v := range []map[uint8][]byte{nil, {}, {77: nil, 127: []byte("some-string-3")}} {
  2452. // fmt.Printf(">>>> running mammoth map v56: %v\n", v)
  2453. var v56v1, v56v2 map[uint8][]byte
  2454. var bs56 []byte
  2455. v56v1 = v
  2456. bs56 = testMarshalErr(v56v1, h, t, "enc-map-v56")
  2457. if v != nil {
  2458. if v == nil {
  2459. v56v2 = nil
  2460. } else {
  2461. v56v2 = make(map[uint8][]byte, len(v))
  2462. } // reset map
  2463. testUnmarshalErr(v56v2, bs56, h, t, "dec-map-v56")
  2464. testDeepEqualErr(v56v1, v56v2, t, "equal-map-v56")
  2465. if v == nil {
  2466. v56v2 = nil
  2467. } else {
  2468. v56v2 = make(map[uint8][]byte, len(v))
  2469. } // reset map
  2470. testUnmarshalErr(rv4i(v56v2), bs56, h, t, "dec-map-v56-noaddr") // decode into non-addressable map value
  2471. testDeepEqualErr(v56v1, v56v2, t, "equal-map-v56-noaddr")
  2472. }
  2473. if v == nil {
  2474. v56v2 = nil
  2475. } else {
  2476. v56v2 = make(map[uint8][]byte, len(v))
  2477. } // reset map
  2478. testUnmarshalErr(&v56v2, bs56, h, t, "dec-map-v56-p-len")
  2479. testDeepEqualErr(v56v1, v56v2, t, "equal-map-v56-p-len")
  2480. bs56 = testMarshalErr(&v56v1, h, t, "enc-map-v56-p")
  2481. v56v2 = nil
  2482. testUnmarshalErr(&v56v2, bs56, h, t, "dec-map-v56-p-nil")
  2483. testDeepEqualErr(v56v1, v56v2, t, "equal-map-v56-p-nil")
  2484. // ...
  2485. if v == nil {
  2486. v56v2 = nil
  2487. } else {
  2488. v56v2 = make(map[uint8][]byte, len(v))
  2489. } // reset map
  2490. var v56v3, v56v4 typMapMapUint8Bytes
  2491. v56v3 = typMapMapUint8Bytes(v56v1)
  2492. v56v4 = typMapMapUint8Bytes(v56v2)
  2493. if v != nil {
  2494. bs56 = testMarshalErr(v56v3, h, t, "enc-map-v56-custom")
  2495. testUnmarshalErr(v56v4, bs56, h, t, "dec-map-v56-p-len")
  2496. testDeepEqualErr(v56v3, v56v4, t, "equal-map-v56-p-len")
  2497. }
  2498. }
  2499. for _, v := range []map[uint8]uint{nil, {}, {111: 0, 77: 127}} {
  2500. // fmt.Printf(">>>> running mammoth map v57: %v\n", v)
  2501. var v57v1, v57v2 map[uint8]uint
  2502. var bs57 []byte
  2503. v57v1 = v
  2504. bs57 = testMarshalErr(v57v1, h, t, "enc-map-v57")
  2505. if v != nil {
  2506. if v == nil {
  2507. v57v2 = nil
  2508. } else {
  2509. v57v2 = make(map[uint8]uint, len(v))
  2510. } // reset map
  2511. testUnmarshalErr(v57v2, bs57, h, t, "dec-map-v57")
  2512. testDeepEqualErr(v57v1, v57v2, t, "equal-map-v57")
  2513. if v == nil {
  2514. v57v2 = nil
  2515. } else {
  2516. v57v2 = make(map[uint8]uint, len(v))
  2517. } // reset map
  2518. testUnmarshalErr(rv4i(v57v2), bs57, h, t, "dec-map-v57-noaddr") // decode into non-addressable map value
  2519. testDeepEqualErr(v57v1, v57v2, t, "equal-map-v57-noaddr")
  2520. }
  2521. if v == nil {
  2522. v57v2 = nil
  2523. } else {
  2524. v57v2 = make(map[uint8]uint, len(v))
  2525. } // reset map
  2526. testUnmarshalErr(&v57v2, bs57, h, t, "dec-map-v57-p-len")
  2527. testDeepEqualErr(v57v1, v57v2, t, "equal-map-v57-p-len")
  2528. bs57 = testMarshalErr(&v57v1, h, t, "enc-map-v57-p")
  2529. v57v2 = nil
  2530. testUnmarshalErr(&v57v2, bs57, h, t, "dec-map-v57-p-nil")
  2531. testDeepEqualErr(v57v1, v57v2, t, "equal-map-v57-p-nil")
  2532. // ...
  2533. if v == nil {
  2534. v57v2 = nil
  2535. } else {
  2536. v57v2 = make(map[uint8]uint, len(v))
  2537. } // reset map
  2538. var v57v3, v57v4 typMapMapUint8Uint
  2539. v57v3 = typMapMapUint8Uint(v57v1)
  2540. v57v4 = typMapMapUint8Uint(v57v2)
  2541. if v != nil {
  2542. bs57 = testMarshalErr(v57v3, h, t, "enc-map-v57-custom")
  2543. testUnmarshalErr(v57v4, bs57, h, t, "dec-map-v57-p-len")
  2544. testDeepEqualErr(v57v3, v57v4, t, "equal-map-v57-p-len")
  2545. }
  2546. }
  2547. for _, v := range []map[uint8]uint8{nil, {}, {111: 0, 77: 127}} {
  2548. // fmt.Printf(">>>> running mammoth map v58: %v\n", v)
  2549. var v58v1, v58v2 map[uint8]uint8
  2550. var bs58 []byte
  2551. v58v1 = v
  2552. bs58 = testMarshalErr(v58v1, h, t, "enc-map-v58")
  2553. if v != nil {
  2554. if v == nil {
  2555. v58v2 = nil
  2556. } else {
  2557. v58v2 = make(map[uint8]uint8, len(v))
  2558. } // reset map
  2559. testUnmarshalErr(v58v2, bs58, h, t, "dec-map-v58")
  2560. testDeepEqualErr(v58v1, v58v2, t, "equal-map-v58")
  2561. if v == nil {
  2562. v58v2 = nil
  2563. } else {
  2564. v58v2 = make(map[uint8]uint8, len(v))
  2565. } // reset map
  2566. testUnmarshalErr(rv4i(v58v2), bs58, h, t, "dec-map-v58-noaddr") // decode into non-addressable map value
  2567. testDeepEqualErr(v58v1, v58v2, t, "equal-map-v58-noaddr")
  2568. }
  2569. if v == nil {
  2570. v58v2 = nil
  2571. } else {
  2572. v58v2 = make(map[uint8]uint8, len(v))
  2573. } // reset map
  2574. testUnmarshalErr(&v58v2, bs58, h, t, "dec-map-v58-p-len")
  2575. testDeepEqualErr(v58v1, v58v2, t, "equal-map-v58-p-len")
  2576. bs58 = testMarshalErr(&v58v1, h, t, "enc-map-v58-p")
  2577. v58v2 = nil
  2578. testUnmarshalErr(&v58v2, bs58, h, t, "dec-map-v58-p-nil")
  2579. testDeepEqualErr(v58v1, v58v2, t, "equal-map-v58-p-nil")
  2580. // ...
  2581. if v == nil {
  2582. v58v2 = nil
  2583. } else {
  2584. v58v2 = make(map[uint8]uint8, len(v))
  2585. } // reset map
  2586. var v58v3, v58v4 typMapMapUint8Uint8
  2587. v58v3 = typMapMapUint8Uint8(v58v1)
  2588. v58v4 = typMapMapUint8Uint8(v58v2)
  2589. if v != nil {
  2590. bs58 = testMarshalErr(v58v3, h, t, "enc-map-v58-custom")
  2591. testUnmarshalErr(v58v4, bs58, h, t, "dec-map-v58-p-len")
  2592. testDeepEqualErr(v58v3, v58v4, t, "equal-map-v58-p-len")
  2593. }
  2594. }
  2595. for _, v := range []map[uint8]uint64{nil, {}, {111: 0, 77: 127}} {
  2596. // fmt.Printf(">>>> running mammoth map v59: %v\n", v)
  2597. var v59v1, v59v2 map[uint8]uint64
  2598. var bs59 []byte
  2599. v59v1 = v
  2600. bs59 = testMarshalErr(v59v1, h, t, "enc-map-v59")
  2601. if v != nil {
  2602. if v == nil {
  2603. v59v2 = nil
  2604. } else {
  2605. v59v2 = make(map[uint8]uint64, len(v))
  2606. } // reset map
  2607. testUnmarshalErr(v59v2, bs59, h, t, "dec-map-v59")
  2608. testDeepEqualErr(v59v1, v59v2, t, "equal-map-v59")
  2609. if v == nil {
  2610. v59v2 = nil
  2611. } else {
  2612. v59v2 = make(map[uint8]uint64, len(v))
  2613. } // reset map
  2614. testUnmarshalErr(rv4i(v59v2), bs59, h, t, "dec-map-v59-noaddr") // decode into non-addressable map value
  2615. testDeepEqualErr(v59v1, v59v2, t, "equal-map-v59-noaddr")
  2616. }
  2617. if v == nil {
  2618. v59v2 = nil
  2619. } else {
  2620. v59v2 = make(map[uint8]uint64, len(v))
  2621. } // reset map
  2622. testUnmarshalErr(&v59v2, bs59, h, t, "dec-map-v59-p-len")
  2623. testDeepEqualErr(v59v1, v59v2, t, "equal-map-v59-p-len")
  2624. bs59 = testMarshalErr(&v59v1, h, t, "enc-map-v59-p")
  2625. v59v2 = nil
  2626. testUnmarshalErr(&v59v2, bs59, h, t, "dec-map-v59-p-nil")
  2627. testDeepEqualErr(v59v1, v59v2, t, "equal-map-v59-p-nil")
  2628. // ...
  2629. if v == nil {
  2630. v59v2 = nil
  2631. } else {
  2632. v59v2 = make(map[uint8]uint64, len(v))
  2633. } // reset map
  2634. var v59v3, v59v4 typMapMapUint8Uint64
  2635. v59v3 = typMapMapUint8Uint64(v59v1)
  2636. v59v4 = typMapMapUint8Uint64(v59v2)
  2637. if v != nil {
  2638. bs59 = testMarshalErr(v59v3, h, t, "enc-map-v59-custom")
  2639. testUnmarshalErr(v59v4, bs59, h, t, "dec-map-v59-p-len")
  2640. testDeepEqualErr(v59v3, v59v4, t, "equal-map-v59-p-len")
  2641. }
  2642. }
  2643. for _, v := range []map[uint8]int{nil, {}, {111: 0, 77: 127}} {
  2644. // fmt.Printf(">>>> running mammoth map v60: %v\n", v)
  2645. var v60v1, v60v2 map[uint8]int
  2646. var bs60 []byte
  2647. v60v1 = v
  2648. bs60 = testMarshalErr(v60v1, h, t, "enc-map-v60")
  2649. if v != nil {
  2650. if v == nil {
  2651. v60v2 = nil
  2652. } else {
  2653. v60v2 = make(map[uint8]int, len(v))
  2654. } // reset map
  2655. testUnmarshalErr(v60v2, bs60, h, t, "dec-map-v60")
  2656. testDeepEqualErr(v60v1, v60v2, t, "equal-map-v60")
  2657. if v == nil {
  2658. v60v2 = nil
  2659. } else {
  2660. v60v2 = make(map[uint8]int, len(v))
  2661. } // reset map
  2662. testUnmarshalErr(rv4i(v60v2), bs60, h, t, "dec-map-v60-noaddr") // decode into non-addressable map value
  2663. testDeepEqualErr(v60v1, v60v2, t, "equal-map-v60-noaddr")
  2664. }
  2665. if v == nil {
  2666. v60v2 = nil
  2667. } else {
  2668. v60v2 = make(map[uint8]int, len(v))
  2669. } // reset map
  2670. testUnmarshalErr(&v60v2, bs60, h, t, "dec-map-v60-p-len")
  2671. testDeepEqualErr(v60v1, v60v2, t, "equal-map-v60-p-len")
  2672. bs60 = testMarshalErr(&v60v1, h, t, "enc-map-v60-p")
  2673. v60v2 = nil
  2674. testUnmarshalErr(&v60v2, bs60, h, t, "dec-map-v60-p-nil")
  2675. testDeepEqualErr(v60v1, v60v2, t, "equal-map-v60-p-nil")
  2676. // ...
  2677. if v == nil {
  2678. v60v2 = nil
  2679. } else {
  2680. v60v2 = make(map[uint8]int, len(v))
  2681. } // reset map
  2682. var v60v3, v60v4 typMapMapUint8Int
  2683. v60v3 = typMapMapUint8Int(v60v1)
  2684. v60v4 = typMapMapUint8Int(v60v2)
  2685. if v != nil {
  2686. bs60 = testMarshalErr(v60v3, h, t, "enc-map-v60-custom")
  2687. testUnmarshalErr(v60v4, bs60, h, t, "dec-map-v60-p-len")
  2688. testDeepEqualErr(v60v3, v60v4, t, "equal-map-v60-p-len")
  2689. }
  2690. }
  2691. for _, v := range []map[uint8]int64{nil, {}, {111: 0, 77: 127}} {
  2692. // fmt.Printf(">>>> running mammoth map v61: %v\n", v)
  2693. var v61v1, v61v2 map[uint8]int64
  2694. var bs61 []byte
  2695. v61v1 = v
  2696. bs61 = testMarshalErr(v61v1, h, t, "enc-map-v61")
  2697. if v != nil {
  2698. if v == nil {
  2699. v61v2 = nil
  2700. } else {
  2701. v61v2 = make(map[uint8]int64, len(v))
  2702. } // reset map
  2703. testUnmarshalErr(v61v2, bs61, h, t, "dec-map-v61")
  2704. testDeepEqualErr(v61v1, v61v2, t, "equal-map-v61")
  2705. if v == nil {
  2706. v61v2 = nil
  2707. } else {
  2708. v61v2 = make(map[uint8]int64, len(v))
  2709. } // reset map
  2710. testUnmarshalErr(rv4i(v61v2), bs61, h, t, "dec-map-v61-noaddr") // decode into non-addressable map value
  2711. testDeepEqualErr(v61v1, v61v2, t, "equal-map-v61-noaddr")
  2712. }
  2713. if v == nil {
  2714. v61v2 = nil
  2715. } else {
  2716. v61v2 = make(map[uint8]int64, len(v))
  2717. } // reset map
  2718. testUnmarshalErr(&v61v2, bs61, h, t, "dec-map-v61-p-len")
  2719. testDeepEqualErr(v61v1, v61v2, t, "equal-map-v61-p-len")
  2720. bs61 = testMarshalErr(&v61v1, h, t, "enc-map-v61-p")
  2721. v61v2 = nil
  2722. testUnmarshalErr(&v61v2, bs61, h, t, "dec-map-v61-p-nil")
  2723. testDeepEqualErr(v61v1, v61v2, t, "equal-map-v61-p-nil")
  2724. // ...
  2725. if v == nil {
  2726. v61v2 = nil
  2727. } else {
  2728. v61v2 = make(map[uint8]int64, len(v))
  2729. } // reset map
  2730. var v61v3, v61v4 typMapMapUint8Int64
  2731. v61v3 = typMapMapUint8Int64(v61v1)
  2732. v61v4 = typMapMapUint8Int64(v61v2)
  2733. if v != nil {
  2734. bs61 = testMarshalErr(v61v3, h, t, "enc-map-v61-custom")
  2735. testUnmarshalErr(v61v4, bs61, h, t, "dec-map-v61-p-len")
  2736. testDeepEqualErr(v61v3, v61v4, t, "equal-map-v61-p-len")
  2737. }
  2738. }
  2739. for _, v := range []map[uint8]float32{nil, {}, {111: 0, 77: 11.1}} {
  2740. // fmt.Printf(">>>> running mammoth map v62: %v\n", v)
  2741. var v62v1, v62v2 map[uint8]float32
  2742. var bs62 []byte
  2743. v62v1 = v
  2744. bs62 = testMarshalErr(v62v1, h, t, "enc-map-v62")
  2745. if v != nil {
  2746. if v == nil {
  2747. v62v2 = nil
  2748. } else {
  2749. v62v2 = make(map[uint8]float32, len(v))
  2750. } // reset map
  2751. testUnmarshalErr(v62v2, bs62, h, t, "dec-map-v62")
  2752. testDeepEqualErr(v62v1, v62v2, t, "equal-map-v62")
  2753. if v == nil {
  2754. v62v2 = nil
  2755. } else {
  2756. v62v2 = make(map[uint8]float32, len(v))
  2757. } // reset map
  2758. testUnmarshalErr(rv4i(v62v2), bs62, h, t, "dec-map-v62-noaddr") // decode into non-addressable map value
  2759. testDeepEqualErr(v62v1, v62v2, t, "equal-map-v62-noaddr")
  2760. }
  2761. if v == nil {
  2762. v62v2 = nil
  2763. } else {
  2764. v62v2 = make(map[uint8]float32, len(v))
  2765. } // reset map
  2766. testUnmarshalErr(&v62v2, bs62, h, t, "dec-map-v62-p-len")
  2767. testDeepEqualErr(v62v1, v62v2, t, "equal-map-v62-p-len")
  2768. bs62 = testMarshalErr(&v62v1, h, t, "enc-map-v62-p")
  2769. v62v2 = nil
  2770. testUnmarshalErr(&v62v2, bs62, h, t, "dec-map-v62-p-nil")
  2771. testDeepEqualErr(v62v1, v62v2, t, "equal-map-v62-p-nil")
  2772. // ...
  2773. if v == nil {
  2774. v62v2 = nil
  2775. } else {
  2776. v62v2 = make(map[uint8]float32, len(v))
  2777. } // reset map
  2778. var v62v3, v62v4 typMapMapUint8Float32
  2779. v62v3 = typMapMapUint8Float32(v62v1)
  2780. v62v4 = typMapMapUint8Float32(v62v2)
  2781. if v != nil {
  2782. bs62 = testMarshalErr(v62v3, h, t, "enc-map-v62-custom")
  2783. testUnmarshalErr(v62v4, bs62, h, t, "dec-map-v62-p-len")
  2784. testDeepEqualErr(v62v3, v62v4, t, "equal-map-v62-p-len")
  2785. }
  2786. }
  2787. for _, v := range []map[uint8]float64{nil, {}, {127: 0, 111: 22.2}} {
  2788. // fmt.Printf(">>>> running mammoth map v63: %v\n", v)
  2789. var v63v1, v63v2 map[uint8]float64
  2790. var bs63 []byte
  2791. v63v1 = v
  2792. bs63 = testMarshalErr(v63v1, h, t, "enc-map-v63")
  2793. if v != nil {
  2794. if v == nil {
  2795. v63v2 = nil
  2796. } else {
  2797. v63v2 = make(map[uint8]float64, len(v))
  2798. } // reset map
  2799. testUnmarshalErr(v63v2, bs63, h, t, "dec-map-v63")
  2800. testDeepEqualErr(v63v1, v63v2, t, "equal-map-v63")
  2801. if v == nil {
  2802. v63v2 = nil
  2803. } else {
  2804. v63v2 = make(map[uint8]float64, len(v))
  2805. } // reset map
  2806. testUnmarshalErr(rv4i(v63v2), bs63, h, t, "dec-map-v63-noaddr") // decode into non-addressable map value
  2807. testDeepEqualErr(v63v1, v63v2, t, "equal-map-v63-noaddr")
  2808. }
  2809. if v == nil {
  2810. v63v2 = nil
  2811. } else {
  2812. v63v2 = make(map[uint8]float64, len(v))
  2813. } // reset map
  2814. testUnmarshalErr(&v63v2, bs63, h, t, "dec-map-v63-p-len")
  2815. testDeepEqualErr(v63v1, v63v2, t, "equal-map-v63-p-len")
  2816. bs63 = testMarshalErr(&v63v1, h, t, "enc-map-v63-p")
  2817. v63v2 = nil
  2818. testUnmarshalErr(&v63v2, bs63, h, t, "dec-map-v63-p-nil")
  2819. testDeepEqualErr(v63v1, v63v2, t, "equal-map-v63-p-nil")
  2820. // ...
  2821. if v == nil {
  2822. v63v2 = nil
  2823. } else {
  2824. v63v2 = make(map[uint8]float64, len(v))
  2825. } // reset map
  2826. var v63v3, v63v4 typMapMapUint8Float64
  2827. v63v3 = typMapMapUint8Float64(v63v1)
  2828. v63v4 = typMapMapUint8Float64(v63v2)
  2829. if v != nil {
  2830. bs63 = testMarshalErr(v63v3, h, t, "enc-map-v63-custom")
  2831. testUnmarshalErr(v63v4, bs63, h, t, "dec-map-v63-p-len")
  2832. testDeepEqualErr(v63v3, v63v4, t, "equal-map-v63-p-len")
  2833. }
  2834. }
  2835. for _, v := range []map[uint8]bool{nil, {}, {77: false, 127: true}} {
  2836. // fmt.Printf(">>>> running mammoth map v64: %v\n", v)
  2837. var v64v1, v64v2 map[uint8]bool
  2838. var bs64 []byte
  2839. v64v1 = v
  2840. bs64 = testMarshalErr(v64v1, h, t, "enc-map-v64")
  2841. if v != nil {
  2842. if v == nil {
  2843. v64v2 = nil
  2844. } else {
  2845. v64v2 = make(map[uint8]bool, len(v))
  2846. } // reset map
  2847. testUnmarshalErr(v64v2, bs64, h, t, "dec-map-v64")
  2848. testDeepEqualErr(v64v1, v64v2, t, "equal-map-v64")
  2849. if v == nil {
  2850. v64v2 = nil
  2851. } else {
  2852. v64v2 = make(map[uint8]bool, len(v))
  2853. } // reset map
  2854. testUnmarshalErr(rv4i(v64v2), bs64, h, t, "dec-map-v64-noaddr") // decode into non-addressable map value
  2855. testDeepEqualErr(v64v1, v64v2, t, "equal-map-v64-noaddr")
  2856. }
  2857. if v == nil {
  2858. v64v2 = nil
  2859. } else {
  2860. v64v2 = make(map[uint8]bool, len(v))
  2861. } // reset map
  2862. testUnmarshalErr(&v64v2, bs64, h, t, "dec-map-v64-p-len")
  2863. testDeepEqualErr(v64v1, v64v2, t, "equal-map-v64-p-len")
  2864. bs64 = testMarshalErr(&v64v1, h, t, "enc-map-v64-p")
  2865. v64v2 = nil
  2866. testUnmarshalErr(&v64v2, bs64, h, t, "dec-map-v64-p-nil")
  2867. testDeepEqualErr(v64v1, v64v2, t, "equal-map-v64-p-nil")
  2868. // ...
  2869. if v == nil {
  2870. v64v2 = nil
  2871. } else {
  2872. v64v2 = make(map[uint8]bool, len(v))
  2873. } // reset map
  2874. var v64v3, v64v4 typMapMapUint8Bool
  2875. v64v3 = typMapMapUint8Bool(v64v1)
  2876. v64v4 = typMapMapUint8Bool(v64v2)
  2877. if v != nil {
  2878. bs64 = testMarshalErr(v64v3, h, t, "enc-map-v64-custom")
  2879. testUnmarshalErr(v64v4, bs64, h, t, "dec-map-v64-p-len")
  2880. testDeepEqualErr(v64v3, v64v4, t, "equal-map-v64-p-len")
  2881. }
  2882. }
  2883. for _, v := range []map[uint64]interface{}{nil, {}, {111: nil, 77: "string-is-an-interface-1"}} {
  2884. // fmt.Printf(">>>> running mammoth map v65: %v\n", v)
  2885. var v65v1, v65v2 map[uint64]interface{}
  2886. var bs65 []byte
  2887. v65v1 = v
  2888. bs65 = testMarshalErr(v65v1, h, t, "enc-map-v65")
  2889. if v != nil {
  2890. if v == nil {
  2891. v65v2 = nil
  2892. } else {
  2893. v65v2 = make(map[uint64]interface{}, len(v))
  2894. } // reset map
  2895. testUnmarshalErr(v65v2, bs65, h, t, "dec-map-v65")
  2896. testDeepEqualErr(v65v1, v65v2, t, "equal-map-v65")
  2897. if v == nil {
  2898. v65v2 = nil
  2899. } else {
  2900. v65v2 = make(map[uint64]interface{}, len(v))
  2901. } // reset map
  2902. testUnmarshalErr(rv4i(v65v2), bs65, h, t, "dec-map-v65-noaddr") // decode into non-addressable map value
  2903. testDeepEqualErr(v65v1, v65v2, t, "equal-map-v65-noaddr")
  2904. }
  2905. if v == nil {
  2906. v65v2 = nil
  2907. } else {
  2908. v65v2 = make(map[uint64]interface{}, len(v))
  2909. } // reset map
  2910. testUnmarshalErr(&v65v2, bs65, h, t, "dec-map-v65-p-len")
  2911. testDeepEqualErr(v65v1, v65v2, t, "equal-map-v65-p-len")
  2912. bs65 = testMarshalErr(&v65v1, h, t, "enc-map-v65-p")
  2913. v65v2 = nil
  2914. testUnmarshalErr(&v65v2, bs65, h, t, "dec-map-v65-p-nil")
  2915. testDeepEqualErr(v65v1, v65v2, t, "equal-map-v65-p-nil")
  2916. // ...
  2917. if v == nil {
  2918. v65v2 = nil
  2919. } else {
  2920. v65v2 = make(map[uint64]interface{}, len(v))
  2921. } // reset map
  2922. var v65v3, v65v4 typMapMapUint64Intf
  2923. v65v3 = typMapMapUint64Intf(v65v1)
  2924. v65v4 = typMapMapUint64Intf(v65v2)
  2925. if v != nil {
  2926. bs65 = testMarshalErr(v65v3, h, t, "enc-map-v65-custom")
  2927. testUnmarshalErr(v65v4, bs65, h, t, "dec-map-v65-p-len")
  2928. testDeepEqualErr(v65v3, v65v4, t, "equal-map-v65-p-len")
  2929. }
  2930. }
  2931. for _, v := range []map[uint64]string{nil, {}, {127: "", 111: "some-string-2"}} {
  2932. // fmt.Printf(">>>> running mammoth map v66: %v\n", v)
  2933. var v66v1, v66v2 map[uint64]string
  2934. var bs66 []byte
  2935. v66v1 = v
  2936. bs66 = testMarshalErr(v66v1, h, t, "enc-map-v66")
  2937. if v != nil {
  2938. if v == nil {
  2939. v66v2 = nil
  2940. } else {
  2941. v66v2 = make(map[uint64]string, len(v))
  2942. } // reset map
  2943. testUnmarshalErr(v66v2, bs66, h, t, "dec-map-v66")
  2944. testDeepEqualErr(v66v1, v66v2, t, "equal-map-v66")
  2945. if v == nil {
  2946. v66v2 = nil
  2947. } else {
  2948. v66v2 = make(map[uint64]string, len(v))
  2949. } // reset map
  2950. testUnmarshalErr(rv4i(v66v2), bs66, h, t, "dec-map-v66-noaddr") // decode into non-addressable map value
  2951. testDeepEqualErr(v66v1, v66v2, t, "equal-map-v66-noaddr")
  2952. }
  2953. if v == nil {
  2954. v66v2 = nil
  2955. } else {
  2956. v66v2 = make(map[uint64]string, len(v))
  2957. } // reset map
  2958. testUnmarshalErr(&v66v2, bs66, h, t, "dec-map-v66-p-len")
  2959. testDeepEqualErr(v66v1, v66v2, t, "equal-map-v66-p-len")
  2960. bs66 = testMarshalErr(&v66v1, h, t, "enc-map-v66-p")
  2961. v66v2 = nil
  2962. testUnmarshalErr(&v66v2, bs66, h, t, "dec-map-v66-p-nil")
  2963. testDeepEqualErr(v66v1, v66v2, t, "equal-map-v66-p-nil")
  2964. // ...
  2965. if v == nil {
  2966. v66v2 = nil
  2967. } else {
  2968. v66v2 = make(map[uint64]string, len(v))
  2969. } // reset map
  2970. var v66v3, v66v4 typMapMapUint64String
  2971. v66v3 = typMapMapUint64String(v66v1)
  2972. v66v4 = typMapMapUint64String(v66v2)
  2973. if v != nil {
  2974. bs66 = testMarshalErr(v66v3, h, t, "enc-map-v66-custom")
  2975. testUnmarshalErr(v66v4, bs66, h, t, "dec-map-v66-p-len")
  2976. testDeepEqualErr(v66v3, v66v4, t, "equal-map-v66-p-len")
  2977. }
  2978. }
  2979. for _, v := range []map[uint64][]byte{nil, {}, {77: nil, 127: []byte("some-string-1")}} {
  2980. // fmt.Printf(">>>> running mammoth map v67: %v\n", v)
  2981. var v67v1, v67v2 map[uint64][]byte
  2982. var bs67 []byte
  2983. v67v1 = v
  2984. bs67 = testMarshalErr(v67v1, h, t, "enc-map-v67")
  2985. if v != nil {
  2986. if v == nil {
  2987. v67v2 = nil
  2988. } else {
  2989. v67v2 = make(map[uint64][]byte, len(v))
  2990. } // reset map
  2991. testUnmarshalErr(v67v2, bs67, h, t, "dec-map-v67")
  2992. testDeepEqualErr(v67v1, v67v2, t, "equal-map-v67")
  2993. if v == nil {
  2994. v67v2 = nil
  2995. } else {
  2996. v67v2 = make(map[uint64][]byte, len(v))
  2997. } // reset map
  2998. testUnmarshalErr(rv4i(v67v2), bs67, h, t, "dec-map-v67-noaddr") // decode into non-addressable map value
  2999. testDeepEqualErr(v67v1, v67v2, t, "equal-map-v67-noaddr")
  3000. }
  3001. if v == nil {
  3002. v67v2 = nil
  3003. } else {
  3004. v67v2 = make(map[uint64][]byte, len(v))
  3005. } // reset map
  3006. testUnmarshalErr(&v67v2, bs67, h, t, "dec-map-v67-p-len")
  3007. testDeepEqualErr(v67v1, v67v2, t, "equal-map-v67-p-len")
  3008. bs67 = testMarshalErr(&v67v1, h, t, "enc-map-v67-p")
  3009. v67v2 = nil
  3010. testUnmarshalErr(&v67v2, bs67, h, t, "dec-map-v67-p-nil")
  3011. testDeepEqualErr(v67v1, v67v2, t, "equal-map-v67-p-nil")
  3012. // ...
  3013. if v == nil {
  3014. v67v2 = nil
  3015. } else {
  3016. v67v2 = make(map[uint64][]byte, len(v))
  3017. } // reset map
  3018. var v67v3, v67v4 typMapMapUint64Bytes
  3019. v67v3 = typMapMapUint64Bytes(v67v1)
  3020. v67v4 = typMapMapUint64Bytes(v67v2)
  3021. if v != nil {
  3022. bs67 = testMarshalErr(v67v3, h, t, "enc-map-v67-custom")
  3023. testUnmarshalErr(v67v4, bs67, h, t, "dec-map-v67-p-len")
  3024. testDeepEqualErr(v67v3, v67v4, t, "equal-map-v67-p-len")
  3025. }
  3026. }
  3027. for _, v := range []map[uint64]uint{nil, {}, {111: 0, 77: 127}} {
  3028. // fmt.Printf(">>>> running mammoth map v68: %v\n", v)
  3029. var v68v1, v68v2 map[uint64]uint
  3030. var bs68 []byte
  3031. v68v1 = v
  3032. bs68 = testMarshalErr(v68v1, h, t, "enc-map-v68")
  3033. if v != nil {
  3034. if v == nil {
  3035. v68v2 = nil
  3036. } else {
  3037. v68v2 = make(map[uint64]uint, len(v))
  3038. } // reset map
  3039. testUnmarshalErr(v68v2, bs68, h, t, "dec-map-v68")
  3040. testDeepEqualErr(v68v1, v68v2, t, "equal-map-v68")
  3041. if v == nil {
  3042. v68v2 = nil
  3043. } else {
  3044. v68v2 = make(map[uint64]uint, len(v))
  3045. } // reset map
  3046. testUnmarshalErr(rv4i(v68v2), bs68, h, t, "dec-map-v68-noaddr") // decode into non-addressable map value
  3047. testDeepEqualErr(v68v1, v68v2, t, "equal-map-v68-noaddr")
  3048. }
  3049. if v == nil {
  3050. v68v2 = nil
  3051. } else {
  3052. v68v2 = make(map[uint64]uint, len(v))
  3053. } // reset map
  3054. testUnmarshalErr(&v68v2, bs68, h, t, "dec-map-v68-p-len")
  3055. testDeepEqualErr(v68v1, v68v2, t, "equal-map-v68-p-len")
  3056. bs68 = testMarshalErr(&v68v1, h, t, "enc-map-v68-p")
  3057. v68v2 = nil
  3058. testUnmarshalErr(&v68v2, bs68, h, t, "dec-map-v68-p-nil")
  3059. testDeepEqualErr(v68v1, v68v2, t, "equal-map-v68-p-nil")
  3060. // ...
  3061. if v == nil {
  3062. v68v2 = nil
  3063. } else {
  3064. v68v2 = make(map[uint64]uint, len(v))
  3065. } // reset map
  3066. var v68v3, v68v4 typMapMapUint64Uint
  3067. v68v3 = typMapMapUint64Uint(v68v1)
  3068. v68v4 = typMapMapUint64Uint(v68v2)
  3069. if v != nil {
  3070. bs68 = testMarshalErr(v68v3, h, t, "enc-map-v68-custom")
  3071. testUnmarshalErr(v68v4, bs68, h, t, "dec-map-v68-p-len")
  3072. testDeepEqualErr(v68v3, v68v4, t, "equal-map-v68-p-len")
  3073. }
  3074. }
  3075. for _, v := range []map[uint64]uint8{nil, {}, {111: 0, 77: 127}} {
  3076. // fmt.Printf(">>>> running mammoth map v69: %v\n", v)
  3077. var v69v1, v69v2 map[uint64]uint8
  3078. var bs69 []byte
  3079. v69v1 = v
  3080. bs69 = testMarshalErr(v69v1, h, t, "enc-map-v69")
  3081. if v != nil {
  3082. if v == nil {
  3083. v69v2 = nil
  3084. } else {
  3085. v69v2 = make(map[uint64]uint8, len(v))
  3086. } // reset map
  3087. testUnmarshalErr(v69v2, bs69, h, t, "dec-map-v69")
  3088. testDeepEqualErr(v69v1, v69v2, t, "equal-map-v69")
  3089. if v == nil {
  3090. v69v2 = nil
  3091. } else {
  3092. v69v2 = make(map[uint64]uint8, len(v))
  3093. } // reset map
  3094. testUnmarshalErr(rv4i(v69v2), bs69, h, t, "dec-map-v69-noaddr") // decode into non-addressable map value
  3095. testDeepEqualErr(v69v1, v69v2, t, "equal-map-v69-noaddr")
  3096. }
  3097. if v == nil {
  3098. v69v2 = nil
  3099. } else {
  3100. v69v2 = make(map[uint64]uint8, len(v))
  3101. } // reset map
  3102. testUnmarshalErr(&v69v2, bs69, h, t, "dec-map-v69-p-len")
  3103. testDeepEqualErr(v69v1, v69v2, t, "equal-map-v69-p-len")
  3104. bs69 = testMarshalErr(&v69v1, h, t, "enc-map-v69-p")
  3105. v69v2 = nil
  3106. testUnmarshalErr(&v69v2, bs69, h, t, "dec-map-v69-p-nil")
  3107. testDeepEqualErr(v69v1, v69v2, t, "equal-map-v69-p-nil")
  3108. // ...
  3109. if v == nil {
  3110. v69v2 = nil
  3111. } else {
  3112. v69v2 = make(map[uint64]uint8, len(v))
  3113. } // reset map
  3114. var v69v3, v69v4 typMapMapUint64Uint8
  3115. v69v3 = typMapMapUint64Uint8(v69v1)
  3116. v69v4 = typMapMapUint64Uint8(v69v2)
  3117. if v != nil {
  3118. bs69 = testMarshalErr(v69v3, h, t, "enc-map-v69-custom")
  3119. testUnmarshalErr(v69v4, bs69, h, t, "dec-map-v69-p-len")
  3120. testDeepEqualErr(v69v3, v69v4, t, "equal-map-v69-p-len")
  3121. }
  3122. }
  3123. for _, v := range []map[uint64]uint64{nil, {}, {111: 0, 77: 127}} {
  3124. // fmt.Printf(">>>> running mammoth map v70: %v\n", v)
  3125. var v70v1, v70v2 map[uint64]uint64
  3126. var bs70 []byte
  3127. v70v1 = v
  3128. bs70 = testMarshalErr(v70v1, h, t, "enc-map-v70")
  3129. if v != nil {
  3130. if v == nil {
  3131. v70v2 = nil
  3132. } else {
  3133. v70v2 = make(map[uint64]uint64, len(v))
  3134. } // reset map
  3135. testUnmarshalErr(v70v2, bs70, h, t, "dec-map-v70")
  3136. testDeepEqualErr(v70v1, v70v2, t, "equal-map-v70")
  3137. if v == nil {
  3138. v70v2 = nil
  3139. } else {
  3140. v70v2 = make(map[uint64]uint64, len(v))
  3141. } // reset map
  3142. testUnmarshalErr(rv4i(v70v2), bs70, h, t, "dec-map-v70-noaddr") // decode into non-addressable map value
  3143. testDeepEqualErr(v70v1, v70v2, t, "equal-map-v70-noaddr")
  3144. }
  3145. if v == nil {
  3146. v70v2 = nil
  3147. } else {
  3148. v70v2 = make(map[uint64]uint64, len(v))
  3149. } // reset map
  3150. testUnmarshalErr(&v70v2, bs70, h, t, "dec-map-v70-p-len")
  3151. testDeepEqualErr(v70v1, v70v2, t, "equal-map-v70-p-len")
  3152. bs70 = testMarshalErr(&v70v1, h, t, "enc-map-v70-p")
  3153. v70v2 = nil
  3154. testUnmarshalErr(&v70v2, bs70, h, t, "dec-map-v70-p-nil")
  3155. testDeepEqualErr(v70v1, v70v2, t, "equal-map-v70-p-nil")
  3156. // ...
  3157. if v == nil {
  3158. v70v2 = nil
  3159. } else {
  3160. v70v2 = make(map[uint64]uint64, len(v))
  3161. } // reset map
  3162. var v70v3, v70v4 typMapMapUint64Uint64
  3163. v70v3 = typMapMapUint64Uint64(v70v1)
  3164. v70v4 = typMapMapUint64Uint64(v70v2)
  3165. if v != nil {
  3166. bs70 = testMarshalErr(v70v3, h, t, "enc-map-v70-custom")
  3167. testUnmarshalErr(v70v4, bs70, h, t, "dec-map-v70-p-len")
  3168. testDeepEqualErr(v70v3, v70v4, t, "equal-map-v70-p-len")
  3169. }
  3170. }
  3171. for _, v := range []map[uint64]int{nil, {}, {111: 0, 77: 127}} {
  3172. // fmt.Printf(">>>> running mammoth map v71: %v\n", v)
  3173. var v71v1, v71v2 map[uint64]int
  3174. var bs71 []byte
  3175. v71v1 = v
  3176. bs71 = testMarshalErr(v71v1, h, t, "enc-map-v71")
  3177. if v != nil {
  3178. if v == nil {
  3179. v71v2 = nil
  3180. } else {
  3181. v71v2 = make(map[uint64]int, len(v))
  3182. } // reset map
  3183. testUnmarshalErr(v71v2, bs71, h, t, "dec-map-v71")
  3184. testDeepEqualErr(v71v1, v71v2, t, "equal-map-v71")
  3185. if v == nil {
  3186. v71v2 = nil
  3187. } else {
  3188. v71v2 = make(map[uint64]int, len(v))
  3189. } // reset map
  3190. testUnmarshalErr(rv4i(v71v2), bs71, h, t, "dec-map-v71-noaddr") // decode into non-addressable map value
  3191. testDeepEqualErr(v71v1, v71v2, t, "equal-map-v71-noaddr")
  3192. }
  3193. if v == nil {
  3194. v71v2 = nil
  3195. } else {
  3196. v71v2 = make(map[uint64]int, len(v))
  3197. } // reset map
  3198. testUnmarshalErr(&v71v2, bs71, h, t, "dec-map-v71-p-len")
  3199. testDeepEqualErr(v71v1, v71v2, t, "equal-map-v71-p-len")
  3200. bs71 = testMarshalErr(&v71v1, h, t, "enc-map-v71-p")
  3201. v71v2 = nil
  3202. testUnmarshalErr(&v71v2, bs71, h, t, "dec-map-v71-p-nil")
  3203. testDeepEqualErr(v71v1, v71v2, t, "equal-map-v71-p-nil")
  3204. // ...
  3205. if v == nil {
  3206. v71v2 = nil
  3207. } else {
  3208. v71v2 = make(map[uint64]int, len(v))
  3209. } // reset map
  3210. var v71v3, v71v4 typMapMapUint64Int
  3211. v71v3 = typMapMapUint64Int(v71v1)
  3212. v71v4 = typMapMapUint64Int(v71v2)
  3213. if v != nil {
  3214. bs71 = testMarshalErr(v71v3, h, t, "enc-map-v71-custom")
  3215. testUnmarshalErr(v71v4, bs71, h, t, "dec-map-v71-p-len")
  3216. testDeepEqualErr(v71v3, v71v4, t, "equal-map-v71-p-len")
  3217. }
  3218. }
  3219. for _, v := range []map[uint64]int64{nil, {}, {111: 0, 77: 127}} {
  3220. // fmt.Printf(">>>> running mammoth map v72: %v\n", v)
  3221. var v72v1, v72v2 map[uint64]int64
  3222. var bs72 []byte
  3223. v72v1 = v
  3224. bs72 = testMarshalErr(v72v1, h, t, "enc-map-v72")
  3225. if v != nil {
  3226. if v == nil {
  3227. v72v2 = nil
  3228. } else {
  3229. v72v2 = make(map[uint64]int64, len(v))
  3230. } // reset map
  3231. testUnmarshalErr(v72v2, bs72, h, t, "dec-map-v72")
  3232. testDeepEqualErr(v72v1, v72v2, t, "equal-map-v72")
  3233. if v == nil {
  3234. v72v2 = nil
  3235. } else {
  3236. v72v2 = make(map[uint64]int64, len(v))
  3237. } // reset map
  3238. testUnmarshalErr(rv4i(v72v2), bs72, h, t, "dec-map-v72-noaddr") // decode into non-addressable map value
  3239. testDeepEqualErr(v72v1, v72v2, t, "equal-map-v72-noaddr")
  3240. }
  3241. if v == nil {
  3242. v72v2 = nil
  3243. } else {
  3244. v72v2 = make(map[uint64]int64, len(v))
  3245. } // reset map
  3246. testUnmarshalErr(&v72v2, bs72, h, t, "dec-map-v72-p-len")
  3247. testDeepEqualErr(v72v1, v72v2, t, "equal-map-v72-p-len")
  3248. bs72 = testMarshalErr(&v72v1, h, t, "enc-map-v72-p")
  3249. v72v2 = nil
  3250. testUnmarshalErr(&v72v2, bs72, h, t, "dec-map-v72-p-nil")
  3251. testDeepEqualErr(v72v1, v72v2, t, "equal-map-v72-p-nil")
  3252. // ...
  3253. if v == nil {
  3254. v72v2 = nil
  3255. } else {
  3256. v72v2 = make(map[uint64]int64, len(v))
  3257. } // reset map
  3258. var v72v3, v72v4 typMapMapUint64Int64
  3259. v72v3 = typMapMapUint64Int64(v72v1)
  3260. v72v4 = typMapMapUint64Int64(v72v2)
  3261. if v != nil {
  3262. bs72 = testMarshalErr(v72v3, h, t, "enc-map-v72-custom")
  3263. testUnmarshalErr(v72v4, bs72, h, t, "dec-map-v72-p-len")
  3264. testDeepEqualErr(v72v3, v72v4, t, "equal-map-v72-p-len")
  3265. }
  3266. }
  3267. for _, v := range []map[uint64]float32{nil, {}, {111: 0, 77: 33.3e3}} {
  3268. // fmt.Printf(">>>> running mammoth map v73: %v\n", v)
  3269. var v73v1, v73v2 map[uint64]float32
  3270. var bs73 []byte
  3271. v73v1 = v
  3272. bs73 = testMarshalErr(v73v1, h, t, "enc-map-v73")
  3273. if v != nil {
  3274. if v == nil {
  3275. v73v2 = nil
  3276. } else {
  3277. v73v2 = make(map[uint64]float32, len(v))
  3278. } // reset map
  3279. testUnmarshalErr(v73v2, bs73, h, t, "dec-map-v73")
  3280. testDeepEqualErr(v73v1, v73v2, t, "equal-map-v73")
  3281. if v == nil {
  3282. v73v2 = nil
  3283. } else {
  3284. v73v2 = make(map[uint64]float32, len(v))
  3285. } // reset map
  3286. testUnmarshalErr(rv4i(v73v2), bs73, h, t, "dec-map-v73-noaddr") // decode into non-addressable map value
  3287. testDeepEqualErr(v73v1, v73v2, t, "equal-map-v73-noaddr")
  3288. }
  3289. if v == nil {
  3290. v73v2 = nil
  3291. } else {
  3292. v73v2 = make(map[uint64]float32, len(v))
  3293. } // reset map
  3294. testUnmarshalErr(&v73v2, bs73, h, t, "dec-map-v73-p-len")
  3295. testDeepEqualErr(v73v1, v73v2, t, "equal-map-v73-p-len")
  3296. bs73 = testMarshalErr(&v73v1, h, t, "enc-map-v73-p")
  3297. v73v2 = nil
  3298. testUnmarshalErr(&v73v2, bs73, h, t, "dec-map-v73-p-nil")
  3299. testDeepEqualErr(v73v1, v73v2, t, "equal-map-v73-p-nil")
  3300. // ...
  3301. if v == nil {
  3302. v73v2 = nil
  3303. } else {
  3304. v73v2 = make(map[uint64]float32, len(v))
  3305. } // reset map
  3306. var v73v3, v73v4 typMapMapUint64Float32
  3307. v73v3 = typMapMapUint64Float32(v73v1)
  3308. v73v4 = typMapMapUint64Float32(v73v2)
  3309. if v != nil {
  3310. bs73 = testMarshalErr(v73v3, h, t, "enc-map-v73-custom")
  3311. testUnmarshalErr(v73v4, bs73, h, t, "dec-map-v73-p-len")
  3312. testDeepEqualErr(v73v3, v73v4, t, "equal-map-v73-p-len")
  3313. }
  3314. }
  3315. for _, v := range []map[uint64]float64{nil, {}, {127: 0, 111: 11.1}} {
  3316. // fmt.Printf(">>>> running mammoth map v74: %v\n", v)
  3317. var v74v1, v74v2 map[uint64]float64
  3318. var bs74 []byte
  3319. v74v1 = v
  3320. bs74 = testMarshalErr(v74v1, h, t, "enc-map-v74")
  3321. if v != nil {
  3322. if v == nil {
  3323. v74v2 = nil
  3324. } else {
  3325. v74v2 = make(map[uint64]float64, len(v))
  3326. } // reset map
  3327. testUnmarshalErr(v74v2, bs74, h, t, "dec-map-v74")
  3328. testDeepEqualErr(v74v1, v74v2, t, "equal-map-v74")
  3329. if v == nil {
  3330. v74v2 = nil
  3331. } else {
  3332. v74v2 = make(map[uint64]float64, len(v))
  3333. } // reset map
  3334. testUnmarshalErr(rv4i(v74v2), bs74, h, t, "dec-map-v74-noaddr") // decode into non-addressable map value
  3335. testDeepEqualErr(v74v1, v74v2, t, "equal-map-v74-noaddr")
  3336. }
  3337. if v == nil {
  3338. v74v2 = nil
  3339. } else {
  3340. v74v2 = make(map[uint64]float64, len(v))
  3341. } // reset map
  3342. testUnmarshalErr(&v74v2, bs74, h, t, "dec-map-v74-p-len")
  3343. testDeepEqualErr(v74v1, v74v2, t, "equal-map-v74-p-len")
  3344. bs74 = testMarshalErr(&v74v1, h, t, "enc-map-v74-p")
  3345. v74v2 = nil
  3346. testUnmarshalErr(&v74v2, bs74, h, t, "dec-map-v74-p-nil")
  3347. testDeepEqualErr(v74v1, v74v2, t, "equal-map-v74-p-nil")
  3348. // ...
  3349. if v == nil {
  3350. v74v2 = nil
  3351. } else {
  3352. v74v2 = make(map[uint64]float64, len(v))
  3353. } // reset map
  3354. var v74v3, v74v4 typMapMapUint64Float64
  3355. v74v3 = typMapMapUint64Float64(v74v1)
  3356. v74v4 = typMapMapUint64Float64(v74v2)
  3357. if v != nil {
  3358. bs74 = testMarshalErr(v74v3, h, t, "enc-map-v74-custom")
  3359. testUnmarshalErr(v74v4, bs74, h, t, "dec-map-v74-p-len")
  3360. testDeepEqualErr(v74v3, v74v4, t, "equal-map-v74-p-len")
  3361. }
  3362. }
  3363. for _, v := range []map[uint64]bool{nil, {}, {77: false, 127: true}} {
  3364. // fmt.Printf(">>>> running mammoth map v75: %v\n", v)
  3365. var v75v1, v75v2 map[uint64]bool
  3366. var bs75 []byte
  3367. v75v1 = v
  3368. bs75 = testMarshalErr(v75v1, h, t, "enc-map-v75")
  3369. if v != nil {
  3370. if v == nil {
  3371. v75v2 = nil
  3372. } else {
  3373. v75v2 = make(map[uint64]bool, len(v))
  3374. } // reset map
  3375. testUnmarshalErr(v75v2, bs75, h, t, "dec-map-v75")
  3376. testDeepEqualErr(v75v1, v75v2, t, "equal-map-v75")
  3377. if v == nil {
  3378. v75v2 = nil
  3379. } else {
  3380. v75v2 = make(map[uint64]bool, len(v))
  3381. } // reset map
  3382. testUnmarshalErr(rv4i(v75v2), bs75, h, t, "dec-map-v75-noaddr") // decode into non-addressable map value
  3383. testDeepEqualErr(v75v1, v75v2, t, "equal-map-v75-noaddr")
  3384. }
  3385. if v == nil {
  3386. v75v2 = nil
  3387. } else {
  3388. v75v2 = make(map[uint64]bool, len(v))
  3389. } // reset map
  3390. testUnmarshalErr(&v75v2, bs75, h, t, "dec-map-v75-p-len")
  3391. testDeepEqualErr(v75v1, v75v2, t, "equal-map-v75-p-len")
  3392. bs75 = testMarshalErr(&v75v1, h, t, "enc-map-v75-p")
  3393. v75v2 = nil
  3394. testUnmarshalErr(&v75v2, bs75, h, t, "dec-map-v75-p-nil")
  3395. testDeepEqualErr(v75v1, v75v2, t, "equal-map-v75-p-nil")
  3396. // ...
  3397. if v == nil {
  3398. v75v2 = nil
  3399. } else {
  3400. v75v2 = make(map[uint64]bool, len(v))
  3401. } // reset map
  3402. var v75v3, v75v4 typMapMapUint64Bool
  3403. v75v3 = typMapMapUint64Bool(v75v1)
  3404. v75v4 = typMapMapUint64Bool(v75v2)
  3405. if v != nil {
  3406. bs75 = testMarshalErr(v75v3, h, t, "enc-map-v75-custom")
  3407. testUnmarshalErr(v75v4, bs75, h, t, "dec-map-v75-p-len")
  3408. testDeepEqualErr(v75v3, v75v4, t, "equal-map-v75-p-len")
  3409. }
  3410. }
  3411. for _, v := range []map[int]interface{}{nil, {}, {111: nil, 77: "string-is-an-interface-2"}} {
  3412. // fmt.Printf(">>>> running mammoth map v76: %v\n", v)
  3413. var v76v1, v76v2 map[int]interface{}
  3414. var bs76 []byte
  3415. v76v1 = v
  3416. bs76 = testMarshalErr(v76v1, h, t, "enc-map-v76")
  3417. if v != nil {
  3418. if v == nil {
  3419. v76v2 = nil
  3420. } else {
  3421. v76v2 = make(map[int]interface{}, len(v))
  3422. } // reset map
  3423. testUnmarshalErr(v76v2, bs76, h, t, "dec-map-v76")
  3424. testDeepEqualErr(v76v1, v76v2, t, "equal-map-v76")
  3425. if v == nil {
  3426. v76v2 = nil
  3427. } else {
  3428. v76v2 = make(map[int]interface{}, len(v))
  3429. } // reset map
  3430. testUnmarshalErr(rv4i(v76v2), bs76, h, t, "dec-map-v76-noaddr") // decode into non-addressable map value
  3431. testDeepEqualErr(v76v1, v76v2, t, "equal-map-v76-noaddr")
  3432. }
  3433. if v == nil {
  3434. v76v2 = nil
  3435. } else {
  3436. v76v2 = make(map[int]interface{}, len(v))
  3437. } // reset map
  3438. testUnmarshalErr(&v76v2, bs76, h, t, "dec-map-v76-p-len")
  3439. testDeepEqualErr(v76v1, v76v2, t, "equal-map-v76-p-len")
  3440. bs76 = testMarshalErr(&v76v1, h, t, "enc-map-v76-p")
  3441. v76v2 = nil
  3442. testUnmarshalErr(&v76v2, bs76, h, t, "dec-map-v76-p-nil")
  3443. testDeepEqualErr(v76v1, v76v2, t, "equal-map-v76-p-nil")
  3444. // ...
  3445. if v == nil {
  3446. v76v2 = nil
  3447. } else {
  3448. v76v2 = make(map[int]interface{}, len(v))
  3449. } // reset map
  3450. var v76v3, v76v4 typMapMapIntIntf
  3451. v76v3 = typMapMapIntIntf(v76v1)
  3452. v76v4 = typMapMapIntIntf(v76v2)
  3453. if v != nil {
  3454. bs76 = testMarshalErr(v76v3, h, t, "enc-map-v76-custom")
  3455. testUnmarshalErr(v76v4, bs76, h, t, "dec-map-v76-p-len")
  3456. testDeepEqualErr(v76v3, v76v4, t, "equal-map-v76-p-len")
  3457. }
  3458. }
  3459. for _, v := range []map[int]string{nil, {}, {127: "", 111: "some-string-3"}} {
  3460. // fmt.Printf(">>>> running mammoth map v77: %v\n", v)
  3461. var v77v1, v77v2 map[int]string
  3462. var bs77 []byte
  3463. v77v1 = v
  3464. bs77 = testMarshalErr(v77v1, h, t, "enc-map-v77")
  3465. if v != nil {
  3466. if v == nil {
  3467. v77v2 = nil
  3468. } else {
  3469. v77v2 = make(map[int]string, len(v))
  3470. } // reset map
  3471. testUnmarshalErr(v77v2, bs77, h, t, "dec-map-v77")
  3472. testDeepEqualErr(v77v1, v77v2, t, "equal-map-v77")
  3473. if v == nil {
  3474. v77v2 = nil
  3475. } else {
  3476. v77v2 = make(map[int]string, len(v))
  3477. } // reset map
  3478. testUnmarshalErr(rv4i(v77v2), bs77, h, t, "dec-map-v77-noaddr") // decode into non-addressable map value
  3479. testDeepEqualErr(v77v1, v77v2, t, "equal-map-v77-noaddr")
  3480. }
  3481. if v == nil {
  3482. v77v2 = nil
  3483. } else {
  3484. v77v2 = make(map[int]string, len(v))
  3485. } // reset map
  3486. testUnmarshalErr(&v77v2, bs77, h, t, "dec-map-v77-p-len")
  3487. testDeepEqualErr(v77v1, v77v2, t, "equal-map-v77-p-len")
  3488. bs77 = testMarshalErr(&v77v1, h, t, "enc-map-v77-p")
  3489. v77v2 = nil
  3490. testUnmarshalErr(&v77v2, bs77, h, t, "dec-map-v77-p-nil")
  3491. testDeepEqualErr(v77v1, v77v2, t, "equal-map-v77-p-nil")
  3492. // ...
  3493. if v == nil {
  3494. v77v2 = nil
  3495. } else {
  3496. v77v2 = make(map[int]string, len(v))
  3497. } // reset map
  3498. var v77v3, v77v4 typMapMapIntString
  3499. v77v3 = typMapMapIntString(v77v1)
  3500. v77v4 = typMapMapIntString(v77v2)
  3501. if v != nil {
  3502. bs77 = testMarshalErr(v77v3, h, t, "enc-map-v77-custom")
  3503. testUnmarshalErr(v77v4, bs77, h, t, "dec-map-v77-p-len")
  3504. testDeepEqualErr(v77v3, v77v4, t, "equal-map-v77-p-len")
  3505. }
  3506. }
  3507. for _, v := range []map[int][]byte{nil, {}, {77: nil, 127: []byte("some-string-2")}} {
  3508. // fmt.Printf(">>>> running mammoth map v78: %v\n", v)
  3509. var v78v1, v78v2 map[int][]byte
  3510. var bs78 []byte
  3511. v78v1 = v
  3512. bs78 = testMarshalErr(v78v1, h, t, "enc-map-v78")
  3513. if v != nil {
  3514. if v == nil {
  3515. v78v2 = nil
  3516. } else {
  3517. v78v2 = make(map[int][]byte, len(v))
  3518. } // reset map
  3519. testUnmarshalErr(v78v2, bs78, h, t, "dec-map-v78")
  3520. testDeepEqualErr(v78v1, v78v2, t, "equal-map-v78")
  3521. if v == nil {
  3522. v78v2 = nil
  3523. } else {
  3524. v78v2 = make(map[int][]byte, len(v))
  3525. } // reset map
  3526. testUnmarshalErr(rv4i(v78v2), bs78, h, t, "dec-map-v78-noaddr") // decode into non-addressable map value
  3527. testDeepEqualErr(v78v1, v78v2, t, "equal-map-v78-noaddr")
  3528. }
  3529. if v == nil {
  3530. v78v2 = nil
  3531. } else {
  3532. v78v2 = make(map[int][]byte, len(v))
  3533. } // reset map
  3534. testUnmarshalErr(&v78v2, bs78, h, t, "dec-map-v78-p-len")
  3535. testDeepEqualErr(v78v1, v78v2, t, "equal-map-v78-p-len")
  3536. bs78 = testMarshalErr(&v78v1, h, t, "enc-map-v78-p")
  3537. v78v2 = nil
  3538. testUnmarshalErr(&v78v2, bs78, h, t, "dec-map-v78-p-nil")
  3539. testDeepEqualErr(v78v1, v78v2, t, "equal-map-v78-p-nil")
  3540. // ...
  3541. if v == nil {
  3542. v78v2 = nil
  3543. } else {
  3544. v78v2 = make(map[int][]byte, len(v))
  3545. } // reset map
  3546. var v78v3, v78v4 typMapMapIntBytes
  3547. v78v3 = typMapMapIntBytes(v78v1)
  3548. v78v4 = typMapMapIntBytes(v78v2)
  3549. if v != nil {
  3550. bs78 = testMarshalErr(v78v3, h, t, "enc-map-v78-custom")
  3551. testUnmarshalErr(v78v4, bs78, h, t, "dec-map-v78-p-len")
  3552. testDeepEqualErr(v78v3, v78v4, t, "equal-map-v78-p-len")
  3553. }
  3554. }
  3555. for _, v := range []map[int]uint{nil, {}, {111: 0, 77: 127}} {
  3556. // fmt.Printf(">>>> running mammoth map v79: %v\n", v)
  3557. var v79v1, v79v2 map[int]uint
  3558. var bs79 []byte
  3559. v79v1 = v
  3560. bs79 = testMarshalErr(v79v1, h, t, "enc-map-v79")
  3561. if v != nil {
  3562. if v == nil {
  3563. v79v2 = nil
  3564. } else {
  3565. v79v2 = make(map[int]uint, len(v))
  3566. } // reset map
  3567. testUnmarshalErr(v79v2, bs79, h, t, "dec-map-v79")
  3568. testDeepEqualErr(v79v1, v79v2, t, "equal-map-v79")
  3569. if v == nil {
  3570. v79v2 = nil
  3571. } else {
  3572. v79v2 = make(map[int]uint, len(v))
  3573. } // reset map
  3574. testUnmarshalErr(rv4i(v79v2), bs79, h, t, "dec-map-v79-noaddr") // decode into non-addressable map value
  3575. testDeepEqualErr(v79v1, v79v2, t, "equal-map-v79-noaddr")
  3576. }
  3577. if v == nil {
  3578. v79v2 = nil
  3579. } else {
  3580. v79v2 = make(map[int]uint, len(v))
  3581. } // reset map
  3582. testUnmarshalErr(&v79v2, bs79, h, t, "dec-map-v79-p-len")
  3583. testDeepEqualErr(v79v1, v79v2, t, "equal-map-v79-p-len")
  3584. bs79 = testMarshalErr(&v79v1, h, t, "enc-map-v79-p")
  3585. v79v2 = nil
  3586. testUnmarshalErr(&v79v2, bs79, h, t, "dec-map-v79-p-nil")
  3587. testDeepEqualErr(v79v1, v79v2, t, "equal-map-v79-p-nil")
  3588. // ...
  3589. if v == nil {
  3590. v79v2 = nil
  3591. } else {
  3592. v79v2 = make(map[int]uint, len(v))
  3593. } // reset map
  3594. var v79v3, v79v4 typMapMapIntUint
  3595. v79v3 = typMapMapIntUint(v79v1)
  3596. v79v4 = typMapMapIntUint(v79v2)
  3597. if v != nil {
  3598. bs79 = testMarshalErr(v79v3, h, t, "enc-map-v79-custom")
  3599. testUnmarshalErr(v79v4, bs79, h, t, "dec-map-v79-p-len")
  3600. testDeepEqualErr(v79v3, v79v4, t, "equal-map-v79-p-len")
  3601. }
  3602. }
  3603. for _, v := range []map[int]uint8{nil, {}, {111: 0, 77: 127}} {
  3604. // fmt.Printf(">>>> running mammoth map v80: %v\n", v)
  3605. var v80v1, v80v2 map[int]uint8
  3606. var bs80 []byte
  3607. v80v1 = v
  3608. bs80 = testMarshalErr(v80v1, h, t, "enc-map-v80")
  3609. if v != nil {
  3610. if v == nil {
  3611. v80v2 = nil
  3612. } else {
  3613. v80v2 = make(map[int]uint8, len(v))
  3614. } // reset map
  3615. testUnmarshalErr(v80v2, bs80, h, t, "dec-map-v80")
  3616. testDeepEqualErr(v80v1, v80v2, t, "equal-map-v80")
  3617. if v == nil {
  3618. v80v2 = nil
  3619. } else {
  3620. v80v2 = make(map[int]uint8, len(v))
  3621. } // reset map
  3622. testUnmarshalErr(rv4i(v80v2), bs80, h, t, "dec-map-v80-noaddr") // decode into non-addressable map value
  3623. testDeepEqualErr(v80v1, v80v2, t, "equal-map-v80-noaddr")
  3624. }
  3625. if v == nil {
  3626. v80v2 = nil
  3627. } else {
  3628. v80v2 = make(map[int]uint8, len(v))
  3629. } // reset map
  3630. testUnmarshalErr(&v80v2, bs80, h, t, "dec-map-v80-p-len")
  3631. testDeepEqualErr(v80v1, v80v2, t, "equal-map-v80-p-len")
  3632. bs80 = testMarshalErr(&v80v1, h, t, "enc-map-v80-p")
  3633. v80v2 = nil
  3634. testUnmarshalErr(&v80v2, bs80, h, t, "dec-map-v80-p-nil")
  3635. testDeepEqualErr(v80v1, v80v2, t, "equal-map-v80-p-nil")
  3636. // ...
  3637. if v == nil {
  3638. v80v2 = nil
  3639. } else {
  3640. v80v2 = make(map[int]uint8, len(v))
  3641. } // reset map
  3642. var v80v3, v80v4 typMapMapIntUint8
  3643. v80v3 = typMapMapIntUint8(v80v1)
  3644. v80v4 = typMapMapIntUint8(v80v2)
  3645. if v != nil {
  3646. bs80 = testMarshalErr(v80v3, h, t, "enc-map-v80-custom")
  3647. testUnmarshalErr(v80v4, bs80, h, t, "dec-map-v80-p-len")
  3648. testDeepEqualErr(v80v3, v80v4, t, "equal-map-v80-p-len")
  3649. }
  3650. }
  3651. for _, v := range []map[int]uint64{nil, {}, {111: 0, 77: 127}} {
  3652. // fmt.Printf(">>>> running mammoth map v81: %v\n", v)
  3653. var v81v1, v81v2 map[int]uint64
  3654. var bs81 []byte
  3655. v81v1 = v
  3656. bs81 = testMarshalErr(v81v1, h, t, "enc-map-v81")
  3657. if v != nil {
  3658. if v == nil {
  3659. v81v2 = nil
  3660. } else {
  3661. v81v2 = make(map[int]uint64, len(v))
  3662. } // reset map
  3663. testUnmarshalErr(v81v2, bs81, h, t, "dec-map-v81")
  3664. testDeepEqualErr(v81v1, v81v2, t, "equal-map-v81")
  3665. if v == nil {
  3666. v81v2 = nil
  3667. } else {
  3668. v81v2 = make(map[int]uint64, len(v))
  3669. } // reset map
  3670. testUnmarshalErr(rv4i(v81v2), bs81, h, t, "dec-map-v81-noaddr") // decode into non-addressable map value
  3671. testDeepEqualErr(v81v1, v81v2, t, "equal-map-v81-noaddr")
  3672. }
  3673. if v == nil {
  3674. v81v2 = nil
  3675. } else {
  3676. v81v2 = make(map[int]uint64, len(v))
  3677. } // reset map
  3678. testUnmarshalErr(&v81v2, bs81, h, t, "dec-map-v81-p-len")
  3679. testDeepEqualErr(v81v1, v81v2, t, "equal-map-v81-p-len")
  3680. bs81 = testMarshalErr(&v81v1, h, t, "enc-map-v81-p")
  3681. v81v2 = nil
  3682. testUnmarshalErr(&v81v2, bs81, h, t, "dec-map-v81-p-nil")
  3683. testDeepEqualErr(v81v1, v81v2, t, "equal-map-v81-p-nil")
  3684. // ...
  3685. if v == nil {
  3686. v81v2 = nil
  3687. } else {
  3688. v81v2 = make(map[int]uint64, len(v))
  3689. } // reset map
  3690. var v81v3, v81v4 typMapMapIntUint64
  3691. v81v3 = typMapMapIntUint64(v81v1)
  3692. v81v4 = typMapMapIntUint64(v81v2)
  3693. if v != nil {
  3694. bs81 = testMarshalErr(v81v3, h, t, "enc-map-v81-custom")
  3695. testUnmarshalErr(v81v4, bs81, h, t, "dec-map-v81-p-len")
  3696. testDeepEqualErr(v81v3, v81v4, t, "equal-map-v81-p-len")
  3697. }
  3698. }
  3699. for _, v := range []map[int]int{nil, {}, {111: 0, 77: 127}} {
  3700. // fmt.Printf(">>>> running mammoth map v82: %v\n", v)
  3701. var v82v1, v82v2 map[int]int
  3702. var bs82 []byte
  3703. v82v1 = v
  3704. bs82 = testMarshalErr(v82v1, h, t, "enc-map-v82")
  3705. if v != nil {
  3706. if v == nil {
  3707. v82v2 = nil
  3708. } else {
  3709. v82v2 = make(map[int]int, len(v))
  3710. } // reset map
  3711. testUnmarshalErr(v82v2, bs82, h, t, "dec-map-v82")
  3712. testDeepEqualErr(v82v1, v82v2, t, "equal-map-v82")
  3713. if v == nil {
  3714. v82v2 = nil
  3715. } else {
  3716. v82v2 = make(map[int]int, len(v))
  3717. } // reset map
  3718. testUnmarshalErr(rv4i(v82v2), bs82, h, t, "dec-map-v82-noaddr") // decode into non-addressable map value
  3719. testDeepEqualErr(v82v1, v82v2, t, "equal-map-v82-noaddr")
  3720. }
  3721. if v == nil {
  3722. v82v2 = nil
  3723. } else {
  3724. v82v2 = make(map[int]int, len(v))
  3725. } // reset map
  3726. testUnmarshalErr(&v82v2, bs82, h, t, "dec-map-v82-p-len")
  3727. testDeepEqualErr(v82v1, v82v2, t, "equal-map-v82-p-len")
  3728. bs82 = testMarshalErr(&v82v1, h, t, "enc-map-v82-p")
  3729. v82v2 = nil
  3730. testUnmarshalErr(&v82v2, bs82, h, t, "dec-map-v82-p-nil")
  3731. testDeepEqualErr(v82v1, v82v2, t, "equal-map-v82-p-nil")
  3732. // ...
  3733. if v == nil {
  3734. v82v2 = nil
  3735. } else {
  3736. v82v2 = make(map[int]int, len(v))
  3737. } // reset map
  3738. var v82v3, v82v4 typMapMapIntInt
  3739. v82v3 = typMapMapIntInt(v82v1)
  3740. v82v4 = typMapMapIntInt(v82v2)
  3741. if v != nil {
  3742. bs82 = testMarshalErr(v82v3, h, t, "enc-map-v82-custom")
  3743. testUnmarshalErr(v82v4, bs82, h, t, "dec-map-v82-p-len")
  3744. testDeepEqualErr(v82v3, v82v4, t, "equal-map-v82-p-len")
  3745. }
  3746. }
  3747. for _, v := range []map[int]int64{nil, {}, {111: 0, 77: 127}} {
  3748. // fmt.Printf(">>>> running mammoth map v83: %v\n", v)
  3749. var v83v1, v83v2 map[int]int64
  3750. var bs83 []byte
  3751. v83v1 = v
  3752. bs83 = testMarshalErr(v83v1, h, t, "enc-map-v83")
  3753. if v != nil {
  3754. if v == nil {
  3755. v83v2 = nil
  3756. } else {
  3757. v83v2 = make(map[int]int64, len(v))
  3758. } // reset map
  3759. testUnmarshalErr(v83v2, bs83, h, t, "dec-map-v83")
  3760. testDeepEqualErr(v83v1, v83v2, t, "equal-map-v83")
  3761. if v == nil {
  3762. v83v2 = nil
  3763. } else {
  3764. v83v2 = make(map[int]int64, len(v))
  3765. } // reset map
  3766. testUnmarshalErr(rv4i(v83v2), bs83, h, t, "dec-map-v83-noaddr") // decode into non-addressable map value
  3767. testDeepEqualErr(v83v1, v83v2, t, "equal-map-v83-noaddr")
  3768. }
  3769. if v == nil {
  3770. v83v2 = nil
  3771. } else {
  3772. v83v2 = make(map[int]int64, len(v))
  3773. } // reset map
  3774. testUnmarshalErr(&v83v2, bs83, h, t, "dec-map-v83-p-len")
  3775. testDeepEqualErr(v83v1, v83v2, t, "equal-map-v83-p-len")
  3776. bs83 = testMarshalErr(&v83v1, h, t, "enc-map-v83-p")
  3777. v83v2 = nil
  3778. testUnmarshalErr(&v83v2, bs83, h, t, "dec-map-v83-p-nil")
  3779. testDeepEqualErr(v83v1, v83v2, t, "equal-map-v83-p-nil")
  3780. // ...
  3781. if v == nil {
  3782. v83v2 = nil
  3783. } else {
  3784. v83v2 = make(map[int]int64, len(v))
  3785. } // reset map
  3786. var v83v3, v83v4 typMapMapIntInt64
  3787. v83v3 = typMapMapIntInt64(v83v1)
  3788. v83v4 = typMapMapIntInt64(v83v2)
  3789. if v != nil {
  3790. bs83 = testMarshalErr(v83v3, h, t, "enc-map-v83-custom")
  3791. testUnmarshalErr(v83v4, bs83, h, t, "dec-map-v83-p-len")
  3792. testDeepEqualErr(v83v3, v83v4, t, "equal-map-v83-p-len")
  3793. }
  3794. }
  3795. for _, v := range []map[int]float32{nil, {}, {111: 0, 77: 22.2}} {
  3796. // fmt.Printf(">>>> running mammoth map v84: %v\n", v)
  3797. var v84v1, v84v2 map[int]float32
  3798. var bs84 []byte
  3799. v84v1 = v
  3800. bs84 = testMarshalErr(v84v1, h, t, "enc-map-v84")
  3801. if v != nil {
  3802. if v == nil {
  3803. v84v2 = nil
  3804. } else {
  3805. v84v2 = make(map[int]float32, len(v))
  3806. } // reset map
  3807. testUnmarshalErr(v84v2, bs84, h, t, "dec-map-v84")
  3808. testDeepEqualErr(v84v1, v84v2, t, "equal-map-v84")
  3809. if v == nil {
  3810. v84v2 = nil
  3811. } else {
  3812. v84v2 = make(map[int]float32, len(v))
  3813. } // reset map
  3814. testUnmarshalErr(rv4i(v84v2), bs84, h, t, "dec-map-v84-noaddr") // decode into non-addressable map value
  3815. testDeepEqualErr(v84v1, v84v2, t, "equal-map-v84-noaddr")
  3816. }
  3817. if v == nil {
  3818. v84v2 = nil
  3819. } else {
  3820. v84v2 = make(map[int]float32, len(v))
  3821. } // reset map
  3822. testUnmarshalErr(&v84v2, bs84, h, t, "dec-map-v84-p-len")
  3823. testDeepEqualErr(v84v1, v84v2, t, "equal-map-v84-p-len")
  3824. bs84 = testMarshalErr(&v84v1, h, t, "enc-map-v84-p")
  3825. v84v2 = nil
  3826. testUnmarshalErr(&v84v2, bs84, h, t, "dec-map-v84-p-nil")
  3827. testDeepEqualErr(v84v1, v84v2, t, "equal-map-v84-p-nil")
  3828. // ...
  3829. if v == nil {
  3830. v84v2 = nil
  3831. } else {
  3832. v84v2 = make(map[int]float32, len(v))
  3833. } // reset map
  3834. var v84v3, v84v4 typMapMapIntFloat32
  3835. v84v3 = typMapMapIntFloat32(v84v1)
  3836. v84v4 = typMapMapIntFloat32(v84v2)
  3837. if v != nil {
  3838. bs84 = testMarshalErr(v84v3, h, t, "enc-map-v84-custom")
  3839. testUnmarshalErr(v84v4, bs84, h, t, "dec-map-v84-p-len")
  3840. testDeepEqualErr(v84v3, v84v4, t, "equal-map-v84-p-len")
  3841. }
  3842. }
  3843. for _, v := range []map[int]float64{nil, {}, {127: 0, 111: 33.3e3}} {
  3844. // fmt.Printf(">>>> running mammoth map v85: %v\n", v)
  3845. var v85v1, v85v2 map[int]float64
  3846. var bs85 []byte
  3847. v85v1 = v
  3848. bs85 = testMarshalErr(v85v1, h, t, "enc-map-v85")
  3849. if v != nil {
  3850. if v == nil {
  3851. v85v2 = nil
  3852. } else {
  3853. v85v2 = make(map[int]float64, len(v))
  3854. } // reset map
  3855. testUnmarshalErr(v85v2, bs85, h, t, "dec-map-v85")
  3856. testDeepEqualErr(v85v1, v85v2, t, "equal-map-v85")
  3857. if v == nil {
  3858. v85v2 = nil
  3859. } else {
  3860. v85v2 = make(map[int]float64, len(v))
  3861. } // reset map
  3862. testUnmarshalErr(rv4i(v85v2), bs85, h, t, "dec-map-v85-noaddr") // decode into non-addressable map value
  3863. testDeepEqualErr(v85v1, v85v2, t, "equal-map-v85-noaddr")
  3864. }
  3865. if v == nil {
  3866. v85v2 = nil
  3867. } else {
  3868. v85v2 = make(map[int]float64, len(v))
  3869. } // reset map
  3870. testUnmarshalErr(&v85v2, bs85, h, t, "dec-map-v85-p-len")
  3871. testDeepEqualErr(v85v1, v85v2, t, "equal-map-v85-p-len")
  3872. bs85 = testMarshalErr(&v85v1, h, t, "enc-map-v85-p")
  3873. v85v2 = nil
  3874. testUnmarshalErr(&v85v2, bs85, h, t, "dec-map-v85-p-nil")
  3875. testDeepEqualErr(v85v1, v85v2, t, "equal-map-v85-p-nil")
  3876. // ...
  3877. if v == nil {
  3878. v85v2 = nil
  3879. } else {
  3880. v85v2 = make(map[int]float64, len(v))
  3881. } // reset map
  3882. var v85v3, v85v4 typMapMapIntFloat64
  3883. v85v3 = typMapMapIntFloat64(v85v1)
  3884. v85v4 = typMapMapIntFloat64(v85v2)
  3885. if v != nil {
  3886. bs85 = testMarshalErr(v85v3, h, t, "enc-map-v85-custom")
  3887. testUnmarshalErr(v85v4, bs85, h, t, "dec-map-v85-p-len")
  3888. testDeepEqualErr(v85v3, v85v4, t, "equal-map-v85-p-len")
  3889. }
  3890. }
  3891. for _, v := range []map[int]bool{nil, {}, {77: false, 127: false}} {
  3892. // fmt.Printf(">>>> running mammoth map v86: %v\n", v)
  3893. var v86v1, v86v2 map[int]bool
  3894. var bs86 []byte
  3895. v86v1 = v
  3896. bs86 = testMarshalErr(v86v1, h, t, "enc-map-v86")
  3897. if v != nil {
  3898. if v == nil {
  3899. v86v2 = nil
  3900. } else {
  3901. v86v2 = make(map[int]bool, len(v))
  3902. } // reset map
  3903. testUnmarshalErr(v86v2, bs86, h, t, "dec-map-v86")
  3904. testDeepEqualErr(v86v1, v86v2, t, "equal-map-v86")
  3905. if v == nil {
  3906. v86v2 = nil
  3907. } else {
  3908. v86v2 = make(map[int]bool, len(v))
  3909. } // reset map
  3910. testUnmarshalErr(rv4i(v86v2), bs86, h, t, "dec-map-v86-noaddr") // decode into non-addressable map value
  3911. testDeepEqualErr(v86v1, v86v2, t, "equal-map-v86-noaddr")
  3912. }
  3913. if v == nil {
  3914. v86v2 = nil
  3915. } else {
  3916. v86v2 = make(map[int]bool, len(v))
  3917. } // reset map
  3918. testUnmarshalErr(&v86v2, bs86, h, t, "dec-map-v86-p-len")
  3919. testDeepEqualErr(v86v1, v86v2, t, "equal-map-v86-p-len")
  3920. bs86 = testMarshalErr(&v86v1, h, t, "enc-map-v86-p")
  3921. v86v2 = nil
  3922. testUnmarshalErr(&v86v2, bs86, h, t, "dec-map-v86-p-nil")
  3923. testDeepEqualErr(v86v1, v86v2, t, "equal-map-v86-p-nil")
  3924. // ...
  3925. if v == nil {
  3926. v86v2 = nil
  3927. } else {
  3928. v86v2 = make(map[int]bool, len(v))
  3929. } // reset map
  3930. var v86v3, v86v4 typMapMapIntBool
  3931. v86v3 = typMapMapIntBool(v86v1)
  3932. v86v4 = typMapMapIntBool(v86v2)
  3933. if v != nil {
  3934. bs86 = testMarshalErr(v86v3, h, t, "enc-map-v86-custom")
  3935. testUnmarshalErr(v86v4, bs86, h, t, "dec-map-v86-p-len")
  3936. testDeepEqualErr(v86v3, v86v4, t, "equal-map-v86-p-len")
  3937. }
  3938. }
  3939. for _, v := range []map[int64]interface{}{nil, {}, {111: nil, 77: "string-is-an-interface-3"}} {
  3940. // fmt.Printf(">>>> running mammoth map v87: %v\n", v)
  3941. var v87v1, v87v2 map[int64]interface{}
  3942. var bs87 []byte
  3943. v87v1 = v
  3944. bs87 = testMarshalErr(v87v1, h, t, "enc-map-v87")
  3945. if v != nil {
  3946. if v == nil {
  3947. v87v2 = nil
  3948. } else {
  3949. v87v2 = make(map[int64]interface{}, len(v))
  3950. } // reset map
  3951. testUnmarshalErr(v87v2, bs87, h, t, "dec-map-v87")
  3952. testDeepEqualErr(v87v1, v87v2, t, "equal-map-v87")
  3953. if v == nil {
  3954. v87v2 = nil
  3955. } else {
  3956. v87v2 = make(map[int64]interface{}, len(v))
  3957. } // reset map
  3958. testUnmarshalErr(rv4i(v87v2), bs87, h, t, "dec-map-v87-noaddr") // decode into non-addressable map value
  3959. testDeepEqualErr(v87v1, v87v2, t, "equal-map-v87-noaddr")
  3960. }
  3961. if v == nil {
  3962. v87v2 = nil
  3963. } else {
  3964. v87v2 = make(map[int64]interface{}, len(v))
  3965. } // reset map
  3966. testUnmarshalErr(&v87v2, bs87, h, t, "dec-map-v87-p-len")
  3967. testDeepEqualErr(v87v1, v87v2, t, "equal-map-v87-p-len")
  3968. bs87 = testMarshalErr(&v87v1, h, t, "enc-map-v87-p")
  3969. v87v2 = nil
  3970. testUnmarshalErr(&v87v2, bs87, h, t, "dec-map-v87-p-nil")
  3971. testDeepEqualErr(v87v1, v87v2, t, "equal-map-v87-p-nil")
  3972. // ...
  3973. if v == nil {
  3974. v87v2 = nil
  3975. } else {
  3976. v87v2 = make(map[int64]interface{}, len(v))
  3977. } // reset map
  3978. var v87v3, v87v4 typMapMapInt64Intf
  3979. v87v3 = typMapMapInt64Intf(v87v1)
  3980. v87v4 = typMapMapInt64Intf(v87v2)
  3981. if v != nil {
  3982. bs87 = testMarshalErr(v87v3, h, t, "enc-map-v87-custom")
  3983. testUnmarshalErr(v87v4, bs87, h, t, "dec-map-v87-p-len")
  3984. testDeepEqualErr(v87v3, v87v4, t, "equal-map-v87-p-len")
  3985. }
  3986. }
  3987. for _, v := range []map[int64]string{nil, {}, {127: "", 111: "some-string-1"}} {
  3988. // fmt.Printf(">>>> running mammoth map v88: %v\n", v)
  3989. var v88v1, v88v2 map[int64]string
  3990. var bs88 []byte
  3991. v88v1 = v
  3992. bs88 = testMarshalErr(v88v1, h, t, "enc-map-v88")
  3993. if v != nil {
  3994. if v == nil {
  3995. v88v2 = nil
  3996. } else {
  3997. v88v2 = make(map[int64]string, len(v))
  3998. } // reset map
  3999. testUnmarshalErr(v88v2, bs88, h, t, "dec-map-v88")
  4000. testDeepEqualErr(v88v1, v88v2, t, "equal-map-v88")
  4001. if v == nil {
  4002. v88v2 = nil
  4003. } else {
  4004. v88v2 = make(map[int64]string, len(v))
  4005. } // reset map
  4006. testUnmarshalErr(rv4i(v88v2), bs88, h, t, "dec-map-v88-noaddr") // decode into non-addressable map value
  4007. testDeepEqualErr(v88v1, v88v2, t, "equal-map-v88-noaddr")
  4008. }
  4009. if v == nil {
  4010. v88v2 = nil
  4011. } else {
  4012. v88v2 = make(map[int64]string, len(v))
  4013. } // reset map
  4014. testUnmarshalErr(&v88v2, bs88, h, t, "dec-map-v88-p-len")
  4015. testDeepEqualErr(v88v1, v88v2, t, "equal-map-v88-p-len")
  4016. bs88 = testMarshalErr(&v88v1, h, t, "enc-map-v88-p")
  4017. v88v2 = nil
  4018. testUnmarshalErr(&v88v2, bs88, h, t, "dec-map-v88-p-nil")
  4019. testDeepEqualErr(v88v1, v88v2, t, "equal-map-v88-p-nil")
  4020. // ...
  4021. if v == nil {
  4022. v88v2 = nil
  4023. } else {
  4024. v88v2 = make(map[int64]string, len(v))
  4025. } // reset map
  4026. var v88v3, v88v4 typMapMapInt64String
  4027. v88v3 = typMapMapInt64String(v88v1)
  4028. v88v4 = typMapMapInt64String(v88v2)
  4029. if v != nil {
  4030. bs88 = testMarshalErr(v88v3, h, t, "enc-map-v88-custom")
  4031. testUnmarshalErr(v88v4, bs88, h, t, "dec-map-v88-p-len")
  4032. testDeepEqualErr(v88v3, v88v4, t, "equal-map-v88-p-len")
  4033. }
  4034. }
  4035. for _, v := range []map[int64][]byte{nil, {}, {77: nil, 127: []byte("some-string-3")}} {
  4036. // fmt.Printf(">>>> running mammoth map v89: %v\n", v)
  4037. var v89v1, v89v2 map[int64][]byte
  4038. var bs89 []byte
  4039. v89v1 = v
  4040. bs89 = testMarshalErr(v89v1, h, t, "enc-map-v89")
  4041. if v != nil {
  4042. if v == nil {
  4043. v89v2 = nil
  4044. } else {
  4045. v89v2 = make(map[int64][]byte, len(v))
  4046. } // reset map
  4047. testUnmarshalErr(v89v2, bs89, h, t, "dec-map-v89")
  4048. testDeepEqualErr(v89v1, v89v2, t, "equal-map-v89")
  4049. if v == nil {
  4050. v89v2 = nil
  4051. } else {
  4052. v89v2 = make(map[int64][]byte, len(v))
  4053. } // reset map
  4054. testUnmarshalErr(rv4i(v89v2), bs89, h, t, "dec-map-v89-noaddr") // decode into non-addressable map value
  4055. testDeepEqualErr(v89v1, v89v2, t, "equal-map-v89-noaddr")
  4056. }
  4057. if v == nil {
  4058. v89v2 = nil
  4059. } else {
  4060. v89v2 = make(map[int64][]byte, len(v))
  4061. } // reset map
  4062. testUnmarshalErr(&v89v2, bs89, h, t, "dec-map-v89-p-len")
  4063. testDeepEqualErr(v89v1, v89v2, t, "equal-map-v89-p-len")
  4064. bs89 = testMarshalErr(&v89v1, h, t, "enc-map-v89-p")
  4065. v89v2 = nil
  4066. testUnmarshalErr(&v89v2, bs89, h, t, "dec-map-v89-p-nil")
  4067. testDeepEqualErr(v89v1, v89v2, t, "equal-map-v89-p-nil")
  4068. // ...
  4069. if v == nil {
  4070. v89v2 = nil
  4071. } else {
  4072. v89v2 = make(map[int64][]byte, len(v))
  4073. } // reset map
  4074. var v89v3, v89v4 typMapMapInt64Bytes
  4075. v89v3 = typMapMapInt64Bytes(v89v1)
  4076. v89v4 = typMapMapInt64Bytes(v89v2)
  4077. if v != nil {
  4078. bs89 = testMarshalErr(v89v3, h, t, "enc-map-v89-custom")
  4079. testUnmarshalErr(v89v4, bs89, h, t, "dec-map-v89-p-len")
  4080. testDeepEqualErr(v89v3, v89v4, t, "equal-map-v89-p-len")
  4081. }
  4082. }
  4083. for _, v := range []map[int64]uint{nil, {}, {111: 0, 77: 127}} {
  4084. // fmt.Printf(">>>> running mammoth map v90: %v\n", v)
  4085. var v90v1, v90v2 map[int64]uint
  4086. var bs90 []byte
  4087. v90v1 = v
  4088. bs90 = testMarshalErr(v90v1, h, t, "enc-map-v90")
  4089. if v != nil {
  4090. if v == nil {
  4091. v90v2 = nil
  4092. } else {
  4093. v90v2 = make(map[int64]uint, len(v))
  4094. } // reset map
  4095. testUnmarshalErr(v90v2, bs90, h, t, "dec-map-v90")
  4096. testDeepEqualErr(v90v1, v90v2, t, "equal-map-v90")
  4097. if v == nil {
  4098. v90v2 = nil
  4099. } else {
  4100. v90v2 = make(map[int64]uint, len(v))
  4101. } // reset map
  4102. testUnmarshalErr(rv4i(v90v2), bs90, h, t, "dec-map-v90-noaddr") // decode into non-addressable map value
  4103. testDeepEqualErr(v90v1, v90v2, t, "equal-map-v90-noaddr")
  4104. }
  4105. if v == nil {
  4106. v90v2 = nil
  4107. } else {
  4108. v90v2 = make(map[int64]uint, len(v))
  4109. } // reset map
  4110. testUnmarshalErr(&v90v2, bs90, h, t, "dec-map-v90-p-len")
  4111. testDeepEqualErr(v90v1, v90v2, t, "equal-map-v90-p-len")
  4112. bs90 = testMarshalErr(&v90v1, h, t, "enc-map-v90-p")
  4113. v90v2 = nil
  4114. testUnmarshalErr(&v90v2, bs90, h, t, "dec-map-v90-p-nil")
  4115. testDeepEqualErr(v90v1, v90v2, t, "equal-map-v90-p-nil")
  4116. // ...
  4117. if v == nil {
  4118. v90v2 = nil
  4119. } else {
  4120. v90v2 = make(map[int64]uint, len(v))
  4121. } // reset map
  4122. var v90v3, v90v4 typMapMapInt64Uint
  4123. v90v3 = typMapMapInt64Uint(v90v1)
  4124. v90v4 = typMapMapInt64Uint(v90v2)
  4125. if v != nil {
  4126. bs90 = testMarshalErr(v90v3, h, t, "enc-map-v90-custom")
  4127. testUnmarshalErr(v90v4, bs90, h, t, "dec-map-v90-p-len")
  4128. testDeepEqualErr(v90v3, v90v4, t, "equal-map-v90-p-len")
  4129. }
  4130. }
  4131. for _, v := range []map[int64]uint8{nil, {}, {111: 0, 77: 127}} {
  4132. // fmt.Printf(">>>> running mammoth map v91: %v\n", v)
  4133. var v91v1, v91v2 map[int64]uint8
  4134. var bs91 []byte
  4135. v91v1 = v
  4136. bs91 = testMarshalErr(v91v1, h, t, "enc-map-v91")
  4137. if v != nil {
  4138. if v == nil {
  4139. v91v2 = nil
  4140. } else {
  4141. v91v2 = make(map[int64]uint8, len(v))
  4142. } // reset map
  4143. testUnmarshalErr(v91v2, bs91, h, t, "dec-map-v91")
  4144. testDeepEqualErr(v91v1, v91v2, t, "equal-map-v91")
  4145. if v == nil {
  4146. v91v2 = nil
  4147. } else {
  4148. v91v2 = make(map[int64]uint8, len(v))
  4149. } // reset map
  4150. testUnmarshalErr(rv4i(v91v2), bs91, h, t, "dec-map-v91-noaddr") // decode into non-addressable map value
  4151. testDeepEqualErr(v91v1, v91v2, t, "equal-map-v91-noaddr")
  4152. }
  4153. if v == nil {
  4154. v91v2 = nil
  4155. } else {
  4156. v91v2 = make(map[int64]uint8, len(v))
  4157. } // reset map
  4158. testUnmarshalErr(&v91v2, bs91, h, t, "dec-map-v91-p-len")
  4159. testDeepEqualErr(v91v1, v91v2, t, "equal-map-v91-p-len")
  4160. bs91 = testMarshalErr(&v91v1, h, t, "enc-map-v91-p")
  4161. v91v2 = nil
  4162. testUnmarshalErr(&v91v2, bs91, h, t, "dec-map-v91-p-nil")
  4163. testDeepEqualErr(v91v1, v91v2, t, "equal-map-v91-p-nil")
  4164. // ...
  4165. if v == nil {
  4166. v91v2 = nil
  4167. } else {
  4168. v91v2 = make(map[int64]uint8, len(v))
  4169. } // reset map
  4170. var v91v3, v91v4 typMapMapInt64Uint8
  4171. v91v3 = typMapMapInt64Uint8(v91v1)
  4172. v91v4 = typMapMapInt64Uint8(v91v2)
  4173. if v != nil {
  4174. bs91 = testMarshalErr(v91v3, h, t, "enc-map-v91-custom")
  4175. testUnmarshalErr(v91v4, bs91, h, t, "dec-map-v91-p-len")
  4176. testDeepEqualErr(v91v3, v91v4, t, "equal-map-v91-p-len")
  4177. }
  4178. }
  4179. for _, v := range []map[int64]uint64{nil, {}, {111: 0, 77: 127}} {
  4180. // fmt.Printf(">>>> running mammoth map v92: %v\n", v)
  4181. var v92v1, v92v2 map[int64]uint64
  4182. var bs92 []byte
  4183. v92v1 = v
  4184. bs92 = testMarshalErr(v92v1, h, t, "enc-map-v92")
  4185. if v != nil {
  4186. if v == nil {
  4187. v92v2 = nil
  4188. } else {
  4189. v92v2 = make(map[int64]uint64, len(v))
  4190. } // reset map
  4191. testUnmarshalErr(v92v2, bs92, h, t, "dec-map-v92")
  4192. testDeepEqualErr(v92v1, v92v2, t, "equal-map-v92")
  4193. if v == nil {
  4194. v92v2 = nil
  4195. } else {
  4196. v92v2 = make(map[int64]uint64, len(v))
  4197. } // reset map
  4198. testUnmarshalErr(rv4i(v92v2), bs92, h, t, "dec-map-v92-noaddr") // decode into non-addressable map value
  4199. testDeepEqualErr(v92v1, v92v2, t, "equal-map-v92-noaddr")
  4200. }
  4201. if v == nil {
  4202. v92v2 = nil
  4203. } else {
  4204. v92v2 = make(map[int64]uint64, len(v))
  4205. } // reset map
  4206. testUnmarshalErr(&v92v2, bs92, h, t, "dec-map-v92-p-len")
  4207. testDeepEqualErr(v92v1, v92v2, t, "equal-map-v92-p-len")
  4208. bs92 = testMarshalErr(&v92v1, h, t, "enc-map-v92-p")
  4209. v92v2 = nil
  4210. testUnmarshalErr(&v92v2, bs92, h, t, "dec-map-v92-p-nil")
  4211. testDeepEqualErr(v92v1, v92v2, t, "equal-map-v92-p-nil")
  4212. // ...
  4213. if v == nil {
  4214. v92v2 = nil
  4215. } else {
  4216. v92v2 = make(map[int64]uint64, len(v))
  4217. } // reset map
  4218. var v92v3, v92v4 typMapMapInt64Uint64
  4219. v92v3 = typMapMapInt64Uint64(v92v1)
  4220. v92v4 = typMapMapInt64Uint64(v92v2)
  4221. if v != nil {
  4222. bs92 = testMarshalErr(v92v3, h, t, "enc-map-v92-custom")
  4223. testUnmarshalErr(v92v4, bs92, h, t, "dec-map-v92-p-len")
  4224. testDeepEqualErr(v92v3, v92v4, t, "equal-map-v92-p-len")
  4225. }
  4226. }
  4227. for _, v := range []map[int64]int{nil, {}, {111: 0, 77: 127}} {
  4228. // fmt.Printf(">>>> running mammoth map v93: %v\n", v)
  4229. var v93v1, v93v2 map[int64]int
  4230. var bs93 []byte
  4231. v93v1 = v
  4232. bs93 = testMarshalErr(v93v1, h, t, "enc-map-v93")
  4233. if v != nil {
  4234. if v == nil {
  4235. v93v2 = nil
  4236. } else {
  4237. v93v2 = make(map[int64]int, len(v))
  4238. } // reset map
  4239. testUnmarshalErr(v93v2, bs93, h, t, "dec-map-v93")
  4240. testDeepEqualErr(v93v1, v93v2, t, "equal-map-v93")
  4241. if v == nil {
  4242. v93v2 = nil
  4243. } else {
  4244. v93v2 = make(map[int64]int, len(v))
  4245. } // reset map
  4246. testUnmarshalErr(rv4i(v93v2), bs93, h, t, "dec-map-v93-noaddr") // decode into non-addressable map value
  4247. testDeepEqualErr(v93v1, v93v2, t, "equal-map-v93-noaddr")
  4248. }
  4249. if v == nil {
  4250. v93v2 = nil
  4251. } else {
  4252. v93v2 = make(map[int64]int, len(v))
  4253. } // reset map
  4254. testUnmarshalErr(&v93v2, bs93, h, t, "dec-map-v93-p-len")
  4255. testDeepEqualErr(v93v1, v93v2, t, "equal-map-v93-p-len")
  4256. bs93 = testMarshalErr(&v93v1, h, t, "enc-map-v93-p")
  4257. v93v2 = nil
  4258. testUnmarshalErr(&v93v2, bs93, h, t, "dec-map-v93-p-nil")
  4259. testDeepEqualErr(v93v1, v93v2, t, "equal-map-v93-p-nil")
  4260. // ...
  4261. if v == nil {
  4262. v93v2 = nil
  4263. } else {
  4264. v93v2 = make(map[int64]int, len(v))
  4265. } // reset map
  4266. var v93v3, v93v4 typMapMapInt64Int
  4267. v93v3 = typMapMapInt64Int(v93v1)
  4268. v93v4 = typMapMapInt64Int(v93v2)
  4269. if v != nil {
  4270. bs93 = testMarshalErr(v93v3, h, t, "enc-map-v93-custom")
  4271. testUnmarshalErr(v93v4, bs93, h, t, "dec-map-v93-p-len")
  4272. testDeepEqualErr(v93v3, v93v4, t, "equal-map-v93-p-len")
  4273. }
  4274. }
  4275. for _, v := range []map[int64]int64{nil, {}, {111: 0, 77: 127}} {
  4276. // fmt.Printf(">>>> running mammoth map v94: %v\n", v)
  4277. var v94v1, v94v2 map[int64]int64
  4278. var bs94 []byte
  4279. v94v1 = v
  4280. bs94 = testMarshalErr(v94v1, h, t, "enc-map-v94")
  4281. if v != nil {
  4282. if v == nil {
  4283. v94v2 = nil
  4284. } else {
  4285. v94v2 = make(map[int64]int64, len(v))
  4286. } // reset map
  4287. testUnmarshalErr(v94v2, bs94, h, t, "dec-map-v94")
  4288. testDeepEqualErr(v94v1, v94v2, t, "equal-map-v94")
  4289. if v == nil {
  4290. v94v2 = nil
  4291. } else {
  4292. v94v2 = make(map[int64]int64, len(v))
  4293. } // reset map
  4294. testUnmarshalErr(rv4i(v94v2), bs94, h, t, "dec-map-v94-noaddr") // decode into non-addressable map value
  4295. testDeepEqualErr(v94v1, v94v2, t, "equal-map-v94-noaddr")
  4296. }
  4297. if v == nil {
  4298. v94v2 = nil
  4299. } else {
  4300. v94v2 = make(map[int64]int64, len(v))
  4301. } // reset map
  4302. testUnmarshalErr(&v94v2, bs94, h, t, "dec-map-v94-p-len")
  4303. testDeepEqualErr(v94v1, v94v2, t, "equal-map-v94-p-len")
  4304. bs94 = testMarshalErr(&v94v1, h, t, "enc-map-v94-p")
  4305. v94v2 = nil
  4306. testUnmarshalErr(&v94v2, bs94, h, t, "dec-map-v94-p-nil")
  4307. testDeepEqualErr(v94v1, v94v2, t, "equal-map-v94-p-nil")
  4308. // ...
  4309. if v == nil {
  4310. v94v2 = nil
  4311. } else {
  4312. v94v2 = make(map[int64]int64, len(v))
  4313. } // reset map
  4314. var v94v3, v94v4 typMapMapInt64Int64
  4315. v94v3 = typMapMapInt64Int64(v94v1)
  4316. v94v4 = typMapMapInt64Int64(v94v2)
  4317. if v != nil {
  4318. bs94 = testMarshalErr(v94v3, h, t, "enc-map-v94-custom")
  4319. testUnmarshalErr(v94v4, bs94, h, t, "dec-map-v94-p-len")
  4320. testDeepEqualErr(v94v3, v94v4, t, "equal-map-v94-p-len")
  4321. }
  4322. }
  4323. for _, v := range []map[int64]float32{nil, {}, {111: 0, 77: 11.1}} {
  4324. // fmt.Printf(">>>> running mammoth map v95: %v\n", v)
  4325. var v95v1, v95v2 map[int64]float32
  4326. var bs95 []byte
  4327. v95v1 = v
  4328. bs95 = testMarshalErr(v95v1, h, t, "enc-map-v95")
  4329. if v != nil {
  4330. if v == nil {
  4331. v95v2 = nil
  4332. } else {
  4333. v95v2 = make(map[int64]float32, len(v))
  4334. } // reset map
  4335. testUnmarshalErr(v95v2, bs95, h, t, "dec-map-v95")
  4336. testDeepEqualErr(v95v1, v95v2, t, "equal-map-v95")
  4337. if v == nil {
  4338. v95v2 = nil
  4339. } else {
  4340. v95v2 = make(map[int64]float32, len(v))
  4341. } // reset map
  4342. testUnmarshalErr(rv4i(v95v2), bs95, h, t, "dec-map-v95-noaddr") // decode into non-addressable map value
  4343. testDeepEqualErr(v95v1, v95v2, t, "equal-map-v95-noaddr")
  4344. }
  4345. if v == nil {
  4346. v95v2 = nil
  4347. } else {
  4348. v95v2 = make(map[int64]float32, len(v))
  4349. } // reset map
  4350. testUnmarshalErr(&v95v2, bs95, h, t, "dec-map-v95-p-len")
  4351. testDeepEqualErr(v95v1, v95v2, t, "equal-map-v95-p-len")
  4352. bs95 = testMarshalErr(&v95v1, h, t, "enc-map-v95-p")
  4353. v95v2 = nil
  4354. testUnmarshalErr(&v95v2, bs95, h, t, "dec-map-v95-p-nil")
  4355. testDeepEqualErr(v95v1, v95v2, t, "equal-map-v95-p-nil")
  4356. // ...
  4357. if v == nil {
  4358. v95v2 = nil
  4359. } else {
  4360. v95v2 = make(map[int64]float32, len(v))
  4361. } // reset map
  4362. var v95v3, v95v4 typMapMapInt64Float32
  4363. v95v3 = typMapMapInt64Float32(v95v1)
  4364. v95v4 = typMapMapInt64Float32(v95v2)
  4365. if v != nil {
  4366. bs95 = testMarshalErr(v95v3, h, t, "enc-map-v95-custom")
  4367. testUnmarshalErr(v95v4, bs95, h, t, "dec-map-v95-p-len")
  4368. testDeepEqualErr(v95v3, v95v4, t, "equal-map-v95-p-len")
  4369. }
  4370. }
  4371. for _, v := range []map[int64]float64{nil, {}, {127: 0, 111: 22.2}} {
  4372. // fmt.Printf(">>>> running mammoth map v96: %v\n", v)
  4373. var v96v1, v96v2 map[int64]float64
  4374. var bs96 []byte
  4375. v96v1 = v
  4376. bs96 = testMarshalErr(v96v1, h, t, "enc-map-v96")
  4377. if v != nil {
  4378. if v == nil {
  4379. v96v2 = nil
  4380. } else {
  4381. v96v2 = make(map[int64]float64, len(v))
  4382. } // reset map
  4383. testUnmarshalErr(v96v2, bs96, h, t, "dec-map-v96")
  4384. testDeepEqualErr(v96v1, v96v2, t, "equal-map-v96")
  4385. if v == nil {
  4386. v96v2 = nil
  4387. } else {
  4388. v96v2 = make(map[int64]float64, len(v))
  4389. } // reset map
  4390. testUnmarshalErr(rv4i(v96v2), bs96, h, t, "dec-map-v96-noaddr") // decode into non-addressable map value
  4391. testDeepEqualErr(v96v1, v96v2, t, "equal-map-v96-noaddr")
  4392. }
  4393. if v == nil {
  4394. v96v2 = nil
  4395. } else {
  4396. v96v2 = make(map[int64]float64, len(v))
  4397. } // reset map
  4398. testUnmarshalErr(&v96v2, bs96, h, t, "dec-map-v96-p-len")
  4399. testDeepEqualErr(v96v1, v96v2, t, "equal-map-v96-p-len")
  4400. bs96 = testMarshalErr(&v96v1, h, t, "enc-map-v96-p")
  4401. v96v2 = nil
  4402. testUnmarshalErr(&v96v2, bs96, h, t, "dec-map-v96-p-nil")
  4403. testDeepEqualErr(v96v1, v96v2, t, "equal-map-v96-p-nil")
  4404. // ...
  4405. if v == nil {
  4406. v96v2 = nil
  4407. } else {
  4408. v96v2 = make(map[int64]float64, len(v))
  4409. } // reset map
  4410. var v96v3, v96v4 typMapMapInt64Float64
  4411. v96v3 = typMapMapInt64Float64(v96v1)
  4412. v96v4 = typMapMapInt64Float64(v96v2)
  4413. if v != nil {
  4414. bs96 = testMarshalErr(v96v3, h, t, "enc-map-v96-custom")
  4415. testUnmarshalErr(v96v4, bs96, h, t, "dec-map-v96-p-len")
  4416. testDeepEqualErr(v96v3, v96v4, t, "equal-map-v96-p-len")
  4417. }
  4418. }
  4419. for _, v := range []map[int64]bool{nil, {}, {77: false, 127: true}} {
  4420. // fmt.Printf(">>>> running mammoth map v97: %v\n", v)
  4421. var v97v1, v97v2 map[int64]bool
  4422. var bs97 []byte
  4423. v97v1 = v
  4424. bs97 = testMarshalErr(v97v1, h, t, "enc-map-v97")
  4425. if v != nil {
  4426. if v == nil {
  4427. v97v2 = nil
  4428. } else {
  4429. v97v2 = make(map[int64]bool, len(v))
  4430. } // reset map
  4431. testUnmarshalErr(v97v2, bs97, h, t, "dec-map-v97")
  4432. testDeepEqualErr(v97v1, v97v2, t, "equal-map-v97")
  4433. if v == nil {
  4434. v97v2 = nil
  4435. } else {
  4436. v97v2 = make(map[int64]bool, len(v))
  4437. } // reset map
  4438. testUnmarshalErr(rv4i(v97v2), bs97, h, t, "dec-map-v97-noaddr") // decode into non-addressable map value
  4439. testDeepEqualErr(v97v1, v97v2, t, "equal-map-v97-noaddr")
  4440. }
  4441. if v == nil {
  4442. v97v2 = nil
  4443. } else {
  4444. v97v2 = make(map[int64]bool, len(v))
  4445. } // reset map
  4446. testUnmarshalErr(&v97v2, bs97, h, t, "dec-map-v97-p-len")
  4447. testDeepEqualErr(v97v1, v97v2, t, "equal-map-v97-p-len")
  4448. bs97 = testMarshalErr(&v97v1, h, t, "enc-map-v97-p")
  4449. v97v2 = nil
  4450. testUnmarshalErr(&v97v2, bs97, h, t, "dec-map-v97-p-nil")
  4451. testDeepEqualErr(v97v1, v97v2, t, "equal-map-v97-p-nil")
  4452. // ...
  4453. if v == nil {
  4454. v97v2 = nil
  4455. } else {
  4456. v97v2 = make(map[int64]bool, len(v))
  4457. } // reset map
  4458. var v97v3, v97v4 typMapMapInt64Bool
  4459. v97v3 = typMapMapInt64Bool(v97v1)
  4460. v97v4 = typMapMapInt64Bool(v97v2)
  4461. if v != nil {
  4462. bs97 = testMarshalErr(v97v3, h, t, "enc-map-v97-custom")
  4463. testUnmarshalErr(v97v4, bs97, h, t, "dec-map-v97-p-len")
  4464. testDeepEqualErr(v97v3, v97v4, t, "equal-map-v97-p-len")
  4465. }
  4466. }
  4467. }
  4468. func doTestMammothMapsAndSlices(t *testing.T, h Handle) {
  4469. doTestMammothSlices(t, h)
  4470. doTestMammothMaps(t, h)
  4471. }