mammoth_generated_test.go 145 KB

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