mammoth_generated_test.go 151 KB

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