mammoth_generated_test.go 160 KB

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