gtest.h 896 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095
  1. // Copyright 2005, Google Inc.
  2. // All rights reserved.
  3. //
  4. // Redistribution and use in source and binary forms, with or without
  5. // modification, are permitted provided that the following conditions are
  6. // met:
  7. //
  8. // * Redistributions of source code must retain the above copyright
  9. // notice, this list of conditions and the following disclaimer.
  10. // * Redistributions in binary form must reproduce the above
  11. // copyright notice, this list of conditions and the following disclaimer
  12. // in the documentation and/or other materials provided with the
  13. // distribution.
  14. // * Neither the name of Google Inc. nor the names of its
  15. // contributors may be used to endorse or promote products derived from
  16. // this software without specific prior written permission.
  17. //
  18. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  22. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  23. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  24. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  25. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  26. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  28. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. //
  30. // The Google C++ Testing and Mocking Framework (Google Test)
  31. //
  32. // This header file defines the public API for Google Test. It should be
  33. // included by any test program that uses Google Test.
  34. //
  35. // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
  36. // leave some internal implementation details in this header file.
  37. // They are clearly marked by comments like this:
  38. //
  39. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  40. //
  41. // Such code is NOT meant to be used by a user directly, and is subject
  42. // to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
  43. // program!
  44. //
  45. // Acknowledgment: Google Test borrowed the idea of automatic test
  46. // registration from Barthelemy Dagenais' (barthelemy@prologique.com)
  47. // easyUnit framework.
  48. // GOOGLETEST_CM0001 DO NOT DELETE
  49. #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
  50. #define GTEST_INCLUDE_GTEST_GTEST_H_
  51. #include <limits>
  52. #include <memory>
  53. #include <ostream>
  54. #include <vector>
  55. // Copyright 2005, Google Inc.
  56. // All rights reserved.
  57. //
  58. // Redistribution and use in source and binary forms, with or without
  59. // modification, are permitted provided that the following conditions are
  60. // met:
  61. //
  62. // * Redistributions of source code must retain the above copyright
  63. // notice, this list of conditions and the following disclaimer.
  64. // * Redistributions in binary form must reproduce the above
  65. // copyright notice, this list of conditions and the following disclaimer
  66. // in the documentation and/or other materials provided with the
  67. // distribution.
  68. // * Neither the name of Google Inc. nor the names of its
  69. // contributors may be used to endorse or promote products derived from
  70. // this software without specific prior written permission.
  71. //
  72. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  73. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  74. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  75. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  76. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  77. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  78. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  79. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  80. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  81. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  82. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  83. //
  84. // The Google C++ Testing and Mocking Framework (Google Test)
  85. //
  86. // This header file declares functions and macros used internally by
  87. // Google Test. They are subject to change without notice.
  88. // GOOGLETEST_CM0001 DO NOT DELETE
  89. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
  90. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
  91. // Copyright 2005, Google Inc.
  92. // All rights reserved.
  93. //
  94. // Redistribution and use in source and binary forms, with or without
  95. // modification, are permitted provided that the following conditions are
  96. // met:
  97. //
  98. // * Redistributions of source code must retain the above copyright
  99. // notice, this list of conditions and the following disclaimer.
  100. // * Redistributions in binary form must reproduce the above
  101. // copyright notice, this list of conditions and the following disclaimer
  102. // in the documentation and/or other materials provided with the
  103. // distribution.
  104. // * Neither the name of Google Inc. nor the names of its
  105. // contributors may be used to endorse or promote products derived from
  106. // this software without specific prior written permission.
  107. //
  108. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  109. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  110. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  111. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  112. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  113. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  114. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  115. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  116. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  117. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  118. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  119. //
  120. // Low-level types and utilities for porting Google Test to various
  121. // platforms. All macros ending with _ and symbols defined in an
  122. // internal namespace are subject to change without notice. Code
  123. // outside Google Test MUST NOT USE THEM DIRECTLY. Macros that don't
  124. // end with _ are part of Google Test's public API and can be used by
  125. // code outside Google Test.
  126. //
  127. // This file is fundamental to Google Test. All other Google Test source
  128. // files are expected to #include this. Therefore, it cannot #include
  129. // any other Google Test header.
  130. // GOOGLETEST_CM0001 DO NOT DELETE
  131. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
  132. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
  133. // Environment-describing macros
  134. // -----------------------------
  135. //
  136. // Google Test can be used in many different environments. Macros in
  137. // this section tell Google Test what kind of environment it is being
  138. // used in, such that Google Test can provide environment-specific
  139. // features and implementations.
  140. //
  141. // Google Test tries to automatically detect the properties of its
  142. // environment, so users usually don't need to worry about these
  143. // macros. However, the automatic detection is not perfect.
  144. // Sometimes it's necessary for a user to define some of the following
  145. // macros in the build script to override Google Test's decisions.
  146. //
  147. // If the user doesn't define a macro in the list, Google Test will
  148. // provide a default definition. After this header is #included, all
  149. // macros in this list will be defined to either 1 or 0.
  150. //
  151. // Notes to maintainers:
  152. // - Each macro here is a user-tweakable knob; do not grow the list
  153. // lightly.
  154. // - Use #if to key off these macros. Don't use #ifdef or "#if
  155. // defined(...)", which will not work as these macros are ALWAYS
  156. // defined.
  157. //
  158. // GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2)
  159. // is/isn't available.
  160. // GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions
  161. // are enabled.
  162. // GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string
  163. // is/isn't available
  164. // GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::wstring
  165. // is/isn't available
  166. // GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular
  167. // expressions are/aren't available.
  168. // GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that <pthread.h>
  169. // is/isn't available.
  170. // GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't
  171. // enabled.
  172. // GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that
  173. // std::wstring does/doesn't work (Google Test can
  174. // be used where std::wstring is unavailable).
  175. // GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple
  176. // is/isn't available.
  177. // GTEST_HAS_SEH - Define it to 1/0 to indicate whether the
  178. // compiler supports Microsoft's "Structured
  179. // Exception Handling".
  180. // GTEST_HAS_STREAM_REDIRECTION
  181. // - Define it to 1/0 to indicate whether the
  182. // platform supports I/O stream redirection using
  183. // dup() and dup2().
  184. // GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google
  185. // Test's own tr1 tuple implementation should be
  186. // used. Unused when the user sets
  187. // GTEST_HAS_TR1_TUPLE to 0.
  188. // GTEST_LANG_CXX11 - Define it to 1/0 to indicate that Google Test
  189. // is building in C++11/C++98 mode.
  190. // GTEST_LINKED_AS_SHARED_LIBRARY
  191. // - Define to 1 when compiling tests that use
  192. // Google Test as a shared library (known as
  193. // DLL on Windows).
  194. // GTEST_CREATE_SHARED_LIBRARY
  195. // - Define to 1 when compiling Google Test itself
  196. // as a shared library.
  197. // GTEST_DEFAULT_DEATH_TEST_STYLE
  198. // - The default value of --gtest_death_test_style.
  199. // The legacy default has been "fast" in the open
  200. // source version since 2008. The recommended value
  201. // is "threadsafe", and can be set in
  202. // custom/gtest-port.h.
  203. // Platform-indicating macros
  204. // --------------------------
  205. //
  206. // Macros indicating the platform on which Google Test is being used
  207. // (a macro is defined to 1 if compiled on the given platform;
  208. // otherwise UNDEFINED -- it's never defined to 0.). Google Test
  209. // defines these macros automatically. Code outside Google Test MUST
  210. // NOT define them.
  211. //
  212. // GTEST_OS_AIX - IBM AIX
  213. // GTEST_OS_CYGWIN - Cygwin
  214. // GTEST_OS_FREEBSD - FreeBSD
  215. // GTEST_OS_FUCHSIA - Fuchsia
  216. // GTEST_OS_HPUX - HP-UX
  217. // GTEST_OS_LINUX - Linux
  218. // GTEST_OS_LINUX_ANDROID - Google Android
  219. // GTEST_OS_MAC - Mac OS X
  220. // GTEST_OS_IOS - iOS
  221. // GTEST_OS_NACL - Google Native Client (NaCl)
  222. // GTEST_OS_NETBSD - NetBSD
  223. // GTEST_OS_OPENBSD - OpenBSD
  224. // GTEST_OS_QNX - QNX
  225. // GTEST_OS_SOLARIS - Sun Solaris
  226. // GTEST_OS_SYMBIAN - Symbian
  227. // GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile)
  228. // GTEST_OS_WINDOWS_DESKTOP - Windows Desktop
  229. // GTEST_OS_WINDOWS_MINGW - MinGW
  230. // GTEST_OS_WINDOWS_MOBILE - Windows Mobile
  231. // GTEST_OS_WINDOWS_PHONE - Windows Phone
  232. // GTEST_OS_WINDOWS_RT - Windows Store App/WinRT
  233. // GTEST_OS_ZOS - z/OS
  234. //
  235. // Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
  236. // most stable support. Since core members of the Google Test project
  237. // don't have access to other platforms, support for them may be less
  238. // stable. If you notice any problems on your platform, please notify
  239. // googletestframework@googlegroups.com (patches for fixing them are
  240. // even more welcome!).
  241. //
  242. // It is possible that none of the GTEST_OS_* macros are defined.
  243. // Feature-indicating macros
  244. // -------------------------
  245. //
  246. // Macros indicating which Google Test features are available (a macro
  247. // is defined to 1 if the corresponding feature is supported;
  248. // otherwise UNDEFINED -- it's never defined to 0.). Google Test
  249. // defines these macros automatically. Code outside Google Test MUST
  250. // NOT define them.
  251. //
  252. // These macros are public so that portable tests can be written.
  253. // Such tests typically surround code using a feature with an #if
  254. // which controls that code. For example:
  255. //
  256. // #if GTEST_HAS_DEATH_TEST
  257. // EXPECT_DEATH(DoSomethingDeadly());
  258. // #endif
  259. //
  260. // GTEST_HAS_COMBINE - the Combine() function (for value-parameterized
  261. // tests)
  262. // GTEST_HAS_DEATH_TEST - death tests
  263. // GTEST_HAS_TYPED_TEST - typed tests
  264. // GTEST_HAS_TYPED_TEST_P - type-parameterized tests
  265. // GTEST_IS_THREADSAFE - Google Test is thread-safe.
  266. // GOOGLETEST_CM0007 DO NOT DELETE
  267. // GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with
  268. // GTEST_HAS_POSIX_RE (see above) which users can
  269. // define themselves.
  270. // GTEST_USES_SIMPLE_RE - our own simple regex is used;
  271. // the above RE\b(s) are mutually exclusive.
  272. // GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
  273. // Misc public macros
  274. // ------------------
  275. //
  276. // GTEST_FLAG(flag_name) - references the variable corresponding to
  277. // the given Google Test flag.
  278. // Internal utilities
  279. // ------------------
  280. //
  281. // The following macros and utilities are for Google Test's INTERNAL
  282. // use only. Code outside Google Test MUST NOT USE THEM DIRECTLY.
  283. //
  284. // Macros for basic C++ coding:
  285. // GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
  286. // GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a
  287. // variable don't have to be used.
  288. // GTEST_DISALLOW_ASSIGN_ - disables operator=.
  289. // GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
  290. // GTEST_MUST_USE_RESULT_ - declares that a function's result must be used.
  291. // GTEST_INTENTIONAL_CONST_COND_PUSH_ - start code section where MSVC C4127 is
  292. // suppressed (constant conditional).
  293. // GTEST_INTENTIONAL_CONST_COND_POP_ - finish code section where MSVC C4127
  294. // is suppressed.
  295. //
  296. // C++11 feature wrappers:
  297. //
  298. // testing::internal::forward - portability wrapper for std::forward.
  299. // testing::internal::move - portability wrapper for std::move.
  300. //
  301. // Synchronization:
  302. // Mutex, MutexLock, ThreadLocal, GetThreadCount()
  303. // - synchronization primitives.
  304. //
  305. // Template meta programming:
  306. // is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only.
  307. // IteratorTraits - partial implementation of std::iterator_traits, which
  308. // is not available in libCstd when compiled with Sun C++.
  309. //
  310. // Smart pointers:
  311. // scoped_ptr - as in TR2.
  312. //
  313. // Regular expressions:
  314. // RE - a simple regular expression class using the POSIX
  315. // Extended Regular Expression syntax on UNIX-like platforms
  316. // GOOGLETEST_CM0008 DO NOT DELETE
  317. // or a reduced regular exception syntax on other
  318. // platforms, including Windows.
  319. // Logging:
  320. // GTEST_LOG_() - logs messages at the specified severity level.
  321. // LogToStderr() - directs all log messages to stderr.
  322. // FlushInfoLog() - flushes informational log messages.
  323. //
  324. // Stdout and stderr capturing:
  325. // CaptureStdout() - starts capturing stdout.
  326. // GetCapturedStdout() - stops capturing stdout and returns the captured
  327. // string.
  328. // CaptureStderr() - starts capturing stderr.
  329. // GetCapturedStderr() - stops capturing stderr and returns the captured
  330. // string.
  331. //
  332. // Integer types:
  333. // TypeWithSize - maps an integer to a int type.
  334. // Int32, UInt32, Int64, UInt64, TimeInMillis
  335. // - integers of known sizes.
  336. // BiggestInt - the biggest signed integer type.
  337. //
  338. // Command-line utilities:
  339. // GTEST_DECLARE_*() - declares a flag.
  340. // GTEST_DEFINE_*() - defines a flag.
  341. // GetInjectableArgvs() - returns the command line as a vector of strings.
  342. //
  343. // Environment variable utilities:
  344. // GetEnv() - gets the value of an environment variable.
  345. // BoolFromGTestEnv() - parses a bool environment variable.
  346. // Int32FromGTestEnv() - parses an Int32 environment variable.
  347. // StringFromGTestEnv() - parses a string environment variable.
  348. #include <ctype.h> // for isspace, etc
  349. #include <stddef.h> // for ptrdiff_t
  350. #include <stdlib.h>
  351. #include <stdio.h>
  352. #include <string.h>
  353. #ifndef _WIN32_WCE
  354. # include <sys/types.h>
  355. # include <sys/stat.h>
  356. #endif // !_WIN32_WCE
  357. #if defined __APPLE__
  358. # include <AvailabilityMacros.h>
  359. # include <TargetConditionals.h>
  360. #endif
  361. // Brings in the definition of HAS_GLOBAL_STRING. This must be done
  362. // BEFORE we test HAS_GLOBAL_STRING.
  363. #include <string> // NOLINT
  364. #include <algorithm> // NOLINT
  365. #include <iostream> // NOLINT
  366. #include <sstream> // NOLINT
  367. #include <utility>
  368. #include <vector> // NOLINT
  369. // Copyright 2015, Google Inc.
  370. // All rights reserved.
  371. //
  372. // Redistribution and use in source and binary forms, with or without
  373. // modification, are permitted provided that the following conditions are
  374. // met:
  375. //
  376. // * Redistributions of source code must retain the above copyright
  377. // notice, this list of conditions and the following disclaimer.
  378. // * Redistributions in binary form must reproduce the above
  379. // copyright notice, this list of conditions and the following disclaimer
  380. // in the documentation and/or other materials provided with the
  381. // distribution.
  382. // * Neither the name of Google Inc. nor the names of its
  383. // contributors may be used to endorse or promote products derived from
  384. // this software without specific prior written permission.
  385. //
  386. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  387. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  388. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  389. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  390. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  391. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  392. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  393. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  394. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  395. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  396. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  397. //
  398. // The Google C++ Testing and Mocking Framework (Google Test)
  399. //
  400. // This header file defines the GTEST_OS_* macro.
  401. // It is separate from gtest-port.h so that custom/gtest-port.h can include it.
  402. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
  403. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
  404. // Determines the platform on which Google Test is compiled.
  405. #ifdef __CYGWIN__
  406. # define GTEST_OS_CYGWIN 1
  407. #elif defined __SYMBIAN32__
  408. # define GTEST_OS_SYMBIAN 1
  409. #elif defined _WIN32
  410. # define GTEST_OS_WINDOWS 1
  411. # ifdef _WIN32_WCE
  412. # define GTEST_OS_WINDOWS_MOBILE 1
  413. # elif defined(__MINGW__) || defined(__MINGW32__)
  414. # define GTEST_OS_WINDOWS_MINGW 1
  415. # elif defined(WINAPI_FAMILY)
  416. # include <winapifamily.h>
  417. # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  418. # define GTEST_OS_WINDOWS_DESKTOP 1
  419. # elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
  420. # define GTEST_OS_WINDOWS_PHONE 1
  421. # elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
  422. # define GTEST_OS_WINDOWS_RT 1
  423. # elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_TV_TITLE)
  424. # define GTEST_OS_WINDOWS_PHONE 1
  425. # define GTEST_OS_WINDOWS_TV_TITLE 1
  426. # else
  427. // WINAPI_FAMILY defined but no known partition matched.
  428. // Default to desktop.
  429. # define GTEST_OS_WINDOWS_DESKTOP 1
  430. # endif
  431. # else
  432. # define GTEST_OS_WINDOWS_DESKTOP 1
  433. # endif // _WIN32_WCE
  434. #elif defined __APPLE__
  435. # define GTEST_OS_MAC 1
  436. # if TARGET_OS_IPHONE
  437. # define GTEST_OS_IOS 1
  438. # endif
  439. #elif defined __FreeBSD__
  440. # define GTEST_OS_FREEBSD 1
  441. #elif defined __Fuchsia__
  442. # define GTEST_OS_FUCHSIA 1
  443. #elif defined __linux__
  444. # define GTEST_OS_LINUX 1
  445. # if defined __ANDROID__
  446. # define GTEST_OS_LINUX_ANDROID 1
  447. # endif
  448. #elif defined __MVS__
  449. # define GTEST_OS_ZOS 1
  450. #elif defined(__sun) && defined(__SVR4)
  451. # define GTEST_OS_SOLARIS 1
  452. #elif defined(_AIX)
  453. # define GTEST_OS_AIX 1
  454. #elif defined(__hpux)
  455. # define GTEST_OS_HPUX 1
  456. #elif defined __native_client__
  457. # define GTEST_OS_NACL 1
  458. #elif defined __NetBSD__
  459. # define GTEST_OS_NETBSD 1
  460. #elif defined __OpenBSD__
  461. # define GTEST_OS_OPENBSD 1
  462. #elif defined __QNX__
  463. # define GTEST_OS_QNX 1
  464. #endif // __CYGWIN__
  465. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
  466. // Copyright 2015, Google Inc.
  467. // All rights reserved.
  468. //
  469. // Redistribution and use in source and binary forms, with or without
  470. // modification, are permitted provided that the following conditions are
  471. // met:
  472. //
  473. // * Redistributions of source code must retain the above copyright
  474. // notice, this list of conditions and the following disclaimer.
  475. // * Redistributions in binary form must reproduce the above
  476. // copyright notice, this list of conditions and the following disclaimer
  477. // in the documentation and/or other materials provided with the
  478. // distribution.
  479. // * Neither the name of Google Inc. nor the names of its
  480. // contributors may be used to endorse or promote products derived from
  481. // this software without specific prior written permission.
  482. //
  483. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  484. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  485. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  486. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  487. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  488. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  489. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  490. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  491. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  492. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  493. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  494. //
  495. // Injection point for custom user configurations. See README for details
  496. //
  497. // ** Custom implementation starts here **
  498. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
  499. #define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
  500. #endif // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
  501. #if !defined(GTEST_DEV_EMAIL_)
  502. # define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
  503. # define GTEST_FLAG_PREFIX_ "gtest_"
  504. # define GTEST_FLAG_PREFIX_DASH_ "gtest-"
  505. # define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
  506. # define GTEST_NAME_ "Google Test"
  507. # define GTEST_PROJECT_URL_ "https://github.com/google/googletest/"
  508. #endif // !defined(GTEST_DEV_EMAIL_)
  509. #if !defined(GTEST_INIT_GOOGLE_TEST_NAME_)
  510. # define GTEST_INIT_GOOGLE_TEST_NAME_ "testing::InitGoogleTest"
  511. #endif // !defined(GTEST_INIT_GOOGLE_TEST_NAME_)
  512. // Determines the version of gcc that is used to compile this.
  513. #ifdef __GNUC__
  514. // 40302 means version 4.3.2.
  515. # define GTEST_GCC_VER_ \
  516. (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
  517. #endif // __GNUC__
  518. // Macros for disabling Microsoft Visual C++ warnings.
  519. //
  520. // GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 4385)
  521. // /* code that triggers warnings C4800 and C4385 */
  522. // GTEST_DISABLE_MSC_WARNINGS_POP_()
  523. #if _MSC_VER >= 1400
  524. # define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings) \
  525. __pragma(warning(push)) \
  526. __pragma(warning(disable: warnings))
  527. # define GTEST_DISABLE_MSC_WARNINGS_POP_() \
  528. __pragma(warning(pop))
  529. #else
  530. // Older versions of MSVC don't have __pragma.
  531. # define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
  532. # define GTEST_DISABLE_MSC_WARNINGS_POP_()
  533. #endif
  534. // Clang on Windows does not understand MSVC's pragma warning.
  535. // We need clang-specific way to disable function deprecation warning.
  536. #ifdef __clang__
  537. # define GTEST_DISABLE_MSC_DEPRECATED_PUSH_() \
  538. _Pragma("clang diagnostic push") \
  539. _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") \
  540. _Pragma("clang diagnostic ignored \"-Wdeprecated-implementations\"")
  541. #define GTEST_DISABLE_MSC_DEPRECATED_POP_() \
  542. _Pragma("clang diagnostic pop")
  543. #else
  544. # define GTEST_DISABLE_MSC_DEPRECATED_PUSH_() \
  545. GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)
  546. # define GTEST_DISABLE_MSC_DEPRECATED_POP_() \
  547. GTEST_DISABLE_MSC_WARNINGS_POP_()
  548. #endif
  549. #ifndef GTEST_LANG_CXX11
  550. // gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when
  551. // -std={c,gnu}++{0x,11} is passed. The C++11 standard specifies a
  552. // value for __cplusplus, and recent versions of clang, gcc, and
  553. // probably other compilers set that too in C++11 mode.
  554. # if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L || _MSC_VER >= 1900
  555. // Compiling in at least C++11 mode.
  556. # define GTEST_LANG_CXX11 1
  557. # else
  558. # define GTEST_LANG_CXX11 0
  559. # endif
  560. #endif
  561. // Distinct from C++11 language support, some environments don't provide
  562. // proper C++11 library support. Notably, it's possible to build in
  563. // C++11 mode when targeting Mac OS X 10.6, which has an old libstdc++
  564. // with no C++11 support.
  565. //
  566. // libstdc++ has sufficient C++11 support as of GCC 4.6.0, __GLIBCXX__
  567. // 20110325, but maintenance releases in the 4.4 and 4.5 series followed
  568. // this date, so check for those versions by their date stamps.
  569. // https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html#abi.versioning
  570. #if GTEST_LANG_CXX11 && \
  571. (!defined(__GLIBCXX__) || ( \
  572. __GLIBCXX__ >= 20110325ul && /* GCC >= 4.6.0 */ \
  573. /* Blacklist of patch releases of older branches: */ \
  574. __GLIBCXX__ != 20110416ul && /* GCC 4.4.6 */ \
  575. __GLIBCXX__ != 20120313ul && /* GCC 4.4.7 */ \
  576. __GLIBCXX__ != 20110428ul && /* GCC 4.5.3 */ \
  577. __GLIBCXX__ != 20120702ul)) /* GCC 4.5.4 */
  578. # define GTEST_STDLIB_CXX11 1
  579. #endif
  580. // Only use C++11 library features if the library provides them.
  581. #if GTEST_STDLIB_CXX11
  582. # define GTEST_HAS_STD_BEGIN_AND_END_ 1
  583. # define GTEST_HAS_STD_FORWARD_LIST_ 1
  584. # if !defined(_MSC_VER) || (_MSC_FULL_VER >= 190023824)
  585. // works only with VS2015U2 and better
  586. # define GTEST_HAS_STD_FUNCTION_ 1
  587. # endif
  588. # define GTEST_HAS_STD_INITIALIZER_LIST_ 1
  589. # define GTEST_HAS_STD_MOVE_ 1
  590. # define GTEST_HAS_STD_UNIQUE_PTR_ 1
  591. # define GTEST_HAS_STD_SHARED_PTR_ 1
  592. # define GTEST_HAS_UNORDERED_MAP_ 1
  593. # define GTEST_HAS_UNORDERED_SET_ 1
  594. #endif
  595. // C++11 specifies that <tuple> provides std::tuple.
  596. // Some platforms still might not have it, however.
  597. #if GTEST_LANG_CXX11
  598. # define GTEST_HAS_STD_TUPLE_ 1
  599. # if defined(__clang__)
  600. // Inspired by
  601. // https://clang.llvm.org/docs/LanguageExtensions.html#include-file-checking-macros
  602. # if defined(__has_include) && !__has_include(<tuple>)
  603. # undef GTEST_HAS_STD_TUPLE_
  604. # endif
  605. # elif defined(_MSC_VER)
  606. // Inspired by boost/config/stdlib/dinkumware.hpp
  607. # if defined(_CPPLIB_VER) && _CPPLIB_VER < 520
  608. # undef GTEST_HAS_STD_TUPLE_
  609. # endif
  610. # elif defined(__GLIBCXX__)
  611. // Inspired by boost/config/stdlib/libstdcpp3.hpp,
  612. // http://gcc.gnu.org/gcc-4.2/changes.html and
  613. // https://web.archive.org/web/20140227044429/gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt01ch01.html#manual.intro.status.standard.200x
  614. # if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
  615. # undef GTEST_HAS_STD_TUPLE_
  616. # endif
  617. # endif
  618. #endif
  619. // Brings in definitions for functions used in the testing::internal::posix
  620. // namespace (read, write, close, chdir, isatty, stat). We do not currently
  621. // use them on Windows Mobile.
  622. #if GTEST_OS_WINDOWS
  623. # if !GTEST_OS_WINDOWS_MOBILE
  624. # include <direct.h>
  625. # include <io.h>
  626. # endif
  627. // In order to avoid having to include <windows.h>, use forward declaration
  628. #if GTEST_OS_WINDOWS_MINGW && !defined(__MINGW64_VERSION_MAJOR)
  629. // MinGW defined _CRITICAL_SECTION and _RTL_CRITICAL_SECTION as two
  630. // separate (equivalent) structs, instead of using typedef
  631. typedef struct _CRITICAL_SECTION GTEST_CRITICAL_SECTION;
  632. #else
  633. // Assume CRITICAL_SECTION is a typedef of _RTL_CRITICAL_SECTION.
  634. // This assumption is verified by
  635. // WindowsTypesTest.CRITICAL_SECTIONIs_RTL_CRITICAL_SECTION.
  636. typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
  637. #endif
  638. #else
  639. // This assumes that non-Windows OSes provide unistd.h. For OSes where this
  640. // is not the case, we need to include headers that provide the functions
  641. // mentioned above.
  642. # include <unistd.h>
  643. # include <strings.h>
  644. #endif // GTEST_OS_WINDOWS
  645. #if GTEST_OS_LINUX_ANDROID
  646. // Used to define __ANDROID_API__ matching the target NDK API level.
  647. # include <android/api-level.h> // NOLINT
  648. #endif
  649. // Defines this to true iff Google Test can use POSIX regular expressions.
  650. #ifndef GTEST_HAS_POSIX_RE
  651. # if GTEST_OS_LINUX_ANDROID
  652. // On Android, <regex.h> is only available starting with Gingerbread.
  653. # define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 9)
  654. # else
  655. # define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)
  656. # endif
  657. #endif
  658. #if GTEST_USES_PCRE
  659. // The appropriate headers have already been included.
  660. #elif GTEST_HAS_POSIX_RE
  661. // On some platforms, <regex.h> needs someone to define size_t, and
  662. // won't compile otherwise. We can #include it here as we already
  663. // included <stdlib.h>, which is guaranteed to define size_t through
  664. // <stddef.h>.
  665. # include <regex.h> // NOLINT
  666. # define GTEST_USES_POSIX_RE 1
  667. #elif GTEST_OS_WINDOWS
  668. // <regex.h> is not available on Windows. Use our own simple regex
  669. // implementation instead.
  670. # define GTEST_USES_SIMPLE_RE 1
  671. #else
  672. // <regex.h> may not be available on this platform. Use our own
  673. // simple regex implementation instead.
  674. # define GTEST_USES_SIMPLE_RE 1
  675. #endif // GTEST_USES_PCRE
  676. #ifndef GTEST_HAS_EXCEPTIONS
  677. // The user didn't tell us whether exceptions are enabled, so we need
  678. // to figure it out.
  679. # if defined(_MSC_VER) && defined(_CPPUNWIND)
  680. // MSVC defines _CPPUNWIND to 1 iff exceptions are enabled.
  681. # define GTEST_HAS_EXCEPTIONS 1
  682. # elif defined(__BORLANDC__)
  683. // C++Builder's implementation of the STL uses the _HAS_EXCEPTIONS
  684. // macro to enable exceptions, so we'll do the same.
  685. // Assumes that exceptions are enabled by default.
  686. # ifndef _HAS_EXCEPTIONS
  687. # define _HAS_EXCEPTIONS 1
  688. # endif // _HAS_EXCEPTIONS
  689. # define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
  690. # elif defined(__clang__)
  691. // clang defines __EXCEPTIONS iff exceptions are enabled before clang 220714,
  692. // but iff cleanups are enabled after that. In Obj-C++ files, there can be
  693. // cleanups for ObjC exceptions which also need cleanups, even if C++ exceptions
  694. // are disabled. clang has __has_feature(cxx_exceptions) which checks for C++
  695. // exceptions starting at clang r206352, but which checked for cleanups prior to
  696. // that. To reliably check for C++ exception availability with clang, check for
  697. // __EXCEPTIONS && __has_feature(cxx_exceptions).
  698. # define GTEST_HAS_EXCEPTIONS (__EXCEPTIONS && __has_feature(cxx_exceptions))
  699. # elif defined(__GNUC__) && __EXCEPTIONS
  700. // gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
  701. # define GTEST_HAS_EXCEPTIONS 1
  702. # elif defined(__SUNPRO_CC)
  703. // Sun Pro CC supports exceptions. However, there is no compile-time way of
  704. // detecting whether they are enabled or not. Therefore, we assume that
  705. // they are enabled unless the user tells us otherwise.
  706. # define GTEST_HAS_EXCEPTIONS 1
  707. # elif defined(__IBMCPP__) && __EXCEPTIONS
  708. // xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
  709. # define GTEST_HAS_EXCEPTIONS 1
  710. # elif defined(__HP_aCC)
  711. // Exception handling is in effect by default in HP aCC compiler. It has to
  712. // be turned of by +noeh compiler option if desired.
  713. # define GTEST_HAS_EXCEPTIONS 1
  714. # else
  715. // For other compilers, we assume exceptions are disabled to be
  716. // conservative.
  717. # define GTEST_HAS_EXCEPTIONS 0
  718. # endif // defined(_MSC_VER) || defined(__BORLANDC__)
  719. #endif // GTEST_HAS_EXCEPTIONS
  720. #if !defined(GTEST_HAS_STD_STRING)
  721. // Even though we don't use this macro any longer, we keep it in case
  722. // some clients still depend on it.
  723. # define GTEST_HAS_STD_STRING 1
  724. #elif !GTEST_HAS_STD_STRING
  725. // The user told us that ::std::string isn't available.
  726. # error "::std::string isn't available."
  727. #endif // !defined(GTEST_HAS_STD_STRING)
  728. #ifndef GTEST_HAS_GLOBAL_STRING
  729. # define GTEST_HAS_GLOBAL_STRING 0
  730. #endif // GTEST_HAS_GLOBAL_STRING
  731. #ifndef GTEST_HAS_STD_WSTRING
  732. // The user didn't tell us whether ::std::wstring is available, so we need
  733. // to figure it out.
  734. // FIXME: uses autoconf to detect whether ::std::wstring
  735. // is available.
  736. // Cygwin 1.7 and below doesn't support ::std::wstring.
  737. // Solaris' libc++ doesn't support it either. Android has
  738. // no support for it at least as recent as Froyo (2.2).
  739. # define GTEST_HAS_STD_WSTRING \
  740. (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
  741. #endif // GTEST_HAS_STD_WSTRING
  742. #ifndef GTEST_HAS_GLOBAL_WSTRING
  743. // The user didn't tell us whether ::wstring is available, so we need
  744. // to figure it out.
  745. # define GTEST_HAS_GLOBAL_WSTRING \
  746. (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
  747. #endif // GTEST_HAS_GLOBAL_WSTRING
  748. // Determines whether RTTI is available.
  749. #ifndef GTEST_HAS_RTTI
  750. // The user didn't tell us whether RTTI is enabled, so we need to
  751. // figure it out.
  752. # ifdef _MSC_VER
  753. # ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled.
  754. # define GTEST_HAS_RTTI 1
  755. # else
  756. # define GTEST_HAS_RTTI 0
  757. # endif
  758. // Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
  759. # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
  760. # ifdef __GXX_RTTI
  761. // When building against STLport with the Android NDK and with
  762. // -frtti -fno-exceptions, the build fails at link time with undefined
  763. // references to __cxa_bad_typeid. Note sure if STL or toolchain bug,
  764. // so disable RTTI when detected.
  765. # if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \
  766. !defined(__EXCEPTIONS)
  767. # define GTEST_HAS_RTTI 0
  768. # else
  769. # define GTEST_HAS_RTTI 1
  770. # endif // GTEST_OS_LINUX_ANDROID && __STLPORT_MAJOR && !__EXCEPTIONS
  771. # else
  772. # define GTEST_HAS_RTTI 0
  773. # endif // __GXX_RTTI
  774. // Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends
  775. // using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the
  776. // first version with C++ support.
  777. # elif defined(__clang__)
  778. # define GTEST_HAS_RTTI __has_feature(cxx_rtti)
  779. // Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
  780. // both the typeid and dynamic_cast features are present.
  781. # elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
  782. # ifdef __RTTI_ALL__
  783. # define GTEST_HAS_RTTI 1
  784. # else
  785. # define GTEST_HAS_RTTI 0
  786. # endif
  787. # else
  788. // For all other compilers, we assume RTTI is enabled.
  789. # define GTEST_HAS_RTTI 1
  790. # endif // _MSC_VER
  791. #endif // GTEST_HAS_RTTI
  792. // It's this header's responsibility to #include <typeinfo> when RTTI
  793. // is enabled.
  794. #if GTEST_HAS_RTTI
  795. # include <typeinfo>
  796. #endif
  797. // Determines whether Google Test can use the pthreads library.
  798. #ifndef GTEST_HAS_PTHREAD
  799. // The user didn't tell us explicitly, so we make reasonable assumptions about
  800. // which platforms have pthreads support.
  801. //
  802. // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
  803. // to your compiler flags.
  804. #define GTEST_HAS_PTHREAD \
  805. (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX || GTEST_OS_QNX || \
  806. GTEST_OS_FREEBSD || GTEST_OS_NACL || GTEST_OS_NETBSD || GTEST_OS_FUCHSIA)
  807. #endif // GTEST_HAS_PTHREAD
  808. #if GTEST_HAS_PTHREAD
  809. // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
  810. // true.
  811. # include <pthread.h> // NOLINT
  812. // For timespec and nanosleep, used below.
  813. # include <time.h> // NOLINT
  814. #endif
  815. // Determines if hash_map/hash_set are available.
  816. // Only used for testing against those containers.
  817. #if !defined(GTEST_HAS_HASH_MAP_)
  818. # if defined(_MSC_VER) && (_MSC_VER < 1900)
  819. # define GTEST_HAS_HASH_MAP_ 1 // Indicates that hash_map is available.
  820. # define GTEST_HAS_HASH_SET_ 1 // Indicates that hash_set is available.
  821. # endif // _MSC_VER
  822. #endif // !defined(GTEST_HAS_HASH_MAP_)
  823. // Determines whether Google Test can use tr1/tuple. You can define
  824. // this macro to 0 to prevent Google Test from using tuple (any
  825. // feature depending on tuple with be disabled in this mode).
  826. #ifndef GTEST_HAS_TR1_TUPLE
  827. # if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR)
  828. // STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>.
  829. # define GTEST_HAS_TR1_TUPLE 0
  830. # elif defined(_MSC_VER) && (_MSC_VER >= 1910)
  831. // Prevent `warning C4996: 'std::tr1': warning STL4002:
  832. // The non-Standard std::tr1 namespace and TR1-only machinery
  833. // are deprecated and will be REMOVED.`
  834. # define GTEST_HAS_TR1_TUPLE 0
  835. # elif GTEST_LANG_CXX11 && defined(_LIBCPP_VERSION)
  836. // libc++ doesn't support TR1.
  837. # define GTEST_HAS_TR1_TUPLE 0
  838. # else
  839. // The user didn't tell us not to do it, so we assume it's OK.
  840. # define GTEST_HAS_TR1_TUPLE 1
  841. # endif
  842. #endif // GTEST_HAS_TR1_TUPLE
  843. // Determines whether Google Test's own tr1 tuple implementation
  844. // should be used.
  845. #ifndef GTEST_USE_OWN_TR1_TUPLE
  846. // We use our own tuple implementation on Symbian.
  847. # if GTEST_OS_SYMBIAN
  848. # define GTEST_USE_OWN_TR1_TUPLE 1
  849. # else
  850. // The user didn't tell us, so we need to figure it out.
  851. // We use our own TR1 tuple if we aren't sure the user has an
  852. // implementation of it already. At this time, libstdc++ 4.0.0+ and
  853. // MSVC 2010 are the only mainstream standard libraries that come
  854. // with a TR1 tuple implementation. NVIDIA's CUDA NVCC compiler
  855. // pretends to be GCC by defining __GNUC__ and friends, but cannot
  856. // compile GCC's tuple implementation. MSVC 2008 (9.0) provides TR1
  857. // tuple in a 323 MB Feature Pack download, which we cannot assume the
  858. // user has. QNX's QCC compiler is a modified GCC but it doesn't
  859. // support TR1 tuple. libc++ only provides std::tuple, in C++11 mode,
  860. // and it can be used with some compilers that define __GNUC__.
  861. # if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \
  862. && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) \
  863. || (_MSC_VER >= 1600 && _MSC_VER < 1900)
  864. # define GTEST_ENV_HAS_TR1_TUPLE_ 1
  865. # endif
  866. // C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used
  867. // in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6
  868. // can build with clang but need to use gcc4.2's libstdc++).
  869. # if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325)
  870. # define GTEST_ENV_HAS_STD_TUPLE_ 1
  871. # endif
  872. # if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_
  873. # define GTEST_USE_OWN_TR1_TUPLE 0
  874. # else
  875. # define GTEST_USE_OWN_TR1_TUPLE 1
  876. # endif
  877. # endif // GTEST_OS_SYMBIAN
  878. #endif // GTEST_USE_OWN_TR1_TUPLE
  879. // To avoid conditional compilation we make it gtest-port.h's responsibility
  880. // to #include the header implementing tuple.
  881. #if GTEST_HAS_STD_TUPLE_
  882. # include <tuple> // IWYU pragma: export
  883. # define GTEST_TUPLE_NAMESPACE_ ::std
  884. #endif // GTEST_HAS_STD_TUPLE_
  885. // We include tr1::tuple even if std::tuple is available to define printers for
  886. // them.
  887. #if GTEST_HAS_TR1_TUPLE
  888. # ifndef GTEST_TUPLE_NAMESPACE_
  889. # define GTEST_TUPLE_NAMESPACE_ ::std::tr1
  890. # endif // GTEST_TUPLE_NAMESPACE_
  891. # if GTEST_USE_OWN_TR1_TUPLE
  892. // This file was GENERATED by command:
  893. // pump.py gtest-tuple.h.pump
  894. // DO NOT EDIT BY HAND!!!
  895. // Copyright 2009 Google Inc.
  896. // All Rights Reserved.
  897. //
  898. // Redistribution and use in source and binary forms, with or without
  899. // modification, are permitted provided that the following conditions are
  900. // met:
  901. //
  902. // * Redistributions of source code must retain the above copyright
  903. // notice, this list of conditions and the following disclaimer.
  904. // * Redistributions in binary form must reproduce the above
  905. // copyright notice, this list of conditions and the following disclaimer
  906. // in the documentation and/or other materials provided with the
  907. // distribution.
  908. // * Neither the name of Google Inc. nor the names of its
  909. // contributors may be used to endorse or promote products derived from
  910. // this software without specific prior written permission.
  911. //
  912. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  913. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  914. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  915. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  916. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  917. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  918. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  919. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  920. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  921. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  922. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  923. // Implements a subset of TR1 tuple needed by Google Test and Google Mock.
  924. // GOOGLETEST_CM0001 DO NOT DELETE
  925. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
  926. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
  927. #include <utility> // For ::std::pair.
  928. // The compiler used in Symbian has a bug that prevents us from declaring the
  929. // tuple template as a friend (it complains that tuple is redefined). This
  930. // bypasses the bug by declaring the members that should otherwise be
  931. // private as public.
  932. // Sun Studio versions < 12 also have the above bug.
  933. #if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
  934. # define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
  935. #else
  936. # define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
  937. template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
  938. private:
  939. #endif
  940. // Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that conflict
  941. // with our own definitions. Therefore using our own tuple does not work on
  942. // those compilers.
  943. #if defined(_MSC_VER) && _MSC_VER >= 1600 /* 1600 is Visual Studio 2010 */
  944. # error "gtest's tuple doesn't compile on Visual Studio 2010 or later. \
  945. GTEST_USE_OWN_TR1_TUPLE must be set to 0 on those compilers."
  946. #endif
  947. // GTEST_n_TUPLE_(T) is the type of an n-tuple.
  948. #define GTEST_0_TUPLE_(T) tuple<>
  949. #define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
  950. void, void, void>
  951. #define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
  952. void, void, void>
  953. #define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
  954. void, void, void>
  955. #define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
  956. void, void, void>
  957. #define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
  958. void, void, void>
  959. #define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
  960. void, void, void>
  961. #define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  962. void, void, void>
  963. #define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  964. T##7, void, void>
  965. #define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  966. T##7, T##8, void>
  967. #define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  968. T##7, T##8, T##9>
  969. // GTEST_n_TYPENAMES_(T) declares a list of n typenames.
  970. #define GTEST_0_TYPENAMES_(T)
  971. #define GTEST_1_TYPENAMES_(T) typename T##0
  972. #define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
  973. #define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
  974. #define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  975. typename T##3
  976. #define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  977. typename T##3, typename T##4
  978. #define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  979. typename T##3, typename T##4, typename T##5
  980. #define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  981. typename T##3, typename T##4, typename T##5, typename T##6
  982. #define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  983. typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
  984. #define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  985. typename T##3, typename T##4, typename T##5, typename T##6, \
  986. typename T##7, typename T##8
  987. #define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  988. typename T##3, typename T##4, typename T##5, typename T##6, \
  989. typename T##7, typename T##8, typename T##9
  990. // In theory, defining stuff in the ::std namespace is undefined
  991. // behavior. We can do this as we are playing the role of a standard
  992. // library vendor.
  993. namespace std {
  994. namespace tr1 {
  995. template <typename T0 = void, typename T1 = void, typename T2 = void,
  996. typename T3 = void, typename T4 = void, typename T5 = void,
  997. typename T6 = void, typename T7 = void, typename T8 = void,
  998. typename T9 = void>
  999. class tuple;
  1000. // Anything in namespace gtest_internal is Google Test's INTERNAL
  1001. // IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
  1002. namespace gtest_internal {
  1003. // ByRef<T>::type is T if T is a reference; otherwise it's const T&.
  1004. template <typename T>
  1005. struct ByRef { typedef const T& type; }; // NOLINT
  1006. template <typename T>
  1007. struct ByRef<T&> { typedef T& type; }; // NOLINT
  1008. // A handy wrapper for ByRef.
  1009. #define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
  1010. // AddRef<T>::type is T if T is a reference; otherwise it's T&. This
  1011. // is the same as tr1::add_reference<T>::type.
  1012. template <typename T>
  1013. struct AddRef { typedef T& type; }; // NOLINT
  1014. template <typename T>
  1015. struct AddRef<T&> { typedef T& type; }; // NOLINT
  1016. // A handy wrapper for AddRef.
  1017. #define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
  1018. // A helper for implementing get<k>().
  1019. template <int k> class Get;
  1020. // A helper for implementing tuple_element<k, T>. kIndexValid is true
  1021. // iff k < the number of fields in tuple type T.
  1022. template <bool kIndexValid, int kIndex, class Tuple>
  1023. struct TupleElement;
  1024. template <GTEST_10_TYPENAMES_(T)>
  1025. struct TupleElement<true, 0, GTEST_10_TUPLE_(T) > {
  1026. typedef T0 type;
  1027. };
  1028. template <GTEST_10_TYPENAMES_(T)>
  1029. struct TupleElement<true, 1, GTEST_10_TUPLE_(T) > {
  1030. typedef T1 type;
  1031. };
  1032. template <GTEST_10_TYPENAMES_(T)>
  1033. struct TupleElement<true, 2, GTEST_10_TUPLE_(T) > {
  1034. typedef T2 type;
  1035. };
  1036. template <GTEST_10_TYPENAMES_(T)>
  1037. struct TupleElement<true, 3, GTEST_10_TUPLE_(T) > {
  1038. typedef T3 type;
  1039. };
  1040. template <GTEST_10_TYPENAMES_(T)>
  1041. struct TupleElement<true, 4, GTEST_10_TUPLE_(T) > {
  1042. typedef T4 type;
  1043. };
  1044. template <GTEST_10_TYPENAMES_(T)>
  1045. struct TupleElement<true, 5, GTEST_10_TUPLE_(T) > {
  1046. typedef T5 type;
  1047. };
  1048. template <GTEST_10_TYPENAMES_(T)>
  1049. struct TupleElement<true, 6, GTEST_10_TUPLE_(T) > {
  1050. typedef T6 type;
  1051. };
  1052. template <GTEST_10_TYPENAMES_(T)>
  1053. struct TupleElement<true, 7, GTEST_10_TUPLE_(T) > {
  1054. typedef T7 type;
  1055. };
  1056. template <GTEST_10_TYPENAMES_(T)>
  1057. struct TupleElement<true, 8, GTEST_10_TUPLE_(T) > {
  1058. typedef T8 type;
  1059. };
  1060. template <GTEST_10_TYPENAMES_(T)>
  1061. struct TupleElement<true, 9, GTEST_10_TUPLE_(T) > {
  1062. typedef T9 type;
  1063. };
  1064. } // namespace gtest_internal
  1065. template <>
  1066. class tuple<> {
  1067. public:
  1068. tuple() {}
  1069. tuple(const tuple& /* t */) {}
  1070. tuple& operator=(const tuple& /* t */) { return *this; }
  1071. };
  1072. template <GTEST_1_TYPENAMES_(T)>
  1073. class GTEST_1_TUPLE_(T) {
  1074. public:
  1075. template <int k> friend class gtest_internal::Get;
  1076. tuple() : f0_() {}
  1077. explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
  1078. tuple(const tuple& t) : f0_(t.f0_) {}
  1079. template <GTEST_1_TYPENAMES_(U)>
  1080. tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
  1081. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1082. template <GTEST_1_TYPENAMES_(U)>
  1083. tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
  1084. return CopyFrom(t);
  1085. }
  1086. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1087. template <GTEST_1_TYPENAMES_(U)>
  1088. tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
  1089. f0_ = t.f0_;
  1090. return *this;
  1091. }
  1092. T0 f0_;
  1093. };
  1094. template <GTEST_2_TYPENAMES_(T)>
  1095. class GTEST_2_TUPLE_(T) {
  1096. public:
  1097. template <int k> friend class gtest_internal::Get;
  1098. tuple() : f0_(), f1_() {}
  1099. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
  1100. f1_(f1) {}
  1101. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
  1102. template <GTEST_2_TYPENAMES_(U)>
  1103. tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
  1104. template <typename U0, typename U1>
  1105. tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
  1106. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1107. template <GTEST_2_TYPENAMES_(U)>
  1108. tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
  1109. return CopyFrom(t);
  1110. }
  1111. template <typename U0, typename U1>
  1112. tuple& operator=(const ::std::pair<U0, U1>& p) {
  1113. f0_ = p.first;
  1114. f1_ = p.second;
  1115. return *this;
  1116. }
  1117. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1118. template <GTEST_2_TYPENAMES_(U)>
  1119. tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
  1120. f0_ = t.f0_;
  1121. f1_ = t.f1_;
  1122. return *this;
  1123. }
  1124. T0 f0_;
  1125. T1 f1_;
  1126. };
  1127. template <GTEST_3_TYPENAMES_(T)>
  1128. class GTEST_3_TUPLE_(T) {
  1129. public:
  1130. template <int k> friend class gtest_internal::Get;
  1131. tuple() : f0_(), f1_(), f2_() {}
  1132. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  1133. GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
  1134. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
  1135. template <GTEST_3_TYPENAMES_(U)>
  1136. tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
  1137. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1138. template <GTEST_3_TYPENAMES_(U)>
  1139. tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
  1140. return CopyFrom(t);
  1141. }
  1142. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1143. template <GTEST_3_TYPENAMES_(U)>
  1144. tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
  1145. f0_ = t.f0_;
  1146. f1_ = t.f1_;
  1147. f2_ = t.f2_;
  1148. return *this;
  1149. }
  1150. T0 f0_;
  1151. T1 f1_;
  1152. T2 f2_;
  1153. };
  1154. template <GTEST_4_TYPENAMES_(T)>
  1155. class GTEST_4_TUPLE_(T) {
  1156. public:
  1157. template <int k> friend class gtest_internal::Get;
  1158. tuple() : f0_(), f1_(), f2_(), f3_() {}
  1159. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  1160. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
  1161. f3_(f3) {}
  1162. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
  1163. template <GTEST_4_TYPENAMES_(U)>
  1164. tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  1165. f3_(t.f3_) {}
  1166. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1167. template <GTEST_4_TYPENAMES_(U)>
  1168. tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
  1169. return CopyFrom(t);
  1170. }
  1171. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1172. template <GTEST_4_TYPENAMES_(U)>
  1173. tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
  1174. f0_ = t.f0_;
  1175. f1_ = t.f1_;
  1176. f2_ = t.f2_;
  1177. f3_ = t.f3_;
  1178. return *this;
  1179. }
  1180. T0 f0_;
  1181. T1 f1_;
  1182. T2 f2_;
  1183. T3 f3_;
  1184. };
  1185. template <GTEST_5_TYPENAMES_(T)>
  1186. class GTEST_5_TUPLE_(T) {
  1187. public:
  1188. template <int k> friend class gtest_internal::Get;
  1189. tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
  1190. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  1191. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
  1192. GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
  1193. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  1194. f4_(t.f4_) {}
  1195. template <GTEST_5_TYPENAMES_(U)>
  1196. tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  1197. f3_(t.f3_), f4_(t.f4_) {}
  1198. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1199. template <GTEST_5_TYPENAMES_(U)>
  1200. tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
  1201. return CopyFrom(t);
  1202. }
  1203. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1204. template <GTEST_5_TYPENAMES_(U)>
  1205. tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
  1206. f0_ = t.f0_;
  1207. f1_ = t.f1_;
  1208. f2_ = t.f2_;
  1209. f3_ = t.f3_;
  1210. f4_ = t.f4_;
  1211. return *this;
  1212. }
  1213. T0 f0_;
  1214. T1 f1_;
  1215. T2 f2_;
  1216. T3 f3_;
  1217. T4 f4_;
  1218. };
  1219. template <GTEST_6_TYPENAMES_(T)>
  1220. class GTEST_6_TUPLE_(T) {
  1221. public:
  1222. template <int k> friend class gtest_internal::Get;
  1223. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
  1224. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  1225. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  1226. GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
  1227. f5_(f5) {}
  1228. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  1229. f4_(t.f4_), f5_(t.f5_) {}
  1230. template <GTEST_6_TYPENAMES_(U)>
  1231. tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  1232. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
  1233. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1234. template <GTEST_6_TYPENAMES_(U)>
  1235. tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
  1236. return CopyFrom(t);
  1237. }
  1238. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1239. template <GTEST_6_TYPENAMES_(U)>
  1240. tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
  1241. f0_ = t.f0_;
  1242. f1_ = t.f1_;
  1243. f2_ = t.f2_;
  1244. f3_ = t.f3_;
  1245. f4_ = t.f4_;
  1246. f5_ = t.f5_;
  1247. return *this;
  1248. }
  1249. T0 f0_;
  1250. T1 f1_;
  1251. T2 f2_;
  1252. T3 f3_;
  1253. T4 f4_;
  1254. T5 f5_;
  1255. };
  1256. template <GTEST_7_TYPENAMES_(T)>
  1257. class GTEST_7_TUPLE_(T) {
  1258. public:
  1259. template <int k> friend class gtest_internal::Get;
  1260. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
  1261. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  1262. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  1263. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
  1264. f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
  1265. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  1266. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
  1267. template <GTEST_7_TYPENAMES_(U)>
  1268. tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  1269. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
  1270. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1271. template <GTEST_7_TYPENAMES_(U)>
  1272. tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
  1273. return CopyFrom(t);
  1274. }
  1275. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1276. template <GTEST_7_TYPENAMES_(U)>
  1277. tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
  1278. f0_ = t.f0_;
  1279. f1_ = t.f1_;
  1280. f2_ = t.f2_;
  1281. f3_ = t.f3_;
  1282. f4_ = t.f4_;
  1283. f5_ = t.f5_;
  1284. f6_ = t.f6_;
  1285. return *this;
  1286. }
  1287. T0 f0_;
  1288. T1 f1_;
  1289. T2 f2_;
  1290. T3 f3_;
  1291. T4 f4_;
  1292. T5 f5_;
  1293. T6 f6_;
  1294. };
  1295. template <GTEST_8_TYPENAMES_(T)>
  1296. class GTEST_8_TUPLE_(T) {
  1297. public:
  1298. template <int k> friend class gtest_internal::Get;
  1299. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
  1300. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  1301. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  1302. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
  1303. GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
  1304. f5_(f5), f6_(f6), f7_(f7) {}
  1305. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  1306. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
  1307. template <GTEST_8_TYPENAMES_(U)>
  1308. tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  1309. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
  1310. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1311. template <GTEST_8_TYPENAMES_(U)>
  1312. tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
  1313. return CopyFrom(t);
  1314. }
  1315. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1316. template <GTEST_8_TYPENAMES_(U)>
  1317. tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
  1318. f0_ = t.f0_;
  1319. f1_ = t.f1_;
  1320. f2_ = t.f2_;
  1321. f3_ = t.f3_;
  1322. f4_ = t.f4_;
  1323. f5_ = t.f5_;
  1324. f6_ = t.f6_;
  1325. f7_ = t.f7_;
  1326. return *this;
  1327. }
  1328. T0 f0_;
  1329. T1 f1_;
  1330. T2 f2_;
  1331. T3 f3_;
  1332. T4 f4_;
  1333. T5 f5_;
  1334. T6 f6_;
  1335. T7 f7_;
  1336. };
  1337. template <GTEST_9_TYPENAMES_(T)>
  1338. class GTEST_9_TUPLE_(T) {
  1339. public:
  1340. template <int k> friend class gtest_internal::Get;
  1341. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
  1342. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  1343. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  1344. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
  1345. GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
  1346. f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
  1347. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  1348. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
  1349. template <GTEST_9_TYPENAMES_(U)>
  1350. tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  1351. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
  1352. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1353. template <GTEST_9_TYPENAMES_(U)>
  1354. tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
  1355. return CopyFrom(t);
  1356. }
  1357. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1358. template <GTEST_9_TYPENAMES_(U)>
  1359. tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
  1360. f0_ = t.f0_;
  1361. f1_ = t.f1_;
  1362. f2_ = t.f2_;
  1363. f3_ = t.f3_;
  1364. f4_ = t.f4_;
  1365. f5_ = t.f5_;
  1366. f6_ = t.f6_;
  1367. f7_ = t.f7_;
  1368. f8_ = t.f8_;
  1369. return *this;
  1370. }
  1371. T0 f0_;
  1372. T1 f1_;
  1373. T2 f2_;
  1374. T3 f3_;
  1375. T4 f4_;
  1376. T5 f5_;
  1377. T6 f6_;
  1378. T7 f7_;
  1379. T8 f8_;
  1380. };
  1381. template <GTEST_10_TYPENAMES_(T)>
  1382. class tuple {
  1383. public:
  1384. template <int k> friend class gtest_internal::Get;
  1385. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
  1386. f9_() {}
  1387. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  1388. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  1389. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
  1390. GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
  1391. f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
  1392. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  1393. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
  1394. template <GTEST_10_TYPENAMES_(U)>
  1395. tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  1396. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
  1397. f9_(t.f9_) {}
  1398. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1399. template <GTEST_10_TYPENAMES_(U)>
  1400. tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
  1401. return CopyFrom(t);
  1402. }
  1403. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1404. template <GTEST_10_TYPENAMES_(U)>
  1405. tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
  1406. f0_ = t.f0_;
  1407. f1_ = t.f1_;
  1408. f2_ = t.f2_;
  1409. f3_ = t.f3_;
  1410. f4_ = t.f4_;
  1411. f5_ = t.f5_;
  1412. f6_ = t.f6_;
  1413. f7_ = t.f7_;
  1414. f8_ = t.f8_;
  1415. f9_ = t.f9_;
  1416. return *this;
  1417. }
  1418. T0 f0_;
  1419. T1 f1_;
  1420. T2 f2_;
  1421. T3 f3_;
  1422. T4 f4_;
  1423. T5 f5_;
  1424. T6 f6_;
  1425. T7 f7_;
  1426. T8 f8_;
  1427. T9 f9_;
  1428. };
  1429. // 6.1.3.2 Tuple creation functions.
  1430. // Known limitations: we don't support passing an
  1431. // std::tr1::reference_wrapper<T> to make_tuple(). And we don't
  1432. // implement tie().
  1433. inline tuple<> make_tuple() { return tuple<>(); }
  1434. template <GTEST_1_TYPENAMES_(T)>
  1435. inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
  1436. return GTEST_1_TUPLE_(T)(f0);
  1437. }
  1438. template <GTEST_2_TYPENAMES_(T)>
  1439. inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
  1440. return GTEST_2_TUPLE_(T)(f0, f1);
  1441. }
  1442. template <GTEST_3_TYPENAMES_(T)>
  1443. inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
  1444. return GTEST_3_TUPLE_(T)(f0, f1, f2);
  1445. }
  1446. template <GTEST_4_TYPENAMES_(T)>
  1447. inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1448. const T3& f3) {
  1449. return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
  1450. }
  1451. template <GTEST_5_TYPENAMES_(T)>
  1452. inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1453. const T3& f3, const T4& f4) {
  1454. return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
  1455. }
  1456. template <GTEST_6_TYPENAMES_(T)>
  1457. inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1458. const T3& f3, const T4& f4, const T5& f5) {
  1459. return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
  1460. }
  1461. template <GTEST_7_TYPENAMES_(T)>
  1462. inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1463. const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
  1464. return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
  1465. }
  1466. template <GTEST_8_TYPENAMES_(T)>
  1467. inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1468. const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
  1469. return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
  1470. }
  1471. template <GTEST_9_TYPENAMES_(T)>
  1472. inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1473. const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
  1474. const T8& f8) {
  1475. return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
  1476. }
  1477. template <GTEST_10_TYPENAMES_(T)>
  1478. inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1479. const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
  1480. const T8& f8, const T9& f9) {
  1481. return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
  1482. }
  1483. // 6.1.3.3 Tuple helper classes.
  1484. template <typename Tuple> struct tuple_size;
  1485. template <GTEST_0_TYPENAMES_(T)>
  1486. struct tuple_size<GTEST_0_TUPLE_(T) > {
  1487. static const int value = 0;
  1488. };
  1489. template <GTEST_1_TYPENAMES_(T)>
  1490. struct tuple_size<GTEST_1_TUPLE_(T) > {
  1491. static const int value = 1;
  1492. };
  1493. template <GTEST_2_TYPENAMES_(T)>
  1494. struct tuple_size<GTEST_2_TUPLE_(T) > {
  1495. static const int value = 2;
  1496. };
  1497. template <GTEST_3_TYPENAMES_(T)>
  1498. struct tuple_size<GTEST_3_TUPLE_(T) > {
  1499. static const int value = 3;
  1500. };
  1501. template <GTEST_4_TYPENAMES_(T)>
  1502. struct tuple_size<GTEST_4_TUPLE_(T) > {
  1503. static const int value = 4;
  1504. };
  1505. template <GTEST_5_TYPENAMES_(T)>
  1506. struct tuple_size<GTEST_5_TUPLE_(T) > {
  1507. static const int value = 5;
  1508. };
  1509. template <GTEST_6_TYPENAMES_(T)>
  1510. struct tuple_size<GTEST_6_TUPLE_(T) > {
  1511. static const int value = 6;
  1512. };
  1513. template <GTEST_7_TYPENAMES_(T)>
  1514. struct tuple_size<GTEST_7_TUPLE_(T) > {
  1515. static const int value = 7;
  1516. };
  1517. template <GTEST_8_TYPENAMES_(T)>
  1518. struct tuple_size<GTEST_8_TUPLE_(T) > {
  1519. static const int value = 8;
  1520. };
  1521. template <GTEST_9_TYPENAMES_(T)>
  1522. struct tuple_size<GTEST_9_TUPLE_(T) > {
  1523. static const int value = 9;
  1524. };
  1525. template <GTEST_10_TYPENAMES_(T)>
  1526. struct tuple_size<GTEST_10_TUPLE_(T) > {
  1527. static const int value = 10;
  1528. };
  1529. template <int k, class Tuple>
  1530. struct tuple_element {
  1531. typedef typename gtest_internal::TupleElement<
  1532. k < (tuple_size<Tuple>::value), k, Tuple>::type type;
  1533. };
  1534. #define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
  1535. // 6.1.3.4 Element access.
  1536. namespace gtest_internal {
  1537. template <>
  1538. class Get<0> {
  1539. public:
  1540. template <class Tuple>
  1541. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
  1542. Field(Tuple& t) { return t.f0_; } // NOLINT
  1543. template <class Tuple>
  1544. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
  1545. ConstField(const Tuple& t) { return t.f0_; }
  1546. };
  1547. template <>
  1548. class Get<1> {
  1549. public:
  1550. template <class Tuple>
  1551. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
  1552. Field(Tuple& t) { return t.f1_; } // NOLINT
  1553. template <class Tuple>
  1554. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
  1555. ConstField(const Tuple& t) { return t.f1_; }
  1556. };
  1557. template <>
  1558. class Get<2> {
  1559. public:
  1560. template <class Tuple>
  1561. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
  1562. Field(Tuple& t) { return t.f2_; } // NOLINT
  1563. template <class Tuple>
  1564. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
  1565. ConstField(const Tuple& t) { return t.f2_; }
  1566. };
  1567. template <>
  1568. class Get<3> {
  1569. public:
  1570. template <class Tuple>
  1571. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
  1572. Field(Tuple& t) { return t.f3_; } // NOLINT
  1573. template <class Tuple>
  1574. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
  1575. ConstField(const Tuple& t) { return t.f3_; }
  1576. };
  1577. template <>
  1578. class Get<4> {
  1579. public:
  1580. template <class Tuple>
  1581. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
  1582. Field(Tuple& t) { return t.f4_; } // NOLINT
  1583. template <class Tuple>
  1584. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
  1585. ConstField(const Tuple& t) { return t.f4_; }
  1586. };
  1587. template <>
  1588. class Get<5> {
  1589. public:
  1590. template <class Tuple>
  1591. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
  1592. Field(Tuple& t) { return t.f5_; } // NOLINT
  1593. template <class Tuple>
  1594. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
  1595. ConstField(const Tuple& t) { return t.f5_; }
  1596. };
  1597. template <>
  1598. class Get<6> {
  1599. public:
  1600. template <class Tuple>
  1601. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
  1602. Field(Tuple& t) { return t.f6_; } // NOLINT
  1603. template <class Tuple>
  1604. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
  1605. ConstField(const Tuple& t) { return t.f6_; }
  1606. };
  1607. template <>
  1608. class Get<7> {
  1609. public:
  1610. template <class Tuple>
  1611. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
  1612. Field(Tuple& t) { return t.f7_; } // NOLINT
  1613. template <class Tuple>
  1614. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
  1615. ConstField(const Tuple& t) { return t.f7_; }
  1616. };
  1617. template <>
  1618. class Get<8> {
  1619. public:
  1620. template <class Tuple>
  1621. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
  1622. Field(Tuple& t) { return t.f8_; } // NOLINT
  1623. template <class Tuple>
  1624. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
  1625. ConstField(const Tuple& t) { return t.f8_; }
  1626. };
  1627. template <>
  1628. class Get<9> {
  1629. public:
  1630. template <class Tuple>
  1631. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
  1632. Field(Tuple& t) { return t.f9_; } // NOLINT
  1633. template <class Tuple>
  1634. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
  1635. ConstField(const Tuple& t) { return t.f9_; }
  1636. };
  1637. } // namespace gtest_internal
  1638. template <int k, GTEST_10_TYPENAMES_(T)>
  1639. GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
  1640. get(GTEST_10_TUPLE_(T)& t) {
  1641. return gtest_internal::Get<k>::Field(t);
  1642. }
  1643. template <int k, GTEST_10_TYPENAMES_(T)>
  1644. GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
  1645. get(const GTEST_10_TUPLE_(T)& t) {
  1646. return gtest_internal::Get<k>::ConstField(t);
  1647. }
  1648. // 6.1.3.5 Relational operators
  1649. // We only implement == and !=, as we don't have a need for the rest yet.
  1650. namespace gtest_internal {
  1651. // SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
  1652. // first k fields of t1 equals the first k fields of t2.
  1653. // SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
  1654. // k1 != k2.
  1655. template <int kSize1, int kSize2>
  1656. struct SameSizeTuplePrefixComparator;
  1657. template <>
  1658. struct SameSizeTuplePrefixComparator<0, 0> {
  1659. template <class Tuple1, class Tuple2>
  1660. static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
  1661. return true;
  1662. }
  1663. };
  1664. template <int k>
  1665. struct SameSizeTuplePrefixComparator<k, k> {
  1666. template <class Tuple1, class Tuple2>
  1667. static bool Eq(const Tuple1& t1, const Tuple2& t2) {
  1668. return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
  1669. ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
  1670. }
  1671. };
  1672. } // namespace gtest_internal
  1673. template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
  1674. inline bool operator==(const GTEST_10_TUPLE_(T)& t,
  1675. const GTEST_10_TUPLE_(U)& u) {
  1676. return gtest_internal::SameSizeTuplePrefixComparator<
  1677. tuple_size<GTEST_10_TUPLE_(T) >::value,
  1678. tuple_size<GTEST_10_TUPLE_(U) >::value>::Eq(t, u);
  1679. }
  1680. template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
  1681. inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
  1682. const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
  1683. // 6.1.4 Pairs.
  1684. // Unimplemented.
  1685. } // namespace tr1
  1686. } // namespace std
  1687. #undef GTEST_0_TUPLE_
  1688. #undef GTEST_1_TUPLE_
  1689. #undef GTEST_2_TUPLE_
  1690. #undef GTEST_3_TUPLE_
  1691. #undef GTEST_4_TUPLE_
  1692. #undef GTEST_5_TUPLE_
  1693. #undef GTEST_6_TUPLE_
  1694. #undef GTEST_7_TUPLE_
  1695. #undef GTEST_8_TUPLE_
  1696. #undef GTEST_9_TUPLE_
  1697. #undef GTEST_10_TUPLE_
  1698. #undef GTEST_0_TYPENAMES_
  1699. #undef GTEST_1_TYPENAMES_
  1700. #undef GTEST_2_TYPENAMES_
  1701. #undef GTEST_3_TYPENAMES_
  1702. #undef GTEST_4_TYPENAMES_
  1703. #undef GTEST_5_TYPENAMES_
  1704. #undef GTEST_6_TYPENAMES_
  1705. #undef GTEST_7_TYPENAMES_
  1706. #undef GTEST_8_TYPENAMES_
  1707. #undef GTEST_9_TYPENAMES_
  1708. #undef GTEST_10_TYPENAMES_
  1709. #undef GTEST_DECLARE_TUPLE_AS_FRIEND_
  1710. #undef GTEST_BY_REF_
  1711. #undef GTEST_ADD_REF_
  1712. #undef GTEST_TUPLE_ELEMENT_
  1713. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
  1714. # elif GTEST_OS_SYMBIAN
  1715. // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
  1716. // use STLport's tuple implementation, which unfortunately doesn't
  1717. // work as the copy of STLport distributed with Symbian is incomplete.
  1718. // By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
  1719. // use its own tuple implementation.
  1720. # ifdef BOOST_HAS_TR1_TUPLE
  1721. # undef BOOST_HAS_TR1_TUPLE
  1722. # endif // BOOST_HAS_TR1_TUPLE
  1723. // This prevents <boost/tr1/detail/config.hpp>, which defines
  1724. // BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
  1725. # define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
  1726. # include <tuple> // IWYU pragma: export // NOLINT
  1727. # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
  1728. // GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header. This does
  1729. // not conform to the TR1 spec, which requires the header to be <tuple>.
  1730. # if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
  1731. // Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
  1732. // which is #included by <tr1/tuple>, to not compile when RTTI is
  1733. // disabled. _TR1_FUNCTIONAL is the header guard for
  1734. // <tr1/functional>. Hence the following #define is used to prevent
  1735. // <tr1/functional> from being included.
  1736. # define _TR1_FUNCTIONAL 1
  1737. # include <tr1/tuple>
  1738. # undef _TR1_FUNCTIONAL // Allows the user to #include
  1739. // <tr1/functional> if they choose to.
  1740. # else
  1741. # include <tr1/tuple> // NOLINT
  1742. # endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
  1743. // VS 2010 now has tr1 support.
  1744. # elif _MSC_VER >= 1600
  1745. # include <tuple> // IWYU pragma: export // NOLINT
  1746. # else // GTEST_USE_OWN_TR1_TUPLE
  1747. # include <tr1/tuple> // IWYU pragma: export // NOLINT
  1748. # endif // GTEST_USE_OWN_TR1_TUPLE
  1749. #endif // GTEST_HAS_TR1_TUPLE
  1750. // Determines whether clone(2) is supported.
  1751. // Usually it will only be available on Linux, excluding
  1752. // Linux on the Itanium architecture.
  1753. // Also see http://linux.die.net/man/2/clone.
  1754. #ifndef GTEST_HAS_CLONE
  1755. // The user didn't tell us, so we need to figure it out.
  1756. # if GTEST_OS_LINUX && !defined(__ia64__)
  1757. # if GTEST_OS_LINUX_ANDROID
  1758. // On Android, clone() became available at different API levels for each 32-bit
  1759. // architecture.
  1760. # if defined(__LP64__) || \
  1761. (defined(__arm__) && __ANDROID_API__ >= 9) || \
  1762. (defined(__mips__) && __ANDROID_API__ >= 12) || \
  1763. (defined(__i386__) && __ANDROID_API__ >= 17)
  1764. # define GTEST_HAS_CLONE 1
  1765. # else
  1766. # define GTEST_HAS_CLONE 0
  1767. # endif
  1768. # else
  1769. # define GTEST_HAS_CLONE 1
  1770. # endif
  1771. # else
  1772. # define GTEST_HAS_CLONE 0
  1773. # endif // GTEST_OS_LINUX && !defined(__ia64__)
  1774. #endif // GTEST_HAS_CLONE
  1775. // Determines whether to support stream redirection. This is used to test
  1776. // output correctness and to implement death tests.
  1777. #ifndef GTEST_HAS_STREAM_REDIRECTION
  1778. // By default, we assume that stream redirection is supported on all
  1779. // platforms except known mobile ones.
  1780. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || \
  1781. GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
  1782. # define GTEST_HAS_STREAM_REDIRECTION 0
  1783. # else
  1784. # define GTEST_HAS_STREAM_REDIRECTION 1
  1785. # endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
  1786. #endif // GTEST_HAS_STREAM_REDIRECTION
  1787. // Determines whether to support death tests.
  1788. // Google Test does not support death tests for VC 7.1 and earlier as
  1789. // abort() in a VC 7.1 application compiled as GUI in debug config
  1790. // pops up a dialog window that cannot be suppressed programmatically.
  1791. #if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
  1792. (GTEST_OS_MAC && !GTEST_OS_IOS) || \
  1793. (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
  1794. GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
  1795. GTEST_OS_OPENBSD || GTEST_OS_QNX || GTEST_OS_FREEBSD || \
  1796. GTEST_OS_NETBSD || GTEST_OS_FUCHSIA)
  1797. # define GTEST_HAS_DEATH_TEST 1
  1798. #endif
  1799. // Determines whether to support type-driven tests.
  1800. // Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
  1801. // Sun Pro CC, IBM Visual Age, and HP aCC support.
  1802. #if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
  1803. defined(__IBMCPP__) || defined(__HP_aCC)
  1804. # define GTEST_HAS_TYPED_TEST 1
  1805. # define GTEST_HAS_TYPED_TEST_P 1
  1806. #endif
  1807. // Determines whether to support Combine(). This only makes sense when
  1808. // value-parameterized tests are enabled. The implementation doesn't
  1809. // work on Sun Studio since it doesn't understand templated conversion
  1810. // operators.
  1811. #if (GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_) && !defined(__SUNPRO_CC)
  1812. # define GTEST_HAS_COMBINE 1
  1813. #endif
  1814. // Determines whether the system compiler uses UTF-16 for encoding wide strings.
  1815. #define GTEST_WIDE_STRING_USES_UTF16_ \
  1816. (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
  1817. // Determines whether test results can be streamed to a socket.
  1818. #if GTEST_OS_LINUX
  1819. # define GTEST_CAN_STREAM_RESULTS_ 1
  1820. #endif
  1821. // Defines some utility macros.
  1822. // The GNU compiler emits a warning if nested "if" statements are followed by
  1823. // an "else" statement and braces are not used to explicitly disambiguate the
  1824. // "else" binding. This leads to problems with code like:
  1825. //
  1826. // if (gate)
  1827. // ASSERT_*(condition) << "Some message";
  1828. //
  1829. // The "switch (0) case 0:" idiom is used to suppress this.
  1830. #ifdef __INTEL_COMPILER
  1831. # define GTEST_AMBIGUOUS_ELSE_BLOCKER_
  1832. #else
  1833. # define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default: // NOLINT
  1834. #endif
  1835. // Use this annotation at the end of a struct/class definition to
  1836. // prevent the compiler from optimizing away instances that are never
  1837. // used. This is useful when all interesting logic happens inside the
  1838. // c'tor and / or d'tor. Example:
  1839. //
  1840. // struct Foo {
  1841. // Foo() { ... }
  1842. // } GTEST_ATTRIBUTE_UNUSED_;
  1843. //
  1844. // Also use it after a variable or parameter declaration to tell the
  1845. // compiler the variable/parameter does not have to be used.
  1846. #if defined(__GNUC__) && !defined(COMPILER_ICC)
  1847. # define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
  1848. #elif defined(__clang__)
  1849. # if __has_attribute(unused)
  1850. # define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
  1851. # endif
  1852. #endif
  1853. #ifndef GTEST_ATTRIBUTE_UNUSED_
  1854. # define GTEST_ATTRIBUTE_UNUSED_
  1855. #endif
  1856. #if GTEST_LANG_CXX11
  1857. # define GTEST_CXX11_EQUALS_DELETE_ = delete
  1858. #else // GTEST_LANG_CXX11
  1859. # define GTEST_CXX11_EQUALS_DELETE_
  1860. #endif // GTEST_LANG_CXX11
  1861. // Use this annotation before a function that takes a printf format string.
  1862. #if (defined(__GNUC__) || defined(__clang__)) && !defined(COMPILER_ICC)
  1863. # if defined(__MINGW_PRINTF_FORMAT)
  1864. // MinGW has two different printf implementations. Ensure the format macro
  1865. // matches the selected implementation. See
  1866. // https://sourceforge.net/p/mingw-w64/wiki2/gnu%20printf/.
  1867. # define GTEST_ATTRIBUTE_PRINTF_(string_index, first_to_check) \
  1868. __attribute__((__format__(__MINGW_PRINTF_FORMAT, string_index, \
  1869. first_to_check)))
  1870. # else
  1871. # define GTEST_ATTRIBUTE_PRINTF_(string_index, first_to_check) \
  1872. __attribute__((__format__(__printf__, string_index, first_to_check)))
  1873. # endif
  1874. #else
  1875. # define GTEST_ATTRIBUTE_PRINTF_(string_index, first_to_check)
  1876. #endif
  1877. // A macro to disallow operator=
  1878. // This should be used in the private: declarations for a class.
  1879. #define GTEST_DISALLOW_ASSIGN_(type) \
  1880. void operator=(type const &) GTEST_CXX11_EQUALS_DELETE_
  1881. // A macro to disallow copy constructor and operator=
  1882. // This should be used in the private: declarations for a class.
  1883. #define GTEST_DISALLOW_COPY_AND_ASSIGN_(type) \
  1884. type(type const &) GTEST_CXX11_EQUALS_DELETE_; \
  1885. GTEST_DISALLOW_ASSIGN_(type)
  1886. // Tell the compiler to warn about unused return values for functions declared
  1887. // with this macro. The macro should be used on function declarations
  1888. // following the argument list:
  1889. //
  1890. // Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
  1891. #if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
  1892. # define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
  1893. #else
  1894. # define GTEST_MUST_USE_RESULT_
  1895. #endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
  1896. // MS C++ compiler emits warning when a conditional expression is compile time
  1897. // constant. In some contexts this warning is false positive and needs to be
  1898. // suppressed. Use the following two macros in such cases:
  1899. //
  1900. // GTEST_INTENTIONAL_CONST_COND_PUSH_()
  1901. // while (true) {
  1902. // GTEST_INTENTIONAL_CONST_COND_POP_()
  1903. // }
  1904. # define GTEST_INTENTIONAL_CONST_COND_PUSH_() \
  1905. GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127)
  1906. # define GTEST_INTENTIONAL_CONST_COND_POP_() \
  1907. GTEST_DISABLE_MSC_WARNINGS_POP_()
  1908. // Determine whether the compiler supports Microsoft's Structured Exception
  1909. // Handling. This is supported by several Windows compilers but generally
  1910. // does not exist on any other system.
  1911. #ifndef GTEST_HAS_SEH
  1912. // The user didn't tell us, so we need to figure it out.
  1913. # if defined(_MSC_VER) || defined(__BORLANDC__)
  1914. // These two compilers are known to support SEH.
  1915. # define GTEST_HAS_SEH 1
  1916. # else
  1917. // Assume no SEH.
  1918. # define GTEST_HAS_SEH 0
  1919. # endif
  1920. #define GTEST_IS_THREADSAFE \
  1921. (GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ \
  1922. || (GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT) \
  1923. || GTEST_HAS_PTHREAD)
  1924. #endif // GTEST_HAS_SEH
  1925. // GTEST_API_ qualifies all symbols that must be exported. The definitions below
  1926. // are guarded by #ifndef to give embedders a chance to define GTEST_API_ in
  1927. // gtest/internal/custom/gtest-port.h
  1928. #ifndef GTEST_API_
  1929. #ifdef _MSC_VER
  1930. # if GTEST_LINKED_AS_SHARED_LIBRARY
  1931. # define GTEST_API_ __declspec(dllimport)
  1932. # elif GTEST_CREATE_SHARED_LIBRARY
  1933. # define GTEST_API_ __declspec(dllexport)
  1934. # endif
  1935. #elif __GNUC__ >= 4 || defined(__clang__)
  1936. # define GTEST_API_ __attribute__((visibility ("default")))
  1937. #endif // _MSC_VER
  1938. #endif // GTEST_API_
  1939. #ifndef GTEST_API_
  1940. # define GTEST_API_
  1941. #endif // GTEST_API_
  1942. #ifndef GTEST_DEFAULT_DEATH_TEST_STYLE
  1943. # define GTEST_DEFAULT_DEATH_TEST_STYLE "fast"
  1944. #endif // GTEST_DEFAULT_DEATH_TEST_STYLE
  1945. #ifdef __GNUC__
  1946. // Ask the compiler to never inline a given function.
  1947. # define GTEST_NO_INLINE_ __attribute__((noinline))
  1948. #else
  1949. # define GTEST_NO_INLINE_
  1950. #endif
  1951. // _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.
  1952. #if !defined(GTEST_HAS_CXXABI_H_)
  1953. # if defined(__GLIBCXX__) || (defined(_LIBCPP_VERSION) && !defined(_MSC_VER))
  1954. # define GTEST_HAS_CXXABI_H_ 1
  1955. # else
  1956. # define GTEST_HAS_CXXABI_H_ 0
  1957. # endif
  1958. #endif
  1959. // A function level attribute to disable checking for use of uninitialized
  1960. // memory when built with MemorySanitizer.
  1961. #if defined(__clang__)
  1962. # if __has_feature(memory_sanitizer)
  1963. # define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ \
  1964. __attribute__((no_sanitize_memory))
  1965. # else
  1966. # define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
  1967. # endif // __has_feature(memory_sanitizer)
  1968. #else
  1969. # define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
  1970. #endif // __clang__
  1971. // A function level attribute to disable AddressSanitizer instrumentation.
  1972. #if defined(__clang__)
  1973. # if __has_feature(address_sanitizer)
  1974. # define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ \
  1975. __attribute__((no_sanitize_address))
  1976. # else
  1977. # define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
  1978. # endif // __has_feature(address_sanitizer)
  1979. #else
  1980. # define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
  1981. #endif // __clang__
  1982. // A function level attribute to disable ThreadSanitizer instrumentation.
  1983. #if defined(__clang__)
  1984. # if __has_feature(thread_sanitizer)
  1985. # define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ \
  1986. __attribute__((no_sanitize_thread))
  1987. # else
  1988. # define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
  1989. # endif // __has_feature(thread_sanitizer)
  1990. #else
  1991. # define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
  1992. #endif // __clang__
  1993. namespace testing {
  1994. class Message;
  1995. #if defined(GTEST_TUPLE_NAMESPACE_)
  1996. // Import tuple and friends into the ::testing namespace.
  1997. // It is part of our interface, having them in ::testing allows us to change
  1998. // their types as needed.
  1999. using GTEST_TUPLE_NAMESPACE_::get;
  2000. using GTEST_TUPLE_NAMESPACE_::make_tuple;
  2001. using GTEST_TUPLE_NAMESPACE_::tuple;
  2002. using GTEST_TUPLE_NAMESPACE_::tuple_size;
  2003. using GTEST_TUPLE_NAMESPACE_::tuple_element;
  2004. #endif // defined(GTEST_TUPLE_NAMESPACE_)
  2005. namespace internal {
  2006. // A secret type that Google Test users don't know about. It has no
  2007. // definition on purpose. Therefore it's impossible to create a
  2008. // Secret object, which is what we want.
  2009. class Secret;
  2010. // The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
  2011. // expression is true. For example, you could use it to verify the
  2012. // size of a static array:
  2013. //
  2014. // GTEST_COMPILE_ASSERT_(GTEST_ARRAY_SIZE_(names) == NUM_NAMES,
  2015. // names_incorrect_size);
  2016. //
  2017. // or to make sure a struct is smaller than a certain size:
  2018. //
  2019. // GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
  2020. //
  2021. // The second argument to the macro is the name of the variable. If
  2022. // the expression is false, most compilers will issue a warning/error
  2023. // containing the name of the variable.
  2024. #if GTEST_LANG_CXX11
  2025. # define GTEST_COMPILE_ASSERT_(expr, msg) static_assert(expr, #msg)
  2026. #else // !GTEST_LANG_CXX11
  2027. template <bool>
  2028. struct CompileAssert {
  2029. };
  2030. # define GTEST_COMPILE_ASSERT_(expr, msg) \
  2031. typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \
  2032. msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_
  2033. #endif // !GTEST_LANG_CXX11
  2034. // Implementation details of GTEST_COMPILE_ASSERT_:
  2035. //
  2036. // (In C++11, we simply use static_assert instead of the following)
  2037. //
  2038. // - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
  2039. // elements (and thus is invalid) when the expression is false.
  2040. //
  2041. // - The simpler definition
  2042. //
  2043. // #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
  2044. //
  2045. // does not work, as gcc supports variable-length arrays whose sizes
  2046. // are determined at run-time (this is gcc's extension and not part
  2047. // of the C++ standard). As a result, gcc fails to reject the
  2048. // following code with the simple definition:
  2049. //
  2050. // int foo;
  2051. // GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
  2052. // // not a compile-time constant.
  2053. //
  2054. // - By using the type CompileAssert<(bool(expr))>, we ensures that
  2055. // expr is a compile-time constant. (Template arguments must be
  2056. // determined at compile-time.)
  2057. //
  2058. // - The outter parentheses in CompileAssert<(bool(expr))> are necessary
  2059. // to work around a bug in gcc 3.4.4 and 4.0.1. If we had written
  2060. //
  2061. // CompileAssert<bool(expr)>
  2062. //
  2063. // instead, these compilers will refuse to compile
  2064. //
  2065. // GTEST_COMPILE_ASSERT_(5 > 0, some_message);
  2066. //
  2067. // (They seem to think the ">" in "5 > 0" marks the end of the
  2068. // template argument list.)
  2069. //
  2070. // - The array size is (bool(expr) ? 1 : -1), instead of simply
  2071. //
  2072. // ((expr) ? 1 : -1).
  2073. //
  2074. // This is to avoid running into a bug in MS VC 7.1, which
  2075. // causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
  2076. // StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
  2077. //
  2078. // This template is declared, but intentionally undefined.
  2079. template <typename T1, typename T2>
  2080. struct StaticAssertTypeEqHelper;
  2081. template <typename T>
  2082. struct StaticAssertTypeEqHelper<T, T> {
  2083. enum { value = true };
  2084. };
  2085. // Same as std::is_same<>.
  2086. template <typename T, typename U>
  2087. struct IsSame {
  2088. enum { value = false };
  2089. };
  2090. template <typename T>
  2091. struct IsSame<T, T> {
  2092. enum { value = true };
  2093. };
  2094. // Evaluates to the number of elements in 'array'.
  2095. #define GTEST_ARRAY_SIZE_(array) (sizeof(array) / sizeof(array[0]))
  2096. #if GTEST_HAS_GLOBAL_STRING
  2097. typedef ::string string;
  2098. #else
  2099. typedef ::std::string string;
  2100. #endif // GTEST_HAS_GLOBAL_STRING
  2101. #if GTEST_HAS_GLOBAL_WSTRING
  2102. typedef ::wstring wstring;
  2103. #elif GTEST_HAS_STD_WSTRING
  2104. typedef ::std::wstring wstring;
  2105. #endif // GTEST_HAS_GLOBAL_WSTRING
  2106. // A helper for suppressing warnings on constant condition. It just
  2107. // returns 'condition'.
  2108. GTEST_API_ bool IsTrue(bool condition);
  2109. // Defines scoped_ptr.
  2110. // RocksDB: use unique_ptr to work around some clang-analyze false reports
  2111. template <typename T>
  2112. using scoped_ptr = std::unique_ptr<T>;
  2113. /*
  2114. // This implementation of scoped_ptr is PARTIAL - it only contains
  2115. // enough stuff to satisfy Google Test's need.
  2116. template <typename T>
  2117. class scoped_ptr {
  2118. public:
  2119. typedef T element_type;
  2120. explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
  2121. ~scoped_ptr() { reset(); }
  2122. T& operator*() const { return *ptr_; }
  2123. T* operator->() const { return ptr_; }
  2124. T* get() const { return ptr_; }
  2125. T* release() {
  2126. T* const ptr = ptr_;
  2127. ptr_ = NULL;
  2128. return ptr;
  2129. }
  2130. void reset(T* p = NULL) {
  2131. if (p != ptr_) {
  2132. if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type.
  2133. delete ptr_;
  2134. }
  2135. ptr_ = p;
  2136. }
  2137. }
  2138. friend void swap(scoped_ptr& a, scoped_ptr& b) {
  2139. using std::swap;
  2140. swap(a.ptr_, b.ptr_);
  2141. }
  2142. private:
  2143. T* ptr_;
  2144. GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
  2145. };
  2146. */
  2147. // Defines RE.
  2148. #if GTEST_USES_PCRE
  2149. // if used, PCRE is injected by custom/gtest-port.h
  2150. #elif GTEST_USES_POSIX_RE || GTEST_USES_SIMPLE_RE
  2151. // A simple C++ wrapper for <regex.h>. It uses the POSIX Extended
  2152. // Regular Expression syntax.
  2153. class GTEST_API_ RE {
  2154. public:
  2155. // A copy constructor is required by the Standard to initialize object
  2156. // references from r-values.
  2157. RE(const RE& other) { Init(other.pattern()); }
  2158. // Constructs an RE from a string.
  2159. RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT
  2160. # if GTEST_HAS_GLOBAL_STRING
  2161. RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT
  2162. # endif // GTEST_HAS_GLOBAL_STRING
  2163. RE(const char* regex) { Init(regex); } // NOLINT
  2164. ~RE();
  2165. // Returns the string representation of the regex.
  2166. const char* pattern() const { return pattern_; }
  2167. // FullMatch(str, re) returns true iff regular expression re matches
  2168. // the entire str.
  2169. // PartialMatch(str, re) returns true iff regular expression re
  2170. // matches a substring of str (including str itself).
  2171. //
  2172. // FIXME: make FullMatch() and PartialMatch() work
  2173. // when str contains NUL characters.
  2174. static bool FullMatch(const ::std::string& str, const RE& re) {
  2175. return FullMatch(str.c_str(), re);
  2176. }
  2177. static bool PartialMatch(const ::std::string& str, const RE& re) {
  2178. return PartialMatch(str.c_str(), re);
  2179. }
  2180. # if GTEST_HAS_GLOBAL_STRING
  2181. static bool FullMatch(const ::string& str, const RE& re) {
  2182. return FullMatch(str.c_str(), re);
  2183. }
  2184. static bool PartialMatch(const ::string& str, const RE& re) {
  2185. return PartialMatch(str.c_str(), re);
  2186. }
  2187. # endif // GTEST_HAS_GLOBAL_STRING
  2188. static bool FullMatch(const char* str, const RE& re);
  2189. static bool PartialMatch(const char* str, const RE& re);
  2190. private:
  2191. void Init(const char* regex);
  2192. // We use a const char* instead of an std::string, as Google Test used to be
  2193. // used where std::string is not available. FIXME: change to
  2194. // std::string.
  2195. const char* pattern_;
  2196. bool is_valid_;
  2197. # if GTEST_USES_POSIX_RE
  2198. regex_t full_regex_; // For FullMatch().
  2199. regex_t partial_regex_; // For PartialMatch().
  2200. # else // GTEST_USES_SIMPLE_RE
  2201. const char* full_pattern_; // For FullMatch();
  2202. # endif
  2203. GTEST_DISALLOW_ASSIGN_(RE);
  2204. };
  2205. #endif // GTEST_USES_PCRE
  2206. // Formats a source file path and a line number as they would appear
  2207. // in an error message from the compiler used to compile this code.
  2208. GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
  2209. // Formats a file location for compiler-independent XML output.
  2210. // Although this function is not platform dependent, we put it next to
  2211. // FormatFileLocation in order to contrast the two functions.
  2212. GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
  2213. int line);
  2214. // Defines logging utilities:
  2215. // GTEST_LOG_(severity) - logs messages at the specified severity level. The
  2216. // message itself is streamed into the macro.
  2217. // LogToStderr() - directs all log messages to stderr.
  2218. // FlushInfoLog() - flushes informational log messages.
  2219. enum GTestLogSeverity {
  2220. GTEST_INFO,
  2221. GTEST_WARNING,
  2222. GTEST_ERROR,
  2223. GTEST_FATAL
  2224. };
  2225. // Formats log entry severity, provides a stream object for streaming the
  2226. // log message, and terminates the message with a newline when going out of
  2227. // scope.
  2228. class GTEST_API_ GTestLog {
  2229. public:
  2230. GTestLog(GTestLogSeverity severity, const char* file, int line);
  2231. // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
  2232. ~GTestLog();
  2233. ::std::ostream& GetStream() { return ::std::cerr; }
  2234. private:
  2235. const GTestLogSeverity severity_;
  2236. GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
  2237. };
  2238. #if !defined(GTEST_LOG_)
  2239. # define GTEST_LOG_(severity) \
  2240. ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
  2241. __FILE__, __LINE__).GetStream()
  2242. inline void LogToStderr() {}
  2243. inline void FlushInfoLog() { fflush(NULL); }
  2244. #endif // !defined(GTEST_LOG_)
  2245. #if !defined(GTEST_CHECK_)
  2246. // INTERNAL IMPLEMENTATION - DO NOT USE.
  2247. //
  2248. // GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
  2249. // is not satisfied.
  2250. // Synopsys:
  2251. // GTEST_CHECK_(boolean_condition);
  2252. // or
  2253. // GTEST_CHECK_(boolean_condition) << "Additional message";
  2254. //
  2255. // This checks the condition and if the condition is not satisfied
  2256. // it prints message about the condition violation, including the
  2257. // condition itself, plus additional message streamed into it, if any,
  2258. // and then it aborts the program. It aborts the program irrespective of
  2259. // whether it is built in the debug mode or not.
  2260. # define GTEST_CHECK_(condition) \
  2261. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  2262. if (::testing::internal::IsTrue(condition)) \
  2263. ; \
  2264. else \
  2265. GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
  2266. #endif // !defined(GTEST_CHECK_)
  2267. // An all-mode assert to verify that the given POSIX-style function
  2268. // call returns 0 (indicating success). Known limitation: this
  2269. // doesn't expand to a balanced 'if' statement, so enclose the macro
  2270. // in {} if you need to use it as the only statement in an 'if'
  2271. // branch.
  2272. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
  2273. if (const int gtest_error = (posix_call)) \
  2274. GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
  2275. << gtest_error
  2276. // Adds reference to a type if it is not a reference type,
  2277. // otherwise leaves it unchanged. This is the same as
  2278. // tr1::add_reference, which is not widely available yet.
  2279. template <typename T>
  2280. struct AddReference { typedef T& type; }; // NOLINT
  2281. template <typename T>
  2282. struct AddReference<T&> { typedef T& type; }; // NOLINT
  2283. // A handy wrapper around AddReference that works when the argument T
  2284. // depends on template parameters.
  2285. #define GTEST_ADD_REFERENCE_(T) \
  2286. typename ::testing::internal::AddReference<T>::type
  2287. // Transforms "T" into "const T&" according to standard reference collapsing
  2288. // rules (this is only needed as a backport for C++98 compilers that do not
  2289. // support reference collapsing). Specifically, it transforms:
  2290. //
  2291. // char ==> const char&
  2292. // const char ==> const char&
  2293. // char& ==> char&
  2294. // const char& ==> const char&
  2295. //
  2296. // Note that the non-const reference will not have "const" added. This is
  2297. // standard, and necessary so that "T" can always bind to "const T&".
  2298. template <typename T>
  2299. struct ConstRef { typedef const T& type; };
  2300. template <typename T>
  2301. struct ConstRef<T&> { typedef T& type; };
  2302. // The argument T must depend on some template parameters.
  2303. #define GTEST_REFERENCE_TO_CONST_(T) \
  2304. typename ::testing::internal::ConstRef<T>::type
  2305. #if GTEST_HAS_STD_MOVE_
  2306. using std::forward;
  2307. using std::move;
  2308. template <typename T>
  2309. struct RvalueRef {
  2310. typedef T&& type;
  2311. };
  2312. #else // GTEST_HAS_STD_MOVE_
  2313. template <typename T>
  2314. const T& move(const T& t) {
  2315. return t;
  2316. }
  2317. template <typename T>
  2318. GTEST_ADD_REFERENCE_(T) forward(GTEST_ADD_REFERENCE_(T) t) { return t; }
  2319. template <typename T>
  2320. struct RvalueRef {
  2321. typedef const T& type;
  2322. };
  2323. #endif // GTEST_HAS_STD_MOVE_
  2324. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  2325. //
  2326. // Use ImplicitCast_ as a safe version of static_cast for upcasting in
  2327. // the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
  2328. // const Foo*). When you use ImplicitCast_, the compiler checks that
  2329. // the cast is safe. Such explicit ImplicitCast_s are necessary in
  2330. // surprisingly many situations where C++ demands an exact type match
  2331. // instead of an argument type convertable to a target type.
  2332. //
  2333. // The syntax for using ImplicitCast_ is the same as for static_cast:
  2334. //
  2335. // ImplicitCast_<ToType>(expr)
  2336. //
  2337. // ImplicitCast_ would have been part of the C++ standard library,
  2338. // but the proposal was submitted too late. It will probably make
  2339. // its way into the language in the future.
  2340. //
  2341. // This relatively ugly name is intentional. It prevents clashes with
  2342. // similar functions users may have (e.g., implicit_cast). The internal
  2343. // namespace alone is not enough because the function can be found by ADL.
  2344. template<typename To>
  2345. inline To ImplicitCast_(To x) { return x; }
  2346. // When you upcast (that is, cast a pointer from type Foo to type
  2347. // SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
  2348. // always succeed. When you downcast (that is, cast a pointer from
  2349. // type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
  2350. // how do you know the pointer is really of type SubclassOfFoo? It
  2351. // could be a bare Foo, or of type DifferentSubclassOfFoo. Thus,
  2352. // when you downcast, you should use this macro. In debug mode, we
  2353. // use dynamic_cast<> to double-check the downcast is legal (we die
  2354. // if it's not). In normal mode, we do the efficient static_cast<>
  2355. // instead. Thus, it's important to test in debug mode to make sure
  2356. // the cast is legal!
  2357. // This is the only place in the code we should use dynamic_cast<>.
  2358. // In particular, you SHOULDN'T be using dynamic_cast<> in order to
  2359. // do RTTI (eg code like this:
  2360. // if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
  2361. // if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
  2362. // You should design the code some other way not to need this.
  2363. //
  2364. // This relatively ugly name is intentional. It prevents clashes with
  2365. // similar functions users may have (e.g., down_cast). The internal
  2366. // namespace alone is not enough because the function can be found by ADL.
  2367. template<typename To, typename From> // use like this: DownCast_<T*>(foo);
  2368. inline To DownCast_(From* f) { // so we only accept pointers
  2369. // Ensures that To is a sub-type of From *. This test is here only
  2370. // for compile-time type checking, and has no overhead in an
  2371. // optimized build at run-time, as it will be optimized away
  2372. // completely.
  2373. GTEST_INTENTIONAL_CONST_COND_PUSH_()
  2374. if (false) {
  2375. GTEST_INTENTIONAL_CONST_COND_POP_()
  2376. const To to = NULL;
  2377. ::testing::internal::ImplicitCast_<From*>(to);
  2378. }
  2379. #if GTEST_HAS_RTTI
  2380. // RTTI: debug mode only!
  2381. GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
  2382. #endif
  2383. return static_cast<To>(f);
  2384. }
  2385. // Downcasts the pointer of type Base to Derived.
  2386. // Derived must be a subclass of Base. The parameter MUST
  2387. // point to a class of type Derived, not any subclass of it.
  2388. // When RTTI is available, the function performs a runtime
  2389. // check to enforce this.
  2390. template <class Derived, class Base>
  2391. Derived* CheckedDowncastToActualType(Base* base) {
  2392. #if GTEST_HAS_RTTI
  2393. GTEST_CHECK_(typeid(*base) == typeid(Derived));
  2394. #endif
  2395. #if GTEST_HAS_DOWNCAST_
  2396. return ::down_cast<Derived*>(base);
  2397. #elif GTEST_HAS_RTTI
  2398. return dynamic_cast<Derived*>(base); // NOLINT
  2399. #else
  2400. return static_cast<Derived*>(base); // Poor man's downcast.
  2401. #endif
  2402. }
  2403. #if GTEST_HAS_STREAM_REDIRECTION
  2404. // Defines the stderr capturer:
  2405. // CaptureStdout - starts capturing stdout.
  2406. // GetCapturedStdout - stops capturing stdout and returns the captured string.
  2407. // CaptureStderr - starts capturing stderr.
  2408. // GetCapturedStderr - stops capturing stderr and returns the captured string.
  2409. //
  2410. GTEST_API_ void CaptureStdout();
  2411. GTEST_API_ std::string GetCapturedStdout();
  2412. GTEST_API_ void CaptureStderr();
  2413. GTEST_API_ std::string GetCapturedStderr();
  2414. #endif // GTEST_HAS_STREAM_REDIRECTION
  2415. // Returns the size (in bytes) of a file.
  2416. GTEST_API_ size_t GetFileSize(FILE* file);
  2417. // Reads the entire content of a file as a string.
  2418. GTEST_API_ std::string ReadEntireFile(FILE* file);
  2419. // All command line arguments.
  2420. GTEST_API_ std::vector<std::string> GetArgvs();
  2421. #if GTEST_HAS_DEATH_TEST
  2422. std::vector<std::string> GetInjectableArgvs();
  2423. // Deprecated: pass the args vector by value instead.
  2424. void SetInjectableArgvs(const std::vector<std::string>* new_argvs);
  2425. void SetInjectableArgvs(const std::vector<std::string>& new_argvs);
  2426. #if GTEST_HAS_GLOBAL_STRING
  2427. void SetInjectableArgvs(const std::vector< ::string>& new_argvs);
  2428. #endif // GTEST_HAS_GLOBAL_STRING
  2429. void ClearInjectableArgvs();
  2430. #endif // GTEST_HAS_DEATH_TEST
  2431. // Defines synchronization primitives.
  2432. #if GTEST_IS_THREADSAFE
  2433. # if GTEST_HAS_PTHREAD
  2434. // Sleeps for (roughly) n milliseconds. This function is only for testing
  2435. // Google Test's own constructs. Don't use it in user tests, either
  2436. // directly or indirectly.
  2437. inline void SleepMilliseconds(int n) {
  2438. const timespec time = {
  2439. 0, // 0 seconds.
  2440. n * 1000L * 1000L, // And n ms.
  2441. };
  2442. nanosleep(&time, NULL);
  2443. }
  2444. # endif // GTEST_HAS_PTHREAD
  2445. # if GTEST_HAS_NOTIFICATION_
  2446. // Notification has already been imported into the namespace.
  2447. // Nothing to do here.
  2448. # elif GTEST_HAS_PTHREAD
  2449. // Allows a controller thread to pause execution of newly created
  2450. // threads until notified. Instances of this class must be created
  2451. // and destroyed in the controller thread.
  2452. //
  2453. // This class is only for testing Google Test's own constructs. Do not
  2454. // use it in user tests, either directly or indirectly.
  2455. class Notification {
  2456. public:
  2457. Notification() : notified_(false) {
  2458. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
  2459. }
  2460. ~Notification() {
  2461. pthread_mutex_destroy(&mutex_);
  2462. }
  2463. // Notifies all threads created with this notification to start. Must
  2464. // be called from the controller thread.
  2465. void Notify() {
  2466. pthread_mutex_lock(&mutex_);
  2467. notified_ = true;
  2468. pthread_mutex_unlock(&mutex_);
  2469. }
  2470. // Blocks until the controller thread notifies. Must be called from a test
  2471. // thread.
  2472. void WaitForNotification() {
  2473. for (;;) {
  2474. pthread_mutex_lock(&mutex_);
  2475. const bool notified = notified_;
  2476. pthread_mutex_unlock(&mutex_);
  2477. if (notified)
  2478. break;
  2479. SleepMilliseconds(10);
  2480. }
  2481. }
  2482. private:
  2483. pthread_mutex_t mutex_;
  2484. bool notified_;
  2485. GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
  2486. };
  2487. # elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
  2488. GTEST_API_ void SleepMilliseconds(int n);
  2489. // Provides leak-safe Windows kernel handle ownership.
  2490. // Used in death tests and in threading support.
  2491. class GTEST_API_ AutoHandle {
  2492. public:
  2493. // Assume that Win32 HANDLE type is equivalent to void*. Doing so allows us to
  2494. // avoid including <windows.h> in this header file. Including <windows.h> is
  2495. // undesirable because it defines a lot of symbols and macros that tend to
  2496. // conflict with client code. This assumption is verified by
  2497. // WindowsTypesTest.HANDLEIsVoidStar.
  2498. typedef void* Handle;
  2499. AutoHandle();
  2500. explicit AutoHandle(Handle handle);
  2501. ~AutoHandle();
  2502. Handle Get() const;
  2503. void Reset();
  2504. void Reset(Handle handle);
  2505. private:
  2506. // Returns true iff the handle is a valid handle object that can be closed.
  2507. bool IsCloseable() const;
  2508. Handle handle_;
  2509. GTEST_DISALLOW_COPY_AND_ASSIGN_(AutoHandle);
  2510. };
  2511. // Allows a controller thread to pause execution of newly created
  2512. // threads until notified. Instances of this class must be created
  2513. // and destroyed in the controller thread.
  2514. //
  2515. // This class is only for testing Google Test's own constructs. Do not
  2516. // use it in user tests, either directly or indirectly.
  2517. class GTEST_API_ Notification {
  2518. public:
  2519. Notification();
  2520. void Notify();
  2521. void WaitForNotification();
  2522. private:
  2523. AutoHandle event_;
  2524. GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
  2525. };
  2526. # endif // GTEST_HAS_NOTIFICATION_
  2527. // On MinGW, we can have both GTEST_OS_WINDOWS and GTEST_HAS_PTHREAD
  2528. // defined, but we don't want to use MinGW's pthreads implementation, which
  2529. // has conformance problems with some versions of the POSIX standard.
  2530. # if GTEST_HAS_PTHREAD && !GTEST_OS_WINDOWS_MINGW
  2531. // As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
  2532. // Consequently, it cannot select a correct instantiation of ThreadWithParam
  2533. // in order to call its Run(). Introducing ThreadWithParamBase as a
  2534. // non-templated base class for ThreadWithParam allows us to bypass this
  2535. // problem.
  2536. class ThreadWithParamBase {
  2537. public:
  2538. virtual ~ThreadWithParamBase() {}
  2539. virtual void Run() = 0;
  2540. };
  2541. // pthread_create() accepts a pointer to a function type with the C linkage.
  2542. // According to the Standard (7.5/1), function types with different linkages
  2543. // are different even if they are otherwise identical. Some compilers (for
  2544. // example, SunStudio) treat them as different types. Since class methods
  2545. // cannot be defined with C-linkage we need to define a free C-function to
  2546. // pass into pthread_create().
  2547. extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
  2548. static_cast<ThreadWithParamBase*>(thread)->Run();
  2549. return NULL;
  2550. }
  2551. // Helper class for testing Google Test's multi-threading constructs.
  2552. // To use it, write:
  2553. //
  2554. // void ThreadFunc(int param) { /* Do things with param */ }
  2555. // Notification thread_can_start;
  2556. // ...
  2557. // // The thread_can_start parameter is optional; you can supply NULL.
  2558. // ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
  2559. // thread_can_start.Notify();
  2560. //
  2561. // These classes are only for testing Google Test's own constructs. Do
  2562. // not use them in user tests, either directly or indirectly.
  2563. template <typename T>
  2564. class ThreadWithParam : public ThreadWithParamBase {
  2565. public:
  2566. typedef void UserThreadFunc(T);
  2567. ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
  2568. : func_(func),
  2569. param_(param),
  2570. thread_can_start_(thread_can_start),
  2571. finished_(false) {
  2572. ThreadWithParamBase* const base = this;
  2573. // The thread can be created only after all fields except thread_
  2574. // have been initialized.
  2575. GTEST_CHECK_POSIX_SUCCESS_(
  2576. pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
  2577. }
  2578. ~ThreadWithParam() { Join(); }
  2579. void Join() {
  2580. if (!finished_) {
  2581. GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
  2582. finished_ = true;
  2583. }
  2584. }
  2585. virtual void Run() {
  2586. if (thread_can_start_ != NULL)
  2587. thread_can_start_->WaitForNotification();
  2588. func_(param_);
  2589. }
  2590. private:
  2591. UserThreadFunc* const func_; // User-supplied thread function.
  2592. const T param_; // User-supplied parameter to the thread function.
  2593. // When non-NULL, used to block execution until the controller thread
  2594. // notifies.
  2595. Notification* const thread_can_start_;
  2596. bool finished_; // true iff we know that the thread function has finished.
  2597. pthread_t thread_; // The native thread object.
  2598. GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
  2599. };
  2600. # endif // !GTEST_OS_WINDOWS && GTEST_HAS_PTHREAD ||
  2601. // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
  2602. # if GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
  2603. // Mutex and ThreadLocal have already been imported into the namespace.
  2604. // Nothing to do here.
  2605. # elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
  2606. // Mutex implements mutex on Windows platforms. It is used in conjunction
  2607. // with class MutexLock:
  2608. //
  2609. // Mutex mutex;
  2610. // ...
  2611. // MutexLock lock(&mutex); // Acquires the mutex and releases it at the
  2612. // // end of the current scope.
  2613. //
  2614. // A static Mutex *must* be defined or declared using one of the following
  2615. // macros:
  2616. // GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
  2617. // GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
  2618. //
  2619. // (A non-static Mutex is defined/declared in the usual way).
  2620. class GTEST_API_ Mutex {
  2621. public:
  2622. enum MutexType { kStatic = 0, kDynamic = 1 };
  2623. // We rely on kStaticMutex being 0 as it is to what the linker initializes
  2624. // type_ in static mutexes. critical_section_ will be initialized lazily
  2625. // in ThreadSafeLazyInit().
  2626. enum StaticConstructorSelector { kStaticMutex = 0 };
  2627. // This constructor intentionally does nothing. It relies on type_ being
  2628. // statically initialized to 0 (effectively setting it to kStatic) and on
  2629. // ThreadSafeLazyInit() to lazily initialize the rest of the members.
  2630. explicit Mutex(StaticConstructorSelector /*dummy*/) {}
  2631. Mutex();
  2632. ~Mutex();
  2633. void Lock();
  2634. void Unlock();
  2635. // Does nothing if the current thread holds the mutex. Otherwise, crashes
  2636. // with high probability.
  2637. void AssertHeld();
  2638. private:
  2639. // Initializes owner_thread_id_ and critical_section_ in static mutexes.
  2640. void ThreadSafeLazyInit();
  2641. // Per https://blogs.msdn.microsoft.com/oldnewthing/20040223-00/?p=40503,
  2642. // we assume that 0 is an invalid value for thread IDs.
  2643. unsigned int owner_thread_id_;
  2644. // For static mutexes, we rely on these members being initialized to zeros
  2645. // by the linker.
  2646. MutexType type_;
  2647. long critical_section_init_phase_; // NOLINT
  2648. GTEST_CRITICAL_SECTION* critical_section_;
  2649. GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
  2650. };
  2651. # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
  2652. extern ::testing::internal::Mutex mutex
  2653. # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
  2654. ::testing::internal::Mutex mutex(::testing::internal::Mutex::kStaticMutex)
  2655. // We cannot name this class MutexLock because the ctor declaration would
  2656. // conflict with a macro named MutexLock, which is defined on some
  2657. // platforms. That macro is used as a defensive measure to prevent against
  2658. // inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
  2659. // "MutexLock l(&mu)". Hence the typedef trick below.
  2660. class GTestMutexLock {
  2661. public:
  2662. explicit GTestMutexLock(Mutex* mutex)
  2663. : mutex_(mutex) { mutex_->Lock(); }
  2664. ~GTestMutexLock() { mutex_->Unlock(); }
  2665. private:
  2666. Mutex* const mutex_;
  2667. GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
  2668. };
  2669. typedef GTestMutexLock MutexLock;
  2670. // Base class for ValueHolder<T>. Allows a caller to hold and delete a value
  2671. // without knowing its type.
  2672. class ThreadLocalValueHolderBase {
  2673. public:
  2674. virtual ~ThreadLocalValueHolderBase() {}
  2675. };
  2676. // Provides a way for a thread to send notifications to a ThreadLocal
  2677. // regardless of its parameter type.
  2678. class ThreadLocalBase {
  2679. public:
  2680. // Creates a new ValueHolder<T> object holding a default value passed to
  2681. // this ThreadLocal<T>'s constructor and returns it. It is the caller's
  2682. // responsibility not to call this when the ThreadLocal<T> instance already
  2683. // has a value on the current thread.
  2684. virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const = 0;
  2685. protected:
  2686. ThreadLocalBase() {}
  2687. virtual ~ThreadLocalBase() {}
  2688. private:
  2689. GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocalBase);
  2690. };
  2691. // Maps a thread to a set of ThreadLocals that have values instantiated on that
  2692. // thread and notifies them when the thread exits. A ThreadLocal instance is
  2693. // expected to persist until all threads it has values on have terminated.
  2694. class GTEST_API_ ThreadLocalRegistry {
  2695. public:
  2696. // Registers thread_local_instance as having value on the current thread.
  2697. // Returns a value that can be used to identify the thread from other threads.
  2698. static ThreadLocalValueHolderBase* GetValueOnCurrentThread(
  2699. const ThreadLocalBase* thread_local_instance);
  2700. // Invoked when a ThreadLocal instance is destroyed.
  2701. static void OnThreadLocalDestroyed(
  2702. const ThreadLocalBase* thread_local_instance);
  2703. };
  2704. class GTEST_API_ ThreadWithParamBase {
  2705. public:
  2706. void Join();
  2707. protected:
  2708. class Runnable {
  2709. public:
  2710. virtual ~Runnable() {}
  2711. virtual void Run() = 0;
  2712. };
  2713. ThreadWithParamBase(Runnable *runnable, Notification* thread_can_start);
  2714. virtual ~ThreadWithParamBase();
  2715. private:
  2716. AutoHandle thread_;
  2717. };
  2718. // Helper class for testing Google Test's multi-threading constructs.
  2719. template <typename T>
  2720. class ThreadWithParam : public ThreadWithParamBase {
  2721. public:
  2722. typedef void UserThreadFunc(T);
  2723. ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
  2724. : ThreadWithParamBase(new RunnableImpl(func, param), thread_can_start) {
  2725. }
  2726. virtual ~ThreadWithParam() {}
  2727. private:
  2728. class RunnableImpl : public Runnable {
  2729. public:
  2730. RunnableImpl(UserThreadFunc* func, T param)
  2731. : func_(func),
  2732. param_(param) {
  2733. }
  2734. virtual ~RunnableImpl() {}
  2735. virtual void Run() {
  2736. func_(param_);
  2737. }
  2738. private:
  2739. UserThreadFunc* const func_;
  2740. const T param_;
  2741. GTEST_DISALLOW_COPY_AND_ASSIGN_(RunnableImpl);
  2742. };
  2743. GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
  2744. };
  2745. // Implements thread-local storage on Windows systems.
  2746. //
  2747. // // Thread 1
  2748. // ThreadLocal<int> tl(100); // 100 is the default value for each thread.
  2749. //
  2750. // // Thread 2
  2751. // tl.set(150); // Changes the value for thread 2 only.
  2752. // EXPECT_EQ(150, tl.get());
  2753. //
  2754. // // Thread 1
  2755. // EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value.
  2756. // tl.set(200);
  2757. // EXPECT_EQ(200, tl.get());
  2758. //
  2759. // The template type argument T must have a public copy constructor.
  2760. // In addition, the default ThreadLocal constructor requires T to have
  2761. // a public default constructor.
  2762. //
  2763. // The users of a TheadLocal instance have to make sure that all but one
  2764. // threads (including the main one) using that instance have exited before
  2765. // destroying it. Otherwise, the per-thread objects managed for them by the
  2766. // ThreadLocal instance are not guaranteed to be destroyed on all platforms.
  2767. //
  2768. // Google Test only uses global ThreadLocal objects. That means they
  2769. // will die after main() has returned. Therefore, no per-thread
  2770. // object managed by Google Test will be leaked as long as all threads
  2771. // using Google Test have exited when main() returns.
  2772. template <typename T>
  2773. class ThreadLocal : public ThreadLocalBase {
  2774. public:
  2775. ThreadLocal() : default_factory_(new DefaultValueHolderFactory()) {}
  2776. explicit ThreadLocal(const T& value)
  2777. : default_factory_(new InstanceValueHolderFactory(value)) {}
  2778. ~ThreadLocal() { ThreadLocalRegistry::OnThreadLocalDestroyed(this); }
  2779. T* pointer() { return GetOrCreateValue(); }
  2780. const T* pointer() const { return GetOrCreateValue(); }
  2781. const T& get() const { return *pointer(); }
  2782. void set(const T& value) { *pointer() = value; }
  2783. private:
  2784. // Holds a value of T. Can be deleted via its base class without the caller
  2785. // knowing the type of T.
  2786. class ValueHolder : public ThreadLocalValueHolderBase {
  2787. public:
  2788. ValueHolder() : value_() {}
  2789. explicit ValueHolder(const T& value) : value_(value) {}
  2790. T* pointer() { return &value_; }
  2791. private:
  2792. T value_;
  2793. GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
  2794. };
  2795. T* GetOrCreateValue() const {
  2796. return static_cast<ValueHolder*>(
  2797. ThreadLocalRegistry::GetValueOnCurrentThread(this))->pointer();
  2798. }
  2799. virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const {
  2800. return default_factory_->MakeNewHolder();
  2801. }
  2802. class ValueHolderFactory {
  2803. public:
  2804. ValueHolderFactory() {}
  2805. virtual ~ValueHolderFactory() {}
  2806. virtual ValueHolder* MakeNewHolder() const = 0;
  2807. private:
  2808. GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);
  2809. };
  2810. class DefaultValueHolderFactory : public ValueHolderFactory {
  2811. public:
  2812. DefaultValueHolderFactory() {}
  2813. virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }
  2814. private:
  2815. GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
  2816. };
  2817. class InstanceValueHolderFactory : public ValueHolderFactory {
  2818. public:
  2819. explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
  2820. virtual ValueHolder* MakeNewHolder() const {
  2821. return new ValueHolder(value_);
  2822. }
  2823. private:
  2824. const T value_; // The value for each thread.
  2825. GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);
  2826. };
  2827. scoped_ptr<ValueHolderFactory> default_factory_;
  2828. GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
  2829. };
  2830. # elif GTEST_HAS_PTHREAD
  2831. // MutexBase and Mutex implement mutex on pthreads-based platforms.
  2832. class MutexBase {
  2833. public:
  2834. // Acquires this mutex.
  2835. void Lock() {
  2836. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
  2837. owner_ = pthread_self();
  2838. has_owner_ = true;
  2839. }
  2840. // Releases this mutex.
  2841. void Unlock() {
  2842. // Since the lock is being released the owner_ field should no longer be
  2843. // considered valid. We don't protect writing to has_owner_ here, as it's
  2844. // the caller's responsibility to ensure that the current thread holds the
  2845. // mutex when this is called.
  2846. has_owner_ = false;
  2847. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
  2848. }
  2849. // Does nothing if the current thread holds the mutex. Otherwise, crashes
  2850. // with high probability.
  2851. void AssertHeld() const {
  2852. GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))
  2853. << "The current thread is not holding the mutex @" << this;
  2854. }
  2855. // A static mutex may be used before main() is entered. It may even
  2856. // be used before the dynamic initialization stage. Therefore we
  2857. // must be able to initialize a static mutex object at link time.
  2858. // This means MutexBase has to be a POD and its member variables
  2859. // have to be public.
  2860. public:
  2861. pthread_mutex_t mutex_; // The underlying pthread mutex.
  2862. // has_owner_ indicates whether the owner_ field below contains a valid thread
  2863. // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All
  2864. // accesses to the owner_ field should be protected by a check of this field.
  2865. // An alternative might be to memset() owner_ to all zeros, but there's no
  2866. // guarantee that a zero'd pthread_t is necessarily invalid or even different
  2867. // from pthread_self().
  2868. bool has_owner_;
  2869. pthread_t owner_; // The thread holding the mutex.
  2870. };
  2871. // Forward-declares a static mutex.
  2872. # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
  2873. extern ::testing::internal::MutexBase mutex
  2874. // Defines and statically (i.e. at link time) initializes a static mutex.
  2875. // The initialization list here does not explicitly initialize each field,
  2876. // instead relying on default initialization for the unspecified fields. In
  2877. // particular, the owner_ field (a pthread_t) is not explicitly initialized.
  2878. // This allows initialization to work whether pthread_t is a scalar or struct.
  2879. // The flag -Wmissing-field-initializers must not be specified for this to work.
  2880. #define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
  2881. ::testing::internal::MutexBase mutex = {PTHREAD_MUTEX_INITIALIZER, false, 0}
  2882. // The Mutex class can only be used for mutexes created at runtime. It
  2883. // shares its API with MutexBase otherwise.
  2884. class Mutex : public MutexBase {
  2885. public:
  2886. Mutex() {
  2887. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
  2888. has_owner_ = false;
  2889. }
  2890. ~Mutex() {
  2891. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
  2892. }
  2893. private:
  2894. GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
  2895. };
  2896. // We cannot name this class MutexLock because the ctor declaration would
  2897. // conflict with a macro named MutexLock, which is defined on some
  2898. // platforms. That macro is used as a defensive measure to prevent against
  2899. // inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
  2900. // "MutexLock l(&mu)". Hence the typedef trick below.
  2901. class GTestMutexLock {
  2902. public:
  2903. explicit GTestMutexLock(MutexBase* mutex)
  2904. : mutex_(mutex) { mutex_->Lock(); }
  2905. ~GTestMutexLock() { mutex_->Unlock(); }
  2906. private:
  2907. MutexBase* const mutex_;
  2908. GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
  2909. };
  2910. typedef GTestMutexLock MutexLock;
  2911. // Helpers for ThreadLocal.
  2912. // pthread_key_create() requires DeleteThreadLocalValue() to have
  2913. // C-linkage. Therefore it cannot be templatized to access
  2914. // ThreadLocal<T>. Hence the need for class
  2915. // ThreadLocalValueHolderBase.
  2916. class ThreadLocalValueHolderBase {
  2917. public:
  2918. virtual ~ThreadLocalValueHolderBase() {}
  2919. };
  2920. // Called by pthread to delete thread-local data stored by
  2921. // pthread_setspecific().
  2922. extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
  2923. delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
  2924. }
  2925. // Implements thread-local storage on pthreads-based systems.
  2926. template <typename T>
  2927. class GTEST_API_ ThreadLocal {
  2928. public:
  2929. ThreadLocal()
  2930. : key_(CreateKey()), default_factory_(new DefaultValueHolderFactory()) {}
  2931. explicit ThreadLocal(const T& value)
  2932. : key_(CreateKey()),
  2933. default_factory_(new InstanceValueHolderFactory(value)) {}
  2934. ~ThreadLocal() {
  2935. // Destroys the managed object for the current thread, if any.
  2936. DeleteThreadLocalValue(pthread_getspecific(key_));
  2937. // Releases resources associated with the key. This will *not*
  2938. // delete managed objects for other threads.
  2939. GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
  2940. }
  2941. T* pointer() { return GetOrCreateValue(); }
  2942. const T* pointer() const { return GetOrCreateValue(); }
  2943. const T& get() const { return *pointer(); }
  2944. void set(const T& value) { *pointer() = value; }
  2945. private:
  2946. // Holds a value of type T.
  2947. class ValueHolder : public ThreadLocalValueHolderBase {
  2948. public:
  2949. ValueHolder() : value_() {}
  2950. explicit ValueHolder(const T& value) : value_(value) {}
  2951. T* pointer() { return &value_; }
  2952. private:
  2953. T value_;
  2954. GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
  2955. };
  2956. static pthread_key_t CreateKey() {
  2957. pthread_key_t key;
  2958. // When a thread exits, DeleteThreadLocalValue() will be called on
  2959. // the object managed for that thread.
  2960. GTEST_CHECK_POSIX_SUCCESS_(
  2961. pthread_key_create(&key, &DeleteThreadLocalValue));
  2962. return key;
  2963. }
  2964. T* GetOrCreateValue() const {
  2965. ThreadLocalValueHolderBase* const holder =
  2966. static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
  2967. if (holder != NULL) {
  2968. return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
  2969. }
  2970. ValueHolder* const new_holder = default_factory_->MakeNewHolder();
  2971. ThreadLocalValueHolderBase* const holder_base = new_holder;
  2972. GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
  2973. return new_holder->pointer();
  2974. }
  2975. class ValueHolderFactory {
  2976. public:
  2977. ValueHolderFactory() {}
  2978. virtual ~ValueHolderFactory() {}
  2979. virtual ValueHolder* MakeNewHolder() const = 0;
  2980. private:
  2981. GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);
  2982. };
  2983. class DefaultValueHolderFactory : public ValueHolderFactory {
  2984. public:
  2985. DefaultValueHolderFactory() {}
  2986. virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }
  2987. private:
  2988. GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
  2989. };
  2990. class InstanceValueHolderFactory : public ValueHolderFactory {
  2991. public:
  2992. explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
  2993. virtual ValueHolder* MakeNewHolder() const {
  2994. return new ValueHolder(value_);
  2995. }
  2996. private:
  2997. const T value_; // The value for each thread.
  2998. GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);
  2999. };
  3000. // A key pthreads uses for looking up per-thread values.
  3001. const pthread_key_t key_;
  3002. scoped_ptr<ValueHolderFactory> default_factory_;
  3003. GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
  3004. };
  3005. # endif // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
  3006. #else // GTEST_IS_THREADSAFE
  3007. // A dummy implementation of synchronization primitives (mutex, lock,
  3008. // and thread-local variable). Necessary for compiling Google Test where
  3009. // mutex is not supported - using Google Test in multiple threads is not
  3010. // supported on such platforms.
  3011. class Mutex {
  3012. public:
  3013. Mutex() {}
  3014. void Lock() {}
  3015. void Unlock() {}
  3016. void AssertHeld() const {}
  3017. };
  3018. # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
  3019. extern ::testing::internal::Mutex mutex
  3020. # define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
  3021. // We cannot name this class MutexLock because the ctor declaration would
  3022. // conflict with a macro named MutexLock, which is defined on some
  3023. // platforms. That macro is used as a defensive measure to prevent against
  3024. // inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
  3025. // "MutexLock l(&mu)". Hence the typedef trick below.
  3026. class GTestMutexLock {
  3027. public:
  3028. explicit GTestMutexLock(Mutex*) {} // NOLINT
  3029. };
  3030. typedef GTestMutexLock MutexLock;
  3031. template <typename T>
  3032. class GTEST_API_ ThreadLocal {
  3033. public:
  3034. ThreadLocal() : value_() {}
  3035. explicit ThreadLocal(const T& value) : value_(value) {}
  3036. T* pointer() { return &value_; }
  3037. const T* pointer() const { return &value_; }
  3038. const T& get() const { return value_; }
  3039. void set(const T& value) { value_ = value; }
  3040. private:
  3041. T value_;
  3042. };
  3043. #endif // GTEST_IS_THREADSAFE
  3044. // Returns the number of threads running in the process, or 0 to indicate that
  3045. // we cannot detect it.
  3046. GTEST_API_ size_t GetThreadCount();
  3047. // Passing non-POD classes through ellipsis (...) crashes the ARM
  3048. // compiler and generates a warning in Sun Studio before 12u4. The Nokia Symbian
  3049. // and the IBM XL C/C++ compiler try to instantiate a copy constructor
  3050. // for objects passed through ellipsis (...), failing for uncopyable
  3051. // objects. We define this to ensure that only POD is passed through
  3052. // ellipsis on these systems.
  3053. #if defined(__SYMBIAN32__) || defined(__IBMCPP__) || \
  3054. (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5130)
  3055. // We lose support for NULL detection where the compiler doesn't like
  3056. // passing non-POD classes through ellipsis (...).
  3057. # define GTEST_ELLIPSIS_NEEDS_POD_ 1
  3058. #else
  3059. # define GTEST_CAN_COMPARE_NULL 1
  3060. #endif
  3061. // The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
  3062. // const T& and const T* in a function template. These compilers
  3063. // _can_ decide between class template specializations for T and T*,
  3064. // so a tr1::type_traits-like is_pointer works.
  3065. #if defined(__SYMBIAN32__) || defined(__IBMCPP__)
  3066. # define GTEST_NEEDS_IS_POINTER_ 1
  3067. #endif
  3068. template <bool bool_value>
  3069. struct bool_constant {
  3070. typedef bool_constant<bool_value> type;
  3071. static const bool value = bool_value;
  3072. };
  3073. template <bool bool_value> const bool bool_constant<bool_value>::value;
  3074. typedef bool_constant<false> false_type;
  3075. typedef bool_constant<true> true_type;
  3076. template <typename T, typename U>
  3077. struct is_same : public false_type {};
  3078. template <typename T>
  3079. struct is_same<T, T> : public true_type {};
  3080. template <typename T>
  3081. struct is_pointer : public false_type {};
  3082. template <typename T>
  3083. struct is_pointer<T*> : public true_type {};
  3084. template <typename Iterator>
  3085. struct IteratorTraits {
  3086. typedef typename Iterator::value_type value_type;
  3087. };
  3088. template <typename T>
  3089. struct IteratorTraits<T*> {
  3090. typedef T value_type;
  3091. };
  3092. template <typename T>
  3093. struct IteratorTraits<const T*> {
  3094. typedef T value_type;
  3095. };
  3096. #if GTEST_OS_WINDOWS
  3097. # define GTEST_PATH_SEP_ "\\"
  3098. # define GTEST_HAS_ALT_PATH_SEP_ 1
  3099. // The biggest signed integer type the compiler supports.
  3100. typedef __int64 BiggestInt;
  3101. #else
  3102. # define GTEST_PATH_SEP_ "/"
  3103. # define GTEST_HAS_ALT_PATH_SEP_ 0
  3104. typedef long long BiggestInt; // NOLINT
  3105. #endif // GTEST_OS_WINDOWS
  3106. // Utilities for char.
  3107. // isspace(int ch) and friends accept an unsigned char or EOF. char
  3108. // may be signed, depending on the compiler (or compiler flags).
  3109. // Therefore we need to cast a char to unsigned char before calling
  3110. // isspace(), etc.
  3111. inline bool IsAlpha(char ch) {
  3112. return isalpha(static_cast<unsigned char>(ch)) != 0;
  3113. }
  3114. inline bool IsAlNum(char ch) {
  3115. return isalnum(static_cast<unsigned char>(ch)) != 0;
  3116. }
  3117. inline bool IsDigit(char ch) {
  3118. return isdigit(static_cast<unsigned char>(ch)) != 0;
  3119. }
  3120. inline bool IsLower(char ch) {
  3121. return islower(static_cast<unsigned char>(ch)) != 0;
  3122. }
  3123. inline bool IsSpace(char ch) {
  3124. return isspace(static_cast<unsigned char>(ch)) != 0;
  3125. }
  3126. inline bool IsUpper(char ch) {
  3127. return isupper(static_cast<unsigned char>(ch)) != 0;
  3128. }
  3129. inline bool IsXDigit(char ch) {
  3130. return isxdigit(static_cast<unsigned char>(ch)) != 0;
  3131. }
  3132. inline bool IsXDigit(wchar_t ch) {
  3133. const unsigned char low_byte = static_cast<unsigned char>(ch);
  3134. return ch == low_byte && isxdigit(low_byte) != 0;
  3135. }
  3136. inline char ToLower(char ch) {
  3137. return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
  3138. }
  3139. inline char ToUpper(char ch) {
  3140. return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
  3141. }
  3142. inline std::string StripTrailingSpaces(std::string str) {
  3143. std::string::iterator it = str.end();
  3144. while (it != str.begin() && IsSpace(*--it))
  3145. it = str.erase(it);
  3146. return str;
  3147. }
  3148. // The testing::internal::posix namespace holds wrappers for common
  3149. // POSIX functions. These wrappers hide the differences between
  3150. // Windows/MSVC and POSIX systems. Since some compilers define these
  3151. // standard functions as macros, the wrapper cannot have the same name
  3152. // as the wrapped function.
  3153. namespace posix {
  3154. // Functions with a different name on Windows.
  3155. #if GTEST_OS_WINDOWS
  3156. typedef struct _stat StatStruct;
  3157. # ifdef __BORLANDC__
  3158. inline int IsATTY(int fd) { return isatty(fd); }
  3159. inline int StrCaseCmp(const char* s1, const char* s2) {
  3160. return stricmp(s1, s2);
  3161. }
  3162. inline char* StrDup(const char* src) { return strdup(src); }
  3163. # else // !__BORLANDC__
  3164. # if GTEST_OS_WINDOWS_MOBILE
  3165. inline int IsATTY(int /* fd */) { return 0; }
  3166. # else
  3167. inline int IsATTY(int fd) { return _isatty(fd); }
  3168. # endif // GTEST_OS_WINDOWS_MOBILE
  3169. inline int StrCaseCmp(const char* s1, const char* s2) {
  3170. return _stricmp(s1, s2);
  3171. }
  3172. inline char* StrDup(const char* src) { return _strdup(src); }
  3173. # endif // __BORLANDC__
  3174. # if GTEST_OS_WINDOWS_MOBILE
  3175. inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
  3176. // Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
  3177. // time and thus not defined there.
  3178. # else
  3179. inline int FileNo(FILE* file) { return _fileno(file); }
  3180. inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
  3181. inline int RmDir(const char* dir) { return _rmdir(dir); }
  3182. inline bool IsDir(const StatStruct& st) {
  3183. return (_S_IFDIR & st.st_mode) != 0;
  3184. }
  3185. # endif // GTEST_OS_WINDOWS_MOBILE
  3186. #else
  3187. typedef struct stat StatStruct;
  3188. inline int FileNo(FILE* file) { return fileno(file); }
  3189. inline int IsATTY(int fd) { return isatty(fd); }
  3190. inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
  3191. inline int StrCaseCmp(const char* s1, const char* s2) {
  3192. return strcasecmp(s1, s2);
  3193. }
  3194. inline char* StrDup(const char* src) { return strdup(src); }
  3195. inline int RmDir(const char* dir) { return rmdir(dir); }
  3196. inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
  3197. #endif // GTEST_OS_WINDOWS
  3198. // Functions deprecated by MSVC 8.0.
  3199. GTEST_DISABLE_MSC_DEPRECATED_PUSH_()
  3200. inline const char* StrNCpy(char* dest, const char* src, size_t n) {
  3201. return strncpy(dest, src, n);
  3202. }
  3203. // ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
  3204. // StrError() aren't needed on Windows CE at this time and thus not
  3205. // defined there.
  3206. #if !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
  3207. inline int ChDir(const char* dir) { return chdir(dir); }
  3208. #endif
  3209. inline FILE* FOpen(const char* path, const char* mode) {
  3210. return fopen(path, mode);
  3211. }
  3212. #if !GTEST_OS_WINDOWS_MOBILE
  3213. inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
  3214. return freopen(path, mode, stream);
  3215. }
  3216. inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
  3217. #endif
  3218. inline int FClose(FILE* fp) { return fclose(fp); }
  3219. #if !GTEST_OS_WINDOWS_MOBILE
  3220. inline int Read(int fd, void* buf, unsigned int count) {
  3221. return static_cast<int>(read(fd, buf, count));
  3222. }
  3223. inline int Write(int fd, const void* buf, unsigned int count) {
  3224. return static_cast<int>(write(fd, buf, count));
  3225. }
  3226. inline int Close(int fd) { return close(fd); }
  3227. inline const char* StrError(int errnum) { return strerror(errnum); }
  3228. #endif
  3229. inline const char* GetEnv(const char* name) {
  3230. #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
  3231. // We are on Windows CE, which has no environment variables.
  3232. static_cast<void>(name); // To prevent 'unused argument' warning.
  3233. return NULL;
  3234. #elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
  3235. // Environment variables which we programmatically clear will be set to the
  3236. // empty string rather than unset (NULL). Handle that case.
  3237. const char* const env = getenv(name);
  3238. return (env != NULL && env[0] != '\0') ? env : NULL;
  3239. #else
  3240. return getenv(name);
  3241. #endif
  3242. }
  3243. GTEST_DISABLE_MSC_DEPRECATED_POP_()
  3244. #if GTEST_OS_WINDOWS_MOBILE
  3245. // Windows CE has no C library. The abort() function is used in
  3246. // several places in Google Test. This implementation provides a reasonable
  3247. // imitation of standard behaviour.
  3248. void Abort();
  3249. #else
  3250. inline void Abort() { abort(); }
  3251. #endif // GTEST_OS_WINDOWS_MOBILE
  3252. } // namespace posix
  3253. // MSVC "deprecates" snprintf and issues warnings wherever it is used. In
  3254. // order to avoid these warnings, we need to use _snprintf or _snprintf_s on
  3255. // MSVC-based platforms. We map the GTEST_SNPRINTF_ macro to the appropriate
  3256. // function in order to achieve that. We use macro definition here because
  3257. // snprintf is a variadic function.
  3258. #if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
  3259. // MSVC 2005 and above support variadic macros.
  3260. # define GTEST_SNPRINTF_(buffer, size, format, ...) \
  3261. _snprintf_s(buffer, size, size, format, __VA_ARGS__)
  3262. #elif defined(_MSC_VER)
  3263. // Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't
  3264. // complain about _snprintf.
  3265. # define GTEST_SNPRINTF_ _snprintf
  3266. #else
  3267. # define GTEST_SNPRINTF_ snprintf
  3268. #endif
  3269. // The maximum number a BiggestInt can represent. This definition
  3270. // works no matter BiggestInt is represented in one's complement or
  3271. // two's complement.
  3272. //
  3273. // We cannot rely on numeric_limits in STL, as __int64 and long long
  3274. // are not part of standard C++ and numeric_limits doesn't need to be
  3275. // defined for them.
  3276. const BiggestInt kMaxBiggestInt =
  3277. ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
  3278. // This template class serves as a compile-time function from size to
  3279. // type. It maps a size in bytes to a primitive type with that
  3280. // size. e.g.
  3281. //
  3282. // TypeWithSize<4>::UInt
  3283. //
  3284. // is typedef-ed to be unsigned int (unsigned integer made up of 4
  3285. // bytes).
  3286. //
  3287. // Such functionality should belong to STL, but I cannot find it
  3288. // there.
  3289. //
  3290. // Google Test uses this class in the implementation of floating-point
  3291. // comparison.
  3292. //
  3293. // For now it only handles UInt (unsigned int) as that's all Google Test
  3294. // needs. Other types can be easily added in the future if need
  3295. // arises.
  3296. template <size_t size>
  3297. class TypeWithSize {
  3298. public:
  3299. // This prevents the user from using TypeWithSize<N> with incorrect
  3300. // values of N.
  3301. typedef void UInt;
  3302. };
  3303. // The specialization for size 4.
  3304. template <>
  3305. class TypeWithSize<4> {
  3306. public:
  3307. // unsigned int has size 4 in both gcc and MSVC.
  3308. //
  3309. // As base/basictypes.h doesn't compile on Windows, we cannot use
  3310. // uint32, uint64, and etc here.
  3311. typedef int Int;
  3312. typedef unsigned int UInt;
  3313. };
  3314. // The specialization for size 8.
  3315. template <>
  3316. class TypeWithSize<8> {
  3317. public:
  3318. #if GTEST_OS_WINDOWS
  3319. typedef __int64 Int;
  3320. typedef unsigned __int64 UInt;
  3321. #else
  3322. typedef long long Int; // NOLINT
  3323. typedef unsigned long long UInt; // NOLINT
  3324. #endif // GTEST_OS_WINDOWS
  3325. };
  3326. // Integer types of known sizes.
  3327. typedef TypeWithSize<4>::Int Int32;
  3328. typedef TypeWithSize<4>::UInt UInt32;
  3329. typedef TypeWithSize<8>::Int Int64;
  3330. typedef TypeWithSize<8>::UInt UInt64;
  3331. typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds.
  3332. // Utilities for command line flags and environment variables.
  3333. // Macro for referencing flags.
  3334. #if !defined(GTEST_FLAG)
  3335. # define GTEST_FLAG(name) FLAGS_gtest_##name
  3336. #endif // !defined(GTEST_FLAG)
  3337. #if !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)
  3338. # define GTEST_USE_OWN_FLAGFILE_FLAG_ 1
  3339. #endif // !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)
  3340. #if !defined(GTEST_DECLARE_bool_)
  3341. # define GTEST_FLAG_SAVER_ ::testing::internal::GTestFlagSaver
  3342. // Macros for declaring flags.
  3343. # define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
  3344. # define GTEST_DECLARE_int32_(name) \
  3345. GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
  3346. # define GTEST_DECLARE_string_(name) \
  3347. GTEST_API_ extern ::std::string GTEST_FLAG(name)
  3348. // Macros for defining flags.
  3349. # define GTEST_DEFINE_bool_(name, default_val, doc) \
  3350. GTEST_API_ bool GTEST_FLAG(name) = (default_val)
  3351. # define GTEST_DEFINE_int32_(name, default_val, doc) \
  3352. GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
  3353. # define GTEST_DEFINE_string_(name, default_val, doc) \
  3354. GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)
  3355. #endif // !defined(GTEST_DECLARE_bool_)
  3356. // Thread annotations
  3357. #if !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)
  3358. # define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
  3359. # define GTEST_LOCK_EXCLUDED_(locks)
  3360. #endif // !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)
  3361. // Parses 'str' for a 32-bit signed integer. If successful, writes the result
  3362. // to *value and returns true; otherwise leaves *value unchanged and returns
  3363. // false.
  3364. // FIXME: Find a better way to refactor flag and environment parsing
  3365. // out of both gtest-port.cc and gtest.cc to avoid exporting this utility
  3366. // function.
  3367. bool ParseInt32(const Message& src_text, const char* str, Int32* value);
  3368. // Parses a bool/Int32/string from the environment variable
  3369. // corresponding to the given Google Test flag.
  3370. bool BoolFromGTestEnv(const char* flag, bool default_val);
  3371. GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
  3372. std::string OutputFlagAlsoCheckEnvVar();
  3373. const char* StringFromGTestEnv(const char* flag, const char* default_val);
  3374. } // namespace internal
  3375. } // namespace testing
  3376. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
  3377. #if GTEST_OS_LINUX
  3378. # include <stdlib.h>
  3379. # include <sys/types.h>
  3380. # include <sys/wait.h>
  3381. # include <unistd.h>
  3382. #endif // GTEST_OS_LINUX
  3383. #if GTEST_HAS_EXCEPTIONS
  3384. # include <stdexcept>
  3385. #endif
  3386. #include <ctype.h>
  3387. #include <float.h>
  3388. #include <string.h>
  3389. // #include <iomanip> // Not included in newer versions of gtest
  3390. #include <limits>
  3391. #include <map>
  3392. #include <set>
  3393. #include <string>
  3394. #include <vector>
  3395. // Copyright 2005, Google Inc.
  3396. // All rights reserved.
  3397. //
  3398. // Redistribution and use in source and binary forms, with or without
  3399. // modification, are permitted provided that the following conditions are
  3400. // met:
  3401. //
  3402. // * Redistributions of source code must retain the above copyright
  3403. // notice, this list of conditions and the following disclaimer.
  3404. // * Redistributions in binary form must reproduce the above
  3405. // copyright notice, this list of conditions and the following disclaimer
  3406. // in the documentation and/or other materials provided with the
  3407. // distribution.
  3408. // * Neither the name of Google Inc. nor the names of its
  3409. // contributors may be used to endorse or promote products derived from
  3410. // this software without specific prior written permission.
  3411. //
  3412. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  3413. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  3414. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  3415. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  3416. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  3417. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  3418. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  3419. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  3420. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3421. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  3422. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3423. //
  3424. // The Google C++ Testing and Mocking Framework (Google Test)
  3425. //
  3426. // This header file defines the Message class.
  3427. //
  3428. // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
  3429. // leave some internal implementation details in this header file.
  3430. // They are clearly marked by comments like this:
  3431. //
  3432. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  3433. //
  3434. // Such code is NOT meant to be used by a user directly, and is subject
  3435. // to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
  3436. // program!
  3437. // GOOGLETEST_CM0001 DO NOT DELETE
  3438. #ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
  3439. #define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
  3440. #include <limits>
  3441. GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
  3442. /* class A needs to have dll-interface to be used by clients of class B */)
  3443. // Ensures that there is at least one operator<< in the global namespace.
  3444. // See Message& operator<<(...) below for why.
  3445. void operator<<(const testing::internal::Secret&, int);
  3446. namespace testing {
  3447. // The Message class works like an ostream repeater.
  3448. //
  3449. // Typical usage:
  3450. //
  3451. // 1. You stream a bunch of values to a Message object.
  3452. // It will remember the text in a stringstream.
  3453. // 2. Then you stream the Message object to an ostream.
  3454. // This causes the text in the Message to be streamed
  3455. // to the ostream.
  3456. //
  3457. // For example;
  3458. //
  3459. // testing::Message foo;
  3460. // foo << 1 << " != " << 2;
  3461. // std::cout << foo;
  3462. //
  3463. // will print "1 != 2".
  3464. //
  3465. // Message is not intended to be inherited from. In particular, its
  3466. // destructor is not virtual.
  3467. //
  3468. // Note that stringstream behaves differently in gcc and in MSVC. You
  3469. // can stream a NULL char pointer to it in the former, but not in the
  3470. // latter (it causes an access violation if you do). The Message
  3471. // class hides this difference by treating a NULL char pointer as
  3472. // "(null)".
  3473. class GTEST_API_ Message {
  3474. private:
  3475. // The type of basic IO manipulators (endl, ends, and flush) for
  3476. // narrow streams.
  3477. typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
  3478. public:
  3479. // Constructs an empty Message.
  3480. Message();
  3481. // Copy constructor.
  3482. Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT
  3483. *ss_ << msg.GetString();
  3484. }
  3485. // Constructs a Message from a C-string.
  3486. explicit Message(const char* str) : ss_(new ::std::stringstream) {
  3487. *ss_ << str;
  3488. }
  3489. #if GTEST_OS_SYMBIAN
  3490. // Streams a value (either a pointer or not) to this object.
  3491. template <typename T>
  3492. inline Message& operator <<(const T& value) {
  3493. StreamHelper(typename internal::is_pointer<T>::type(), value);
  3494. return *this;
  3495. }
  3496. #else
  3497. // Streams a non-pointer value to this object.
  3498. template <typename T>
  3499. inline Message& operator <<(const T& val) {
  3500. // Some libraries overload << for STL containers. These
  3501. // overloads are defined in the global namespace instead of ::std.
  3502. //
  3503. // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
  3504. // overloads are visible in either the std namespace or the global
  3505. // namespace, but not other namespaces, including the testing
  3506. // namespace which Google Test's Message class is in.
  3507. //
  3508. // To allow STL containers (and other types that has a << operator
  3509. // defined in the global namespace) to be used in Google Test
  3510. // assertions, testing::Message must access the custom << operator
  3511. // from the global namespace. With this using declaration,
  3512. // overloads of << defined in the global namespace and those
  3513. // visible via Koenig lookup are both exposed in this function.
  3514. using ::operator <<;
  3515. *ss_ << val;
  3516. return *this;
  3517. }
  3518. // Streams a pointer value to this object.
  3519. //
  3520. // This function is an overload of the previous one. When you
  3521. // stream a pointer to a Message, this definition will be used as it
  3522. // is more specialized. (The C++ Standard, section
  3523. // [temp.func.order].) If you stream a non-pointer, then the
  3524. // previous definition will be used.
  3525. //
  3526. // The reason for this overload is that streaming a NULL pointer to
  3527. // ostream is undefined behavior. Depending on the compiler, you
  3528. // may get "0", "(nil)", "(null)", or an access violation. To
  3529. // ensure consistent result across compilers, we always treat NULL
  3530. // as "(null)".
  3531. template <typename T>
  3532. inline Message& operator <<(T* const& pointer) { // NOLINT
  3533. if (pointer == NULL) {
  3534. *ss_ << "(null)";
  3535. } else {
  3536. *ss_ << pointer;
  3537. }
  3538. return *this;
  3539. }
  3540. #endif // GTEST_OS_SYMBIAN
  3541. // Since the basic IO manipulators are overloaded for both narrow
  3542. // and wide streams, we have to provide this specialized definition
  3543. // of operator <<, even though its body is the same as the
  3544. // templatized version above. Without this definition, streaming
  3545. // endl or other basic IO manipulators to Message will confuse the
  3546. // compiler.
  3547. Message& operator <<(BasicNarrowIoManip val) {
  3548. *ss_ << val;
  3549. return *this;
  3550. }
  3551. // Instead of 1/0, we want to see true/false for bool values.
  3552. Message& operator <<(bool b) {
  3553. return *this << (b ? "true" : "false");
  3554. }
  3555. // These two overloads allow streaming a wide C string to a Message
  3556. // using the UTF-8 encoding.
  3557. Message& operator <<(const wchar_t* wide_c_str);
  3558. Message& operator <<(wchar_t* wide_c_str);
  3559. #if GTEST_HAS_STD_WSTRING
  3560. // Converts the given wide string to a narrow string using the UTF-8
  3561. // encoding, and streams the result to this Message object.
  3562. Message& operator <<(const ::std::wstring& wstr);
  3563. #endif // GTEST_HAS_STD_WSTRING
  3564. #if GTEST_HAS_GLOBAL_WSTRING
  3565. // Converts the given wide string to a narrow string using the UTF-8
  3566. // encoding, and streams the result to this Message object.
  3567. Message& operator <<(const ::wstring& wstr);
  3568. #endif // GTEST_HAS_GLOBAL_WSTRING
  3569. // Gets the text streamed to this object so far as an std::string.
  3570. // Each '\0' character in the buffer is replaced with "\\0".
  3571. //
  3572. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  3573. std::string GetString() const;
  3574. private:
  3575. #if GTEST_OS_SYMBIAN
  3576. // These are needed as the Nokia Symbian Compiler cannot decide between
  3577. // const T& and const T* in a function template. The Nokia compiler _can_
  3578. // decide between class template specializations for T and T*, so a
  3579. // tr1::type_traits-like is_pointer works, and we can overload on that.
  3580. template <typename T>
  3581. inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) {
  3582. if (pointer == NULL) {
  3583. *ss_ << "(null)";
  3584. } else {
  3585. *ss_ << pointer;
  3586. }
  3587. }
  3588. template <typename T>
  3589. inline void StreamHelper(internal::false_type /*is_pointer*/,
  3590. const T& value) {
  3591. // See the comments in Message& operator <<(const T&) above for why
  3592. // we need this using statement.
  3593. using ::operator <<;
  3594. *ss_ << value;
  3595. }
  3596. #endif // GTEST_OS_SYMBIAN
  3597. // We'll hold the text streamed to this object here.
  3598. const internal::scoped_ptr< ::std::stringstream> ss_;
  3599. // We declare (but don't implement) this to prevent the compiler
  3600. // from implementing the assignment operator.
  3601. void operator=(const Message&);
  3602. };
  3603. // Streams a Message to an ostream.
  3604. inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
  3605. return os << sb.GetString();
  3606. }
  3607. namespace internal {
  3608. // Converts a streamable value to an std::string. A NULL pointer is
  3609. // converted to "(null)". When the input value is a ::string,
  3610. // ::std::string, ::wstring, or ::std::wstring object, each NUL
  3611. // character in it is replaced with "\\0".
  3612. template <typename T>
  3613. std::string StreamableToString(const T& streamable) {
  3614. return (Message() << streamable).GetString();
  3615. }
  3616. } // namespace internal
  3617. } // namespace testing
  3618. GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
  3619. #endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
  3620. // Copyright 2008, Google Inc.
  3621. // All rights reserved.
  3622. //
  3623. // Redistribution and use in source and binary forms, with or without
  3624. // modification, are permitted provided that the following conditions are
  3625. // met:
  3626. //
  3627. // * Redistributions of source code must retain the above copyright
  3628. // notice, this list of conditions and the following disclaimer.
  3629. // * Redistributions in binary form must reproduce the above
  3630. // copyright notice, this list of conditions and the following disclaimer
  3631. // in the documentation and/or other materials provided with the
  3632. // distribution.
  3633. // * Neither the name of Google Inc. nor the names of its
  3634. // contributors may be used to endorse or promote products derived from
  3635. // this software without specific prior written permission.
  3636. //
  3637. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  3638. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  3639. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  3640. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  3641. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  3642. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  3643. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  3644. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  3645. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3646. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  3647. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3648. //
  3649. // Google Test filepath utilities
  3650. //
  3651. // This header file declares classes and functions used internally by
  3652. // Google Test. They are subject to change without notice.
  3653. //
  3654. // This file is #included in gtest/internal/gtest-internal.h.
  3655. // Do not include this header file separately!
  3656. // GOOGLETEST_CM0001 DO NOT DELETE
  3657. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
  3658. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
  3659. // Copyright 2005, Google Inc.
  3660. // All rights reserved.
  3661. //
  3662. // Redistribution and use in source and binary forms, with or without
  3663. // modification, are permitted provided that the following conditions are
  3664. // met:
  3665. //
  3666. // * Redistributions of source code must retain the above copyright
  3667. // notice, this list of conditions and the following disclaimer.
  3668. // * Redistributions in binary form must reproduce the above
  3669. // copyright notice, this list of conditions and the following disclaimer
  3670. // in the documentation and/or other materials provided with the
  3671. // distribution.
  3672. // * Neither the name of Google Inc. nor the names of its
  3673. // contributors may be used to endorse or promote products derived from
  3674. // this software without specific prior written permission.
  3675. //
  3676. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  3677. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  3678. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  3679. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  3680. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  3681. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  3682. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  3683. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  3684. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3685. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  3686. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3687. //
  3688. // The Google C++ Testing and Mocking Framework (Google Test)
  3689. //
  3690. // This header file declares the String class and functions used internally by
  3691. // Google Test. They are subject to change without notice. They should not used
  3692. // by code external to Google Test.
  3693. //
  3694. // This header file is #included by gtest-internal.h.
  3695. // It should not be #included by other files.
  3696. // GOOGLETEST_CM0001 DO NOT DELETE
  3697. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
  3698. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
  3699. #ifdef __BORLANDC__
  3700. // string.h is not guaranteed to provide strcpy on C++ Builder.
  3701. # include <mem.h>
  3702. #endif
  3703. #include <string.h>
  3704. #include <string>
  3705. namespace testing {
  3706. namespace internal {
  3707. // String - an abstract class holding static string utilities.
  3708. class GTEST_API_ String {
  3709. public:
  3710. // Static utility methods
  3711. // Clones a 0-terminated C string, allocating memory using new. The
  3712. // caller is responsible for deleting the return value using
  3713. // delete[]. Returns the cloned string, or NULL if the input is
  3714. // NULL.
  3715. //
  3716. // This is different from strdup() in string.h, which allocates
  3717. // memory using malloc().
  3718. static const char* CloneCString(const char* c_str);
  3719. #if GTEST_OS_WINDOWS_MOBILE
  3720. // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
  3721. // able to pass strings to Win32 APIs on CE we need to convert them
  3722. // to 'Unicode', UTF-16.
  3723. // Creates a UTF-16 wide string from the given ANSI string, allocating
  3724. // memory using new. The caller is responsible for deleting the return
  3725. // value using delete[]. Returns the wide string, or NULL if the
  3726. // input is NULL.
  3727. //
  3728. // The wide string is created using the ANSI codepage (CP_ACP) to
  3729. // match the behaviour of the ANSI versions of Win32 calls and the
  3730. // C runtime.
  3731. static LPCWSTR AnsiToUtf16(const char* c_str);
  3732. // Creates an ANSI string from the given wide string, allocating
  3733. // memory using new. The caller is responsible for deleting the return
  3734. // value using delete[]. Returns the ANSI string, or NULL if the
  3735. // input is NULL.
  3736. //
  3737. // The returned string is created using the ANSI codepage (CP_ACP) to
  3738. // match the behaviour of the ANSI versions of Win32 calls and the
  3739. // C runtime.
  3740. static const char* Utf16ToAnsi(LPCWSTR utf16_str);
  3741. #endif
  3742. // Compares two C strings. Returns true iff they have the same content.
  3743. //
  3744. // Unlike strcmp(), this function can handle NULL argument(s). A
  3745. // NULL C string is considered different to any non-NULL C string,
  3746. // including the empty string.
  3747. static bool CStringEquals(const char* lhs, const char* rhs);
  3748. // Converts a wide C string to a String using the UTF-8 encoding.
  3749. // NULL will be converted to "(null)". If an error occurred during
  3750. // the conversion, "(failed to convert from wide string)" is
  3751. // returned.
  3752. static std::string ShowWideCString(const wchar_t* wide_c_str);
  3753. // Compares two wide C strings. Returns true iff they have the same
  3754. // content.
  3755. //
  3756. // Unlike wcscmp(), this function can handle NULL argument(s). A
  3757. // NULL C string is considered different to any non-NULL C string,
  3758. // including the empty string.
  3759. static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
  3760. // Compares two C strings, ignoring case. Returns true iff they
  3761. // have the same content.
  3762. //
  3763. // Unlike strcasecmp(), this function can handle NULL argument(s).
  3764. // A NULL C string is considered different to any non-NULL C string,
  3765. // including the empty string.
  3766. static bool CaseInsensitiveCStringEquals(const char* lhs,
  3767. const char* rhs);
  3768. // Compares two wide C strings, ignoring case. Returns true iff they
  3769. // have the same content.
  3770. //
  3771. // Unlike wcscasecmp(), this function can handle NULL argument(s).
  3772. // A NULL C string is considered different to any non-NULL wide C string,
  3773. // including the empty string.
  3774. // NB: The implementations on different platforms slightly differ.
  3775. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
  3776. // environment variable. On GNU platform this method uses wcscasecmp
  3777. // which compares according to LC_CTYPE category of the current locale.
  3778. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
  3779. // current locale.
  3780. static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
  3781. const wchar_t* rhs);
  3782. // Returns true iff the given string ends with the given suffix, ignoring
  3783. // case. Any string is considered to end with an empty suffix.
  3784. static bool EndsWithCaseInsensitive(
  3785. const std::string& str, const std::string& suffix);
  3786. // Formats an int value as "%02d".
  3787. static std::string FormatIntWidth2(int value); // "%02d" for width == 2
  3788. // Formats an int value as "%X".
  3789. static std::string FormatHexInt(int value);
  3790. // Formats a byte as "%02X".
  3791. static std::string FormatByte(unsigned char value);
  3792. private:
  3793. String(); // Not meant to be instantiated.
  3794. }; // class String
  3795. // Gets the content of the stringstream's buffer as an std::string. Each '\0'
  3796. // character in the buffer is replaced with "\\0".
  3797. GTEST_API_ std::string StringStreamToString(::std::stringstream* stream);
  3798. } // namespace internal
  3799. } // namespace testing
  3800. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
  3801. GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
  3802. /* class A needs to have dll-interface to be used by clients of class B */)
  3803. namespace testing {
  3804. namespace internal {
  3805. // FilePath - a class for file and directory pathname manipulation which
  3806. // handles platform-specific conventions (like the pathname separator).
  3807. // Used for helper functions for naming files in a directory for xml output.
  3808. // Except for Set methods, all methods are const or static, which provides an
  3809. // "immutable value object" -- useful for peace of mind.
  3810. // A FilePath with a value ending in a path separator ("like/this/") represents
  3811. // a directory, otherwise it is assumed to represent a file. In either case,
  3812. // it may or may not represent an actual file or directory in the file system.
  3813. // Names are NOT checked for syntax correctness -- no checking for illegal
  3814. // characters, malformed paths, etc.
  3815. class GTEST_API_ FilePath {
  3816. public:
  3817. FilePath() : pathname_("") { }
  3818. FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
  3819. explicit FilePath(const std::string& pathname) : pathname_(pathname) {
  3820. Normalize();
  3821. }
  3822. FilePath& operator=(const FilePath& rhs) {
  3823. Set(rhs);
  3824. return *this;
  3825. }
  3826. void Set(const FilePath& rhs) {
  3827. pathname_ = rhs.pathname_;
  3828. }
  3829. const std::string& string() const { return pathname_; }
  3830. const char* c_str() const { return pathname_.c_str(); }
  3831. // Returns the current working directory, or "" if unsuccessful.
  3832. static FilePath GetCurrentDir();
  3833. // Given directory = "dir", base_name = "test", number = 0,
  3834. // extension = "xml", returns "dir/test.xml". If number is greater
  3835. // than zero (e.g., 12), returns "dir/test_12.xml".
  3836. // On Windows platform, uses \ as the separator rather than /.
  3837. static FilePath MakeFileName(const FilePath& directory,
  3838. const FilePath& base_name,
  3839. int number,
  3840. const char* extension);
  3841. // Given directory = "dir", relative_path = "test.xml",
  3842. // returns "dir/test.xml".
  3843. // On Windows, uses \ as the separator rather than /.
  3844. static FilePath ConcatPaths(const FilePath& directory,
  3845. const FilePath& relative_path);
  3846. // Returns a pathname for a file that does not currently exist. The pathname
  3847. // will be directory/base_name.extension or
  3848. // directory/base_name_<number>.extension if directory/base_name.extension
  3849. // already exists. The number will be incremented until a pathname is found
  3850. // that does not already exist.
  3851. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
  3852. // There could be a race condition if two or more processes are calling this
  3853. // function at the same time -- they could both pick the same filename.
  3854. static FilePath GenerateUniqueFileName(const FilePath& directory,
  3855. const FilePath& base_name,
  3856. const char* extension);
  3857. // Returns true iff the path is "".
  3858. bool IsEmpty() const { return pathname_.empty(); }
  3859. // If input name has a trailing separator character, removes it and returns
  3860. // the name, otherwise return the name string unmodified.
  3861. // On Windows platform, uses \ as the separator, other platforms use /.
  3862. FilePath RemoveTrailingPathSeparator() const;
  3863. // Returns a copy of the FilePath with the directory part removed.
  3864. // Example: FilePath("path/to/file").RemoveDirectoryName() returns
  3865. // FilePath("file"). If there is no directory part ("just_a_file"), it returns
  3866. // the FilePath unmodified. If there is no file part ("just_a_dir/") it
  3867. // returns an empty FilePath ("").
  3868. // On Windows platform, '\' is the path separator, otherwise it is '/'.
  3869. FilePath RemoveDirectoryName() const;
  3870. // RemoveFileName returns the directory path with the filename removed.
  3871. // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
  3872. // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
  3873. // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
  3874. // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
  3875. // On Windows platform, '\' is the path separator, otherwise it is '/'.
  3876. FilePath RemoveFileName() const;
  3877. // Returns a copy of the FilePath with the case-insensitive extension removed.
  3878. // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
  3879. // FilePath("dir/file"). If a case-insensitive extension is not
  3880. // found, returns a copy of the original FilePath.
  3881. FilePath RemoveExtension(const char* extension) const;
  3882. // Creates directories so that path exists. Returns true if successful or if
  3883. // the directories already exist; returns false if unable to create
  3884. // directories for any reason. Will also return false if the FilePath does
  3885. // not represent a directory (that is, it doesn't end with a path separator).
  3886. bool CreateDirectoriesRecursively() const;
  3887. // Create the directory so that path exists. Returns true if successful or
  3888. // if the directory already exists; returns false if unable to create the
  3889. // directory for any reason, including if the parent directory does not
  3890. // exist. Not named "CreateDirectory" because that's a macro on Windows.
  3891. bool CreateFolder() const;
  3892. // Returns true if FilePath describes something in the file-system,
  3893. // either a file, directory, or whatever, and that something exists.
  3894. bool FileOrDirectoryExists() const;
  3895. // Returns true if pathname describes a directory in the file-system
  3896. // that exists.
  3897. bool DirectoryExists() const;
  3898. // Returns true if FilePath ends with a path separator, which indicates that
  3899. // it is intended to represent a directory. Returns false otherwise.
  3900. // This does NOT check that a directory (or file) actually exists.
  3901. bool IsDirectory() const;
  3902. // Returns true if pathname describes a root directory. (Windows has one
  3903. // root directory per disk drive.)
  3904. bool IsRootDirectory() const;
  3905. // Returns true if pathname describes an absolute path.
  3906. bool IsAbsolutePath() const;
  3907. private:
  3908. // Replaces multiple consecutive separators with a single separator.
  3909. // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
  3910. // redundancies that might be in a pathname involving "." or "..".
  3911. //
  3912. // A pathname with multiple consecutive separators may occur either through
  3913. // user error or as a result of some scripts or APIs that generate a pathname
  3914. // with a trailing separator. On other platforms the same API or script
  3915. // may NOT generate a pathname with a trailing "/". Then elsewhere that
  3916. // pathname may have another "/" and pathname components added to it,
  3917. // without checking for the separator already being there.
  3918. // The script language and operating system may allow paths like "foo//bar"
  3919. // but some of the functions in FilePath will not handle that correctly. In
  3920. // particular, RemoveTrailingPathSeparator() only removes one separator, and
  3921. // it is called in CreateDirectoriesRecursively() assuming that it will change
  3922. // a pathname from directory syntax (trailing separator) to filename syntax.
  3923. //
  3924. // On Windows this method also replaces the alternate path separator '/' with
  3925. // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
  3926. // "bar\\foo".
  3927. void Normalize();
  3928. // Returns a pointer to the last occurence of a valid path separator in
  3929. // the FilePath. On Windows, for example, both '/' and '\' are valid path
  3930. // separators. Returns NULL if no path separator was found.
  3931. const char* FindLastPathSeparator() const;
  3932. std::string pathname_;
  3933. }; // class FilePath
  3934. } // namespace internal
  3935. } // namespace testing
  3936. GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
  3937. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
  3938. // This file was GENERATED by command:
  3939. // pump.py gtest-type-util.h.pump
  3940. // DO NOT EDIT BY HAND!!!
  3941. // Copyright 2008 Google Inc.
  3942. // All Rights Reserved.
  3943. //
  3944. // Redistribution and use in source and binary forms, with or without
  3945. // modification, are permitted provided that the following conditions are
  3946. // met:
  3947. //
  3948. // * Redistributions of source code must retain the above copyright
  3949. // notice, this list of conditions and the following disclaimer.
  3950. // * Redistributions in binary form must reproduce the above
  3951. // copyright notice, this list of conditions and the following disclaimer
  3952. // in the documentation and/or other materials provided with the
  3953. // distribution.
  3954. // * Neither the name of Google Inc. nor the names of its
  3955. // contributors may be used to endorse or promote products derived from
  3956. // this software without specific prior written permission.
  3957. //
  3958. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  3959. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  3960. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  3961. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  3962. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  3963. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  3964. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  3965. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  3966. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3967. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  3968. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3969. // Type utilities needed for implementing typed and type-parameterized
  3970. // tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
  3971. //
  3972. // Currently we support at most 50 types in a list, and at most 50
  3973. // type-parameterized tests in one type-parameterized test case.
  3974. // Please contact googletestframework@googlegroups.com if you need
  3975. // more.
  3976. // GOOGLETEST_CM0001 DO NOT DELETE
  3977. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
  3978. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
  3979. // #ifdef __GNUC__ is too general here. It is possible to use gcc without using
  3980. // libstdc++ (which is where cxxabi.h comes from).
  3981. # if GTEST_HAS_CXXABI_H_
  3982. # include <cxxabi.h>
  3983. # elif defined(__HP_aCC)
  3984. # include <acxx_demangle.h>
  3985. # endif // GTEST_HASH_CXXABI_H_
  3986. namespace testing {
  3987. namespace internal {
  3988. // Canonicalizes a given name with respect to the Standard C++ Library.
  3989. // This handles removing the inline namespace within `std` that is
  3990. // used by various standard libraries (e.g., `std::__1`). Names outside
  3991. // of namespace std are returned unmodified.
  3992. inline std::string CanonicalizeForStdLibVersioning(std::string s) {
  3993. static const char prefix[] = "std::__";
  3994. if (s.compare(0, strlen(prefix), prefix) == 0) {
  3995. std::string::size_type end = s.find("::", strlen(prefix));
  3996. if (end != s.npos) {
  3997. // Erase everything between the initial `std` and the second `::`.
  3998. s.erase(strlen("std"), end - strlen("std"));
  3999. }
  4000. }
  4001. return s;
  4002. }
  4003. // GetTypeName<T>() returns a human-readable name of type T.
  4004. // NB: This function is also used in Google Mock, so don't move it inside of
  4005. // the typed-test-only section below.
  4006. template <typename T>
  4007. std::string GetTypeName() {
  4008. # if GTEST_HAS_RTTI
  4009. const char* const name = typeid(T).name();
  4010. # if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
  4011. int status = 0;
  4012. // gcc's implementation of typeid(T).name() mangles the type name,
  4013. // so we have to demangle it.
  4014. # if GTEST_HAS_CXXABI_H_
  4015. using abi::__cxa_demangle;
  4016. # endif // GTEST_HAS_CXXABI_H_
  4017. char* const readable_name = __cxa_demangle(name, 0, 0, &status);
  4018. const std::string name_str(status == 0 ? readable_name : name);
  4019. free(readable_name);
  4020. return CanonicalizeForStdLibVersioning(name_str);
  4021. # else
  4022. return name;
  4023. # endif // GTEST_HAS_CXXABI_H_ || __HP_aCC
  4024. # else
  4025. return "<type>";
  4026. # endif // GTEST_HAS_RTTI
  4027. }
  4028. #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  4029. // AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
  4030. // type. This can be used as a compile-time assertion to ensure that
  4031. // two types are equal.
  4032. template <typename T1, typename T2>
  4033. struct AssertTypeEq;
  4034. template <typename T>
  4035. struct AssertTypeEq<T, T> {
  4036. typedef bool type;
  4037. };
  4038. // A unique type used as the default value for the arguments of class
  4039. // template Types. This allows us to simulate variadic templates
  4040. // (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
  4041. // support directly.
  4042. struct None {};
  4043. // The following family of struct and struct templates are used to
  4044. // represent type lists. In particular, TypesN<T1, T2, ..., TN>
  4045. // represents a type list with N types (T1, T2, ..., and TN) in it.
  4046. // Except for Types0, every struct in the family has two member types:
  4047. // Head for the first type in the list, and Tail for the rest of the
  4048. // list.
  4049. // The empty type list.
  4050. struct Types0 {};
  4051. // Type lists of length 1, 2, 3, and so on.
  4052. template <typename T1>
  4053. struct Types1 {
  4054. typedef T1 Head;
  4055. typedef Types0 Tail;
  4056. };
  4057. template <typename T1, typename T2>
  4058. struct Types2 {
  4059. typedef T1 Head;
  4060. typedef Types1<T2> Tail;
  4061. };
  4062. template <typename T1, typename T2, typename T3>
  4063. struct Types3 {
  4064. typedef T1 Head;
  4065. typedef Types2<T2, T3> Tail;
  4066. };
  4067. template <typename T1, typename T2, typename T3, typename T4>
  4068. struct Types4 {
  4069. typedef T1 Head;
  4070. typedef Types3<T2, T3, T4> Tail;
  4071. };
  4072. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  4073. struct Types5 {
  4074. typedef T1 Head;
  4075. typedef Types4<T2, T3, T4, T5> Tail;
  4076. };
  4077. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4078. typename T6>
  4079. struct Types6 {
  4080. typedef T1 Head;
  4081. typedef Types5<T2, T3, T4, T5, T6> Tail;
  4082. };
  4083. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4084. typename T6, typename T7>
  4085. struct Types7 {
  4086. typedef T1 Head;
  4087. typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
  4088. };
  4089. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4090. typename T6, typename T7, typename T8>
  4091. struct Types8 {
  4092. typedef T1 Head;
  4093. typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
  4094. };
  4095. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4096. typename T6, typename T7, typename T8, typename T9>
  4097. struct Types9 {
  4098. typedef T1 Head;
  4099. typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
  4100. };
  4101. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4102. typename T6, typename T7, typename T8, typename T9, typename T10>
  4103. struct Types10 {
  4104. typedef T1 Head;
  4105. typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
  4106. };
  4107. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4108. typename T6, typename T7, typename T8, typename T9, typename T10,
  4109. typename T11>
  4110. struct Types11 {
  4111. typedef T1 Head;
  4112. typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
  4113. };
  4114. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4115. typename T6, typename T7, typename T8, typename T9, typename T10,
  4116. typename T11, typename T12>
  4117. struct Types12 {
  4118. typedef T1 Head;
  4119. typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
  4120. };
  4121. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4122. typename T6, typename T7, typename T8, typename T9, typename T10,
  4123. typename T11, typename T12, typename T13>
  4124. struct Types13 {
  4125. typedef T1 Head;
  4126. typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
  4127. };
  4128. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4129. typename T6, typename T7, typename T8, typename T9, typename T10,
  4130. typename T11, typename T12, typename T13, typename T14>
  4131. struct Types14 {
  4132. typedef T1 Head;
  4133. typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
  4134. };
  4135. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4136. typename T6, typename T7, typename T8, typename T9, typename T10,
  4137. typename T11, typename T12, typename T13, typename T14, typename T15>
  4138. struct Types15 {
  4139. typedef T1 Head;
  4140. typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4141. T15> Tail;
  4142. };
  4143. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4144. typename T6, typename T7, typename T8, typename T9, typename T10,
  4145. typename T11, typename T12, typename T13, typename T14, typename T15,
  4146. typename T16>
  4147. struct Types16 {
  4148. typedef T1 Head;
  4149. typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4150. T16> Tail;
  4151. };
  4152. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4153. typename T6, typename T7, typename T8, typename T9, typename T10,
  4154. typename T11, typename T12, typename T13, typename T14, typename T15,
  4155. typename T16, typename T17>
  4156. struct Types17 {
  4157. typedef T1 Head;
  4158. typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4159. T16, T17> Tail;
  4160. };
  4161. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4162. typename T6, typename T7, typename T8, typename T9, typename T10,
  4163. typename T11, typename T12, typename T13, typename T14, typename T15,
  4164. typename T16, typename T17, typename T18>
  4165. struct Types18 {
  4166. typedef T1 Head;
  4167. typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4168. T16, T17, T18> Tail;
  4169. };
  4170. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4171. typename T6, typename T7, typename T8, typename T9, typename T10,
  4172. typename T11, typename T12, typename T13, typename T14, typename T15,
  4173. typename T16, typename T17, typename T18, typename T19>
  4174. struct Types19 {
  4175. typedef T1 Head;
  4176. typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4177. T16, T17, T18, T19> Tail;
  4178. };
  4179. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4180. typename T6, typename T7, typename T8, typename T9, typename T10,
  4181. typename T11, typename T12, typename T13, typename T14, typename T15,
  4182. typename T16, typename T17, typename T18, typename T19, typename T20>
  4183. struct Types20 {
  4184. typedef T1 Head;
  4185. typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4186. T16, T17, T18, T19, T20> Tail;
  4187. };
  4188. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4189. typename T6, typename T7, typename T8, typename T9, typename T10,
  4190. typename T11, typename T12, typename T13, typename T14, typename T15,
  4191. typename T16, typename T17, typename T18, typename T19, typename T20,
  4192. typename T21>
  4193. struct Types21 {
  4194. typedef T1 Head;
  4195. typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4196. T16, T17, T18, T19, T20, T21> Tail;
  4197. };
  4198. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4199. typename T6, typename T7, typename T8, typename T9, typename T10,
  4200. typename T11, typename T12, typename T13, typename T14, typename T15,
  4201. typename T16, typename T17, typename T18, typename T19, typename T20,
  4202. typename T21, typename T22>
  4203. struct Types22 {
  4204. typedef T1 Head;
  4205. typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4206. T16, T17, T18, T19, T20, T21, T22> Tail;
  4207. };
  4208. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4209. typename T6, typename T7, typename T8, typename T9, typename T10,
  4210. typename T11, typename T12, typename T13, typename T14, typename T15,
  4211. typename T16, typename T17, typename T18, typename T19, typename T20,
  4212. typename T21, typename T22, typename T23>
  4213. struct Types23 {
  4214. typedef T1 Head;
  4215. typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4216. T16, T17, T18, T19, T20, T21, T22, T23> Tail;
  4217. };
  4218. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4219. typename T6, typename T7, typename T8, typename T9, typename T10,
  4220. typename T11, typename T12, typename T13, typename T14, typename T15,
  4221. typename T16, typename T17, typename T18, typename T19, typename T20,
  4222. typename T21, typename T22, typename T23, typename T24>
  4223. struct Types24 {
  4224. typedef T1 Head;
  4225. typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4226. T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
  4227. };
  4228. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4229. typename T6, typename T7, typename T8, typename T9, typename T10,
  4230. typename T11, typename T12, typename T13, typename T14, typename T15,
  4231. typename T16, typename T17, typename T18, typename T19, typename T20,
  4232. typename T21, typename T22, typename T23, typename T24, typename T25>
  4233. struct Types25 {
  4234. typedef T1 Head;
  4235. typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4236. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
  4237. };
  4238. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4239. typename T6, typename T7, typename T8, typename T9, typename T10,
  4240. typename T11, typename T12, typename T13, typename T14, typename T15,
  4241. typename T16, typename T17, typename T18, typename T19, typename T20,
  4242. typename T21, typename T22, typename T23, typename T24, typename T25,
  4243. typename T26>
  4244. struct Types26 {
  4245. typedef T1 Head;
  4246. typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4247. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
  4248. };
  4249. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4250. typename T6, typename T7, typename T8, typename T9, typename T10,
  4251. typename T11, typename T12, typename T13, typename T14, typename T15,
  4252. typename T16, typename T17, typename T18, typename T19, typename T20,
  4253. typename T21, typename T22, typename T23, typename T24, typename T25,
  4254. typename T26, typename T27>
  4255. struct Types27 {
  4256. typedef T1 Head;
  4257. typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4258. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
  4259. };
  4260. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4261. typename T6, typename T7, typename T8, typename T9, typename T10,
  4262. typename T11, typename T12, typename T13, typename T14, typename T15,
  4263. typename T16, typename T17, typename T18, typename T19, typename T20,
  4264. typename T21, typename T22, typename T23, typename T24, typename T25,
  4265. typename T26, typename T27, typename T28>
  4266. struct Types28 {
  4267. typedef T1 Head;
  4268. typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4269. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
  4270. };
  4271. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4272. typename T6, typename T7, typename T8, typename T9, typename T10,
  4273. typename T11, typename T12, typename T13, typename T14, typename T15,
  4274. typename T16, typename T17, typename T18, typename T19, typename T20,
  4275. typename T21, typename T22, typename T23, typename T24, typename T25,
  4276. typename T26, typename T27, typename T28, typename T29>
  4277. struct Types29 {
  4278. typedef T1 Head;
  4279. typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4280. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4281. T29> Tail;
  4282. };
  4283. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4284. typename T6, typename T7, typename T8, typename T9, typename T10,
  4285. typename T11, typename T12, typename T13, typename T14, typename T15,
  4286. typename T16, typename T17, typename T18, typename T19, typename T20,
  4287. typename T21, typename T22, typename T23, typename T24, typename T25,
  4288. typename T26, typename T27, typename T28, typename T29, typename T30>
  4289. struct Types30 {
  4290. typedef T1 Head;
  4291. typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4292. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4293. T30> Tail;
  4294. };
  4295. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4296. typename T6, typename T7, typename T8, typename T9, typename T10,
  4297. typename T11, typename T12, typename T13, typename T14, typename T15,
  4298. typename T16, typename T17, typename T18, typename T19, typename T20,
  4299. typename T21, typename T22, typename T23, typename T24, typename T25,
  4300. typename T26, typename T27, typename T28, typename T29, typename T30,
  4301. typename T31>
  4302. struct Types31 {
  4303. typedef T1 Head;
  4304. typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4305. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4306. T30, T31> Tail;
  4307. };
  4308. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4309. typename T6, typename T7, typename T8, typename T9, typename T10,
  4310. typename T11, typename T12, typename T13, typename T14, typename T15,
  4311. typename T16, typename T17, typename T18, typename T19, typename T20,
  4312. typename T21, typename T22, typename T23, typename T24, typename T25,
  4313. typename T26, typename T27, typename T28, typename T29, typename T30,
  4314. typename T31, typename T32>
  4315. struct Types32 {
  4316. typedef T1 Head;
  4317. typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4318. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4319. T30, T31, T32> Tail;
  4320. };
  4321. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4322. typename T6, typename T7, typename T8, typename T9, typename T10,
  4323. typename T11, typename T12, typename T13, typename T14, typename T15,
  4324. typename T16, typename T17, typename T18, typename T19, typename T20,
  4325. typename T21, typename T22, typename T23, typename T24, typename T25,
  4326. typename T26, typename T27, typename T28, typename T29, typename T30,
  4327. typename T31, typename T32, typename T33>
  4328. struct Types33 {
  4329. typedef T1 Head;
  4330. typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4331. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4332. T30, T31, T32, T33> Tail;
  4333. };
  4334. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4335. typename T6, typename T7, typename T8, typename T9, typename T10,
  4336. typename T11, typename T12, typename T13, typename T14, typename T15,
  4337. typename T16, typename T17, typename T18, typename T19, typename T20,
  4338. typename T21, typename T22, typename T23, typename T24, typename T25,
  4339. typename T26, typename T27, typename T28, typename T29, typename T30,
  4340. typename T31, typename T32, typename T33, typename T34>
  4341. struct Types34 {
  4342. typedef T1 Head;
  4343. typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4344. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4345. T30, T31, T32, T33, T34> Tail;
  4346. };
  4347. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4348. typename T6, typename T7, typename T8, typename T9, typename T10,
  4349. typename T11, typename T12, typename T13, typename T14, typename T15,
  4350. typename T16, typename T17, typename T18, typename T19, typename T20,
  4351. typename T21, typename T22, typename T23, typename T24, typename T25,
  4352. typename T26, typename T27, typename T28, typename T29, typename T30,
  4353. typename T31, typename T32, typename T33, typename T34, typename T35>
  4354. struct Types35 {
  4355. typedef T1 Head;
  4356. typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4357. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4358. T30, T31, T32, T33, T34, T35> Tail;
  4359. };
  4360. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4361. typename T6, typename T7, typename T8, typename T9, typename T10,
  4362. typename T11, typename T12, typename T13, typename T14, typename T15,
  4363. typename T16, typename T17, typename T18, typename T19, typename T20,
  4364. typename T21, typename T22, typename T23, typename T24, typename T25,
  4365. typename T26, typename T27, typename T28, typename T29, typename T30,
  4366. typename T31, typename T32, typename T33, typename T34, typename T35,
  4367. typename T36>
  4368. struct Types36 {
  4369. typedef T1 Head;
  4370. typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4371. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4372. T30, T31, T32, T33, T34, T35, T36> Tail;
  4373. };
  4374. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4375. typename T6, typename T7, typename T8, typename T9, typename T10,
  4376. typename T11, typename T12, typename T13, typename T14, typename T15,
  4377. typename T16, typename T17, typename T18, typename T19, typename T20,
  4378. typename T21, typename T22, typename T23, typename T24, typename T25,
  4379. typename T26, typename T27, typename T28, typename T29, typename T30,
  4380. typename T31, typename T32, typename T33, typename T34, typename T35,
  4381. typename T36, typename T37>
  4382. struct Types37 {
  4383. typedef T1 Head;
  4384. typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4385. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4386. T30, T31, T32, T33, T34, T35, T36, T37> Tail;
  4387. };
  4388. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4389. typename T6, typename T7, typename T8, typename T9, typename T10,
  4390. typename T11, typename T12, typename T13, typename T14, typename T15,
  4391. typename T16, typename T17, typename T18, typename T19, typename T20,
  4392. typename T21, typename T22, typename T23, typename T24, typename T25,
  4393. typename T26, typename T27, typename T28, typename T29, typename T30,
  4394. typename T31, typename T32, typename T33, typename T34, typename T35,
  4395. typename T36, typename T37, typename T38>
  4396. struct Types38 {
  4397. typedef T1 Head;
  4398. typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4399. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4400. T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
  4401. };
  4402. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4403. typename T6, typename T7, typename T8, typename T9, typename T10,
  4404. typename T11, typename T12, typename T13, typename T14, typename T15,
  4405. typename T16, typename T17, typename T18, typename T19, typename T20,
  4406. typename T21, typename T22, typename T23, typename T24, typename T25,
  4407. typename T26, typename T27, typename T28, typename T29, typename T30,
  4408. typename T31, typename T32, typename T33, typename T34, typename T35,
  4409. typename T36, typename T37, typename T38, typename T39>
  4410. struct Types39 {
  4411. typedef T1 Head;
  4412. typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4413. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4414. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
  4415. };
  4416. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4417. typename T6, typename T7, typename T8, typename T9, typename T10,
  4418. typename T11, typename T12, typename T13, typename T14, typename T15,
  4419. typename T16, typename T17, typename T18, typename T19, typename T20,
  4420. typename T21, typename T22, typename T23, typename T24, typename T25,
  4421. typename T26, typename T27, typename T28, typename T29, typename T30,
  4422. typename T31, typename T32, typename T33, typename T34, typename T35,
  4423. typename T36, typename T37, typename T38, typename T39, typename T40>
  4424. struct Types40 {
  4425. typedef T1 Head;
  4426. typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4427. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4428. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
  4429. };
  4430. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4431. typename T6, typename T7, typename T8, typename T9, typename T10,
  4432. typename T11, typename T12, typename T13, typename T14, typename T15,
  4433. typename T16, typename T17, typename T18, typename T19, typename T20,
  4434. typename T21, typename T22, typename T23, typename T24, typename T25,
  4435. typename T26, typename T27, typename T28, typename T29, typename T30,
  4436. typename T31, typename T32, typename T33, typename T34, typename T35,
  4437. typename T36, typename T37, typename T38, typename T39, typename T40,
  4438. typename T41>
  4439. struct Types41 {
  4440. typedef T1 Head;
  4441. typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4442. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4443. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
  4444. };
  4445. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4446. typename T6, typename T7, typename T8, typename T9, typename T10,
  4447. typename T11, typename T12, typename T13, typename T14, typename T15,
  4448. typename T16, typename T17, typename T18, typename T19, typename T20,
  4449. typename T21, typename T22, typename T23, typename T24, typename T25,
  4450. typename T26, typename T27, typename T28, typename T29, typename T30,
  4451. typename T31, typename T32, typename T33, typename T34, typename T35,
  4452. typename T36, typename T37, typename T38, typename T39, typename T40,
  4453. typename T41, typename T42>
  4454. struct Types42 {
  4455. typedef T1 Head;
  4456. typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4457. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4458. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
  4459. };
  4460. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4461. typename T6, typename T7, typename T8, typename T9, typename T10,
  4462. typename T11, typename T12, typename T13, typename T14, typename T15,
  4463. typename T16, typename T17, typename T18, typename T19, typename T20,
  4464. typename T21, typename T22, typename T23, typename T24, typename T25,
  4465. typename T26, typename T27, typename T28, typename T29, typename T30,
  4466. typename T31, typename T32, typename T33, typename T34, typename T35,
  4467. typename T36, typename T37, typename T38, typename T39, typename T40,
  4468. typename T41, typename T42, typename T43>
  4469. struct Types43 {
  4470. typedef T1 Head;
  4471. typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4472. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4473. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  4474. T43> Tail;
  4475. };
  4476. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4477. typename T6, typename T7, typename T8, typename T9, typename T10,
  4478. typename T11, typename T12, typename T13, typename T14, typename T15,
  4479. typename T16, typename T17, typename T18, typename T19, typename T20,
  4480. typename T21, typename T22, typename T23, typename T24, typename T25,
  4481. typename T26, typename T27, typename T28, typename T29, typename T30,
  4482. typename T31, typename T32, typename T33, typename T34, typename T35,
  4483. typename T36, typename T37, typename T38, typename T39, typename T40,
  4484. typename T41, typename T42, typename T43, typename T44>
  4485. struct Types44 {
  4486. typedef T1 Head;
  4487. typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4488. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4489. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  4490. T44> Tail;
  4491. };
  4492. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4493. typename T6, typename T7, typename T8, typename T9, typename T10,
  4494. typename T11, typename T12, typename T13, typename T14, typename T15,
  4495. typename T16, typename T17, typename T18, typename T19, typename T20,
  4496. typename T21, typename T22, typename T23, typename T24, typename T25,
  4497. typename T26, typename T27, typename T28, typename T29, typename T30,
  4498. typename T31, typename T32, typename T33, typename T34, typename T35,
  4499. typename T36, typename T37, typename T38, typename T39, typename T40,
  4500. typename T41, typename T42, typename T43, typename T44, typename T45>
  4501. struct Types45 {
  4502. typedef T1 Head;
  4503. typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4504. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4505. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  4506. T44, T45> Tail;
  4507. };
  4508. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4509. typename T6, typename T7, typename T8, typename T9, typename T10,
  4510. typename T11, typename T12, typename T13, typename T14, typename T15,
  4511. typename T16, typename T17, typename T18, typename T19, typename T20,
  4512. typename T21, typename T22, typename T23, typename T24, typename T25,
  4513. typename T26, typename T27, typename T28, typename T29, typename T30,
  4514. typename T31, typename T32, typename T33, typename T34, typename T35,
  4515. typename T36, typename T37, typename T38, typename T39, typename T40,
  4516. typename T41, typename T42, typename T43, typename T44, typename T45,
  4517. typename T46>
  4518. struct Types46 {
  4519. typedef T1 Head;
  4520. typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4521. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4522. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  4523. T44, T45, T46> Tail;
  4524. };
  4525. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4526. typename T6, typename T7, typename T8, typename T9, typename T10,
  4527. typename T11, typename T12, typename T13, typename T14, typename T15,
  4528. typename T16, typename T17, typename T18, typename T19, typename T20,
  4529. typename T21, typename T22, typename T23, typename T24, typename T25,
  4530. typename T26, typename T27, typename T28, typename T29, typename T30,
  4531. typename T31, typename T32, typename T33, typename T34, typename T35,
  4532. typename T36, typename T37, typename T38, typename T39, typename T40,
  4533. typename T41, typename T42, typename T43, typename T44, typename T45,
  4534. typename T46, typename T47>
  4535. struct Types47 {
  4536. typedef T1 Head;
  4537. typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4538. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4539. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  4540. T44, T45, T46, T47> Tail;
  4541. };
  4542. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4543. typename T6, typename T7, typename T8, typename T9, typename T10,
  4544. typename T11, typename T12, typename T13, typename T14, typename T15,
  4545. typename T16, typename T17, typename T18, typename T19, typename T20,
  4546. typename T21, typename T22, typename T23, typename T24, typename T25,
  4547. typename T26, typename T27, typename T28, typename T29, typename T30,
  4548. typename T31, typename T32, typename T33, typename T34, typename T35,
  4549. typename T36, typename T37, typename T38, typename T39, typename T40,
  4550. typename T41, typename T42, typename T43, typename T44, typename T45,
  4551. typename T46, typename T47, typename T48>
  4552. struct Types48 {
  4553. typedef T1 Head;
  4554. typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4555. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4556. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  4557. T44, T45, T46, T47, T48> Tail;
  4558. };
  4559. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4560. typename T6, typename T7, typename T8, typename T9, typename T10,
  4561. typename T11, typename T12, typename T13, typename T14, typename T15,
  4562. typename T16, typename T17, typename T18, typename T19, typename T20,
  4563. typename T21, typename T22, typename T23, typename T24, typename T25,
  4564. typename T26, typename T27, typename T28, typename T29, typename T30,
  4565. typename T31, typename T32, typename T33, typename T34, typename T35,
  4566. typename T36, typename T37, typename T38, typename T39, typename T40,
  4567. typename T41, typename T42, typename T43, typename T44, typename T45,
  4568. typename T46, typename T47, typename T48, typename T49>
  4569. struct Types49 {
  4570. typedef T1 Head;
  4571. typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4572. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4573. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  4574. T44, T45, T46, T47, T48, T49> Tail;
  4575. };
  4576. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4577. typename T6, typename T7, typename T8, typename T9, typename T10,
  4578. typename T11, typename T12, typename T13, typename T14, typename T15,
  4579. typename T16, typename T17, typename T18, typename T19, typename T20,
  4580. typename T21, typename T22, typename T23, typename T24, typename T25,
  4581. typename T26, typename T27, typename T28, typename T29, typename T30,
  4582. typename T31, typename T32, typename T33, typename T34, typename T35,
  4583. typename T36, typename T37, typename T38, typename T39, typename T40,
  4584. typename T41, typename T42, typename T43, typename T44, typename T45,
  4585. typename T46, typename T47, typename T48, typename T49, typename T50>
  4586. struct Types50 {
  4587. typedef T1 Head;
  4588. typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4589. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4590. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  4591. T44, T45, T46, T47, T48, T49, T50> Tail;
  4592. };
  4593. } // namespace internal
  4594. // We don't want to require the users to write TypesN<...> directly,
  4595. // as that would require them to count the length. Types<...> is much
  4596. // easier to write, but generates horrible messages when there is a
  4597. // compiler error, as gcc insists on printing out each template
  4598. // argument, even if it has the default value (this means Types<int>
  4599. // will appear as Types<int, None, None, ..., None> in the compiler
  4600. // errors).
  4601. //
  4602. // Our solution is to combine the best part of the two approaches: a
  4603. // user would write Types<T1, ..., TN>, and Google Test will translate
  4604. // that to TypesN<T1, ..., TN> internally to make error messages
  4605. // readable. The translation is done by the 'type' member of the
  4606. // Types template.
  4607. template <typename T1 = internal::None, typename T2 = internal::None,
  4608. typename T3 = internal::None, typename T4 = internal::None,
  4609. typename T5 = internal::None, typename T6 = internal::None,
  4610. typename T7 = internal::None, typename T8 = internal::None,
  4611. typename T9 = internal::None, typename T10 = internal::None,
  4612. typename T11 = internal::None, typename T12 = internal::None,
  4613. typename T13 = internal::None, typename T14 = internal::None,
  4614. typename T15 = internal::None, typename T16 = internal::None,
  4615. typename T17 = internal::None, typename T18 = internal::None,
  4616. typename T19 = internal::None, typename T20 = internal::None,
  4617. typename T21 = internal::None, typename T22 = internal::None,
  4618. typename T23 = internal::None, typename T24 = internal::None,
  4619. typename T25 = internal::None, typename T26 = internal::None,
  4620. typename T27 = internal::None, typename T28 = internal::None,
  4621. typename T29 = internal::None, typename T30 = internal::None,
  4622. typename T31 = internal::None, typename T32 = internal::None,
  4623. typename T33 = internal::None, typename T34 = internal::None,
  4624. typename T35 = internal::None, typename T36 = internal::None,
  4625. typename T37 = internal::None, typename T38 = internal::None,
  4626. typename T39 = internal::None, typename T40 = internal::None,
  4627. typename T41 = internal::None, typename T42 = internal::None,
  4628. typename T43 = internal::None, typename T44 = internal::None,
  4629. typename T45 = internal::None, typename T46 = internal::None,
  4630. typename T47 = internal::None, typename T48 = internal::None,
  4631. typename T49 = internal::None, typename T50 = internal::None>
  4632. struct Types {
  4633. typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4634. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4635. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4636. T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
  4637. };
  4638. template <>
  4639. struct Types<internal::None, internal::None, internal::None, internal::None,
  4640. internal::None, internal::None, internal::None, internal::None,
  4641. internal::None, internal::None, internal::None, internal::None,
  4642. internal::None, internal::None, internal::None, internal::None,
  4643. internal::None, internal::None, internal::None, internal::None,
  4644. internal::None, internal::None, internal::None, internal::None,
  4645. internal::None, internal::None, internal::None, internal::None,
  4646. internal::None, internal::None, internal::None, internal::None,
  4647. internal::None, internal::None, internal::None, internal::None,
  4648. internal::None, internal::None, internal::None, internal::None,
  4649. internal::None, internal::None, internal::None, internal::None,
  4650. internal::None, internal::None, internal::None, internal::None,
  4651. internal::None, internal::None> {
  4652. typedef internal::Types0 type;
  4653. };
  4654. template <typename T1>
  4655. struct Types<T1, internal::None, internal::None, internal::None,
  4656. internal::None, internal::None, internal::None, internal::None,
  4657. internal::None, internal::None, internal::None, internal::None,
  4658. internal::None, internal::None, internal::None, internal::None,
  4659. internal::None, internal::None, internal::None, internal::None,
  4660. internal::None, internal::None, internal::None, internal::None,
  4661. internal::None, internal::None, internal::None, internal::None,
  4662. internal::None, internal::None, internal::None, internal::None,
  4663. internal::None, internal::None, internal::None, internal::None,
  4664. internal::None, internal::None, internal::None, internal::None,
  4665. internal::None, internal::None, internal::None, internal::None,
  4666. internal::None, internal::None, internal::None, internal::None,
  4667. internal::None, internal::None> {
  4668. typedef internal::Types1<T1> type;
  4669. };
  4670. template <typename T1, typename T2>
  4671. struct Types<T1, T2, internal::None, internal::None, internal::None,
  4672. internal::None, internal::None, internal::None, internal::None,
  4673. internal::None, internal::None, internal::None, internal::None,
  4674. internal::None, internal::None, internal::None, internal::None,
  4675. internal::None, internal::None, internal::None, internal::None,
  4676. internal::None, internal::None, internal::None, internal::None,
  4677. internal::None, internal::None, internal::None, internal::None,
  4678. internal::None, internal::None, internal::None, internal::None,
  4679. internal::None, internal::None, internal::None, internal::None,
  4680. internal::None, internal::None, internal::None, internal::None,
  4681. internal::None, internal::None, internal::None, internal::None,
  4682. internal::None, internal::None, internal::None, internal::None,
  4683. internal::None> {
  4684. typedef internal::Types2<T1, T2> type;
  4685. };
  4686. template <typename T1, typename T2, typename T3>
  4687. struct Types<T1, T2, T3, internal::None, internal::None, internal::None,
  4688. internal::None, internal::None, internal::None, internal::None,
  4689. internal::None, internal::None, internal::None, internal::None,
  4690. internal::None, internal::None, internal::None, internal::None,
  4691. internal::None, internal::None, internal::None, internal::None,
  4692. internal::None, internal::None, internal::None, internal::None,
  4693. internal::None, internal::None, internal::None, internal::None,
  4694. internal::None, internal::None, internal::None, internal::None,
  4695. internal::None, internal::None, internal::None, internal::None,
  4696. internal::None, internal::None, internal::None, internal::None,
  4697. internal::None, internal::None, internal::None, internal::None,
  4698. internal::None, internal::None, internal::None, internal::None> {
  4699. typedef internal::Types3<T1, T2, T3> type;
  4700. };
  4701. template <typename T1, typename T2, typename T3, typename T4>
  4702. struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,
  4703. internal::None, internal::None, internal::None, internal::None,
  4704. internal::None, internal::None, internal::None, internal::None,
  4705. internal::None, internal::None, internal::None, internal::None,
  4706. internal::None, internal::None, internal::None, internal::None,
  4707. internal::None, internal::None, internal::None, internal::None,
  4708. internal::None, internal::None, internal::None, internal::None,
  4709. internal::None, internal::None, internal::None, internal::None,
  4710. internal::None, internal::None, internal::None, internal::None,
  4711. internal::None, internal::None, internal::None, internal::None,
  4712. internal::None, internal::None, internal::None, internal::None,
  4713. internal::None, internal::None, internal::None> {
  4714. typedef internal::Types4<T1, T2, T3, T4> type;
  4715. };
  4716. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  4717. struct Types<T1, T2, T3, T4, T5, internal::None, internal::None,
  4718. internal::None, internal::None, internal::None, internal::None,
  4719. internal::None, internal::None, internal::None, internal::None,
  4720. internal::None, internal::None, internal::None, internal::None,
  4721. internal::None, internal::None, internal::None, internal::None,
  4722. internal::None, internal::None, internal::None, internal::None,
  4723. internal::None, internal::None, internal::None, internal::None,
  4724. internal::None, internal::None, internal::None, internal::None,
  4725. internal::None, internal::None, internal::None, internal::None,
  4726. internal::None, internal::None, internal::None, internal::None,
  4727. internal::None, internal::None, internal::None, internal::None,
  4728. internal::None, internal::None, internal::None> {
  4729. typedef internal::Types5<T1, T2, T3, T4, T5> type;
  4730. };
  4731. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4732. typename T6>
  4733. struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,
  4734. internal::None, internal::None, internal::None, internal::None,
  4735. internal::None, internal::None, internal::None, internal::None,
  4736. internal::None, internal::None, internal::None, internal::None,
  4737. internal::None, internal::None, internal::None, internal::None,
  4738. internal::None, internal::None, internal::None, internal::None,
  4739. internal::None, internal::None, internal::None, internal::None,
  4740. internal::None, internal::None, internal::None, internal::None,
  4741. internal::None, internal::None, internal::None, internal::None,
  4742. internal::None, internal::None, internal::None, internal::None,
  4743. internal::None, internal::None, internal::None, internal::None,
  4744. internal::None, internal::None> {
  4745. typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
  4746. };
  4747. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4748. typename T6, typename T7>
  4749. struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,
  4750. internal::None, internal::None, internal::None, internal::None,
  4751. internal::None, internal::None, internal::None, internal::None,
  4752. internal::None, internal::None, internal::None, internal::None,
  4753. internal::None, internal::None, internal::None, internal::None,
  4754. internal::None, internal::None, internal::None, internal::None,
  4755. internal::None, internal::None, internal::None, internal::None,
  4756. internal::None, internal::None, internal::None, internal::None,
  4757. internal::None, internal::None, internal::None, internal::None,
  4758. internal::None, internal::None, internal::None, internal::None,
  4759. internal::None, internal::None, internal::None, internal::None,
  4760. internal::None> {
  4761. typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
  4762. };
  4763. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4764. typename T6, typename T7, typename T8>
  4765. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,
  4766. internal::None, internal::None, internal::None, internal::None,
  4767. internal::None, internal::None, internal::None, internal::None,
  4768. internal::None, internal::None, internal::None, internal::None,
  4769. internal::None, internal::None, internal::None, internal::None,
  4770. internal::None, internal::None, internal::None, internal::None,
  4771. internal::None, internal::None, internal::None, internal::None,
  4772. internal::None, internal::None, internal::None, internal::None,
  4773. internal::None, internal::None, internal::None, internal::None,
  4774. internal::None, internal::None, internal::None, internal::None,
  4775. internal::None, internal::None, internal::None, internal::None> {
  4776. typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
  4777. };
  4778. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4779. typename T6, typename T7, typename T8, typename T9>
  4780. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,
  4781. internal::None, internal::None, internal::None, internal::None,
  4782. internal::None, internal::None, internal::None, internal::None,
  4783. internal::None, internal::None, internal::None, internal::None,
  4784. internal::None, internal::None, internal::None, internal::None,
  4785. internal::None, internal::None, internal::None, internal::None,
  4786. internal::None, internal::None, internal::None, internal::None,
  4787. internal::None, internal::None, internal::None, internal::None,
  4788. internal::None, internal::None, internal::None, internal::None,
  4789. internal::None, internal::None, internal::None, internal::None,
  4790. internal::None, internal::None, internal::None, internal::None> {
  4791. typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
  4792. };
  4793. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4794. typename T6, typename T7, typename T8, typename T9, typename T10>
  4795. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,
  4796. internal::None, internal::None, internal::None, internal::None,
  4797. internal::None, internal::None, internal::None, internal::None,
  4798. internal::None, internal::None, internal::None, internal::None,
  4799. internal::None, internal::None, internal::None, internal::None,
  4800. internal::None, internal::None, internal::None, internal::None,
  4801. internal::None, internal::None, internal::None, internal::None,
  4802. internal::None, internal::None, internal::None, internal::None,
  4803. internal::None, internal::None, internal::None, internal::None,
  4804. internal::None, internal::None, internal::None, internal::None,
  4805. internal::None, internal::None, internal::None> {
  4806. typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
  4807. };
  4808. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4809. typename T6, typename T7, typename T8, typename T9, typename T10,
  4810. typename T11>
  4811. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,
  4812. internal::None, internal::None, internal::None, internal::None,
  4813. internal::None, internal::None, internal::None, internal::None,
  4814. internal::None, internal::None, internal::None, internal::None,
  4815. internal::None, internal::None, internal::None, internal::None,
  4816. internal::None, internal::None, internal::None, internal::None,
  4817. internal::None, internal::None, internal::None, internal::None,
  4818. internal::None, internal::None, internal::None, internal::None,
  4819. internal::None, internal::None, internal::None, internal::None,
  4820. internal::None, internal::None, internal::None, internal::None,
  4821. internal::None, internal::None> {
  4822. typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
  4823. };
  4824. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4825. typename T6, typename T7, typename T8, typename T9, typename T10,
  4826. typename T11, typename T12>
  4827. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,
  4828. internal::None, internal::None, internal::None, internal::None,
  4829. internal::None, internal::None, internal::None, internal::None,
  4830. internal::None, internal::None, internal::None, internal::None,
  4831. internal::None, internal::None, internal::None, internal::None,
  4832. internal::None, internal::None, internal::None, internal::None,
  4833. internal::None, internal::None, internal::None, internal::None,
  4834. internal::None, internal::None, internal::None, internal::None,
  4835. internal::None, internal::None, internal::None, internal::None,
  4836. internal::None, internal::None, internal::None, internal::None,
  4837. internal::None> {
  4838. typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  4839. T12> type;
  4840. };
  4841. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4842. typename T6, typename T7, typename T8, typename T9, typename T10,
  4843. typename T11, typename T12, typename T13>
  4844. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  4845. internal::None, internal::None, internal::None, internal::None,
  4846. internal::None, internal::None, internal::None, internal::None,
  4847. internal::None, internal::None, internal::None, internal::None,
  4848. internal::None, internal::None, internal::None, internal::None,
  4849. internal::None, internal::None, internal::None, internal::None,
  4850. internal::None, internal::None, internal::None, internal::None,
  4851. internal::None, internal::None, internal::None, internal::None,
  4852. internal::None, internal::None, internal::None, internal::None,
  4853. internal::None, internal::None, internal::None, internal::None,
  4854. internal::None> {
  4855. typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4856. T13> type;
  4857. };
  4858. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4859. typename T6, typename T7, typename T8, typename T9, typename T10,
  4860. typename T11, typename T12, typename T13, typename T14>
  4861. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4862. internal::None, internal::None, internal::None, internal::None,
  4863. internal::None, internal::None, internal::None, internal::None,
  4864. internal::None, internal::None, internal::None, internal::None,
  4865. internal::None, internal::None, internal::None, internal::None,
  4866. internal::None, internal::None, internal::None, internal::None,
  4867. internal::None, internal::None, internal::None, internal::None,
  4868. internal::None, internal::None, internal::None, internal::None,
  4869. internal::None, internal::None, internal::None, internal::None,
  4870. internal::None, internal::None, internal::None, internal::None> {
  4871. typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4872. T13, T14> type;
  4873. };
  4874. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4875. typename T6, typename T7, typename T8, typename T9, typename T10,
  4876. typename T11, typename T12, typename T13, typename T14, typename T15>
  4877. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4878. internal::None, internal::None, internal::None, internal::None,
  4879. internal::None, internal::None, internal::None, internal::None,
  4880. internal::None, internal::None, internal::None, internal::None,
  4881. internal::None, internal::None, internal::None, internal::None,
  4882. internal::None, internal::None, internal::None, internal::None,
  4883. internal::None, internal::None, internal::None, internal::None,
  4884. internal::None, internal::None, internal::None, internal::None,
  4885. internal::None, internal::None, internal::None, internal::None,
  4886. internal::None, internal::None, internal::None> {
  4887. typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4888. T13, T14, T15> type;
  4889. };
  4890. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4891. typename T6, typename T7, typename T8, typename T9, typename T10,
  4892. typename T11, typename T12, typename T13, typename T14, typename T15,
  4893. typename T16>
  4894. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4895. T16, internal::None, internal::None, internal::None, internal::None,
  4896. internal::None, internal::None, internal::None, internal::None,
  4897. internal::None, internal::None, internal::None, internal::None,
  4898. internal::None, internal::None, internal::None, internal::None,
  4899. internal::None, internal::None, internal::None, internal::None,
  4900. internal::None, internal::None, internal::None, internal::None,
  4901. internal::None, internal::None, internal::None, internal::None,
  4902. internal::None, internal::None, internal::None, internal::None,
  4903. internal::None, internal::None> {
  4904. typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4905. T13, T14, T15, T16> type;
  4906. };
  4907. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4908. typename T6, typename T7, typename T8, typename T9, typename T10,
  4909. typename T11, typename T12, typename T13, typename T14, typename T15,
  4910. typename T16, typename T17>
  4911. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4912. T16, T17, internal::None, internal::None, internal::None, internal::None,
  4913. internal::None, internal::None, internal::None, internal::None,
  4914. internal::None, internal::None, internal::None, internal::None,
  4915. internal::None, internal::None, internal::None, internal::None,
  4916. internal::None, internal::None, internal::None, internal::None,
  4917. internal::None, internal::None, internal::None, internal::None,
  4918. internal::None, internal::None, internal::None, internal::None,
  4919. internal::None, internal::None, internal::None, internal::None,
  4920. internal::None> {
  4921. typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4922. T13, T14, T15, T16, T17> type;
  4923. };
  4924. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4925. typename T6, typename T7, typename T8, typename T9, typename T10,
  4926. typename T11, typename T12, typename T13, typename T14, typename T15,
  4927. typename T16, typename T17, typename T18>
  4928. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4929. T16, T17, T18, internal::None, internal::None, internal::None,
  4930. internal::None, internal::None, internal::None, internal::None,
  4931. internal::None, internal::None, internal::None, internal::None,
  4932. internal::None, internal::None, internal::None, internal::None,
  4933. internal::None, internal::None, internal::None, internal::None,
  4934. internal::None, internal::None, internal::None, internal::None,
  4935. internal::None, internal::None, internal::None, internal::None,
  4936. internal::None, internal::None, internal::None, internal::None,
  4937. internal::None> {
  4938. typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4939. T13, T14, T15, T16, T17, T18> type;
  4940. };
  4941. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4942. typename T6, typename T7, typename T8, typename T9, typename T10,
  4943. typename T11, typename T12, typename T13, typename T14, typename T15,
  4944. typename T16, typename T17, typename T18, typename T19>
  4945. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4946. T16, T17, T18, T19, internal::None, internal::None, internal::None,
  4947. internal::None, internal::None, internal::None, internal::None,
  4948. internal::None, internal::None, internal::None, internal::None,
  4949. internal::None, internal::None, internal::None, internal::None,
  4950. internal::None, internal::None, internal::None, internal::None,
  4951. internal::None, internal::None, internal::None, internal::None,
  4952. internal::None, internal::None, internal::None, internal::None,
  4953. internal::None, internal::None, internal::None, internal::None> {
  4954. typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4955. T13, T14, T15, T16, T17, T18, T19> type;
  4956. };
  4957. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4958. typename T6, typename T7, typename T8, typename T9, typename T10,
  4959. typename T11, typename T12, typename T13, typename T14, typename T15,
  4960. typename T16, typename T17, typename T18, typename T19, typename T20>
  4961. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4962. T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,
  4963. internal::None, internal::None, internal::None, internal::None,
  4964. internal::None, internal::None, internal::None, internal::None,
  4965. internal::None, internal::None, internal::None, internal::None,
  4966. internal::None, internal::None, internal::None, internal::None,
  4967. internal::None, internal::None, internal::None, internal::None,
  4968. internal::None, internal::None, internal::None, internal::None,
  4969. internal::None, internal::None, internal::None> {
  4970. typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4971. T13, T14, T15, T16, T17, T18, T19, T20> type;
  4972. };
  4973. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4974. typename T6, typename T7, typename T8, typename T9, typename T10,
  4975. typename T11, typename T12, typename T13, typename T14, typename T15,
  4976. typename T16, typename T17, typename T18, typename T19, typename T20,
  4977. typename T21>
  4978. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4979. T16, T17, T18, T19, T20, T21, internal::None, internal::None,
  4980. internal::None, internal::None, internal::None, internal::None,
  4981. internal::None, internal::None, internal::None, internal::None,
  4982. internal::None, internal::None, internal::None, internal::None,
  4983. internal::None, internal::None, internal::None, internal::None,
  4984. internal::None, internal::None, internal::None, internal::None,
  4985. internal::None, internal::None, internal::None, internal::None,
  4986. internal::None, internal::None, internal::None> {
  4987. typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4988. T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
  4989. };
  4990. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4991. typename T6, typename T7, typename T8, typename T9, typename T10,
  4992. typename T11, typename T12, typename T13, typename T14, typename T15,
  4993. typename T16, typename T17, typename T18, typename T19, typename T20,
  4994. typename T21, typename T22>
  4995. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4996. T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None,
  4997. internal::None, internal::None, internal::None, internal::None,
  4998. internal::None, internal::None, internal::None, internal::None,
  4999. internal::None, internal::None, internal::None, internal::None,
  5000. internal::None, internal::None, internal::None, internal::None,
  5001. internal::None, internal::None, internal::None, internal::None,
  5002. internal::None, internal::None, internal::None, internal::None,
  5003. internal::None, internal::None> {
  5004. typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5005. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
  5006. };
  5007. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5008. typename T6, typename T7, typename T8, typename T9, typename T10,
  5009. typename T11, typename T12, typename T13, typename T14, typename T15,
  5010. typename T16, typename T17, typename T18, typename T19, typename T20,
  5011. typename T21, typename T22, typename T23>
  5012. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5013. T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None,
  5014. internal::None, internal::None, internal::None, internal::None,
  5015. internal::None, internal::None, internal::None, internal::None,
  5016. internal::None, internal::None, internal::None, internal::None,
  5017. internal::None, internal::None, internal::None, internal::None,
  5018. internal::None, internal::None, internal::None, internal::None,
  5019. internal::None, internal::None, internal::None, internal::None,
  5020. internal::None> {
  5021. typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5022. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
  5023. };
  5024. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5025. typename T6, typename T7, typename T8, typename T9, typename T10,
  5026. typename T11, typename T12, typename T13, typename T14, typename T15,
  5027. typename T16, typename T17, typename T18, typename T19, typename T20,
  5028. typename T21, typename T22, typename T23, typename T24>
  5029. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5030. T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,
  5031. internal::None, internal::None, internal::None, internal::None,
  5032. internal::None, internal::None, internal::None, internal::None,
  5033. internal::None, internal::None, internal::None, internal::None,
  5034. internal::None, internal::None, internal::None, internal::None,
  5035. internal::None, internal::None, internal::None, internal::None,
  5036. internal::None, internal::None, internal::None, internal::None,
  5037. internal::None> {
  5038. typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5039. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
  5040. };
  5041. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5042. typename T6, typename T7, typename T8, typename T9, typename T10,
  5043. typename T11, typename T12, typename T13, typename T14, typename T15,
  5044. typename T16, typename T17, typename T18, typename T19, typename T20,
  5045. typename T21, typename T22, typename T23, typename T24, typename T25>
  5046. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5047. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,
  5048. internal::None, internal::None, internal::None, internal::None,
  5049. internal::None, internal::None, internal::None, internal::None,
  5050. internal::None, internal::None, internal::None, internal::None,
  5051. internal::None, internal::None, internal::None, internal::None,
  5052. internal::None, internal::None, internal::None, internal::None,
  5053. internal::None, internal::None, internal::None, internal::None> {
  5054. typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5055. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
  5056. };
  5057. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5058. typename T6, typename T7, typename T8, typename T9, typename T10,
  5059. typename T11, typename T12, typename T13, typename T14, typename T15,
  5060. typename T16, typename T17, typename T18, typename T19, typename T20,
  5061. typename T21, typename T22, typename T23, typename T24, typename T25,
  5062. typename T26>
  5063. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5064. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,
  5065. internal::None, internal::None, internal::None, internal::None,
  5066. internal::None, internal::None, internal::None, internal::None,
  5067. internal::None, internal::None, internal::None, internal::None,
  5068. internal::None, internal::None, internal::None, internal::None,
  5069. internal::None, internal::None, internal::None, internal::None,
  5070. internal::None, internal::None, internal::None> {
  5071. typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5072. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  5073. T26> type;
  5074. };
  5075. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5076. typename T6, typename T7, typename T8, typename T9, typename T10,
  5077. typename T11, typename T12, typename T13, typename T14, typename T15,
  5078. typename T16, typename T17, typename T18, typename T19, typename T20,
  5079. typename T21, typename T22, typename T23, typename T24, typename T25,
  5080. typename T26, typename T27>
  5081. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5082. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,
  5083. internal::None, internal::None, internal::None, internal::None,
  5084. internal::None, internal::None, internal::None, internal::None,
  5085. internal::None, internal::None, internal::None, internal::None,
  5086. internal::None, internal::None, internal::None, internal::None,
  5087. internal::None, internal::None, internal::None, internal::None,
  5088. internal::None, internal::None> {
  5089. typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5090. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5091. T27> type;
  5092. };
  5093. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5094. typename T6, typename T7, typename T8, typename T9, typename T10,
  5095. typename T11, typename T12, typename T13, typename T14, typename T15,
  5096. typename T16, typename T17, typename T18, typename T19, typename T20,
  5097. typename T21, typename T22, typename T23, typename T24, typename T25,
  5098. typename T26, typename T27, typename T28>
  5099. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5100. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5101. internal::None, internal::None, internal::None, internal::None,
  5102. internal::None, internal::None, internal::None, internal::None,
  5103. internal::None, internal::None, internal::None, internal::None,
  5104. internal::None, internal::None, internal::None, internal::None,
  5105. internal::None, internal::None, internal::None, internal::None,
  5106. internal::None, internal::None> {
  5107. typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5108. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5109. T27, T28> type;
  5110. };
  5111. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5112. typename T6, typename T7, typename T8, typename T9, typename T10,
  5113. typename T11, typename T12, typename T13, typename T14, typename T15,
  5114. typename T16, typename T17, typename T18, typename T19, typename T20,
  5115. typename T21, typename T22, typename T23, typename T24, typename T25,
  5116. typename T26, typename T27, typename T28, typename T29>
  5117. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5118. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5119. internal::None, internal::None, internal::None, internal::None,
  5120. internal::None, internal::None, internal::None, internal::None,
  5121. internal::None, internal::None, internal::None, internal::None,
  5122. internal::None, internal::None, internal::None, internal::None,
  5123. internal::None, internal::None, internal::None, internal::None,
  5124. internal::None> {
  5125. typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5126. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5127. T27, T28, T29> type;
  5128. };
  5129. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5130. typename T6, typename T7, typename T8, typename T9, typename T10,
  5131. typename T11, typename T12, typename T13, typename T14, typename T15,
  5132. typename T16, typename T17, typename T18, typename T19, typename T20,
  5133. typename T21, typename T22, typename T23, typename T24, typename T25,
  5134. typename T26, typename T27, typename T28, typename T29, typename T30>
  5135. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5136. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5137. internal::None, internal::None, internal::None, internal::None,
  5138. internal::None, internal::None, internal::None, internal::None,
  5139. internal::None, internal::None, internal::None, internal::None,
  5140. internal::None, internal::None, internal::None, internal::None,
  5141. internal::None, internal::None, internal::None, internal::None> {
  5142. typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5143. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5144. T27, T28, T29, T30> type;
  5145. };
  5146. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5147. typename T6, typename T7, typename T8, typename T9, typename T10,
  5148. typename T11, typename T12, typename T13, typename T14, typename T15,
  5149. typename T16, typename T17, typename T18, typename T19, typename T20,
  5150. typename T21, typename T22, typename T23, typename T24, typename T25,
  5151. typename T26, typename T27, typename T28, typename T29, typename T30,
  5152. typename T31>
  5153. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5154. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5155. T31, internal::None, internal::None, internal::None, internal::None,
  5156. internal::None, internal::None, internal::None, internal::None,
  5157. internal::None, internal::None, internal::None, internal::None,
  5158. internal::None, internal::None, internal::None, internal::None,
  5159. internal::None, internal::None, internal::None> {
  5160. typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5161. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5162. T27, T28, T29, T30, T31> type;
  5163. };
  5164. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5165. typename T6, typename T7, typename T8, typename T9, typename T10,
  5166. typename T11, typename T12, typename T13, typename T14, typename T15,
  5167. typename T16, typename T17, typename T18, typename T19, typename T20,
  5168. typename T21, typename T22, typename T23, typename T24, typename T25,
  5169. typename T26, typename T27, typename T28, typename T29, typename T30,
  5170. typename T31, typename T32>
  5171. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5172. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5173. T31, T32, internal::None, internal::None, internal::None, internal::None,
  5174. internal::None, internal::None, internal::None, internal::None,
  5175. internal::None, internal::None, internal::None, internal::None,
  5176. internal::None, internal::None, internal::None, internal::None,
  5177. internal::None, internal::None> {
  5178. typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5179. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5180. T27, T28, T29, T30, T31, T32> type;
  5181. };
  5182. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5183. typename T6, typename T7, typename T8, typename T9, typename T10,
  5184. typename T11, typename T12, typename T13, typename T14, typename T15,
  5185. typename T16, typename T17, typename T18, typename T19, typename T20,
  5186. typename T21, typename T22, typename T23, typename T24, typename T25,
  5187. typename T26, typename T27, typename T28, typename T29, typename T30,
  5188. typename T31, typename T32, typename T33>
  5189. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5190. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5191. T31, T32, T33, internal::None, internal::None, internal::None,
  5192. internal::None, internal::None, internal::None, internal::None,
  5193. internal::None, internal::None, internal::None, internal::None,
  5194. internal::None, internal::None, internal::None, internal::None,
  5195. internal::None, internal::None> {
  5196. typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5197. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5198. T27, T28, T29, T30, T31, T32, T33> type;
  5199. };
  5200. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5201. typename T6, typename T7, typename T8, typename T9, typename T10,
  5202. typename T11, typename T12, typename T13, typename T14, typename T15,
  5203. typename T16, typename T17, typename T18, typename T19, typename T20,
  5204. typename T21, typename T22, typename T23, typename T24, typename T25,
  5205. typename T26, typename T27, typename T28, typename T29, typename T30,
  5206. typename T31, typename T32, typename T33, typename T34>
  5207. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5208. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5209. T31, T32, T33, T34, internal::None, internal::None, internal::None,
  5210. internal::None, internal::None, internal::None, internal::None,
  5211. internal::None, internal::None, internal::None, internal::None,
  5212. internal::None, internal::None, internal::None, internal::None,
  5213. internal::None> {
  5214. typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5215. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5216. T27, T28, T29, T30, T31, T32, T33, T34> type;
  5217. };
  5218. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5219. typename T6, typename T7, typename T8, typename T9, typename T10,
  5220. typename T11, typename T12, typename T13, typename T14, typename T15,
  5221. typename T16, typename T17, typename T18, typename T19, typename T20,
  5222. typename T21, typename T22, typename T23, typename T24, typename T25,
  5223. typename T26, typename T27, typename T28, typename T29, typename T30,
  5224. typename T31, typename T32, typename T33, typename T34, typename T35>
  5225. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5226. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5227. T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
  5228. internal::None, internal::None, internal::None, internal::None,
  5229. internal::None, internal::None, internal::None, internal::None,
  5230. internal::None, internal::None, internal::None, internal::None> {
  5231. typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5232. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5233. T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
  5234. };
  5235. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5236. typename T6, typename T7, typename T8, typename T9, typename T10,
  5237. typename T11, typename T12, typename T13, typename T14, typename T15,
  5238. typename T16, typename T17, typename T18, typename T19, typename T20,
  5239. typename T21, typename T22, typename T23, typename T24, typename T25,
  5240. typename T26, typename T27, typename T28, typename T29, typename T30,
  5241. typename T31, typename T32, typename T33, typename T34, typename T35,
  5242. typename T36>
  5243. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5244. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5245. T31, T32, T33, T34, T35, T36, internal::None, internal::None,
  5246. internal::None, internal::None, internal::None, internal::None,
  5247. internal::None, internal::None, internal::None, internal::None,
  5248. internal::None, internal::None, internal::None, internal::None> {
  5249. typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5250. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5251. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
  5252. };
  5253. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5254. typename T6, typename T7, typename T8, typename T9, typename T10,
  5255. typename T11, typename T12, typename T13, typename T14, typename T15,
  5256. typename T16, typename T17, typename T18, typename T19, typename T20,
  5257. typename T21, typename T22, typename T23, typename T24, typename T25,
  5258. typename T26, typename T27, typename T28, typename T29, typename T30,
  5259. typename T31, typename T32, typename T33, typename T34, typename T35,
  5260. typename T36, typename T37>
  5261. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5262. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5263. T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
  5264. internal::None, internal::None, internal::None, internal::None,
  5265. internal::None, internal::None, internal::None, internal::None,
  5266. internal::None, internal::None, internal::None> {
  5267. typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5268. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5269. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
  5270. };
  5271. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5272. typename T6, typename T7, typename T8, typename T9, typename T10,
  5273. typename T11, typename T12, typename T13, typename T14, typename T15,
  5274. typename T16, typename T17, typename T18, typename T19, typename T20,
  5275. typename T21, typename T22, typename T23, typename T24, typename T25,
  5276. typename T26, typename T27, typename T28, typename T29, typename T30,
  5277. typename T31, typename T32, typename T33, typename T34, typename T35,
  5278. typename T36, typename T37, typename T38>
  5279. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5280. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5281. T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
  5282. internal::None, internal::None, internal::None, internal::None,
  5283. internal::None, internal::None, internal::None, internal::None,
  5284. internal::None, internal::None> {
  5285. typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5286. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5287. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
  5288. };
  5289. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5290. typename T6, typename T7, typename T8, typename T9, typename T10,
  5291. typename T11, typename T12, typename T13, typename T14, typename T15,
  5292. typename T16, typename T17, typename T18, typename T19, typename T20,
  5293. typename T21, typename T22, typename T23, typename T24, typename T25,
  5294. typename T26, typename T27, typename T28, typename T29, typename T30,
  5295. typename T31, typename T32, typename T33, typename T34, typename T35,
  5296. typename T36, typename T37, typename T38, typename T39>
  5297. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5298. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5299. T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
  5300. internal::None, internal::None, internal::None, internal::None,
  5301. internal::None, internal::None, internal::None, internal::None,
  5302. internal::None, internal::None> {
  5303. typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5304. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5305. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
  5306. };
  5307. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5308. typename T6, typename T7, typename T8, typename T9, typename T10,
  5309. typename T11, typename T12, typename T13, typename T14, typename T15,
  5310. typename T16, typename T17, typename T18, typename T19, typename T20,
  5311. typename T21, typename T22, typename T23, typename T24, typename T25,
  5312. typename T26, typename T27, typename T28, typename T29, typename T30,
  5313. typename T31, typename T32, typename T33, typename T34, typename T35,
  5314. typename T36, typename T37, typename T38, typename T39, typename T40>
  5315. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5316. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5317. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
  5318. internal::None, internal::None, internal::None, internal::None,
  5319. internal::None, internal::None, internal::None, internal::None,
  5320. internal::None> {
  5321. typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5322. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5323. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  5324. T40> type;
  5325. };
  5326. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5327. typename T6, typename T7, typename T8, typename T9, typename T10,
  5328. typename T11, typename T12, typename T13, typename T14, typename T15,
  5329. typename T16, typename T17, typename T18, typename T19, typename T20,
  5330. typename T21, typename T22, typename T23, typename T24, typename T25,
  5331. typename T26, typename T27, typename T28, typename T29, typename T30,
  5332. typename T31, typename T32, typename T33, typename T34, typename T35,
  5333. typename T36, typename T37, typename T38, typename T39, typename T40,
  5334. typename T41>
  5335. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5336. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5337. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
  5338. internal::None, internal::None, internal::None, internal::None,
  5339. internal::None, internal::None, internal::None, internal::None> {
  5340. typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5341. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5342. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  5343. T41> type;
  5344. };
  5345. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5346. typename T6, typename T7, typename T8, typename T9, typename T10,
  5347. typename T11, typename T12, typename T13, typename T14, typename T15,
  5348. typename T16, typename T17, typename T18, typename T19, typename T20,
  5349. typename T21, typename T22, typename T23, typename T24, typename T25,
  5350. typename T26, typename T27, typename T28, typename T29, typename T30,
  5351. typename T31, typename T32, typename T33, typename T34, typename T35,
  5352. typename T36, typename T37, typename T38, typename T39, typename T40,
  5353. typename T41, typename T42>
  5354. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5355. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5356. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
  5357. internal::None, internal::None, internal::None, internal::None,
  5358. internal::None, internal::None, internal::None> {
  5359. typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5360. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5361. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  5362. T41, T42> type;
  5363. };
  5364. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5365. typename T6, typename T7, typename T8, typename T9, typename T10,
  5366. typename T11, typename T12, typename T13, typename T14, typename T15,
  5367. typename T16, typename T17, typename T18, typename T19, typename T20,
  5368. typename T21, typename T22, typename T23, typename T24, typename T25,
  5369. typename T26, typename T27, typename T28, typename T29, typename T30,
  5370. typename T31, typename T32, typename T33, typename T34, typename T35,
  5371. typename T36, typename T37, typename T38, typename T39, typename T40,
  5372. typename T41, typename T42, typename T43>
  5373. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5374. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5375. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  5376. internal::None, internal::None, internal::None, internal::None,
  5377. internal::None, internal::None, internal::None> {
  5378. typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5379. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5380. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  5381. T41, T42, T43> type;
  5382. };
  5383. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5384. typename T6, typename T7, typename T8, typename T9, typename T10,
  5385. typename T11, typename T12, typename T13, typename T14, typename T15,
  5386. typename T16, typename T17, typename T18, typename T19, typename T20,
  5387. typename T21, typename T22, typename T23, typename T24, typename T25,
  5388. typename T26, typename T27, typename T28, typename T29, typename T30,
  5389. typename T31, typename T32, typename T33, typename T34, typename T35,
  5390. typename T36, typename T37, typename T38, typename T39, typename T40,
  5391. typename T41, typename T42, typename T43, typename T44>
  5392. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5393. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5394. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  5395. internal::None, internal::None, internal::None, internal::None,
  5396. internal::None, internal::None> {
  5397. typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5398. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5399. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  5400. T41, T42, T43, T44> type;
  5401. };
  5402. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5403. typename T6, typename T7, typename T8, typename T9, typename T10,
  5404. typename T11, typename T12, typename T13, typename T14, typename T15,
  5405. typename T16, typename T17, typename T18, typename T19, typename T20,
  5406. typename T21, typename T22, typename T23, typename T24, typename T25,
  5407. typename T26, typename T27, typename T28, typename T29, typename T30,
  5408. typename T31, typename T32, typename T33, typename T34, typename T35,
  5409. typename T36, typename T37, typename T38, typename T39, typename T40,
  5410. typename T41, typename T42, typename T43, typename T44, typename T45>
  5411. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5412. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5413. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  5414. internal::None, internal::None, internal::None, internal::None,
  5415. internal::None> {
  5416. typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5417. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5418. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  5419. T41, T42, T43, T44, T45> type;
  5420. };
  5421. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5422. typename T6, typename T7, typename T8, typename T9, typename T10,
  5423. typename T11, typename T12, typename T13, typename T14, typename T15,
  5424. typename T16, typename T17, typename T18, typename T19, typename T20,
  5425. typename T21, typename T22, typename T23, typename T24, typename T25,
  5426. typename T26, typename T27, typename T28, typename T29, typename T30,
  5427. typename T31, typename T32, typename T33, typename T34, typename T35,
  5428. typename T36, typename T37, typename T38, typename T39, typename T40,
  5429. typename T41, typename T42, typename T43, typename T44, typename T45,
  5430. typename T46>
  5431. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5432. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5433. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  5434. T46, internal::None, internal::None, internal::None, internal::None> {
  5435. typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5436. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5437. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  5438. T41, T42, T43, T44, T45, T46> type;
  5439. };
  5440. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5441. typename T6, typename T7, typename T8, typename T9, typename T10,
  5442. typename T11, typename T12, typename T13, typename T14, typename T15,
  5443. typename T16, typename T17, typename T18, typename T19, typename T20,
  5444. typename T21, typename T22, typename T23, typename T24, typename T25,
  5445. typename T26, typename T27, typename T28, typename T29, typename T30,
  5446. typename T31, typename T32, typename T33, typename T34, typename T35,
  5447. typename T36, typename T37, typename T38, typename T39, typename T40,
  5448. typename T41, typename T42, typename T43, typename T44, typename T45,
  5449. typename T46, typename T47>
  5450. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5451. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5452. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  5453. T46, T47, internal::None, internal::None, internal::None> {
  5454. typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5455. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5456. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  5457. T41, T42, T43, T44, T45, T46, T47> type;
  5458. };
  5459. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5460. typename T6, typename T7, typename T8, typename T9, typename T10,
  5461. typename T11, typename T12, typename T13, typename T14, typename T15,
  5462. typename T16, typename T17, typename T18, typename T19, typename T20,
  5463. typename T21, typename T22, typename T23, typename T24, typename T25,
  5464. typename T26, typename T27, typename T28, typename T29, typename T30,
  5465. typename T31, typename T32, typename T33, typename T34, typename T35,
  5466. typename T36, typename T37, typename T38, typename T39, typename T40,
  5467. typename T41, typename T42, typename T43, typename T44, typename T45,
  5468. typename T46, typename T47, typename T48>
  5469. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5470. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5471. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  5472. T46, T47, T48, internal::None, internal::None> {
  5473. typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5474. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5475. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  5476. T41, T42, T43, T44, T45, T46, T47, T48> type;
  5477. };
  5478. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5479. typename T6, typename T7, typename T8, typename T9, typename T10,
  5480. typename T11, typename T12, typename T13, typename T14, typename T15,
  5481. typename T16, typename T17, typename T18, typename T19, typename T20,
  5482. typename T21, typename T22, typename T23, typename T24, typename T25,
  5483. typename T26, typename T27, typename T28, typename T29, typename T30,
  5484. typename T31, typename T32, typename T33, typename T34, typename T35,
  5485. typename T36, typename T37, typename T38, typename T39, typename T40,
  5486. typename T41, typename T42, typename T43, typename T44, typename T45,
  5487. typename T46, typename T47, typename T48, typename T49>
  5488. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5489. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5490. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  5491. T46, T47, T48, T49, internal::None> {
  5492. typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5493. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5494. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  5495. T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
  5496. };
  5497. namespace internal {
  5498. # define GTEST_TEMPLATE_ template <typename T> class
  5499. // The template "selector" struct TemplateSel<Tmpl> is used to
  5500. // represent Tmpl, which must be a class template with one type
  5501. // parameter, as a type. TemplateSel<Tmpl>::Bind<T>::type is defined
  5502. // as the type Tmpl<T>. This allows us to actually instantiate the
  5503. // template "selected" by TemplateSel<Tmpl>.
  5504. //
  5505. // This trick is necessary for simulating typedef for class templates,
  5506. // which C++ doesn't support directly.
  5507. template <GTEST_TEMPLATE_ Tmpl>
  5508. struct TemplateSel {
  5509. template <typename T>
  5510. struct Bind {
  5511. typedef Tmpl<T> type;
  5512. };
  5513. };
  5514. # define GTEST_BIND_(TmplSel, T) \
  5515. TmplSel::template Bind<T>::type
  5516. // A unique struct template used as the default value for the
  5517. // arguments of class template Templates. This allows us to simulate
  5518. // variadic templates (e.g. Templates<int>, Templates<int, double>,
  5519. // and etc), which C++ doesn't support directly.
  5520. template <typename T>
  5521. struct NoneT {};
  5522. // The following family of struct and struct templates are used to
  5523. // represent template lists. In particular, TemplatesN<T1, T2, ...,
  5524. // TN> represents a list of N templates (T1, T2, ..., and TN). Except
  5525. // for Templates0, every struct in the family has two member types:
  5526. // Head for the selector of the first template in the list, and Tail
  5527. // for the rest of the list.
  5528. // The empty template list.
  5529. struct Templates0 {};
  5530. // Template lists of length 1, 2, 3, and so on.
  5531. template <GTEST_TEMPLATE_ T1>
  5532. struct Templates1 {
  5533. typedef TemplateSel<T1> Head;
  5534. typedef Templates0 Tail;
  5535. };
  5536. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
  5537. struct Templates2 {
  5538. typedef TemplateSel<T1> Head;
  5539. typedef Templates1<T2> Tail;
  5540. };
  5541. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
  5542. struct Templates3 {
  5543. typedef TemplateSel<T1> Head;
  5544. typedef Templates2<T2, T3> Tail;
  5545. };
  5546. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5547. GTEST_TEMPLATE_ T4>
  5548. struct Templates4 {
  5549. typedef TemplateSel<T1> Head;
  5550. typedef Templates3<T2, T3, T4> Tail;
  5551. };
  5552. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5553. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
  5554. struct Templates5 {
  5555. typedef TemplateSel<T1> Head;
  5556. typedef Templates4<T2, T3, T4, T5> Tail;
  5557. };
  5558. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5559. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
  5560. struct Templates6 {
  5561. typedef TemplateSel<T1> Head;
  5562. typedef Templates5<T2, T3, T4, T5, T6> Tail;
  5563. };
  5564. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5565. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5566. GTEST_TEMPLATE_ T7>
  5567. struct Templates7 {
  5568. typedef TemplateSel<T1> Head;
  5569. typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
  5570. };
  5571. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5572. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5573. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
  5574. struct Templates8 {
  5575. typedef TemplateSel<T1> Head;
  5576. typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
  5577. };
  5578. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5579. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5580. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
  5581. struct Templates9 {
  5582. typedef TemplateSel<T1> Head;
  5583. typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
  5584. };
  5585. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5586. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5587. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5588. GTEST_TEMPLATE_ T10>
  5589. struct Templates10 {
  5590. typedef TemplateSel<T1> Head;
  5591. typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
  5592. };
  5593. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5594. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5595. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5596. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
  5597. struct Templates11 {
  5598. typedef TemplateSel<T1> Head;
  5599. typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
  5600. };
  5601. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5602. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5603. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5604. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
  5605. struct Templates12 {
  5606. typedef TemplateSel<T1> Head;
  5607. typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
  5608. };
  5609. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5610. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5611. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5612. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5613. GTEST_TEMPLATE_ T13>
  5614. struct Templates13 {
  5615. typedef TemplateSel<T1> Head;
  5616. typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
  5617. };
  5618. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5619. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5620. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5621. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5622. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
  5623. struct Templates14 {
  5624. typedef TemplateSel<T1> Head;
  5625. typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5626. T14> Tail;
  5627. };
  5628. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5629. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5630. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5631. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5632. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
  5633. struct Templates15 {
  5634. typedef TemplateSel<T1> Head;
  5635. typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5636. T15> Tail;
  5637. };
  5638. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5639. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5640. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5641. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5642. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5643. GTEST_TEMPLATE_ T16>
  5644. struct Templates16 {
  5645. typedef TemplateSel<T1> Head;
  5646. typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5647. T15, T16> Tail;
  5648. };
  5649. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5650. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5651. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5652. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5653. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5654. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
  5655. struct Templates17 {
  5656. typedef TemplateSel<T1> Head;
  5657. typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5658. T15, T16, T17> Tail;
  5659. };
  5660. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5661. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5662. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5663. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5664. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5665. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
  5666. struct Templates18 {
  5667. typedef TemplateSel<T1> Head;
  5668. typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5669. T15, T16, T17, T18> Tail;
  5670. };
  5671. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5672. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5673. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5674. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5675. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5676. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5677. GTEST_TEMPLATE_ T19>
  5678. struct Templates19 {
  5679. typedef TemplateSel<T1> Head;
  5680. typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5681. T15, T16, T17, T18, T19> Tail;
  5682. };
  5683. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5684. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5685. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5686. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5687. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5688. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5689. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
  5690. struct Templates20 {
  5691. typedef TemplateSel<T1> Head;
  5692. typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5693. T15, T16, T17, T18, T19, T20> Tail;
  5694. };
  5695. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5696. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5697. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5698. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5699. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5700. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5701. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
  5702. struct Templates21 {
  5703. typedef TemplateSel<T1> Head;
  5704. typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5705. T15, T16, T17, T18, T19, T20, T21> Tail;
  5706. };
  5707. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5708. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5709. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5710. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5711. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5712. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5713. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5714. GTEST_TEMPLATE_ T22>
  5715. struct Templates22 {
  5716. typedef TemplateSel<T1> Head;
  5717. typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5718. T15, T16, T17, T18, T19, T20, T21, T22> Tail;
  5719. };
  5720. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5721. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5722. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5723. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5724. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5725. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5726. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5727. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
  5728. struct Templates23 {
  5729. typedef TemplateSel<T1> Head;
  5730. typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5731. T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
  5732. };
  5733. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5734. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5735. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5736. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5737. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5738. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5739. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5740. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
  5741. struct Templates24 {
  5742. typedef TemplateSel<T1> Head;
  5743. typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5744. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
  5745. };
  5746. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5747. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5748. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5749. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5750. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5751. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5752. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5753. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5754. GTEST_TEMPLATE_ T25>
  5755. struct Templates25 {
  5756. typedef TemplateSel<T1> Head;
  5757. typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5758. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
  5759. };
  5760. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5761. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5762. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5763. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5764. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5765. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5766. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5767. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5768. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
  5769. struct Templates26 {
  5770. typedef TemplateSel<T1> Head;
  5771. typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5772. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
  5773. };
  5774. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5775. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5776. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5777. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5778. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5779. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5780. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5781. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5782. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
  5783. struct Templates27 {
  5784. typedef TemplateSel<T1> Head;
  5785. typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5786. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
  5787. };
  5788. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5789. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5790. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5791. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5792. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5793. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5794. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5795. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5796. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5797. GTEST_TEMPLATE_ T28>
  5798. struct Templates28 {
  5799. typedef TemplateSel<T1> Head;
  5800. typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5801. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5802. T28> Tail;
  5803. };
  5804. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5805. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5806. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5807. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5808. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5809. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5810. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5811. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5812. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5813. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
  5814. struct Templates29 {
  5815. typedef TemplateSel<T1> Head;
  5816. typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5817. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5818. T29> Tail;
  5819. };
  5820. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5821. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5822. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5823. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5824. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5825. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5826. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5827. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5828. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5829. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
  5830. struct Templates30 {
  5831. typedef TemplateSel<T1> Head;
  5832. typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5833. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5834. T29, T30> Tail;
  5835. };
  5836. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5837. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5838. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5839. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5840. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5841. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5842. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5843. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5844. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5845. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5846. GTEST_TEMPLATE_ T31>
  5847. struct Templates31 {
  5848. typedef TemplateSel<T1> Head;
  5849. typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5850. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5851. T29, T30, T31> Tail;
  5852. };
  5853. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5854. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5855. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5856. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5857. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5858. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5859. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5860. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5861. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5862. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5863. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
  5864. struct Templates32 {
  5865. typedef TemplateSel<T1> Head;
  5866. typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5867. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5868. T29, T30, T31, T32> Tail;
  5869. };
  5870. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5871. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5872. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5873. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5874. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5875. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5876. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5877. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5878. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5879. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5880. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
  5881. struct Templates33 {
  5882. typedef TemplateSel<T1> Head;
  5883. typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5884. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5885. T29, T30, T31, T32, T33> Tail;
  5886. };
  5887. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5888. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5889. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5890. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5891. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5892. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5893. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5894. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5895. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5896. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5897. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5898. GTEST_TEMPLATE_ T34>
  5899. struct Templates34 {
  5900. typedef TemplateSel<T1> Head;
  5901. typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5902. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5903. T29, T30, T31, T32, T33, T34> Tail;
  5904. };
  5905. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5906. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5907. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5908. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5909. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5910. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5911. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5912. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5913. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5914. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5915. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5916. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
  5917. struct Templates35 {
  5918. typedef TemplateSel<T1> Head;
  5919. typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5920. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5921. T29, T30, T31, T32, T33, T34, T35> Tail;
  5922. };
  5923. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5924. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5925. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5926. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5927. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5928. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5929. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5930. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5931. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5932. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5933. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5934. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
  5935. struct Templates36 {
  5936. typedef TemplateSel<T1> Head;
  5937. typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5938. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5939. T29, T30, T31, T32, T33, T34, T35, T36> Tail;
  5940. };
  5941. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5942. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5943. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5944. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5945. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5946. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5947. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5948. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5949. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5950. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5951. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5952. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5953. GTEST_TEMPLATE_ T37>
  5954. struct Templates37 {
  5955. typedef TemplateSel<T1> Head;
  5956. typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5957. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5958. T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
  5959. };
  5960. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5961. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5962. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5963. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5964. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5965. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5966. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5967. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5968. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5969. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5970. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5971. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5972. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
  5973. struct Templates38 {
  5974. typedef TemplateSel<T1> Head;
  5975. typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5976. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5977. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
  5978. };
  5979. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5980. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5981. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5982. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5983. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5984. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5985. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5986. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5987. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5988. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5989. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5990. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5991. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
  5992. struct Templates39 {
  5993. typedef TemplateSel<T1> Head;
  5994. typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5995. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5996. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
  5997. };
  5998. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5999. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6000. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6001. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6002. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6003. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6004. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6005. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6006. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6007. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6008. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6009. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6010. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6011. GTEST_TEMPLATE_ T40>
  6012. struct Templates40 {
  6013. typedef TemplateSel<T1> Head;
  6014. typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6015. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6016. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
  6017. };
  6018. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6019. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6020. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6021. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6022. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6023. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6024. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6025. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6026. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6027. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6028. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6029. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6030. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6031. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
  6032. struct Templates41 {
  6033. typedef TemplateSel<T1> Head;
  6034. typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6035. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6036. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
  6037. };
  6038. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6039. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6040. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6041. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6042. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6043. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6044. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6045. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6046. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6047. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6048. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6049. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6050. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6051. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
  6052. struct Templates42 {
  6053. typedef TemplateSel<T1> Head;
  6054. typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6055. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6056. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6057. T42> Tail;
  6058. };
  6059. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6060. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6061. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6062. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6063. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6064. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6065. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6066. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6067. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6068. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6069. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6070. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6071. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6072. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6073. GTEST_TEMPLATE_ T43>
  6074. struct Templates43 {
  6075. typedef TemplateSel<T1> Head;
  6076. typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6077. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6078. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  6079. T43> Tail;
  6080. };
  6081. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6082. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6083. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6084. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6085. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6086. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6087. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6088. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6089. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6090. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6091. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6092. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6093. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6094. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6095. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
  6096. struct Templates44 {
  6097. typedef TemplateSel<T1> Head;
  6098. typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6099. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6100. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  6101. T43, T44> Tail;
  6102. };
  6103. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6104. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6105. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6106. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6107. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6108. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6109. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6110. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6111. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6112. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6113. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6114. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6115. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6116. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6117. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
  6118. struct Templates45 {
  6119. typedef TemplateSel<T1> Head;
  6120. typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6121. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6122. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  6123. T43, T44, T45> Tail;
  6124. };
  6125. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6126. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6127. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6128. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6129. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6130. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6131. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6132. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6133. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6134. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6135. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6136. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6137. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6138. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6139. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6140. GTEST_TEMPLATE_ T46>
  6141. struct Templates46 {
  6142. typedef TemplateSel<T1> Head;
  6143. typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6144. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6145. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  6146. T43, T44, T45, T46> Tail;
  6147. };
  6148. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6149. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6150. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6151. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6152. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6153. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6154. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6155. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6156. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6157. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6158. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6159. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6160. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6161. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6162. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6163. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
  6164. struct Templates47 {
  6165. typedef TemplateSel<T1> Head;
  6166. typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6167. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6168. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  6169. T43, T44, T45, T46, T47> Tail;
  6170. };
  6171. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6172. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6173. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6174. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6175. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6176. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6177. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6178. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6179. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6180. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6181. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6182. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6183. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6184. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6185. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6186. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
  6187. struct Templates48 {
  6188. typedef TemplateSel<T1> Head;
  6189. typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6190. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6191. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  6192. T43, T44, T45, T46, T47, T48> Tail;
  6193. };
  6194. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6195. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6196. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6197. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6198. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6199. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6200. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6201. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6202. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6203. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6204. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6205. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6206. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6207. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6208. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6209. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
  6210. GTEST_TEMPLATE_ T49>
  6211. struct Templates49 {
  6212. typedef TemplateSel<T1> Head;
  6213. typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6214. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6215. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  6216. T43, T44, T45, T46, T47, T48, T49> Tail;
  6217. };
  6218. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6219. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6220. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6221. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6222. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6223. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6224. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6225. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6226. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6227. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6228. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6229. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6230. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6231. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6232. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6233. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
  6234. GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
  6235. struct Templates50 {
  6236. typedef TemplateSel<T1> Head;
  6237. typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6238. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6239. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  6240. T43, T44, T45, T46, T47, T48, T49, T50> Tail;
  6241. };
  6242. // We don't want to require the users to write TemplatesN<...> directly,
  6243. // as that would require them to count the length. Templates<...> is much
  6244. // easier to write, but generates horrible messages when there is a
  6245. // compiler error, as gcc insists on printing out each template
  6246. // argument, even if it has the default value (this means Templates<list>
  6247. // will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
  6248. // errors).
  6249. //
  6250. // Our solution is to combine the best part of the two approaches: a
  6251. // user would write Templates<T1, ..., TN>, and Google Test will translate
  6252. // that to TemplatesN<T1, ..., TN> internally to make error messages
  6253. // readable. The translation is done by the 'type' member of the
  6254. // Templates template.
  6255. template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
  6256. GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
  6257. GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
  6258. GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
  6259. GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
  6260. GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
  6261. GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
  6262. GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
  6263. GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
  6264. GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
  6265. GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
  6266. GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
  6267. GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
  6268. GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
  6269. GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
  6270. GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
  6271. GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
  6272. GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
  6273. GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
  6274. GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
  6275. GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
  6276. GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
  6277. GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
  6278. GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
  6279. GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
  6280. struct Templates {
  6281. typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6282. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6283. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6284. T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
  6285. };
  6286. template <>
  6287. struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6288. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6289. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6290. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6291. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6292. NoneT> {
  6293. typedef Templates0 type;
  6294. };
  6295. template <GTEST_TEMPLATE_ T1>
  6296. struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6297. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6298. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6299. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6300. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6301. NoneT> {
  6302. typedef Templates1<T1> type;
  6303. };
  6304. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
  6305. struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6306. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6307. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6308. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6309. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6310. NoneT> {
  6311. typedef Templates2<T1, T2> type;
  6312. };
  6313. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
  6314. struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6315. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6316. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6317. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6318. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6319. typedef Templates3<T1, T2, T3> type;
  6320. };
  6321. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6322. GTEST_TEMPLATE_ T4>
  6323. struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6324. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6325. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6326. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6327. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6328. typedef Templates4<T1, T2, T3, T4> type;
  6329. };
  6330. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6331. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
  6332. struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6333. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6334. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6335. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6336. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6337. typedef Templates5<T1, T2, T3, T4, T5> type;
  6338. };
  6339. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6340. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
  6341. struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
  6342. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6343. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6344. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6345. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6346. typedef Templates6<T1, T2, T3, T4, T5, T6> type;
  6347. };
  6348. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6349. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6350. GTEST_TEMPLATE_ T7>
  6351. struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
  6352. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6353. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6354. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6355. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6356. typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
  6357. };
  6358. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6359. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6360. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
  6361. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
  6362. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6363. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6364. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6365. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6366. typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
  6367. };
  6368. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6369. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6370. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
  6371. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
  6372. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6373. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6374. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6375. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6376. typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
  6377. };
  6378. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6379. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6380. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6381. GTEST_TEMPLATE_ T10>
  6382. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
  6383. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6384. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6385. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6386. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6387. typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
  6388. };
  6389. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6390. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6391. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6392. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
  6393. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
  6394. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6395. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6396. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6397. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6398. typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
  6399. };
  6400. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6401. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6402. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6403. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
  6404. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
  6405. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6406. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6407. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6408. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6409. typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
  6410. };
  6411. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6412. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6413. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6414. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6415. GTEST_TEMPLATE_ T13>
  6416. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
  6417. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6418. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6419. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6420. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6421. typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  6422. T13> type;
  6423. };
  6424. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6425. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6426. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6427. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6428. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
  6429. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6430. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6431. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6432. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6433. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6434. typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6435. T14> type;
  6436. };
  6437. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6438. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6439. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6440. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6441. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
  6442. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6443. T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6444. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6445. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6446. NoneT, NoneT, NoneT, NoneT, NoneT> {
  6447. typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6448. T14, T15> type;
  6449. };
  6450. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6451. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6452. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6453. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6454. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6455. GTEST_TEMPLATE_ T16>
  6456. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6457. T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6458. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6459. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6460. NoneT, NoneT, NoneT, NoneT, NoneT> {
  6461. typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6462. T14, T15, T16> type;
  6463. };
  6464. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6465. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6466. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6467. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6468. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6469. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
  6470. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6471. T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6472. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6473. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6474. NoneT, NoneT, NoneT, NoneT, NoneT> {
  6475. typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6476. T14, T15, T16, T17> type;
  6477. };
  6478. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6479. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6480. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6481. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6482. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6483. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
  6484. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6485. T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6486. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6487. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6488. NoneT, NoneT, NoneT, NoneT> {
  6489. typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6490. T14, T15, T16, T17, T18> type;
  6491. };
  6492. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6493. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6494. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6495. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6496. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6497. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6498. GTEST_TEMPLATE_ T19>
  6499. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6500. T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6501. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6502. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6503. NoneT, NoneT, NoneT, NoneT> {
  6504. typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6505. T14, T15, T16, T17, T18, T19> type;
  6506. };
  6507. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6508. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6509. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6510. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6511. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6512. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6513. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
  6514. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6515. T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6516. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6517. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6518. NoneT, NoneT, NoneT, NoneT> {
  6519. typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6520. T14, T15, T16, T17, T18, T19, T20> type;
  6521. };
  6522. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6523. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6524. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6525. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6526. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6527. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6528. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
  6529. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6530. T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
  6531. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6532. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6533. NoneT, NoneT, NoneT, NoneT> {
  6534. typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6535. T14, T15, T16, T17, T18, T19, T20, T21> type;
  6536. };
  6537. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6538. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6539. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6540. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6541. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6542. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6543. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6544. GTEST_TEMPLATE_ T22>
  6545. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6546. T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
  6547. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6548. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6549. NoneT, NoneT, NoneT> {
  6550. typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6551. T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
  6552. };
  6553. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6554. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6555. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6556. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6557. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6558. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6559. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6560. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
  6561. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6562. T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
  6563. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6564. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6565. NoneT, NoneT, NoneT> {
  6566. typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6567. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
  6568. };
  6569. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6570. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6571. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6572. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6573. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6574. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6575. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6576. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
  6577. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6578. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
  6579. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6580. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6581. NoneT, NoneT, NoneT> {
  6582. typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6583. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
  6584. };
  6585. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6586. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6587. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6588. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6589. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6590. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6591. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6592. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6593. GTEST_TEMPLATE_ T25>
  6594. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6595. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
  6596. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6597. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6598. NoneT, NoneT> {
  6599. typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6600. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
  6601. };
  6602. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6603. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6604. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6605. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6606. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6607. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6608. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6609. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6610. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
  6611. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6612. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
  6613. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6614. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6615. NoneT, NoneT> {
  6616. typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6617. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
  6618. };
  6619. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6620. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6621. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6622. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6623. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6624. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6625. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6626. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6627. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
  6628. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6629. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
  6630. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6631. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6632. NoneT, NoneT> {
  6633. typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6634. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  6635. T27> type;
  6636. };
  6637. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6638. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6639. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6640. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6641. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6642. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6643. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6644. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6645. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6646. GTEST_TEMPLATE_ T28>
  6647. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6648. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6649. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6650. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6651. NoneT, NoneT> {
  6652. typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6653. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6654. T28> type;
  6655. };
  6656. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6657. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6658. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6659. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6660. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6661. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6662. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6663. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6664. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6665. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
  6666. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6667. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6668. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6669. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6670. NoneT> {
  6671. typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6672. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6673. T28, T29> type;
  6674. };
  6675. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6676. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6677. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6678. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6679. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6680. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6681. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6682. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6683. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6684. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
  6685. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6686. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6687. T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6688. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6689. typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6690. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6691. T28, T29, T30> type;
  6692. };
  6693. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6694. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6695. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6696. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6697. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6698. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6699. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6700. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6701. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6702. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6703. GTEST_TEMPLATE_ T31>
  6704. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6705. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6706. T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6707. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6708. typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6709. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6710. T28, T29, T30, T31> type;
  6711. };
  6712. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6713. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6714. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6715. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6716. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6717. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6718. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6719. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6720. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6721. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6722. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
  6723. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6724. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6725. T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6726. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6727. typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6728. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6729. T28, T29, T30, T31, T32> type;
  6730. };
  6731. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6732. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6733. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6734. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6735. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6736. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6737. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6738. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6739. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6740. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6741. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
  6742. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6743. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6744. T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6745. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6746. typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6747. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6748. T28, T29, T30, T31, T32, T33> type;
  6749. };
  6750. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6751. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6752. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6753. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6754. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6755. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6756. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6757. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6758. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6759. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6760. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6761. GTEST_TEMPLATE_ T34>
  6762. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6763. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6764. T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6765. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6766. typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6767. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6768. T28, T29, T30, T31, T32, T33, T34> type;
  6769. };
  6770. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6771. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6772. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6773. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6774. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6775. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6776. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6777. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6778. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6779. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6780. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6781. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
  6782. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6783. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6784. T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6785. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6786. typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6787. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6788. T28, T29, T30, T31, T32, T33, T34, T35> type;
  6789. };
  6790. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6791. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6792. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6793. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6794. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6795. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6796. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6797. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6798. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6799. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6800. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6801. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
  6802. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6803. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6804. T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
  6805. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6806. typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6807. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6808. T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
  6809. };
  6810. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6811. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6812. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6813. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6814. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6815. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6816. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6817. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6818. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6819. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6820. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6821. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6822. GTEST_TEMPLATE_ T37>
  6823. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6824. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6825. T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
  6826. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6827. typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6828. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6829. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
  6830. };
  6831. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6832. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6833. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6834. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6835. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6836. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6837. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6838. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6839. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6840. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6841. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6842. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6843. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
  6844. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6845. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6846. T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
  6847. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6848. typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6849. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6850. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
  6851. };
  6852. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6853. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6854. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6855. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6856. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6857. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6858. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6859. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6860. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6861. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6862. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6863. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6864. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
  6865. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6866. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6867. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
  6868. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6869. typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6870. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6871. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
  6872. };
  6873. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6874. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6875. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6876. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6877. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6878. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6879. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6880. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6881. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6882. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6883. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6884. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6885. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6886. GTEST_TEMPLATE_ T40>
  6887. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6888. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6889. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
  6890. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6891. typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6892. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6893. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
  6894. };
  6895. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6896. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6897. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6898. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6899. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6900. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6901. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6902. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6903. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6904. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6905. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6906. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6907. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6908. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
  6909. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6910. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6911. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
  6912. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6913. typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6914. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6915. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  6916. T41> type;
  6917. };
  6918. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6919. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6920. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6921. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6922. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6923. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6924. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6925. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6926. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6927. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6928. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6929. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6930. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6931. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
  6932. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6933. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6934. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
  6935. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6936. typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6937. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6938. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6939. T42> type;
  6940. };
  6941. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6942. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6943. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6944. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6945. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6946. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6947. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6948. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6949. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6950. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6951. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6952. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6953. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6954. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6955. GTEST_TEMPLATE_ T43>
  6956. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6957. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6958. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  6959. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6960. typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6961. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6962. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6963. T42, T43> type;
  6964. };
  6965. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6966. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6967. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6968. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6969. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6970. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6971. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6972. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6973. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6974. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6975. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6976. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6977. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6978. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6979. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
  6980. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6981. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6982. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  6983. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6984. typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6985. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6986. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6987. T42, T43, T44> type;
  6988. };
  6989. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6990. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6991. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6992. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6993. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6994. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6995. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6996. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6997. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6998. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6999. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  7000. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  7001. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  7002. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  7003. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
  7004. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  7005. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  7006. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  7007. T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
  7008. typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  7009. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  7010. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  7011. T42, T43, T44, T45> type;
  7012. };
  7013. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  7014. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  7015. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  7016. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  7017. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  7018. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  7019. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  7020. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  7021. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  7022. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  7023. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  7024. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  7025. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  7026. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  7027. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  7028. GTEST_TEMPLATE_ T46>
  7029. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  7030. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  7031. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  7032. T45, T46, NoneT, NoneT, NoneT, NoneT> {
  7033. typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  7034. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  7035. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  7036. T42, T43, T44, T45, T46> type;
  7037. };
  7038. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  7039. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  7040. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  7041. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  7042. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  7043. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  7044. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  7045. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  7046. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  7047. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  7048. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  7049. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  7050. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  7051. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  7052. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  7053. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
  7054. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  7055. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  7056. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  7057. T45, T46, T47, NoneT, NoneT, NoneT> {
  7058. typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  7059. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  7060. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  7061. T42, T43, T44, T45, T46, T47> type;
  7062. };
  7063. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  7064. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  7065. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  7066. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  7067. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  7068. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  7069. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  7070. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  7071. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  7072. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  7073. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  7074. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  7075. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  7076. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  7077. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  7078. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
  7079. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  7080. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  7081. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  7082. T45, T46, T47, T48, NoneT, NoneT> {
  7083. typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  7084. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  7085. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  7086. T42, T43, T44, T45, T46, T47, T48> type;
  7087. };
  7088. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  7089. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  7090. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  7091. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  7092. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  7093. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  7094. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  7095. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  7096. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  7097. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  7098. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  7099. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  7100. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  7101. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  7102. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  7103. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
  7104. GTEST_TEMPLATE_ T49>
  7105. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  7106. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  7107. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  7108. T45, T46, T47, T48, T49, NoneT> {
  7109. typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  7110. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  7111. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  7112. T42, T43, T44, T45, T46, T47, T48, T49> type;
  7113. };
  7114. // The TypeList template makes it possible to use either a single type
  7115. // or a Types<...> list in TYPED_TEST_CASE() and
  7116. // INSTANTIATE_TYPED_TEST_CASE_P().
  7117. template <typename T>
  7118. struct TypeList {
  7119. typedef Types1<T> type;
  7120. };
  7121. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  7122. typename T6, typename T7, typename T8, typename T9, typename T10,
  7123. typename T11, typename T12, typename T13, typename T14, typename T15,
  7124. typename T16, typename T17, typename T18, typename T19, typename T20,
  7125. typename T21, typename T22, typename T23, typename T24, typename T25,
  7126. typename T26, typename T27, typename T28, typename T29, typename T30,
  7127. typename T31, typename T32, typename T33, typename T34, typename T35,
  7128. typename T36, typename T37, typename T38, typename T39, typename T40,
  7129. typename T41, typename T42, typename T43, typename T44, typename T45,
  7130. typename T46, typename T47, typename T48, typename T49, typename T50>
  7131. struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  7132. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  7133. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  7134. T44, T45, T46, T47, T48, T49, T50> > {
  7135. typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  7136. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  7137. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  7138. T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
  7139. };
  7140. #endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  7141. } // namespace internal
  7142. } // namespace testing
  7143. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
  7144. // Due to C++ preprocessor weirdness, we need double indirection to
  7145. // concatenate two tokens when one of them is __LINE__. Writing
  7146. //
  7147. // foo ## __LINE__
  7148. //
  7149. // will result in the token foo__LINE__, instead of foo followed by
  7150. // the current line number. For more details, see
  7151. // http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
  7152. #define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
  7153. #define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
  7154. // Stringifies its argument.
  7155. #define GTEST_STRINGIFY_(name) #name
  7156. class ProtocolMessage;
  7157. namespace proto2 { class Message; }
  7158. namespace testing {
  7159. // Forward declarations.
  7160. class AssertionResult; // Result of an assertion.
  7161. class Message; // Represents a failure message.
  7162. class Test; // Represents a test.
  7163. class TestInfo; // Information about a test.
  7164. class TestPartResult; // Result of a test part.
  7165. class UnitTest; // A collection of test cases.
  7166. template <typename T>
  7167. ::std::string PrintToString(const T& value);
  7168. namespace internal {
  7169. struct TraceInfo; // Information about a trace point.
  7170. class TestInfoImpl; // Opaque implementation of TestInfo
  7171. class UnitTestImpl; // Opaque implementation of UnitTest
  7172. // The text used in failure messages to indicate the start of the
  7173. // stack trace.
  7174. GTEST_API_ extern const char kStackTraceMarker[];
  7175. // Two overloaded helpers for checking at compile time whether an
  7176. // expression is a null pointer literal (i.e. NULL or any 0-valued
  7177. // compile-time integral constant). Their return values have
  7178. // different sizes, so we can use sizeof() to test which version is
  7179. // picked by the compiler. These helpers have no implementations, as
  7180. // we only need their signatures.
  7181. //
  7182. // Given IsNullLiteralHelper(x), the compiler will pick the first
  7183. // version if x can be implicitly converted to Secret*, and pick the
  7184. // second version otherwise. Since Secret is a secret and incomplete
  7185. // type, the only expression a user can write that has type Secret* is
  7186. // a null pointer literal. Therefore, we know that x is a null
  7187. // pointer literal if and only if the first version is picked by the
  7188. // compiler.
  7189. char IsNullLiteralHelper(Secret* p);
  7190. char (&IsNullLiteralHelper(...))[2]; // NOLINT
  7191. // A compile-time bool constant that is true if and only if x is a
  7192. // null pointer literal (i.e. NULL or any 0-valued compile-time
  7193. // integral constant).
  7194. #ifdef GTEST_ELLIPSIS_NEEDS_POD_
  7195. // We lose support for NULL detection where the compiler doesn't like
  7196. // passing non-POD classes through ellipsis (...).
  7197. # define GTEST_IS_NULL_LITERAL_(x) false
  7198. #else
  7199. # define GTEST_IS_NULL_LITERAL_(x) \
  7200. (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
  7201. #endif // GTEST_ELLIPSIS_NEEDS_POD_
  7202. // Appends the user-supplied message to the Google-Test-generated message.
  7203. GTEST_API_ std::string AppendUserMessage(
  7204. const std::string& gtest_msg, const Message& user_msg);
  7205. #if GTEST_HAS_EXCEPTIONS
  7206. GTEST_DISABLE_MSC_WARNINGS_PUSH_(4275 \
  7207. /* an exported class was derived from a class that was not exported */)
  7208. // This exception is thrown by (and only by) a failed Google Test
  7209. // assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions
  7210. // are enabled). We derive it from std::runtime_error, which is for
  7211. // errors presumably detectable only at run time. Since
  7212. // std::runtime_error inherits from std::exception, many testing
  7213. // frameworks know how to extract and print the message inside it.
  7214. class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {
  7215. public:
  7216. explicit GoogleTestFailureException(const TestPartResult& failure);
  7217. };
  7218. GTEST_DISABLE_MSC_WARNINGS_POP_() // 4275
  7219. #endif // GTEST_HAS_EXCEPTIONS
  7220. namespace edit_distance {
  7221. // Returns the optimal edits to go from 'left' to 'right'.
  7222. // All edits cost the same, with replace having lower priority than
  7223. // add/remove.
  7224. // Simple implementation of the Wagner-Fischer algorithm.
  7225. // See http://en.wikipedia.org/wiki/Wagner-Fischer_algorithm
  7226. enum EditType { kMatch, kAdd, kRemove, kReplace };
  7227. GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
  7228. const std::vector<size_t>& left, const std::vector<size_t>& right);
  7229. // Same as above, but the input is represented as strings.
  7230. GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
  7231. const std::vector<std::string>& left,
  7232. const std::vector<std::string>& right);
  7233. // Create a diff of the input strings in Unified diff format.
  7234. GTEST_API_ std::string CreateUnifiedDiff(const std::vector<std::string>& left,
  7235. const std::vector<std::string>& right,
  7236. size_t context = 2);
  7237. } // namespace edit_distance
  7238. // Calculate the diff between 'left' and 'right' and return it in unified diff
  7239. // format.
  7240. // If not null, stores in 'total_line_count' the total number of lines found
  7241. // in left + right.
  7242. GTEST_API_ std::string DiffStrings(const std::string& left,
  7243. const std::string& right,
  7244. size_t* total_line_count);
  7245. // Constructs and returns the message for an equality assertion
  7246. // (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
  7247. //
  7248. // The first four parameters are the expressions used in the assertion
  7249. // and their values, as strings. For example, for ASSERT_EQ(foo, bar)
  7250. // where foo is 5 and bar is 6, we have:
  7251. //
  7252. // expected_expression: "foo"
  7253. // actual_expression: "bar"
  7254. // expected_value: "5"
  7255. // actual_value: "6"
  7256. //
  7257. // The ignoring_case parameter is true iff the assertion is a
  7258. // *_STRCASEEQ*. When it's true, the string " (ignoring case)" will
  7259. // be inserted into the message.
  7260. GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
  7261. const char* actual_expression,
  7262. const std::string& expected_value,
  7263. const std::string& actual_value,
  7264. bool ignoring_case);
  7265. // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
  7266. GTEST_API_ std::string GetBoolAssertionFailureMessage(
  7267. const AssertionResult& assertion_result,
  7268. const char* expression_text,
  7269. const char* actual_predicate_value,
  7270. const char* expected_predicate_value);
  7271. // This template class represents an IEEE floating-point number
  7272. // (either single-precision or double-precision, depending on the
  7273. // template parameters).
  7274. //
  7275. // The purpose of this class is to do more sophisticated number
  7276. // comparison. (Due to round-off error, etc, it's very unlikely that
  7277. // two floating-points will be equal exactly. Hence a naive
  7278. // comparison by the == operation often doesn't work.)
  7279. //
  7280. // Format of IEEE floating-point:
  7281. //
  7282. // The most-significant bit being the leftmost, an IEEE
  7283. // floating-point looks like
  7284. //
  7285. // sign_bit exponent_bits fraction_bits
  7286. //
  7287. // Here, sign_bit is a single bit that designates the sign of the
  7288. // number.
  7289. //
  7290. // For float, there are 8 exponent bits and 23 fraction bits.
  7291. //
  7292. // For double, there are 11 exponent bits and 52 fraction bits.
  7293. //
  7294. // More details can be found at
  7295. // http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
  7296. //
  7297. // Template parameter:
  7298. //
  7299. // RawType: the raw floating-point type (either float or double)
  7300. template <typename RawType>
  7301. class FloatingPoint {
  7302. public:
  7303. // Defines the unsigned integer type that has the same size as the
  7304. // floating point number.
  7305. typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
  7306. // Constants.
  7307. // # of bits in a number.
  7308. static const size_t kBitCount = 8*sizeof(RawType);
  7309. // # of fraction bits in a number.
  7310. static const size_t kFractionBitCount =
  7311. std::numeric_limits<RawType>::digits - 1;
  7312. // # of exponent bits in a number.
  7313. static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
  7314. // The mask for the sign bit.
  7315. static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
  7316. // The mask for the fraction bits.
  7317. static const Bits kFractionBitMask =
  7318. ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
  7319. // The mask for the exponent bits.
  7320. static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
  7321. // How many ULP's (Units in the Last Place) we want to tolerate when
  7322. // comparing two numbers. The larger the value, the more error we
  7323. // allow. A 0 value means that two numbers must be exactly the same
  7324. // to be considered equal.
  7325. //
  7326. // The maximum error of a single floating-point operation is 0.5
  7327. // units in the last place. On Intel CPU's, all floating-point
  7328. // calculations are done with 80-bit precision, while double has 64
  7329. // bits. Therefore, 4 should be enough for ordinary use.
  7330. //
  7331. // See the following article for more details on ULP:
  7332. // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
  7333. static const size_t kMaxUlps = 4;
  7334. // Constructs a FloatingPoint from a raw floating-point number.
  7335. //
  7336. // On an Intel CPU, passing a non-normalized NAN (Not a Number)
  7337. // around may change its bits, although the new value is guaranteed
  7338. // to be also a NAN. Therefore, don't expect this constructor to
  7339. // preserve the bits in x when x is a NAN.
  7340. explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
  7341. // Static methods
  7342. // Reinterprets a bit pattern as a floating-point number.
  7343. //
  7344. // This function is needed to test the AlmostEquals() method.
  7345. static RawType ReinterpretBits(const Bits bits) {
  7346. FloatingPoint fp(0);
  7347. fp.u_.bits_ = bits;
  7348. return fp.u_.value_;
  7349. }
  7350. // Returns the floating-point number that represent positive infinity.
  7351. static RawType Infinity() {
  7352. return ReinterpretBits(kExponentBitMask);
  7353. }
  7354. // Returns the maximum representable finite floating-point number.
  7355. static RawType Max();
  7356. // Non-static methods
  7357. // Returns the bits that represents this number.
  7358. const Bits &bits() const { return u_.bits_; }
  7359. // Returns the exponent bits of this number.
  7360. Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
  7361. // Returns the fraction bits of this number.
  7362. Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
  7363. // Returns the sign bit of this number.
  7364. Bits sign_bit() const { return kSignBitMask & u_.bits_; }
  7365. // Returns true iff this is NAN (not a number).
  7366. bool is_nan() const {
  7367. // It's a NAN if the exponent bits are all ones and the fraction
  7368. // bits are not entirely zeros.
  7369. return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
  7370. }
  7371. // Returns true iff this number is at most kMaxUlps ULP's away from
  7372. // rhs. In particular, this function:
  7373. //
  7374. // - returns false if either number is (or both are) NAN.
  7375. // - treats really large numbers as almost equal to infinity.
  7376. // - thinks +0.0 and -0.0 are 0 DLP's apart.
  7377. bool AlmostEquals(const FloatingPoint& rhs) const {
  7378. // The IEEE standard says that any comparison operation involving
  7379. // a NAN must return false.
  7380. if (is_nan() || rhs.is_nan()) return false;
  7381. return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
  7382. <= kMaxUlps;
  7383. }
  7384. private:
  7385. // The data type used to store the actual floating-point number.
  7386. union FloatingPointUnion {
  7387. RawType value_; // The raw floating-point number.
  7388. Bits bits_; // The bits that represent the number.
  7389. };
  7390. // Converts an integer from the sign-and-magnitude representation to
  7391. // the biased representation. More precisely, let N be 2 to the
  7392. // power of (kBitCount - 1), an integer x is represented by the
  7393. // unsigned number x + N.
  7394. //
  7395. // For instance,
  7396. //
  7397. // -N + 1 (the most negative number representable using
  7398. // sign-and-magnitude) is represented by 1;
  7399. // 0 is represented by N; and
  7400. // N - 1 (the biggest number representable using
  7401. // sign-and-magnitude) is represented by 2N - 1.
  7402. //
  7403. // Read http://en.wikipedia.org/wiki/Signed_number_representations
  7404. // for more details on signed number representations.
  7405. static Bits SignAndMagnitudeToBiased(const Bits &sam) {
  7406. if (kSignBitMask & sam) {
  7407. // sam represents a negative number.
  7408. return ~sam + 1;
  7409. } else {
  7410. // sam represents a positive number.
  7411. return kSignBitMask | sam;
  7412. }
  7413. }
  7414. // Given two numbers in the sign-and-magnitude representation,
  7415. // returns the distance between them as an unsigned number.
  7416. static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
  7417. const Bits &sam2) {
  7418. const Bits biased1 = SignAndMagnitudeToBiased(sam1);
  7419. const Bits biased2 = SignAndMagnitudeToBiased(sam2);
  7420. return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
  7421. }
  7422. FloatingPointUnion u_;
  7423. };
  7424. // We cannot use std::numeric_limits<T>::max() as it clashes with the max()
  7425. // macro defined by <windows.h>.
  7426. template <>
  7427. inline float FloatingPoint<float>::Max() { return FLT_MAX; }
  7428. template <>
  7429. inline double FloatingPoint<double>::Max() { return DBL_MAX; }
  7430. // Typedefs the instances of the FloatingPoint template class that we
  7431. // care to use.
  7432. typedef FloatingPoint<float> Float;
  7433. typedef FloatingPoint<double> Double;
  7434. // In order to catch the mistake of putting tests that use different
  7435. // test fixture classes in the same test case, we need to assign
  7436. // unique IDs to fixture classes and compare them. The TypeId type is
  7437. // used to hold such IDs. The user should treat TypeId as an opaque
  7438. // type: the only operation allowed on TypeId values is to compare
  7439. // them for equality using the == operator.
  7440. typedef const void* TypeId;
  7441. template <typename T>
  7442. class TypeIdHelper {
  7443. public:
  7444. // dummy_ must not have a const type. Otherwise an overly eager
  7445. // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
  7446. // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
  7447. static bool dummy_;
  7448. };
  7449. template <typename T>
  7450. bool TypeIdHelper<T>::dummy_ = false;
  7451. // GetTypeId<T>() returns the ID of type T. Different values will be
  7452. // returned for different types. Calling the function twice with the
  7453. // same type argument is guaranteed to return the same ID.
  7454. template <typename T>
  7455. TypeId GetTypeId() {
  7456. // The compiler is required to allocate a different
  7457. // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
  7458. // the template. Therefore, the address of dummy_ is guaranteed to
  7459. // be unique.
  7460. return &(TypeIdHelper<T>::dummy_);
  7461. }
  7462. // Returns the type ID of ::testing::Test. Always call this instead
  7463. // of GetTypeId< ::testing::Test>() to get the type ID of
  7464. // ::testing::Test, as the latter may give the wrong result due to a
  7465. // suspected linker bug when compiling Google Test as a Mac OS X
  7466. // framework.
  7467. GTEST_API_ TypeId GetTestTypeId();
  7468. // Defines the abstract factory interface that creates instances
  7469. // of a Test object.
  7470. class TestFactoryBase {
  7471. public:
  7472. virtual ~TestFactoryBase() {}
  7473. // Creates a test instance to run. The instance is both created and destroyed
  7474. // within TestInfoImpl::Run()
  7475. virtual Test* CreateTest() = 0;
  7476. protected:
  7477. TestFactoryBase() {}
  7478. private:
  7479. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
  7480. };
  7481. // This class provides implementation of TeastFactoryBase interface.
  7482. // It is used in TEST and TEST_F macros.
  7483. template <class TestClass>
  7484. class TestFactoryImpl : public TestFactoryBase {
  7485. public:
  7486. virtual Test* CreateTest() { return new TestClass; }
  7487. };
  7488. #if GTEST_OS_WINDOWS
  7489. // Predicate-formatters for implementing the HRESULT checking macros
  7490. // {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
  7491. // We pass a long instead of HRESULT to avoid causing an
  7492. // include dependency for the HRESULT type.
  7493. GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
  7494. long hr); // NOLINT
  7495. GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
  7496. long hr); // NOLINT
  7497. #endif // GTEST_OS_WINDOWS
  7498. // Types of SetUpTestCase() and TearDownTestCase() functions.
  7499. typedef void (*SetUpTestCaseFunc)();
  7500. typedef void (*TearDownTestCaseFunc)();
  7501. struct CodeLocation {
  7502. CodeLocation(const std::string& a_file, int a_line)
  7503. : file(a_file), line(a_line) {}
  7504. std::string file;
  7505. int line;
  7506. };
  7507. // Creates a new TestInfo object and registers it with Google Test;
  7508. // returns the created object.
  7509. //
  7510. // Arguments:
  7511. //
  7512. // test_case_name: name of the test case
  7513. // name: name of the test
  7514. // type_param the name of the test's type parameter, or NULL if
  7515. // this is not a typed or a type-parameterized test.
  7516. // value_param text representation of the test's value parameter,
  7517. // or NULL if this is not a type-parameterized test.
  7518. // code_location: code location where the test is defined
  7519. // fixture_class_id: ID of the test fixture class
  7520. // set_up_tc: pointer to the function that sets up the test case
  7521. // tear_down_tc: pointer to the function that tears down the test case
  7522. // factory: pointer to the factory that creates a test object.
  7523. // The newly created TestInfo instance will assume
  7524. // ownership of the factory object.
  7525. GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
  7526. const char* test_case_name,
  7527. const char* name,
  7528. const char* type_param,
  7529. const char* value_param,
  7530. CodeLocation code_location,
  7531. TypeId fixture_class_id,
  7532. SetUpTestCaseFunc set_up_tc,
  7533. TearDownTestCaseFunc tear_down_tc,
  7534. TestFactoryBase* factory);
  7535. // If *pstr starts with the given prefix, modifies *pstr to be right
  7536. // past the prefix and returns true; otherwise leaves *pstr unchanged
  7537. // and returns false. None of pstr, *pstr, and prefix can be NULL.
  7538. GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
  7539. #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  7540. GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
  7541. /* class A needs to have dll-interface to be used by clients of class B */)
  7542. // State of the definition of a type-parameterized test case.
  7543. class GTEST_API_ TypedTestCasePState {
  7544. public:
  7545. TypedTestCasePState() : registered_(false) {}
  7546. // Adds the given test name to defined_test_names_ and return true
  7547. // if the test case hasn't been registered; otherwise aborts the
  7548. // program.
  7549. bool AddTestName(const char* file, int line, const char* case_name,
  7550. const char* test_name) {
  7551. if (registered_) {
  7552. fprintf(stderr, "%s Test %s must be defined before "
  7553. "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
  7554. FormatFileLocation(file, line).c_str(), test_name, case_name);
  7555. fflush(stderr);
  7556. posix::Abort();
  7557. }
  7558. registered_tests_.insert(
  7559. ::std::make_pair(test_name, CodeLocation(file, line)));
  7560. return true;
  7561. }
  7562. bool TestExists(const std::string& test_name) const {
  7563. return registered_tests_.count(test_name) > 0;
  7564. }
  7565. const CodeLocation& GetCodeLocation(const std::string& test_name) const {
  7566. RegisteredTestsMap::const_iterator it = registered_tests_.find(test_name);
  7567. GTEST_CHECK_(it != registered_tests_.end());
  7568. return it->second;
  7569. }
  7570. // Verifies that registered_tests match the test names in
  7571. // defined_test_names_; returns registered_tests if successful, or
  7572. // aborts the program otherwise.
  7573. const char* VerifyRegisteredTestNames(
  7574. const char* file, int line, const char* registered_tests);
  7575. private:
  7576. typedef ::std::map<std::string, CodeLocation> RegisteredTestsMap;
  7577. bool registered_;
  7578. RegisteredTestsMap registered_tests_;
  7579. };
  7580. GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
  7581. // Skips to the first non-space char after the first comma in 'str';
  7582. // returns NULL if no comma is found in 'str'.
  7583. inline const char* SkipComma(const char* str) {
  7584. const char* comma = strchr(str, ',');
  7585. if (comma == NULL) {
  7586. return NULL;
  7587. }
  7588. while (IsSpace(*(++comma))) {}
  7589. return comma;
  7590. }
  7591. // Returns the prefix of 'str' before the first comma in it; returns
  7592. // the entire string if it contains no comma.
  7593. inline std::string GetPrefixUntilComma(const char* str) {
  7594. const char* comma = strchr(str, ',');
  7595. return comma == NULL ? str : std::string(str, comma);
  7596. }
  7597. // Splits a given string on a given delimiter, populating a given
  7598. // vector with the fields.
  7599. void SplitString(const ::std::string& str, char delimiter,
  7600. ::std::vector< ::std::string>* dest);
  7601. // The default argument to the template below for the case when the user does
  7602. // not provide a name generator.
  7603. struct DefaultNameGenerator {
  7604. template <typename T>
  7605. static std::string GetName(int i) {
  7606. return StreamableToString(i);
  7607. }
  7608. };
  7609. template <typename Provided = DefaultNameGenerator>
  7610. struct NameGeneratorSelector {
  7611. typedef Provided type;
  7612. };
  7613. template <typename NameGenerator>
  7614. void GenerateNamesRecursively(Types0, std::vector<std::string>*, int) {}
  7615. template <typename NameGenerator, typename Types>
  7616. void GenerateNamesRecursively(Types, std::vector<std::string>* result, int i) {
  7617. result->push_back(NameGenerator::template GetName<typename Types::Head>(i));
  7618. GenerateNamesRecursively<NameGenerator>(typename Types::Tail(), result,
  7619. i + 1);
  7620. }
  7621. template <typename NameGenerator, typename Types>
  7622. std::vector<std::string> GenerateNames() {
  7623. std::vector<std::string> result;
  7624. GenerateNamesRecursively<NameGenerator>(Types(), &result, 0);
  7625. return result;
  7626. }
  7627. // TypeParameterizedTest<Fixture, TestSel, Types>::Register()
  7628. // registers a list of type-parameterized tests with Google Test. The
  7629. // return value is insignificant - we just need to return something
  7630. // such that we can call this function in a namespace scope.
  7631. //
  7632. // Implementation note: The GTEST_TEMPLATE_ macro declares a template
  7633. // template parameter. It's defined in gtest-type-util.h.
  7634. template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
  7635. class TypeParameterizedTest {
  7636. public:
  7637. // 'index' is the index of the test in the type list 'Types'
  7638. // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
  7639. // Types). Valid values for 'index' are [0, N - 1] where N is the
  7640. // length of Types.
  7641. static bool Register(const char* prefix, const CodeLocation& code_location,
  7642. const char* case_name, const char* test_names, int index,
  7643. const std::vector<std::string>& type_names =
  7644. GenerateNames<DefaultNameGenerator, Types>()) {
  7645. typedef typename Types::Head Type;
  7646. typedef Fixture<Type> FixtureClass;
  7647. typedef typename GTEST_BIND_(TestSel, Type) TestClass;
  7648. // First, registers the first type-parameterized test in the type
  7649. // list.
  7650. MakeAndRegisterTestInfo(
  7651. (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name +
  7652. "/" + type_names[index])
  7653. .c_str(),
  7654. StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),
  7655. GetTypeName<Type>().c_str(),
  7656. NULL, // No value parameter.
  7657. code_location, GetTypeId<FixtureClass>(), TestClass::SetUpTestCase,
  7658. TestClass::TearDownTestCase, new TestFactoryImpl<TestClass>);
  7659. // Next, recurses (at compile time) with the tail of the type list.
  7660. return TypeParameterizedTest<Fixture, TestSel,
  7661. typename Types::Tail>::Register(prefix,
  7662. code_location,
  7663. case_name,
  7664. test_names,
  7665. index + 1,
  7666. type_names);
  7667. }
  7668. };
  7669. // The base case for the compile time recursion.
  7670. template <GTEST_TEMPLATE_ Fixture, class TestSel>
  7671. class TypeParameterizedTest<Fixture, TestSel, Types0> {
  7672. public:
  7673. static bool Register(const char* /*prefix*/, const CodeLocation&,
  7674. const char* /*case_name*/, const char* /*test_names*/,
  7675. int /*index*/,
  7676. const std::vector<std::string>& =
  7677. std::vector<std::string>() /*type_names*/) {
  7678. return true;
  7679. }
  7680. };
  7681. // TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
  7682. // registers *all combinations* of 'Tests' and 'Types' with Google
  7683. // Test. The return value is insignificant - we just need to return
  7684. // something such that we can call this function in a namespace scope.
  7685. template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
  7686. class TypeParameterizedTestCase {
  7687. public:
  7688. static bool Register(const char* prefix, CodeLocation code_location,
  7689. const TypedTestCasePState* state, const char* case_name,
  7690. const char* test_names,
  7691. const std::vector<std::string>& type_names =
  7692. GenerateNames<DefaultNameGenerator, Types>()) {
  7693. std::string test_name = StripTrailingSpaces(
  7694. GetPrefixUntilComma(test_names));
  7695. if (!state->TestExists(test_name)) {
  7696. fprintf(stderr, "Failed to get code location for test %s.%s at %s.",
  7697. case_name, test_name.c_str(),
  7698. FormatFileLocation(code_location.file.c_str(),
  7699. code_location.line).c_str());
  7700. fflush(stderr);
  7701. posix::Abort();
  7702. }
  7703. const CodeLocation& test_location = state->GetCodeLocation(test_name);
  7704. typedef typename Tests::Head Head;
  7705. // First, register the first test in 'Test' for each type in 'Types'.
  7706. TypeParameterizedTest<Fixture, Head, Types>::Register(
  7707. prefix, test_location, case_name, test_names, 0, type_names);
  7708. // Next, recurses (at compile time) with the tail of the test list.
  7709. return TypeParameterizedTestCase<Fixture, typename Tests::Tail,
  7710. Types>::Register(prefix, code_location,
  7711. state, case_name,
  7712. SkipComma(test_names),
  7713. type_names);
  7714. }
  7715. };
  7716. // The base case for the compile time recursion.
  7717. template <GTEST_TEMPLATE_ Fixture, typename Types>
  7718. class TypeParameterizedTestCase<Fixture, Templates0, Types> {
  7719. public:
  7720. static bool Register(const char* /*prefix*/, const CodeLocation&,
  7721. const TypedTestCasePState* /*state*/,
  7722. const char* /*case_name*/, const char* /*test_names*/,
  7723. const std::vector<std::string>& =
  7724. std::vector<std::string>() /*type_names*/) {
  7725. return true;
  7726. }
  7727. };
  7728. #endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  7729. // Returns the current OS stack trace as an std::string.
  7730. //
  7731. // The maximum number of stack frames to be included is specified by
  7732. // the gtest_stack_trace_depth flag. The skip_count parameter
  7733. // specifies the number of top frames to be skipped, which doesn't
  7734. // count against the number of frames to be included.
  7735. //
  7736. // For example, if Foo() calls Bar(), which in turn calls
  7737. // GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
  7738. // the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
  7739. GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(
  7740. UnitTest* unit_test, int skip_count);
  7741. // Helpers for suppressing warnings on unreachable code or constant
  7742. // condition.
  7743. // Always returns true.
  7744. GTEST_API_ bool AlwaysTrue();
  7745. // Always returns false.
  7746. inline bool AlwaysFalse() { return !AlwaysTrue(); }
  7747. // Helper for suppressing false warning from Clang on a const char*
  7748. // variable declared in a conditional expression always being NULL in
  7749. // the else branch.
  7750. struct GTEST_API_ ConstCharPtr {
  7751. ConstCharPtr(const char* str) : value(str) {}
  7752. operator bool() const { return true; }
  7753. const char* value;
  7754. };
  7755. // A simple Linear Congruential Generator for generating random
  7756. // numbers with a uniform distribution. Unlike rand() and srand(), it
  7757. // doesn't use global state (and therefore can't interfere with user
  7758. // code). Unlike rand_r(), it's portable. An LCG isn't very random,
  7759. // but it's good enough for our purposes.
  7760. class GTEST_API_ Random {
  7761. public:
  7762. static const UInt32 kMaxRange = 1u << 31;
  7763. explicit Random(UInt32 seed) : state_(seed) {}
  7764. void Reseed(UInt32 seed) { state_ = seed; }
  7765. // Generates a random number from [0, range). Crashes if 'range' is
  7766. // 0 or greater than kMaxRange.
  7767. UInt32 Generate(UInt32 range);
  7768. private:
  7769. UInt32 state_;
  7770. GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
  7771. };
  7772. // Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
  7773. // compiler error iff T1 and T2 are different types.
  7774. template <typename T1, typename T2>
  7775. struct CompileAssertTypesEqual;
  7776. template <typename T>
  7777. struct CompileAssertTypesEqual<T, T> {
  7778. };
  7779. // Removes the reference from a type if it is a reference type,
  7780. // otherwise leaves it unchanged. This is the same as
  7781. // tr1::remove_reference, which is not widely available yet.
  7782. template <typename T>
  7783. struct RemoveReference { typedef T type; }; // NOLINT
  7784. template <typename T>
  7785. struct RemoveReference<T&> { typedef T type; }; // NOLINT
  7786. // A handy wrapper around RemoveReference that works when the argument
  7787. // T depends on template parameters.
  7788. #define GTEST_REMOVE_REFERENCE_(T) \
  7789. typename ::testing::internal::RemoveReference<T>::type
  7790. // Removes const from a type if it is a const type, otherwise leaves
  7791. // it unchanged. This is the same as tr1::remove_const, which is not
  7792. // widely available yet.
  7793. template <typename T>
  7794. struct RemoveConst { typedef T type; }; // NOLINT
  7795. template <typename T>
  7796. struct RemoveConst<const T> { typedef T type; }; // NOLINT
  7797. // MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
  7798. // definition to fail to remove the const in 'const int[3]' and 'const
  7799. // char[3][4]'. The following specialization works around the bug.
  7800. template <typename T, size_t N>
  7801. struct RemoveConst<const T[N]> {
  7802. typedef typename RemoveConst<T>::type type[N];
  7803. };
  7804. #if defined(_MSC_VER) && _MSC_VER < 1400
  7805. // This is the only specialization that allows VC++ 7.1 to remove const in
  7806. // 'const int[3] and 'const int[3][4]'. However, it causes trouble with GCC
  7807. // and thus needs to be conditionally compiled.
  7808. template <typename T, size_t N>
  7809. struct RemoveConst<T[N]> {
  7810. typedef typename RemoveConst<T>::type type[N];
  7811. };
  7812. #endif
  7813. // A handy wrapper around RemoveConst that works when the argument
  7814. // T depends on template parameters.
  7815. #define GTEST_REMOVE_CONST_(T) \
  7816. typename ::testing::internal::RemoveConst<T>::type
  7817. // Turns const U&, U&, const U, and U all into U.
  7818. #define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
  7819. GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
  7820. // ImplicitlyConvertible<From, To>::value is a compile-time bool
  7821. // constant that's true iff type From can be implicitly converted to
  7822. // type To.
  7823. template <typename From, typename To>
  7824. class ImplicitlyConvertible {
  7825. private:
  7826. // We need the following helper functions only for their types.
  7827. // They have no implementations.
  7828. // MakeFrom() is an expression whose type is From. We cannot simply
  7829. // use From(), as the type From may not have a public default
  7830. // constructor.
  7831. static typename AddReference<From>::type MakeFrom();
  7832. // These two functions are overloaded. Given an expression
  7833. // Helper(x), the compiler will pick the first version if x can be
  7834. // implicitly converted to type To; otherwise it will pick the
  7835. // second version.
  7836. //
  7837. // The first version returns a value of size 1, and the second
  7838. // version returns a value of size 2. Therefore, by checking the
  7839. // size of Helper(x), which can be done at compile time, we can tell
  7840. // which version of Helper() is used, and hence whether x can be
  7841. // implicitly converted to type To.
  7842. static char Helper(To);
  7843. static char (&Helper(...))[2]; // NOLINT
  7844. // We have to put the 'public' section after the 'private' section,
  7845. // or MSVC refuses to compile the code.
  7846. public:
  7847. #if defined(__BORLANDC__)
  7848. // C++Builder cannot use member overload resolution during template
  7849. // instantiation. The simplest workaround is to use its C++0x type traits
  7850. // functions (C++Builder 2009 and above only).
  7851. static const bool value = __is_convertible(From, To);
  7852. #else
  7853. // MSVC warns about implicitly converting from double to int for
  7854. // possible loss of data, so we need to temporarily disable the
  7855. // warning.
  7856. GTEST_DISABLE_MSC_WARNINGS_PUSH_(4244)
  7857. static const bool value =
  7858. sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
  7859. GTEST_DISABLE_MSC_WARNINGS_POP_()
  7860. #endif // __BORLANDC__
  7861. };
  7862. template <typename From, typename To>
  7863. const bool ImplicitlyConvertible<From, To>::value;
  7864. // IsAProtocolMessage<T>::value is a compile-time bool constant that's
  7865. // true iff T is type ProtocolMessage, proto2::Message, or a subclass
  7866. // of those.
  7867. template <typename T>
  7868. struct IsAProtocolMessage
  7869. : public bool_constant<
  7870. ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
  7871. ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
  7872. };
  7873. // When the compiler sees expression IsContainerTest<C>(0), if C is an
  7874. // STL-style container class, the first overload of IsContainerTest
  7875. // will be viable (since both C::iterator* and C::const_iterator* are
  7876. // valid types and NULL can be implicitly converted to them). It will
  7877. // be picked over the second overload as 'int' is a perfect match for
  7878. // the type of argument 0. If C::iterator or C::const_iterator is not
  7879. // a valid type, the first overload is not viable, and the second
  7880. // overload will be picked. Therefore, we can determine whether C is
  7881. // a container class by checking the type of IsContainerTest<C>(0).
  7882. // The value of the expression is insignificant.
  7883. //
  7884. // In C++11 mode we check the existence of a const_iterator and that an
  7885. // iterator is properly implemented for the container.
  7886. //
  7887. // For pre-C++11 that we look for both C::iterator and C::const_iterator.
  7888. // The reason is that C++ injects the name of a class as a member of the
  7889. // class itself (e.g. you can refer to class iterator as either
  7890. // 'iterator' or 'iterator::iterator'). If we look for C::iterator
  7891. // only, for example, we would mistakenly think that a class named
  7892. // iterator is an STL container.
  7893. //
  7894. // Also note that the simpler approach of overloading
  7895. // IsContainerTest(typename C::const_iterator*) and
  7896. // IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
  7897. typedef int IsContainer;
  7898. #if GTEST_LANG_CXX11
  7899. template <class C,
  7900. class Iterator = decltype(::std::declval<const C&>().begin()),
  7901. class = decltype(::std::declval<const C&>().end()),
  7902. class = decltype(++::std::declval<Iterator&>()),
  7903. class = decltype(*::std::declval<Iterator>()),
  7904. class = typename C::const_iterator>
  7905. IsContainer IsContainerTest(int /* dummy */) {
  7906. return 0;
  7907. }
  7908. #else
  7909. template <class C>
  7910. IsContainer IsContainerTest(int /* dummy */,
  7911. typename C::iterator* /* it */ = NULL,
  7912. typename C::const_iterator* /* const_it */ = NULL) {
  7913. return 0;
  7914. }
  7915. #endif // GTEST_LANG_CXX11
  7916. typedef char IsNotContainer;
  7917. template <class C>
  7918. IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
  7919. // Trait to detect whether a type T is a hash table.
  7920. // The heuristic used is that the type contains an inner type `hasher` and does
  7921. // not contain an inner type `reverse_iterator`.
  7922. // If the container is iterable in reverse, then order might actually matter.
  7923. template <typename T>
  7924. struct IsHashTable {
  7925. private:
  7926. template <typename U>
  7927. static char test(typename U::hasher*, typename U::reverse_iterator*);
  7928. template <typename U>
  7929. static int test(typename U::hasher*, ...);
  7930. template <typename U>
  7931. static char test(...);
  7932. public:
  7933. static const bool value = sizeof(test<T>(0, 0)) == sizeof(int);
  7934. };
  7935. template <typename T>
  7936. const bool IsHashTable<T>::value;
  7937. template<typename T>
  7938. struct VoidT {
  7939. typedef void value_type;
  7940. };
  7941. template <typename T, typename = void>
  7942. struct HasValueType : false_type {};
  7943. template <typename T>
  7944. struct HasValueType<T, VoidT<typename T::value_type> > : true_type {
  7945. };
  7946. template <typename C,
  7947. bool = sizeof(IsContainerTest<C>(0)) == sizeof(IsContainer),
  7948. bool = HasValueType<C>::value>
  7949. struct IsRecursiveContainerImpl;
  7950. template <typename C, bool HV>
  7951. struct IsRecursiveContainerImpl<C, false, HV> : public false_type {};
  7952. // Since the IsRecursiveContainerImpl depends on the IsContainerTest we need to
  7953. // obey the same inconsistencies as the IsContainerTest, namely check if
  7954. // something is a container is relying on only const_iterator in C++11 and
  7955. // is relying on both const_iterator and iterator otherwise
  7956. template <typename C>
  7957. struct IsRecursiveContainerImpl<C, true, false> : public false_type {};
  7958. template <typename C>
  7959. struct IsRecursiveContainerImpl<C, true, true> {
  7960. #if GTEST_LANG_CXX11
  7961. typedef typename IteratorTraits<typename C::const_iterator>::value_type
  7962. value_type;
  7963. #else
  7964. typedef typename IteratorTraits<typename C::iterator>::value_type value_type;
  7965. #endif
  7966. typedef is_same<value_type, C> type;
  7967. };
  7968. // IsRecursiveContainer<Type> is a unary compile-time predicate that
  7969. // evaluates whether C is a recursive container type. A recursive container
  7970. // type is a container type whose value_type is equal to the container type
  7971. // itself. An example for a recursive container type is
  7972. // boost::filesystem::path, whose iterator has a value_type that is equal to
  7973. // boost::filesystem::path.
  7974. template <typename C>
  7975. struct IsRecursiveContainer : public IsRecursiveContainerImpl<C>::type {};
  7976. // EnableIf<condition>::type is void when 'Cond' is true, and
  7977. // undefined when 'Cond' is false. To use SFINAE to make a function
  7978. // overload only apply when a particular expression is true, add
  7979. // "typename EnableIf<expression>::type* = 0" as the last parameter.
  7980. template<bool> struct EnableIf;
  7981. template<> struct EnableIf<true> { typedef void type; }; // NOLINT
  7982. // Utilities for native arrays.
  7983. // ArrayEq() compares two k-dimensional native arrays using the
  7984. // elements' operator==, where k can be any integer >= 0. When k is
  7985. // 0, ArrayEq() degenerates into comparing a single pair of values.
  7986. template <typename T, typename U>
  7987. bool ArrayEq(const T* lhs, size_t size, const U* rhs);
  7988. // This generic version is used when k is 0.
  7989. template <typename T, typename U>
  7990. inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
  7991. // This overload is used when k >= 1.
  7992. template <typename T, typename U, size_t N>
  7993. inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
  7994. return internal::ArrayEq(lhs, N, rhs);
  7995. }
  7996. // This helper reduces code bloat. If we instead put its logic inside
  7997. // the previous ArrayEq() function, arrays with different sizes would
  7998. // lead to different copies of the template code.
  7999. template <typename T, typename U>
  8000. bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
  8001. for (size_t i = 0; i != size; i++) {
  8002. if (!internal::ArrayEq(lhs[i], rhs[i]))
  8003. return false;
  8004. }
  8005. return true;
  8006. }
  8007. // Finds the first element in the iterator range [begin, end) that
  8008. // equals elem. Element may be a native array type itself.
  8009. template <typename Iter, typename Element>
  8010. Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
  8011. for (Iter it = begin; it != end; ++it) {
  8012. if (internal::ArrayEq(*it, elem))
  8013. return it;
  8014. }
  8015. return end;
  8016. }
  8017. // CopyArray() copies a k-dimensional native array using the elements'
  8018. // operator=, where k can be any integer >= 0. When k is 0,
  8019. // CopyArray() degenerates into copying a single value.
  8020. template <typename T, typename U>
  8021. void CopyArray(const T* from, size_t size, U* to);
  8022. // This generic version is used when k is 0.
  8023. template <typename T, typename U>
  8024. inline void CopyArray(const T& from, U* to) { *to = from; }
  8025. // This overload is used when k >= 1.
  8026. template <typename T, typename U, size_t N>
  8027. inline void CopyArray(const T(&from)[N], U(*to)[N]) {
  8028. internal::CopyArray(from, N, *to);
  8029. }
  8030. // This helper reduces code bloat. If we instead put its logic inside
  8031. // the previous CopyArray() function, arrays with different sizes
  8032. // would lead to different copies of the template code.
  8033. template <typename T, typename U>
  8034. void CopyArray(const T* from, size_t size, U* to) {
  8035. for (size_t i = 0; i != size; i++) {
  8036. internal::CopyArray(from[i], to + i);
  8037. }
  8038. }
  8039. // The relation between an NativeArray object (see below) and the
  8040. // native array it represents.
  8041. // We use 2 different structs to allow non-copyable types to be used, as long
  8042. // as RelationToSourceReference() is passed.
  8043. struct RelationToSourceReference {};
  8044. struct RelationToSourceCopy {};
  8045. // Adapts a native array to a read-only STL-style container. Instead
  8046. // of the complete STL container concept, this adaptor only implements
  8047. // members useful for Google Mock's container matchers. New members
  8048. // should be added as needed. To simplify the implementation, we only
  8049. // support Element being a raw type (i.e. having no top-level const or
  8050. // reference modifier). It's the client's responsibility to satisfy
  8051. // this requirement. Element can be an array type itself (hence
  8052. // multi-dimensional arrays are supported).
  8053. template <typename Element>
  8054. class NativeArray {
  8055. public:
  8056. // STL-style container typedefs.
  8057. typedef Element value_type;
  8058. typedef Element* iterator;
  8059. typedef const Element* const_iterator;
  8060. // Constructs from a native array. References the source.
  8061. NativeArray(const Element* array, size_t count, RelationToSourceReference) {
  8062. InitRef(array, count);
  8063. }
  8064. // Constructs from a native array. Copies the source.
  8065. NativeArray(const Element* array, size_t count, RelationToSourceCopy) {
  8066. InitCopy(array, count);
  8067. }
  8068. // Copy constructor.
  8069. NativeArray(const NativeArray& rhs) {
  8070. (this->*rhs.clone_)(rhs.array_, rhs.size_);
  8071. }
  8072. ~NativeArray() {
  8073. if (clone_ != &NativeArray::InitRef)
  8074. delete[] array_;
  8075. }
  8076. // STL-style container methods.
  8077. size_t size() const { return size_; }
  8078. const_iterator begin() const { return array_; }
  8079. const_iterator end() const { return array_ + size_; }
  8080. bool operator==(const NativeArray& rhs) const {
  8081. return size() == rhs.size() &&
  8082. ArrayEq(begin(), size(), rhs.begin());
  8083. }
  8084. private:
  8085. enum {
  8086. kCheckTypeIsNotConstOrAReference = StaticAssertTypeEqHelper<
  8087. Element, GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>::value
  8088. };
  8089. // Initializes this object with a copy of the input.
  8090. void InitCopy(const Element* array, size_t a_size) {
  8091. Element* const copy = new Element[a_size];
  8092. CopyArray(array, a_size, copy);
  8093. array_ = copy;
  8094. size_ = a_size;
  8095. clone_ = &NativeArray::InitCopy;
  8096. }
  8097. // Initializes this object with a reference of the input.
  8098. void InitRef(const Element* array, size_t a_size) {
  8099. array_ = array;
  8100. size_ = a_size;
  8101. clone_ = &NativeArray::InitRef;
  8102. }
  8103. const Element* array_;
  8104. size_t size_;
  8105. void (NativeArray::*clone_)(const Element*, size_t);
  8106. GTEST_DISALLOW_ASSIGN_(NativeArray);
  8107. };
  8108. } // namespace internal
  8109. } // namespace testing
  8110. #define GTEST_MESSAGE_AT_(file, line, message, result_type) \
  8111. ::testing::internal::AssertHelper(result_type, file, line, message) \
  8112. = ::testing::Message()
  8113. #define GTEST_MESSAGE_(message, result_type) \
  8114. GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
  8115. #define GTEST_FATAL_FAILURE_(message) \
  8116. return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
  8117. #define GTEST_NONFATAL_FAILURE_(message) \
  8118. GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
  8119. #define GTEST_SUCCESS_(message) \
  8120. GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
  8121. // Suppress MSVC warning 4702 (unreachable code) for the code following
  8122. // statement if it returns or throws (or doesn't return or throw in some
  8123. // situations).
  8124. #define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
  8125. if (::testing::internal::AlwaysTrue()) { statement; }
  8126. #define GTEST_TEST_THROW_(statement, expected_exception, fail) \
  8127. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  8128. if (::testing::internal::ConstCharPtr gtest_msg = "") { \
  8129. bool gtest_caught_expected = false; \
  8130. try { \
  8131. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  8132. } \
  8133. catch (expected_exception const&) { \
  8134. gtest_caught_expected = true; \
  8135. } \
  8136. catch (...) { \
  8137. gtest_msg.value = \
  8138. "Expected: " #statement " throws an exception of type " \
  8139. #expected_exception ".\n Actual: it throws a different type."; \
  8140. goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
  8141. } \
  8142. if (!gtest_caught_expected) { \
  8143. gtest_msg.value = \
  8144. "Expected: " #statement " throws an exception of type " \
  8145. #expected_exception ".\n Actual: it throws nothing."; \
  8146. goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
  8147. } \
  8148. } else \
  8149. GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
  8150. fail(gtest_msg.value)
  8151. #define GTEST_TEST_NO_THROW_(statement, fail) \
  8152. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  8153. if (::testing::internal::AlwaysTrue()) { \
  8154. try { \
  8155. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  8156. } \
  8157. catch (...) { \
  8158. goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
  8159. } \
  8160. } else \
  8161. GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
  8162. fail("Expected: " #statement " doesn't throw an exception.\n" \
  8163. " Actual: it throws.")
  8164. #define GTEST_TEST_ANY_THROW_(statement, fail) \
  8165. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  8166. if (::testing::internal::AlwaysTrue()) { \
  8167. bool gtest_caught_any = false; \
  8168. try { \
  8169. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  8170. } \
  8171. catch (...) { \
  8172. gtest_caught_any = true; \
  8173. } \
  8174. if (!gtest_caught_any) { \
  8175. goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
  8176. } \
  8177. } else \
  8178. GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
  8179. fail("Expected: " #statement " throws an exception.\n" \
  8180. " Actual: it doesn't.")
  8181. // Implements Boolean test assertions such as EXPECT_TRUE. expression can be
  8182. // either a boolean expression or an AssertionResult. text is a textual
  8183. // represenation of expression as it was passed into the EXPECT_TRUE.
  8184. #define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
  8185. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  8186. if (const ::testing::AssertionResult gtest_ar_ = \
  8187. ::testing::AssertionResult(expression)) \
  8188. ; \
  8189. else \
  8190. fail(::testing::internal::GetBoolAssertionFailureMessage(\
  8191. gtest_ar_, text, #actual, #expected).c_str())
  8192. #define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
  8193. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  8194. if (::testing::internal::AlwaysTrue()) { \
  8195. ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
  8196. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  8197. if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
  8198. goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
  8199. } \
  8200. } else \
  8201. GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
  8202. fail("Expected: " #statement " doesn't generate new fatal " \
  8203. "failures in the current thread.\n" \
  8204. " Actual: it does.")
  8205. // Expands to the name of the class that implements the given test.
  8206. #define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
  8207. test_case_name##_##test_name##_Test
  8208. // Helper macro for defining tests.
  8209. #define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
  8210. class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
  8211. public:\
  8212. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
  8213. private:\
  8214. virtual void TestBody();\
  8215. static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
  8216. GTEST_DISALLOW_COPY_AND_ASSIGN_(\
  8217. GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
  8218. };\
  8219. \
  8220. ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
  8221. ::test_info_ =\
  8222. ::testing::internal::MakeAndRegisterTestInfo(\
  8223. #test_case_name, #test_name, NULL, NULL, \
  8224. ::testing::internal::CodeLocation(__FILE__, __LINE__), \
  8225. (parent_id), \
  8226. parent_class::SetUpTestCase, \
  8227. parent_class::TearDownTestCase, \
  8228. new ::testing::internal::TestFactoryImpl<\
  8229. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
  8230. void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
  8231. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
  8232. // Copyright 2005, Google Inc.
  8233. // All rights reserved.
  8234. //
  8235. // Redistribution and use in source and binary forms, with or without
  8236. // modification, are permitted provided that the following conditions are
  8237. // met:
  8238. //
  8239. // * Redistributions of source code must retain the above copyright
  8240. // notice, this list of conditions and the following disclaimer.
  8241. // * Redistributions in binary form must reproduce the above
  8242. // copyright notice, this list of conditions and the following disclaimer
  8243. // in the documentation and/or other materials provided with the
  8244. // distribution.
  8245. // * Neither the name of Google Inc. nor the names of its
  8246. // contributors may be used to endorse or promote products derived from
  8247. // this software without specific prior written permission.
  8248. //
  8249. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8250. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  8251. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8252. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  8253. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8254. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  8255. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  8256. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  8257. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  8258. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  8259. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8260. //
  8261. // The Google C++ Testing and Mocking Framework (Google Test)
  8262. //
  8263. // This header file defines the public API for death tests. It is
  8264. // #included by gtest.h so a user doesn't need to include this
  8265. // directly.
  8266. // GOOGLETEST_CM0001 DO NOT DELETE
  8267. #ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
  8268. #define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
  8269. // Copyright 2005, Google Inc.
  8270. // All rights reserved.
  8271. //
  8272. // Redistribution and use in source and binary forms, with or without
  8273. // modification, are permitted provided that the following conditions are
  8274. // met:
  8275. //
  8276. // * Redistributions of source code must retain the above copyright
  8277. // notice, this list of conditions and the following disclaimer.
  8278. // * Redistributions in binary form must reproduce the above
  8279. // copyright notice, this list of conditions and the following disclaimer
  8280. // in the documentation and/or other materials provided with the
  8281. // distribution.
  8282. // * Neither the name of Google Inc. nor the names of its
  8283. // contributors may be used to endorse or promote products derived from
  8284. // this software without specific prior written permission.
  8285. //
  8286. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8287. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  8288. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8289. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  8290. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8291. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  8292. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  8293. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  8294. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  8295. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  8296. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8297. //
  8298. // The Google C++ Testing and Mocking Framework (Google Test)
  8299. //
  8300. // This header file defines internal utilities needed for implementing
  8301. // death tests. They are subject to change without notice.
  8302. // GOOGLETEST_CM0001 DO NOT DELETE
  8303. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
  8304. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
  8305. #include <stdio.h>
  8306. namespace testing {
  8307. namespace internal {
  8308. GTEST_DECLARE_string_(internal_run_death_test);
  8309. // Names of the flags (needed for parsing Google Test flags).
  8310. const char kDeathTestStyleFlag[] = "death_test_style";
  8311. const char kDeathTestUseFork[] = "death_test_use_fork";
  8312. const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
  8313. #if GTEST_HAS_DEATH_TEST
  8314. GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
  8315. /* class A needs to have dll-interface to be used by clients of class B */)
  8316. // DeathTest is a class that hides much of the complexity of the
  8317. // GTEST_DEATH_TEST_ macro. It is abstract; its static Create method
  8318. // returns a concrete class that depends on the prevailing death test
  8319. // style, as defined by the --gtest_death_test_style and/or
  8320. // --gtest_internal_run_death_test flags.
  8321. // In describing the results of death tests, these terms are used with
  8322. // the corresponding definitions:
  8323. //
  8324. // exit status: The integer exit information in the format specified
  8325. // by wait(2)
  8326. // exit code: The integer code passed to exit(3), _exit(2), or
  8327. // returned from main()
  8328. class GTEST_API_ DeathTest {
  8329. public:
  8330. // Create returns false if there was an error determining the
  8331. // appropriate action to take for the current death test; for example,
  8332. // if the gtest_death_test_style flag is set to an invalid value.
  8333. // The LastMessage method will return a more detailed message in that
  8334. // case. Otherwise, the DeathTest pointer pointed to by the "test"
  8335. // argument is set. If the death test should be skipped, the pointer
  8336. // is set to NULL; otherwise, it is set to the address of a new concrete
  8337. // DeathTest object that controls the execution of the current test.
  8338. static bool Create(const char* statement, const RE* regex,
  8339. const char* file, int line, DeathTest** test);
  8340. DeathTest();
  8341. virtual ~DeathTest() { }
  8342. // A helper class that aborts a death test when it's deleted.
  8343. class ReturnSentinel {
  8344. public:
  8345. explicit ReturnSentinel(DeathTest* test) : test_(test) { }
  8346. ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
  8347. private:
  8348. DeathTest* const test_;
  8349. GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
  8350. } GTEST_ATTRIBUTE_UNUSED_;
  8351. // An enumeration of possible roles that may be taken when a death
  8352. // test is encountered. EXECUTE means that the death test logic should
  8353. // be executed immediately. OVERSEE means that the program should prepare
  8354. // the appropriate environment for a child process to execute the death
  8355. // test, then wait for it to complete.
  8356. enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
  8357. // An enumeration of the three reasons that a test might be aborted.
  8358. enum AbortReason {
  8359. TEST_ENCOUNTERED_RETURN_STATEMENT,
  8360. TEST_THREW_EXCEPTION,
  8361. TEST_DID_NOT_DIE
  8362. };
  8363. // Assumes one of the above roles.
  8364. virtual TestRole AssumeRole() = 0;
  8365. // Waits for the death test to finish and returns its status.
  8366. virtual int Wait() = 0;
  8367. // Returns true if the death test passed; that is, the test process
  8368. // exited during the test, its exit status matches a user-supplied
  8369. // predicate, and its stderr output matches a user-supplied regular
  8370. // expression.
  8371. // The user-supplied predicate may be a macro expression rather
  8372. // than a function pointer or functor, or else Wait and Passed could
  8373. // be combined.
  8374. virtual bool Passed(bool exit_status_ok) = 0;
  8375. // Signals that the death test did not die as expected.
  8376. virtual void Abort(AbortReason reason) = 0;
  8377. // Returns a human-readable outcome message regarding the outcome of
  8378. // the last death test.
  8379. static const char* LastMessage();
  8380. static void set_last_death_test_message(const std::string& message);
  8381. private:
  8382. // A string containing a description of the outcome of the last death test.
  8383. static std::string last_death_test_message_;
  8384. GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
  8385. };
  8386. GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
  8387. // Factory interface for death tests. May be mocked out for testing.
  8388. class DeathTestFactory {
  8389. public:
  8390. virtual ~DeathTestFactory() { }
  8391. virtual bool Create(const char* statement, const RE* regex,
  8392. const char* file, int line, DeathTest** test) = 0;
  8393. };
  8394. // A concrete DeathTestFactory implementation for normal use.
  8395. class DefaultDeathTestFactory : public DeathTestFactory {
  8396. public:
  8397. virtual bool Create(const char* statement, const RE* regex,
  8398. const char* file, int line, DeathTest** test);
  8399. };
  8400. // Returns true if exit_status describes a process that was terminated
  8401. // by a signal, or exited normally with a nonzero exit code.
  8402. GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
  8403. // Traps C++ exceptions escaping statement and reports them as test
  8404. // failures. Note that trapping SEH exceptions is not implemented here.
  8405. # if GTEST_HAS_EXCEPTIONS
  8406. # define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
  8407. try { \
  8408. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  8409. } catch (const ::std::exception& gtest_exception) { \
  8410. fprintf(\
  8411. stderr, \
  8412. "\n%s: Caught std::exception-derived exception escaping the " \
  8413. "death test statement. Exception message: %s\n", \
  8414. ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
  8415. gtest_exception.what()); \
  8416. fflush(stderr); \
  8417. death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
  8418. } catch (...) { \
  8419. death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
  8420. }
  8421. # else
  8422. # define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
  8423. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
  8424. # endif
  8425. // This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
  8426. // ASSERT_EXIT*, and EXPECT_EXIT*.
  8427. # define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
  8428. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  8429. if (::testing::internal::AlwaysTrue()) { \
  8430. const ::testing::internal::RE& gtest_regex = (regex); \
  8431. ::testing::internal::DeathTest* gtest_dt; \
  8432. if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \
  8433. __FILE__, __LINE__, &gtest_dt)) { \
  8434. goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
  8435. } \
  8436. if (gtest_dt != NULL) { \
  8437. ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
  8438. gtest_dt_ptr(gtest_dt); \
  8439. switch (gtest_dt->AssumeRole()) { \
  8440. case ::testing::internal::DeathTest::OVERSEE_TEST: \
  8441. if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
  8442. goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
  8443. } \
  8444. break; \
  8445. case ::testing::internal::DeathTest::EXECUTE_TEST: { \
  8446. ::testing::internal::DeathTest::ReturnSentinel \
  8447. gtest_sentinel(gtest_dt); \
  8448. GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
  8449. gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
  8450. break; \
  8451. } \
  8452. default: \
  8453. break; \
  8454. } \
  8455. } \
  8456. } else \
  8457. GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
  8458. fail(::testing::internal::DeathTest::LastMessage())
  8459. // The symbol "fail" here expands to something into which a message
  8460. // can be streamed.
  8461. // This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in
  8462. // NDEBUG mode. In this case we need the statements to be executed and the macro
  8463. // must accept a streamed message even though the message is never printed.
  8464. // The regex object is not evaluated, but it is used to prevent "unused"
  8465. // warnings and to avoid an expression that doesn't compile in debug mode.
  8466. #define GTEST_EXECUTE_STATEMENT_(statement, regex) \
  8467. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  8468. if (::testing::internal::AlwaysTrue()) { \
  8469. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  8470. } else if (!::testing::internal::AlwaysTrue()) { \
  8471. const ::testing::internal::RE& gtest_regex = (regex); \
  8472. static_cast<void>(gtest_regex); \
  8473. } else \
  8474. ::testing::Message()
  8475. // A class representing the parsed contents of the
  8476. // --gtest_internal_run_death_test flag, as it existed when
  8477. // RUN_ALL_TESTS was called.
  8478. class InternalRunDeathTestFlag {
  8479. public:
  8480. InternalRunDeathTestFlag(const std::string& a_file,
  8481. int a_line,
  8482. int an_index,
  8483. int a_write_fd)
  8484. : file_(a_file), line_(a_line), index_(an_index),
  8485. write_fd_(a_write_fd) {}
  8486. ~InternalRunDeathTestFlag() {
  8487. if (write_fd_ >= 0)
  8488. posix::Close(write_fd_);
  8489. }
  8490. const std::string& file() const { return file_; }
  8491. int line() const { return line_; }
  8492. int index() const { return index_; }
  8493. int write_fd() const { return write_fd_; }
  8494. private:
  8495. std::string file_;
  8496. int line_;
  8497. int index_;
  8498. int write_fd_;
  8499. GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
  8500. };
  8501. // Returns a newly created InternalRunDeathTestFlag object with fields
  8502. // initialized from the GTEST_FLAG(internal_run_death_test) flag if
  8503. // the flag is specified; otherwise returns NULL.
  8504. InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
  8505. #endif // GTEST_HAS_DEATH_TEST
  8506. } // namespace internal
  8507. } // namespace testing
  8508. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
  8509. namespace testing {
  8510. // This flag controls the style of death tests. Valid values are "threadsafe",
  8511. // meaning that the death test child process will re-execute the test binary
  8512. // from the start, running only a single death test, or "fast",
  8513. // meaning that the child process will execute the test logic immediately
  8514. // after forking.
  8515. GTEST_DECLARE_string_(death_test_style);
  8516. #if GTEST_HAS_DEATH_TEST
  8517. namespace internal {
  8518. // Returns a Boolean value indicating whether the caller is currently
  8519. // executing in the context of the death test child process. Tools such as
  8520. // Valgrind heap checkers may need this to modify their behavior in death
  8521. // tests. IMPORTANT: This is an internal utility. Using it may break the
  8522. // implementation of death tests. User code MUST NOT use it.
  8523. GTEST_API_ bool InDeathTestChild();
  8524. } // namespace internal
  8525. // The following macros are useful for writing death tests.
  8526. // Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
  8527. // executed:
  8528. //
  8529. // 1. It generates a warning if there is more than one active
  8530. // thread. This is because it's safe to fork() or clone() only
  8531. // when there is a single thread.
  8532. //
  8533. // 2. The parent process clone()s a sub-process and runs the death
  8534. // test in it; the sub-process exits with code 0 at the end of the
  8535. // death test, if it hasn't exited already.
  8536. //
  8537. // 3. The parent process waits for the sub-process to terminate.
  8538. //
  8539. // 4. The parent process checks the exit code and error message of
  8540. // the sub-process.
  8541. //
  8542. // Examples:
  8543. //
  8544. // ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
  8545. // for (int i = 0; i < 5; i++) {
  8546. // EXPECT_DEATH(server.ProcessRequest(i),
  8547. // "Invalid request .* in ProcessRequest()")
  8548. // << "Failed to die on request " << i;
  8549. // }
  8550. //
  8551. // ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
  8552. //
  8553. // bool KilledBySIGHUP(int exit_code) {
  8554. // return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
  8555. // }
  8556. //
  8557. // ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
  8558. //
  8559. // On the regular expressions used in death tests:
  8560. //
  8561. // GOOGLETEST_CM0005 DO NOT DELETE
  8562. // On POSIX-compliant systems (*nix), we use the <regex.h> library,
  8563. // which uses the POSIX extended regex syntax.
  8564. //
  8565. // On other platforms (e.g. Windows or Mac), we only support a simple regex
  8566. // syntax implemented as part of Google Test. This limited
  8567. // implementation should be enough most of the time when writing
  8568. // death tests; though it lacks many features you can find in PCRE
  8569. // or POSIX extended regex syntax. For example, we don't support
  8570. // union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
  8571. // repetition count ("x{5,7}"), among others.
  8572. //
  8573. // Below is the syntax that we do support. We chose it to be a
  8574. // subset of both PCRE and POSIX extended regex, so it's easy to
  8575. // learn wherever you come from. In the following: 'A' denotes a
  8576. // literal character, period (.), or a single \\ escape sequence;
  8577. // 'x' and 'y' denote regular expressions; 'm' and 'n' are for
  8578. // natural numbers.
  8579. //
  8580. // c matches any literal character c
  8581. // \\d matches any decimal digit
  8582. // \\D matches any character that's not a decimal digit
  8583. // \\f matches \f
  8584. // \\n matches \n
  8585. // \\r matches \r
  8586. // \\s matches any ASCII whitespace, including \n
  8587. // \\S matches any character that's not a whitespace
  8588. // \\t matches \t
  8589. // \\v matches \v
  8590. // \\w matches any letter, _, or decimal digit
  8591. // \\W matches any character that \\w doesn't match
  8592. // \\c matches any literal character c, which must be a punctuation
  8593. // . matches any single character except \n
  8594. // A? matches 0 or 1 occurrences of A
  8595. // A* matches 0 or many occurrences of A
  8596. // A+ matches 1 or many occurrences of A
  8597. // ^ matches the beginning of a string (not that of each line)
  8598. // $ matches the end of a string (not that of each line)
  8599. // xy matches x followed by y
  8600. //
  8601. // If you accidentally use PCRE or POSIX extended regex features
  8602. // not implemented by us, you will get a run-time failure. In that
  8603. // case, please try to rewrite your regular expression within the
  8604. // above syntax.
  8605. //
  8606. // This implementation is *not* meant to be as highly tuned or robust
  8607. // as a compiled regex library, but should perform well enough for a
  8608. // death test, which already incurs significant overhead by launching
  8609. // a child process.
  8610. //
  8611. // Known caveats:
  8612. //
  8613. // A "threadsafe" style death test obtains the path to the test
  8614. // program from argv[0] and re-executes it in the sub-process. For
  8615. // simplicity, the current implementation doesn't search the PATH
  8616. // when launching the sub-process. This means that the user must
  8617. // invoke the test program via a path that contains at least one
  8618. // path separator (e.g. path/to/foo_test and
  8619. // /absolute/path/to/bar_test are fine, but foo_test is not). This
  8620. // is rarely a problem as people usually don't put the test binary
  8621. // directory in PATH.
  8622. //
  8623. // FIXME: make thread-safe death tests search the PATH.
  8624. // Asserts that a given statement causes the program to exit, with an
  8625. // integer exit status that satisfies predicate, and emitting error output
  8626. // that matches regex.
  8627. # define ASSERT_EXIT(statement, predicate, regex) \
  8628. GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
  8629. // Like ASSERT_EXIT, but continues on to successive tests in the
  8630. // test case, if any:
  8631. # define EXPECT_EXIT(statement, predicate, regex) \
  8632. GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
  8633. // Asserts that a given statement causes the program to exit, either by
  8634. // explicitly exiting with a nonzero exit code or being killed by a
  8635. // signal, and emitting error output that matches regex.
  8636. # define ASSERT_DEATH(statement, regex) \
  8637. ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
  8638. // Like ASSERT_DEATH, but continues on to successive tests in the
  8639. // test case, if any:
  8640. # define EXPECT_DEATH(statement, regex) \
  8641. EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
  8642. // Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
  8643. // Tests that an exit code describes a normal exit with a given exit code.
  8644. class GTEST_API_ ExitedWithCode {
  8645. public:
  8646. explicit ExitedWithCode(int exit_code);
  8647. bool operator()(int exit_status) const;
  8648. private:
  8649. // No implementation - assignment is unsupported.
  8650. void operator=(const ExitedWithCode& other);
  8651. const int exit_code_;
  8652. };
  8653. # if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA
  8654. // Tests that an exit code describes an exit due to termination by a
  8655. // given signal.
  8656. // GOOGLETEST_CM0006 DO NOT DELETE
  8657. class GTEST_API_ KilledBySignal {
  8658. public:
  8659. explicit KilledBySignal(int signum);
  8660. bool operator()(int exit_status) const;
  8661. private:
  8662. const int signum_;
  8663. };
  8664. # endif // !GTEST_OS_WINDOWS
  8665. // EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
  8666. // The death testing framework causes this to have interesting semantics,
  8667. // since the sideeffects of the call are only visible in opt mode, and not
  8668. // in debug mode.
  8669. //
  8670. // In practice, this can be used to test functions that utilize the
  8671. // LOG(DFATAL) macro using the following style:
  8672. //
  8673. // int DieInDebugOr12(int* sideeffect) {
  8674. // if (sideeffect) {
  8675. // *sideeffect = 12;
  8676. // }
  8677. // LOG(DFATAL) << "death";
  8678. // return 12;
  8679. // }
  8680. //
  8681. // TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
  8682. // int sideeffect = 0;
  8683. // // Only asserts in dbg.
  8684. // EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
  8685. //
  8686. // #ifdef NDEBUG
  8687. // // opt-mode has sideeffect visible.
  8688. // EXPECT_EQ(12, sideeffect);
  8689. // #else
  8690. // // dbg-mode no visible sideeffect.
  8691. // EXPECT_EQ(0, sideeffect);
  8692. // #endif
  8693. // }
  8694. //
  8695. // This will assert that DieInDebugReturn12InOpt() crashes in debug
  8696. // mode, usually due to a DCHECK or LOG(DFATAL), but returns the
  8697. // appropriate fallback value (12 in this case) in opt mode. If you
  8698. // need to test that a function has appropriate side-effects in opt
  8699. // mode, include assertions against the side-effects. A general
  8700. // pattern for this is:
  8701. //
  8702. // EXPECT_DEBUG_DEATH({
  8703. // // Side-effects here will have an effect after this statement in
  8704. // // opt mode, but none in debug mode.
  8705. // EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
  8706. // }, "death");
  8707. //
  8708. # ifdef NDEBUG
  8709. # define EXPECT_DEBUG_DEATH(statement, regex) \
  8710. GTEST_EXECUTE_STATEMENT_(statement, regex)
  8711. # define ASSERT_DEBUG_DEATH(statement, regex) \
  8712. GTEST_EXECUTE_STATEMENT_(statement, regex)
  8713. # else
  8714. # define EXPECT_DEBUG_DEATH(statement, regex) \
  8715. EXPECT_DEATH(statement, regex)
  8716. # define ASSERT_DEBUG_DEATH(statement, regex) \
  8717. ASSERT_DEATH(statement, regex)
  8718. # endif // NDEBUG for EXPECT_DEBUG_DEATH
  8719. #endif // GTEST_HAS_DEATH_TEST
  8720. // This macro is used for implementing macros such as
  8721. // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
  8722. // death tests are not supported. Those macros must compile on such systems
  8723. // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
  8724. // systems that support death tests. This allows one to write such a macro
  8725. // on a system that does not support death tests and be sure that it will
  8726. // compile on a death-test supporting system. It is exposed publicly so that
  8727. // systems that have death-tests with stricter requirements than
  8728. // GTEST_HAS_DEATH_TEST can write their own equivalent of
  8729. // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED.
  8730. //
  8731. // Parameters:
  8732. // statement - A statement that a macro such as EXPECT_DEATH would test
  8733. // for program termination. This macro has to make sure this
  8734. // statement is compiled but not executed, to ensure that
  8735. // EXPECT_DEATH_IF_SUPPORTED compiles with a certain
  8736. // parameter iff EXPECT_DEATH compiles with it.
  8737. // regex - A regex that a macro such as EXPECT_DEATH would use to test
  8738. // the output of statement. This parameter has to be
  8739. // compiled but not evaluated by this macro, to ensure that
  8740. // this macro only accepts expressions that a macro such as
  8741. // EXPECT_DEATH would accept.
  8742. // terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
  8743. // and a return statement for ASSERT_DEATH_IF_SUPPORTED.
  8744. // This ensures that ASSERT_DEATH_IF_SUPPORTED will not
  8745. // compile inside functions where ASSERT_DEATH doesn't
  8746. // compile.
  8747. //
  8748. // The branch that has an always false condition is used to ensure that
  8749. // statement and regex are compiled (and thus syntactically correct) but
  8750. // never executed. The unreachable code macro protects the terminator
  8751. // statement from generating an 'unreachable code' warning in case
  8752. // statement unconditionally returns or throws. The Message constructor at
  8753. // the end allows the syntax of streaming additional messages into the
  8754. // macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
  8755. # define GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, terminator) \
  8756. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  8757. if (::testing::internal::AlwaysTrue()) { \
  8758. GTEST_LOG_(WARNING) \
  8759. << "Death tests are not supported on this platform.\n" \
  8760. << "Statement '" #statement "' cannot be verified."; \
  8761. } else if (::testing::internal::AlwaysFalse()) { \
  8762. ::testing::internal::RE::PartialMatch(".*", (regex)); \
  8763. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  8764. terminator; \
  8765. } else \
  8766. ::testing::Message()
  8767. // EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
  8768. // ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
  8769. // death tests are supported; otherwise they just issue a warning. This is
  8770. // useful when you are combining death test assertions with normal test
  8771. // assertions in one test.
  8772. #if GTEST_HAS_DEATH_TEST
  8773. # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
  8774. EXPECT_DEATH(statement, regex)
  8775. # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
  8776. ASSERT_DEATH(statement, regex)
  8777. #else
  8778. # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
  8779. GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, )
  8780. # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
  8781. GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, return)
  8782. #endif
  8783. } // namespace testing
  8784. #endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
  8785. // This file was GENERATED by command:
  8786. // pump.py gtest-param-test.h.pump
  8787. // DO NOT EDIT BY HAND!!!
  8788. // Copyright 2008, Google Inc.
  8789. // All rights reserved.
  8790. //
  8791. // Redistribution and use in source and binary forms, with or without
  8792. // modification, are permitted provided that the following conditions are
  8793. // met:
  8794. //
  8795. // * Redistributions of source code must retain the above copyright
  8796. // notice, this list of conditions and the following disclaimer.
  8797. // * Redistributions in binary form must reproduce the above
  8798. // copyright notice, this list of conditions and the following disclaimer
  8799. // in the documentation and/or other materials provided with the
  8800. // distribution.
  8801. // * Neither the name of Google Inc. nor the names of its
  8802. // contributors may be used to endorse or promote products derived from
  8803. // this software without specific prior written permission.
  8804. //
  8805. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8806. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  8807. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8808. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  8809. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8810. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  8811. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  8812. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  8813. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  8814. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  8815. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8816. //
  8817. // Macros and functions for implementing parameterized tests
  8818. // in Google C++ Testing and Mocking Framework (Google Test)
  8819. //
  8820. // This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
  8821. //
  8822. // GOOGLETEST_CM0001 DO NOT DELETE
  8823. #ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
  8824. #define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
  8825. // Value-parameterized tests allow you to test your code with different
  8826. // parameters without writing multiple copies of the same test.
  8827. //
  8828. // Here is how you use value-parameterized tests:
  8829. #if 0
  8830. // To write value-parameterized tests, first you should define a fixture
  8831. // class. It is usually derived from testing::TestWithParam<T> (see below for
  8832. // another inheritance scheme that's sometimes useful in more complicated
  8833. // class hierarchies), where the type of your parameter values.
  8834. // TestWithParam<T> is itself derived from testing::Test. T can be any
  8835. // copyable type. If it's a raw pointer, you are responsible for managing the
  8836. // lifespan of the pointed values.
  8837. class FooTest : public ::testing::TestWithParam<const char*> {
  8838. // You can implement all the usual class fixture members here.
  8839. };
  8840. // Then, use the TEST_P macro to define as many parameterized tests
  8841. // for this fixture as you want. The _P suffix is for "parameterized"
  8842. // or "pattern", whichever you prefer to think.
  8843. TEST_P(FooTest, DoesBlah) {
  8844. // Inside a test, access the test parameter with the GetParam() method
  8845. // of the TestWithParam<T> class:
  8846. EXPECT_TRUE(foo.Blah(GetParam()));
  8847. ...
  8848. }
  8849. TEST_P(FooTest, HasBlahBlah) {
  8850. ...
  8851. }
  8852. // Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
  8853. // case with any set of parameters you want. Google Test defines a number
  8854. // of functions for generating test parameters. They return what we call
  8855. // (surprise!) parameter generators. Here is a summary of them, which
  8856. // are all in the testing namespace:
  8857. //
  8858. //
  8859. // Range(begin, end [, step]) - Yields values {begin, begin+step,
  8860. // begin+step+step, ...}. The values do not
  8861. // include end. step defaults to 1.
  8862. // Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}.
  8863. // ValuesIn(container) - Yields values from a C-style array, an STL
  8864. // ValuesIn(begin,end) container, or an iterator range [begin, end).
  8865. // Bool() - Yields sequence {false, true}.
  8866. // Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product
  8867. // for the math savvy) of the values generated
  8868. // by the N generators.
  8869. //
  8870. // For more details, see comments at the definitions of these functions below
  8871. // in this file.
  8872. //
  8873. // The following statement will instantiate tests from the FooTest test case
  8874. // each with parameter values "meeny", "miny", and "moe".
  8875. INSTANTIATE_TEST_CASE_P(InstantiationName,
  8876. FooTest,
  8877. Values("meeny", "miny", "moe"));
  8878. // To distinguish different instances of the pattern, (yes, you
  8879. // can instantiate it more then once) the first argument to the
  8880. // INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
  8881. // actual test case name. Remember to pick unique prefixes for different
  8882. // instantiations. The tests from the instantiation above will have
  8883. // these names:
  8884. //
  8885. // * InstantiationName/FooTest.DoesBlah/0 for "meeny"
  8886. // * InstantiationName/FooTest.DoesBlah/1 for "miny"
  8887. // * InstantiationName/FooTest.DoesBlah/2 for "moe"
  8888. // * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
  8889. // * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
  8890. // * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
  8891. //
  8892. // You can use these names in --gtest_filter.
  8893. //
  8894. // This statement will instantiate all tests from FooTest again, each
  8895. // with parameter values "cat" and "dog":
  8896. const char* pets[] = {"cat", "dog"};
  8897. INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
  8898. // The tests from the instantiation above will have these names:
  8899. //
  8900. // * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
  8901. // * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
  8902. // * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
  8903. // * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
  8904. //
  8905. // Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
  8906. // in the given test case, whether their definitions come before or
  8907. // AFTER the INSTANTIATE_TEST_CASE_P statement.
  8908. //
  8909. // Please also note that generator expressions (including parameters to the
  8910. // generators) are evaluated in InitGoogleTest(), after main() has started.
  8911. // This allows the user on one hand, to adjust generator parameters in order
  8912. // to dynamically determine a set of tests to run and on the other hand,
  8913. // give the user a chance to inspect the generated tests with Google Test
  8914. // reflection API before RUN_ALL_TESTS() is executed.
  8915. //
  8916. // You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
  8917. // for more examples.
  8918. //
  8919. // In the future, we plan to publish the API for defining new parameter
  8920. // generators. But for now this interface remains part of the internal
  8921. // implementation and is subject to change.
  8922. //
  8923. //
  8924. // A parameterized test fixture must be derived from testing::Test and from
  8925. // testing::WithParamInterface<T>, where T is the type of the parameter
  8926. // values. Inheriting from TestWithParam<T> satisfies that requirement because
  8927. // TestWithParam<T> inherits from both Test and WithParamInterface. In more
  8928. // complicated hierarchies, however, it is occasionally useful to inherit
  8929. // separately from Test and WithParamInterface. For example:
  8930. class BaseTest : public ::testing::Test {
  8931. // You can inherit all the usual members for a non-parameterized test
  8932. // fixture here.
  8933. };
  8934. class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
  8935. // The usual test fixture members go here too.
  8936. };
  8937. TEST_F(BaseTest, HasFoo) {
  8938. // This is an ordinary non-parameterized test.
  8939. }
  8940. TEST_P(DerivedTest, DoesBlah) {
  8941. // GetParam works just the same here as if you inherit from TestWithParam.
  8942. EXPECT_TRUE(foo.Blah(GetParam()));
  8943. }
  8944. #endif // 0
  8945. #if !GTEST_OS_SYMBIAN
  8946. # include <utility>
  8947. #endif
  8948. // Copyright 2008 Google Inc.
  8949. // All Rights Reserved.
  8950. //
  8951. // Redistribution and use in source and binary forms, with or without
  8952. // modification, are permitted provided that the following conditions are
  8953. // met:
  8954. //
  8955. // * Redistributions of source code must retain the above copyright
  8956. // notice, this list of conditions and the following disclaimer.
  8957. // * Redistributions in binary form must reproduce the above
  8958. // copyright notice, this list of conditions and the following disclaimer
  8959. // in the documentation and/or other materials provided with the
  8960. // distribution.
  8961. // * Neither the name of Google Inc. nor the names of its
  8962. // contributors may be used to endorse or promote products derived from
  8963. // this software without specific prior written permission.
  8964. //
  8965. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8966. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  8967. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8968. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  8969. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8970. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  8971. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  8972. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  8973. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  8974. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  8975. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8976. // Type and function utilities for implementing parameterized tests.
  8977. // GOOGLETEST_CM0001 DO NOT DELETE
  8978. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
  8979. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
  8980. #include <ctype.h>
  8981. #include <iterator>
  8982. #include <set>
  8983. #include <utility>
  8984. #include <vector>
  8985. // Copyright 2003 Google Inc.
  8986. // All rights reserved.
  8987. //
  8988. // Redistribution and use in source and binary forms, with or without
  8989. // modification, are permitted provided that the following conditions are
  8990. // met:
  8991. //
  8992. // * Redistributions of source code must retain the above copyright
  8993. // notice, this list of conditions and the following disclaimer.
  8994. // * Redistributions in binary form must reproduce the above
  8995. // copyright notice, this list of conditions and the following disclaimer
  8996. // in the documentation and/or other materials provided with the
  8997. // distribution.
  8998. // * Neither the name of Google Inc. nor the names of its
  8999. // contributors may be used to endorse or promote products derived from
  9000. // this software without specific prior written permission.
  9001. //
  9002. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  9003. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  9004. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  9005. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  9006. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  9007. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  9008. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  9009. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  9010. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  9011. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  9012. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  9013. //
  9014. // A "smart" pointer type with reference tracking. Every pointer to a
  9015. // particular object is kept on a circular linked list. When the last pointer
  9016. // to an object is destroyed or reassigned, the object is deleted.
  9017. //
  9018. // Used properly, this deletes the object when the last reference goes away.
  9019. // There are several caveats:
  9020. // - Like all reference counting schemes, cycles lead to leaks.
  9021. // - Each smart pointer is actually two pointers (8 bytes instead of 4).
  9022. // - Every time a pointer is assigned, the entire list of pointers to that
  9023. // object is traversed. This class is therefore NOT SUITABLE when there
  9024. // will often be more than two or three pointers to a particular object.
  9025. // - References are only tracked as long as linked_ptr<> objects are copied.
  9026. // If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
  9027. // will happen (double deletion).
  9028. //
  9029. // A good use of this class is storing object references in STL containers.
  9030. // You can safely put linked_ptr<> in a vector<>.
  9031. // Other uses may not be as good.
  9032. //
  9033. // Note: If you use an incomplete type with linked_ptr<>, the class
  9034. // *containing* linked_ptr<> must have a constructor and destructor (even
  9035. // if they do nothing!).
  9036. //
  9037. // Bill Gibbons suggested we use something like this.
  9038. //
  9039. // Thread Safety:
  9040. // Unlike other linked_ptr implementations, in this implementation
  9041. // a linked_ptr object is thread-safe in the sense that:
  9042. // - it's safe to copy linked_ptr objects concurrently,
  9043. // - it's safe to copy *from* a linked_ptr and read its underlying
  9044. // raw pointer (e.g. via get()) concurrently, and
  9045. // - it's safe to write to two linked_ptrs that point to the same
  9046. // shared object concurrently.
  9047. // FIXME: rename this to safe_linked_ptr to avoid
  9048. // confusion with normal linked_ptr.
  9049. // GOOGLETEST_CM0001 DO NOT DELETE
  9050. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
  9051. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
  9052. #include <stdlib.h>
  9053. #include <assert.h>
  9054. namespace testing {
  9055. namespace internal {
  9056. // Protects copying of all linked_ptr objects.
  9057. GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
  9058. // This is used internally by all instances of linked_ptr<>. It needs to be
  9059. // a non-template class because different types of linked_ptr<> can refer to
  9060. // the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
  9061. // So, it needs to be possible for different types of linked_ptr to participate
  9062. // in the same circular linked list, so we need a single class type here.
  9063. //
  9064. // DO NOT USE THIS CLASS DIRECTLY YOURSELF. Use linked_ptr<T>.
  9065. class linked_ptr_internal {
  9066. public:
  9067. // Create a new circle that includes only this instance.
  9068. void join_new() {
  9069. next_ = this;
  9070. }
  9071. // Many linked_ptr operations may change p.link_ for some linked_ptr
  9072. // variable p in the same circle as this object. Therefore we need
  9073. // to prevent two such operations from occurring concurrently.
  9074. //
  9075. // Note that different types of linked_ptr objects can coexist in a
  9076. // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
  9077. // linked_ptr<Derived2>). Therefore we must use a single mutex to
  9078. // protect all linked_ptr objects. This can create serious
  9079. // contention in production code, but is acceptable in a testing
  9080. // framework.
  9081. // Join an existing circle.
  9082. void join(linked_ptr_internal const* ptr)
  9083. GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
  9084. MutexLock lock(&g_linked_ptr_mutex);
  9085. linked_ptr_internal const* p = ptr;
  9086. while (p->next_ != ptr) {
  9087. assert(p->next_ != this &&
  9088. "Trying to join() a linked ring we are already in. "
  9089. "Is GMock thread safety enabled?");
  9090. p = p->next_;
  9091. }
  9092. p->next_ = this;
  9093. next_ = ptr;
  9094. }
  9095. // Leave whatever circle we're part of. Returns true if we were the
  9096. // last member of the circle. Once this is done, you can join() another.
  9097. bool depart()
  9098. GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
  9099. MutexLock lock(&g_linked_ptr_mutex);
  9100. if (next_ == this) return true;
  9101. linked_ptr_internal const* p = next_;
  9102. while (p->next_ != this) {
  9103. assert(p->next_ != next_ &&
  9104. "Trying to depart() a linked ring we are not in. "
  9105. "Is GMock thread safety enabled?");
  9106. p = p->next_;
  9107. }
  9108. p->next_ = next_;
  9109. return false;
  9110. }
  9111. private:
  9112. mutable linked_ptr_internal const* next_;
  9113. };
  9114. template <typename T>
  9115. class linked_ptr {
  9116. public:
  9117. typedef T element_type;
  9118. // Take over ownership of a raw pointer. This should happen as soon as
  9119. // possible after the object is created.
  9120. explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
  9121. ~linked_ptr() { depart(); }
  9122. // Copy an existing linked_ptr<>, adding ourselves to the list of references.
  9123. template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
  9124. linked_ptr(linked_ptr const& ptr) { // NOLINT
  9125. assert(&ptr != this);
  9126. copy(&ptr);
  9127. }
  9128. // Assignment releases the old value and acquires the new.
  9129. template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
  9130. depart();
  9131. copy(&ptr);
  9132. return *this;
  9133. }
  9134. linked_ptr& operator=(linked_ptr const& ptr) {
  9135. if (&ptr != this) {
  9136. depart();
  9137. copy(&ptr);
  9138. }
  9139. return *this;
  9140. }
  9141. // Smart pointer members.
  9142. void reset(T* ptr = NULL) {
  9143. depart();
  9144. capture(ptr);
  9145. }
  9146. T* get() const { return value_; }
  9147. T* operator->() const { return value_; }
  9148. T& operator*() const { return *value_; }
  9149. bool operator==(T* p) const { return value_ == p; }
  9150. bool operator!=(T* p) const { return value_ != p; }
  9151. template <typename U>
  9152. bool operator==(linked_ptr<U> const& ptr) const {
  9153. return value_ == ptr.get();
  9154. }
  9155. template <typename U>
  9156. bool operator!=(linked_ptr<U> const& ptr) const {
  9157. return value_ != ptr.get();
  9158. }
  9159. private:
  9160. template <typename U>
  9161. friend class linked_ptr;
  9162. T* value_;
  9163. linked_ptr_internal link_;
  9164. void depart() {
  9165. if (link_.depart()) delete value_;
  9166. }
  9167. void capture(T* ptr) {
  9168. value_ = ptr;
  9169. link_.join_new();
  9170. }
  9171. template <typename U> void copy(linked_ptr<U> const* ptr) {
  9172. value_ = ptr->get();
  9173. if (value_)
  9174. link_.join(&ptr->link_);
  9175. else
  9176. link_.join_new();
  9177. }
  9178. };
  9179. template<typename T> inline
  9180. bool operator==(T* ptr, const linked_ptr<T>& x) {
  9181. return ptr == x.get();
  9182. }
  9183. template<typename T> inline
  9184. bool operator!=(T* ptr, const linked_ptr<T>& x) {
  9185. return ptr != x.get();
  9186. }
  9187. // A function to convert T* into linked_ptr<T>
  9188. // Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
  9189. // for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
  9190. template <typename T>
  9191. linked_ptr<T> make_linked_ptr(T* ptr) {
  9192. return linked_ptr<T>(ptr);
  9193. }
  9194. } // namespace internal
  9195. } // namespace testing
  9196. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
  9197. // Copyright 2007, Google Inc.
  9198. // All rights reserved.
  9199. //
  9200. // Redistribution and use in source and binary forms, with or without
  9201. // modification, are permitted provided that the following conditions are
  9202. // met:
  9203. //
  9204. // * Redistributions of source code must retain the above copyright
  9205. // notice, this list of conditions and the following disclaimer.
  9206. // * Redistributions in binary form must reproduce the above
  9207. // copyright notice, this list of conditions and the following disclaimer
  9208. // in the documentation and/or other materials provided with the
  9209. // distribution.
  9210. // * Neither the name of Google Inc. nor the names of its
  9211. // contributors may be used to endorse or promote products derived from
  9212. // this software without specific prior written permission.
  9213. //
  9214. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  9215. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  9216. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  9217. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  9218. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  9219. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  9220. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  9221. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  9222. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  9223. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  9224. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  9225. // Google Test - The Google C++ Testing and Mocking Framework
  9226. //
  9227. // This file implements a universal value printer that can print a
  9228. // value of any type T:
  9229. //
  9230. // void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
  9231. //
  9232. // A user can teach this function how to print a class type T by
  9233. // defining either operator<<() or PrintTo() in the namespace that
  9234. // defines T. More specifically, the FIRST defined function in the
  9235. // following list will be used (assuming T is defined in namespace
  9236. // foo):
  9237. //
  9238. // 1. foo::PrintTo(const T&, ostream*)
  9239. // 2. operator<<(ostream&, const T&) defined in either foo or the
  9240. // global namespace.
  9241. //
  9242. // However if T is an STL-style container then it is printed element-wise
  9243. // unless foo::PrintTo(const T&, ostream*) is defined. Note that
  9244. // operator<<() is ignored for container types.
  9245. //
  9246. // If none of the above is defined, it will print the debug string of
  9247. // the value if it is a protocol buffer, or print the raw bytes in the
  9248. // value otherwise.
  9249. //
  9250. // To aid debugging: when T is a reference type, the address of the
  9251. // value is also printed; when T is a (const) char pointer, both the
  9252. // pointer value and the NUL-terminated string it points to are
  9253. // printed.
  9254. //
  9255. // We also provide some convenient wrappers:
  9256. //
  9257. // // Prints a value to a string. For a (const or not) char
  9258. // // pointer, the NUL-terminated string (but not the pointer) is
  9259. // // printed.
  9260. // std::string ::testing::PrintToString(const T& value);
  9261. //
  9262. // // Prints a value tersely: for a reference type, the referenced
  9263. // // value (but not the address) is printed; for a (const or not) char
  9264. // // pointer, the NUL-terminated string (but not the pointer) is
  9265. // // printed.
  9266. // void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
  9267. //
  9268. // // Prints value using the type inferred by the compiler. The difference
  9269. // // from UniversalTersePrint() is that this function prints both the
  9270. // // pointer and the NUL-terminated string for a (const or not) char pointer.
  9271. // void ::testing::internal::UniversalPrint(const T& value, ostream*);
  9272. //
  9273. // // Prints the fields of a tuple tersely to a string vector, one
  9274. // // element for each field. Tuple support must be enabled in
  9275. // // gtest-port.h.
  9276. // std::vector<string> UniversalTersePrintTupleFieldsToStrings(
  9277. // const Tuple& value);
  9278. //
  9279. // Known limitation:
  9280. //
  9281. // The print primitives print the elements of an STL-style container
  9282. // using the compiler-inferred type of *iter where iter is a
  9283. // const_iterator of the container. When const_iterator is an input
  9284. // iterator but not a forward iterator, this inferred type may not
  9285. // match value_type, and the print output may be incorrect. In
  9286. // practice, this is rarely a problem as for most containers
  9287. // const_iterator is a forward iterator. We'll fix this if there's an
  9288. // actual need for it. Note that this fix cannot rely on value_type
  9289. // being defined as many user-defined container types don't have
  9290. // value_type.
  9291. // GOOGLETEST_CM0001 DO NOT DELETE
  9292. #ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
  9293. #define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
  9294. #include <ostream> // NOLINT
  9295. #include <sstream>
  9296. #include <string>
  9297. #include <utility>
  9298. #include <vector>
  9299. #if GTEST_HAS_STD_TUPLE_
  9300. # include <tuple>
  9301. #endif
  9302. #if GTEST_HAS_ABSL
  9303. #include "absl/strings/string_view.h"
  9304. #include "absl/types/optional.h"
  9305. #include "absl/types/variant.h"
  9306. #endif // GTEST_HAS_ABSL
  9307. namespace testing {
  9308. // Definitions in the 'internal' and 'internal2' name spaces are
  9309. // subject to change without notice. DO NOT USE THEM IN USER CODE!
  9310. namespace internal2 {
  9311. // Prints the given number of bytes in the given object to the given
  9312. // ostream.
  9313. GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
  9314. size_t count,
  9315. ::std::ostream* os);
  9316. // For selecting which printer to use when a given type has neither <<
  9317. // nor PrintTo().
  9318. enum TypeKind {
  9319. kProtobuf, // a protobuf type
  9320. kConvertibleToInteger, // a type implicitly convertible to BiggestInt
  9321. // (e.g. a named or unnamed enum type)
  9322. #if GTEST_HAS_ABSL
  9323. kConvertibleToStringView, // a type implicitly convertible to
  9324. // absl::string_view
  9325. #endif
  9326. kOtherType // anything else
  9327. };
  9328. // TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
  9329. // by the universal printer to print a value of type T when neither
  9330. // operator<< nor PrintTo() is defined for T, where kTypeKind is the
  9331. // "kind" of T as defined by enum TypeKind.
  9332. template <typename T, TypeKind kTypeKind>
  9333. class TypeWithoutFormatter {
  9334. public:
  9335. // This default version is called when kTypeKind is kOtherType.
  9336. static void PrintValue(const T& value, ::std::ostream* os) {
  9337. PrintBytesInObjectTo(static_cast<const unsigned char*>(
  9338. reinterpret_cast<const void*>(&value)),
  9339. sizeof(value), os);
  9340. }
  9341. };
  9342. // We print a protobuf using its ShortDebugString() when the string
  9343. // doesn't exceed this many characters; otherwise we print it using
  9344. // DebugString() for better readability.
  9345. const size_t kProtobufOneLinerMaxLength = 50;
  9346. template <typename T>
  9347. class TypeWithoutFormatter<T, kProtobuf> {
  9348. public:
  9349. static void PrintValue(const T& value, ::std::ostream* os) {
  9350. std::string pretty_str = value.ShortDebugString();
  9351. if (pretty_str.length() > kProtobufOneLinerMaxLength) {
  9352. pretty_str = "\n" + value.DebugString();
  9353. }
  9354. *os << ("<" + pretty_str + ">");
  9355. }
  9356. };
  9357. template <typename T>
  9358. class TypeWithoutFormatter<T, kConvertibleToInteger> {
  9359. public:
  9360. // Since T has no << operator or PrintTo() but can be implicitly
  9361. // converted to BiggestInt, we print it as a BiggestInt.
  9362. //
  9363. // Most likely T is an enum type (either named or unnamed), in which
  9364. // case printing it as an integer is the desired behavior. In case
  9365. // T is not an enum, printing it as an integer is the best we can do
  9366. // given that it has no user-defined printer.
  9367. static void PrintValue(const T& value, ::std::ostream* os) {
  9368. const internal::BiggestInt kBigInt = value;
  9369. *os << kBigInt;
  9370. }
  9371. };
  9372. #if GTEST_HAS_ABSL
  9373. template <typename T>
  9374. class TypeWithoutFormatter<T, kConvertibleToStringView> {
  9375. public:
  9376. // Since T has neither operator<< nor PrintTo() but can be implicitly
  9377. // converted to absl::string_view, we print it as a absl::string_view.
  9378. //
  9379. // Note: the implementation is further below, as it depends on
  9380. // internal::PrintTo symbol which is defined later in the file.
  9381. static void PrintValue(const T& value, ::std::ostream* os);
  9382. };
  9383. #endif
  9384. // Prints the given value to the given ostream. If the value is a
  9385. // protocol message, its debug string is printed; if it's an enum or
  9386. // of a type implicitly convertible to BiggestInt, it's printed as an
  9387. // integer; otherwise the bytes in the value are printed. This is
  9388. // what UniversalPrinter<T>::Print() does when it knows nothing about
  9389. // type T and T has neither << operator nor PrintTo().
  9390. //
  9391. // A user can override this behavior for a class type Foo by defining
  9392. // a << operator in the namespace where Foo is defined.
  9393. //
  9394. // We put this operator in namespace 'internal2' instead of 'internal'
  9395. // to simplify the implementation, as much code in 'internal' needs to
  9396. // use << in STL, which would conflict with our own << were it defined
  9397. // in 'internal'.
  9398. //
  9399. // Note that this operator<< takes a generic std::basic_ostream<Char,
  9400. // CharTraits> type instead of the more restricted std::ostream. If
  9401. // we define it to take an std::ostream instead, we'll get an
  9402. // "ambiguous overloads" compiler error when trying to print a type
  9403. // Foo that supports streaming to std::basic_ostream<Char,
  9404. // CharTraits>, as the compiler cannot tell whether
  9405. // operator<<(std::ostream&, const T&) or
  9406. // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
  9407. // specific.
  9408. template <typename Char, typename CharTraits, typename T>
  9409. ::std::basic_ostream<Char, CharTraits>& operator<<(
  9410. ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
  9411. TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value
  9412. ? kProtobuf
  9413. : internal::ImplicitlyConvertible<
  9414. const T&, internal::BiggestInt>::value
  9415. ? kConvertibleToInteger
  9416. :
  9417. #if GTEST_HAS_ABSL
  9418. internal::ImplicitlyConvertible<
  9419. const T&, absl::string_view>::value
  9420. ? kConvertibleToStringView
  9421. :
  9422. #endif
  9423. kOtherType)>::PrintValue(x, &os);
  9424. return os;
  9425. }
  9426. } // namespace internal2
  9427. } // namespace testing
  9428. // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
  9429. // magic needed for implementing UniversalPrinter won't work.
  9430. namespace testing_internal {
  9431. // Used to print a value that is not an STL-style container when the
  9432. // user doesn't define PrintTo() for it.
  9433. template <typename T>
  9434. void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
  9435. // With the following statement, during unqualified name lookup,
  9436. // testing::internal2::operator<< appears as if it was declared in
  9437. // the nearest enclosing namespace that contains both
  9438. // ::testing_internal and ::testing::internal2, i.e. the global
  9439. // namespace. For more details, refer to the C++ Standard section
  9440. // 7.3.4-1 [namespace.udir]. This allows us to fall back onto
  9441. // testing::internal2::operator<< in case T doesn't come with a <<
  9442. // operator.
  9443. //
  9444. // We cannot write 'using ::testing::internal2::operator<<;', which
  9445. // gcc 3.3 fails to compile due to a compiler bug.
  9446. using namespace ::testing::internal2; // NOLINT
  9447. // Assuming T is defined in namespace foo, in the next statement,
  9448. // the compiler will consider all of:
  9449. //
  9450. // 1. foo::operator<< (thanks to Koenig look-up),
  9451. // 2. ::operator<< (as the current namespace is enclosed in ::),
  9452. // 3. testing::internal2::operator<< (thanks to the using statement above).
  9453. //
  9454. // The operator<< whose type matches T best will be picked.
  9455. //
  9456. // We deliberately allow #2 to be a candidate, as sometimes it's
  9457. // impossible to define #1 (e.g. when foo is ::std, defining
  9458. // anything in it is undefined behavior unless you are a compiler
  9459. // vendor.).
  9460. *os << value;
  9461. }
  9462. } // namespace testing_internal
  9463. namespace testing {
  9464. namespace internal {
  9465. // FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a
  9466. // value of type ToPrint that is an operand of a comparison assertion
  9467. // (e.g. ASSERT_EQ). OtherOperand is the type of the other operand in
  9468. // the comparison, and is used to help determine the best way to
  9469. // format the value. In particular, when the value is a C string
  9470. // (char pointer) and the other operand is an STL string object, we
  9471. // want to format the C string as a string, since we know it is
  9472. // compared by value with the string object. If the value is a char
  9473. // pointer but the other operand is not an STL string object, we don't
  9474. // know whether the pointer is supposed to point to a NUL-terminated
  9475. // string, and thus want to print it as a pointer to be safe.
  9476. //
  9477. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  9478. // The default case.
  9479. template <typename ToPrint, typename OtherOperand>
  9480. class FormatForComparison {
  9481. public:
  9482. static ::std::string Format(const ToPrint& value) {
  9483. return ::testing::PrintToString(value);
  9484. }
  9485. };
  9486. // Array.
  9487. template <typename ToPrint, size_t N, typename OtherOperand>
  9488. class FormatForComparison<ToPrint[N], OtherOperand> {
  9489. public:
  9490. static ::std::string Format(const ToPrint* value) {
  9491. return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);
  9492. }
  9493. };
  9494. // By default, print C string as pointers to be safe, as we don't know
  9495. // whether they actually point to a NUL-terminated string.
  9496. #define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType) \
  9497. template <typename OtherOperand> \
  9498. class FormatForComparison<CharType*, OtherOperand> { \
  9499. public: \
  9500. static ::std::string Format(CharType* value) { \
  9501. return ::testing::PrintToString(static_cast<const void*>(value)); \
  9502. } \
  9503. }
  9504. GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);
  9505. GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);
  9506. GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);
  9507. GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);
  9508. #undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
  9509. // If a C string is compared with an STL string object, we know it's meant
  9510. // to point to a NUL-terminated string, and thus can print it as a string.
  9511. #define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
  9512. template <> \
  9513. class FormatForComparison<CharType*, OtherStringType> { \
  9514. public: \
  9515. static ::std::string Format(CharType* value) { \
  9516. return ::testing::PrintToString(value); \
  9517. } \
  9518. }
  9519. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
  9520. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
  9521. #if GTEST_HAS_GLOBAL_STRING
  9522. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
  9523. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
  9524. #endif
  9525. #if GTEST_HAS_GLOBAL_WSTRING
  9526. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);
  9527. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);
  9528. #endif
  9529. #if GTEST_HAS_STD_WSTRING
  9530. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
  9531. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);
  9532. #endif
  9533. #undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
  9534. // Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
  9535. // operand to be used in a failure message. The type (but not value)
  9536. // of the other operand may affect the format. This allows us to
  9537. // print a char* as a raw pointer when it is compared against another
  9538. // char* or void*, and print it as a C string when it is compared
  9539. // against an std::string object, for example.
  9540. //
  9541. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  9542. template <typename T1, typename T2>
  9543. std::string FormatForComparisonFailureMessage(
  9544. const T1& value, const T2& /* other_operand */) {
  9545. return FormatForComparison<T1, T2>::Format(value);
  9546. }
  9547. // UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
  9548. // value to the given ostream. The caller must ensure that
  9549. // 'ostream_ptr' is not NULL, or the behavior is undefined.
  9550. //
  9551. // We define UniversalPrinter as a class template (as opposed to a
  9552. // function template), as we need to partially specialize it for
  9553. // reference types, which cannot be done with function templates.
  9554. template <typename T>
  9555. class UniversalPrinter;
  9556. template <typename T>
  9557. void UniversalPrint(const T& value, ::std::ostream* os);
  9558. enum DefaultPrinterType {
  9559. kPrintContainer,
  9560. kPrintPointer,
  9561. kPrintFunctionPointer,
  9562. kPrintOther,
  9563. };
  9564. template <DefaultPrinterType type> struct WrapPrinterType {};
  9565. // Used to print an STL-style container when the user doesn't define
  9566. // a PrintTo() for it.
  9567. template <typename C>
  9568. void DefaultPrintTo(WrapPrinterType<kPrintContainer> /* dummy */,
  9569. const C& container, ::std::ostream* os) {
  9570. const size_t kMaxCount = 32; // The maximum number of elements to print.
  9571. *os << '{';
  9572. size_t count = 0;
  9573. for (typename C::const_iterator it = container.begin();
  9574. it != container.end(); ++it, ++count) {
  9575. if (count > 0) {
  9576. *os << ',';
  9577. if (count == kMaxCount) { // Enough has been printed.
  9578. *os << " ...";
  9579. break;
  9580. }
  9581. }
  9582. *os << ' ';
  9583. // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
  9584. // handle *it being a native array.
  9585. internal::UniversalPrint(*it, os);
  9586. }
  9587. if (count > 0) {
  9588. *os << ' ';
  9589. }
  9590. *os << '}';
  9591. }
  9592. // Used to print a pointer that is neither a char pointer nor a member
  9593. // pointer, when the user doesn't define PrintTo() for it. (A member
  9594. // variable pointer or member function pointer doesn't really point to
  9595. // a location in the address space. Their representation is
  9596. // implementation-defined. Therefore they will be printed as raw
  9597. // bytes.)
  9598. template <typename T>
  9599. void DefaultPrintTo(WrapPrinterType<kPrintPointer> /* dummy */,
  9600. T* p, ::std::ostream* os) {
  9601. if (p == NULL) {
  9602. *os << "NULL";
  9603. } else {
  9604. // T is not a function type. We just call << to print p,
  9605. // relying on ADL to pick up user-defined << for their pointer
  9606. // types, if any.
  9607. *os << p;
  9608. }
  9609. }
  9610. template <typename T>
  9611. void DefaultPrintTo(WrapPrinterType<kPrintFunctionPointer> /* dummy */,
  9612. T* p, ::std::ostream* os) {
  9613. if (p == NULL) {
  9614. *os << "NULL";
  9615. } else {
  9616. // T is a function type, so '*os << p' doesn't do what we want
  9617. // (it just prints p as bool). We want to print p as a const
  9618. // void*.
  9619. *os << reinterpret_cast<const void*>(p);
  9620. }
  9621. }
  9622. // Used to print a non-container, non-pointer value when the user
  9623. // doesn't define PrintTo() for it.
  9624. template <typename T>
  9625. void DefaultPrintTo(WrapPrinterType<kPrintOther> /* dummy */,
  9626. const T& value, ::std::ostream* os) {
  9627. ::testing_internal::DefaultPrintNonContainerTo(value, os);
  9628. }
  9629. // Prints the given value using the << operator if it has one;
  9630. // otherwise prints the bytes in it. This is what
  9631. // UniversalPrinter<T>::Print() does when PrintTo() is not specialized
  9632. // or overloaded for type T.
  9633. //
  9634. // A user can override this behavior for a class type Foo by defining
  9635. // an overload of PrintTo() in the namespace where Foo is defined. We
  9636. // give the user this option as sometimes defining a << operator for
  9637. // Foo is not desirable (e.g. the coding style may prevent doing it,
  9638. // or there is already a << operator but it doesn't do what the user
  9639. // wants).
  9640. template <typename T>
  9641. void PrintTo(const T& value, ::std::ostream* os) {
  9642. // DefaultPrintTo() is overloaded. The type of its first argument
  9643. // determines which version will be picked.
  9644. //
  9645. // Note that we check for container types here, prior to we check
  9646. // for protocol message types in our operator<<. The rationale is:
  9647. //
  9648. // For protocol messages, we want to give people a chance to
  9649. // override Google Mock's format by defining a PrintTo() or
  9650. // operator<<. For STL containers, other formats can be
  9651. // incompatible with Google Mock's format for the container
  9652. // elements; therefore we check for container types here to ensure
  9653. // that our format is used.
  9654. //
  9655. // Note that MSVC and clang-cl do allow an implicit conversion from
  9656. // pointer-to-function to pointer-to-object, but clang-cl warns on it.
  9657. // So don't use ImplicitlyConvertible if it can be helped since it will
  9658. // cause this warning, and use a separate overload of DefaultPrintTo for
  9659. // function pointers so that the `*os << p` in the object pointer overload
  9660. // doesn't cause that warning either.
  9661. DefaultPrintTo(
  9662. WrapPrinterType <
  9663. (sizeof(IsContainerTest<T>(0)) == sizeof(IsContainer)) &&
  9664. !IsRecursiveContainer<T>::value
  9665. ? kPrintContainer
  9666. : !is_pointer<T>::value
  9667. ? kPrintOther
  9668. #if GTEST_LANG_CXX11
  9669. : std::is_function<typename std::remove_pointer<T>::type>::value
  9670. #else
  9671. : !internal::ImplicitlyConvertible<T, const void*>::value
  9672. #endif
  9673. ? kPrintFunctionPointer
  9674. : kPrintPointer > (),
  9675. value, os);
  9676. }
  9677. // The following list of PrintTo() overloads tells
  9678. // UniversalPrinter<T>::Print() how to print standard types (built-in
  9679. // types, strings, plain arrays, and pointers).
  9680. // Overloads for various char types.
  9681. GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
  9682. GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
  9683. inline void PrintTo(char c, ::std::ostream* os) {
  9684. // When printing a plain char, we always treat it as unsigned. This
  9685. // way, the output won't be affected by whether the compiler thinks
  9686. // char is signed or not.
  9687. PrintTo(static_cast<unsigned char>(c), os);
  9688. }
  9689. // Overloads for other simple built-in types.
  9690. inline void PrintTo(bool x, ::std::ostream* os) {
  9691. *os << (x ? "true" : "false");
  9692. }
  9693. // Overload for wchar_t type.
  9694. // Prints a wchar_t as a symbol if it is printable or as its internal
  9695. // code otherwise and also as its decimal code (except for L'\0').
  9696. // The L'\0' char is printed as "L'\\0'". The decimal code is printed
  9697. // as signed integer when wchar_t is implemented by the compiler
  9698. // as a signed type and is printed as an unsigned integer when wchar_t
  9699. // is implemented as an unsigned type.
  9700. GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
  9701. // Overloads for C strings.
  9702. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
  9703. inline void PrintTo(char* s, ::std::ostream* os) {
  9704. PrintTo(ImplicitCast_<const char*>(s), os);
  9705. }
  9706. // signed/unsigned char is often used for representing binary data, so
  9707. // we print pointers to it as void* to be safe.
  9708. inline void PrintTo(const signed char* s, ::std::ostream* os) {
  9709. PrintTo(ImplicitCast_<const void*>(s), os);
  9710. }
  9711. inline void PrintTo(signed char* s, ::std::ostream* os) {
  9712. PrintTo(ImplicitCast_<const void*>(s), os);
  9713. }
  9714. inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
  9715. PrintTo(ImplicitCast_<const void*>(s), os);
  9716. }
  9717. inline void PrintTo(unsigned char* s, ::std::ostream* os) {
  9718. PrintTo(ImplicitCast_<const void*>(s), os);
  9719. }
  9720. // MSVC can be configured to define wchar_t as a typedef of unsigned
  9721. // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
  9722. // type. When wchar_t is a typedef, defining an overload for const
  9723. // wchar_t* would cause unsigned short* be printed as a wide string,
  9724. // possibly causing invalid memory accesses.
  9725. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
  9726. // Overloads for wide C strings
  9727. GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
  9728. inline void PrintTo(wchar_t* s, ::std::ostream* os) {
  9729. PrintTo(ImplicitCast_<const wchar_t*>(s), os);
  9730. }
  9731. #endif
  9732. // Overload for C arrays. Multi-dimensional arrays are printed
  9733. // properly.
  9734. // Prints the given number of elements in an array, without printing
  9735. // the curly braces.
  9736. template <typename T>
  9737. void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
  9738. UniversalPrint(a[0], os);
  9739. for (size_t i = 1; i != count; i++) {
  9740. *os << ", ";
  9741. UniversalPrint(a[i], os);
  9742. }
  9743. }
  9744. // Overloads for ::string and ::std::string.
  9745. #if GTEST_HAS_GLOBAL_STRING
  9746. GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
  9747. inline void PrintTo(const ::string& s, ::std::ostream* os) {
  9748. PrintStringTo(s, os);
  9749. }
  9750. #endif // GTEST_HAS_GLOBAL_STRING
  9751. GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
  9752. inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
  9753. PrintStringTo(s, os);
  9754. }
  9755. // Overloads for ::wstring and ::std::wstring.
  9756. #if GTEST_HAS_GLOBAL_WSTRING
  9757. GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
  9758. inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
  9759. PrintWideStringTo(s, os);
  9760. }
  9761. #endif // GTEST_HAS_GLOBAL_WSTRING
  9762. #if GTEST_HAS_STD_WSTRING
  9763. GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
  9764. inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
  9765. PrintWideStringTo(s, os);
  9766. }
  9767. #endif // GTEST_HAS_STD_WSTRING
  9768. #if GTEST_HAS_ABSL
  9769. // Overload for absl::string_view.
  9770. inline void PrintTo(absl::string_view sp, ::std::ostream* os) {
  9771. PrintTo(::std::string(sp), os);
  9772. }
  9773. #endif // GTEST_HAS_ABSL
  9774. #if GTEST_LANG_CXX11
  9775. inline void PrintTo(std::nullptr_t, ::std::ostream* os) { *os << "(nullptr)"; }
  9776. #endif // GTEST_LANG_CXX11
  9777. #if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
  9778. // Helper function for printing a tuple. T must be instantiated with
  9779. // a tuple type.
  9780. template <typename T>
  9781. void PrintTupleTo(const T& t, ::std::ostream* os);
  9782. #endif // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
  9783. #if GTEST_HAS_TR1_TUPLE
  9784. // Overload for ::std::tr1::tuple. Needed for printing function arguments,
  9785. // which are packed as tuples.
  9786. // Overloaded PrintTo() for tuples of various arities. We support
  9787. // tuples of up-to 10 fields. The following implementation works
  9788. // regardless of whether tr1::tuple is implemented using the
  9789. // non-standard variadic template feature or not.
  9790. inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
  9791. PrintTupleTo(t, os);
  9792. }
  9793. template <typename T1>
  9794. void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
  9795. PrintTupleTo(t, os);
  9796. }
  9797. template <typename T1, typename T2>
  9798. void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
  9799. PrintTupleTo(t, os);
  9800. }
  9801. template <typename T1, typename T2, typename T3>
  9802. void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
  9803. PrintTupleTo(t, os);
  9804. }
  9805. template <typename T1, typename T2, typename T3, typename T4>
  9806. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
  9807. PrintTupleTo(t, os);
  9808. }
  9809. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  9810. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
  9811. ::std::ostream* os) {
  9812. PrintTupleTo(t, os);
  9813. }
  9814. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9815. typename T6>
  9816. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
  9817. ::std::ostream* os) {
  9818. PrintTupleTo(t, os);
  9819. }
  9820. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9821. typename T6, typename T7>
  9822. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
  9823. ::std::ostream* os) {
  9824. PrintTupleTo(t, os);
  9825. }
  9826. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9827. typename T6, typename T7, typename T8>
  9828. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
  9829. ::std::ostream* os) {
  9830. PrintTupleTo(t, os);
  9831. }
  9832. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9833. typename T6, typename T7, typename T8, typename T9>
  9834. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
  9835. ::std::ostream* os) {
  9836. PrintTupleTo(t, os);
  9837. }
  9838. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9839. typename T6, typename T7, typename T8, typename T9, typename T10>
  9840. void PrintTo(
  9841. const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
  9842. ::std::ostream* os) {
  9843. PrintTupleTo(t, os);
  9844. }
  9845. #endif // GTEST_HAS_TR1_TUPLE
  9846. #if GTEST_HAS_STD_TUPLE_
  9847. template <typename... Types>
  9848. void PrintTo(const ::std::tuple<Types...>& t, ::std::ostream* os) {
  9849. PrintTupleTo(t, os);
  9850. }
  9851. #endif // GTEST_HAS_STD_TUPLE_
  9852. // Overload for std::pair.
  9853. template <typename T1, typename T2>
  9854. void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
  9855. *os << '(';
  9856. // We cannot use UniversalPrint(value.first, os) here, as T1 may be
  9857. // a reference type. The same for printing value.second.
  9858. UniversalPrinter<T1>::Print(value.first, os);
  9859. *os << ", ";
  9860. UniversalPrinter<T2>::Print(value.second, os);
  9861. *os << ')';
  9862. }
  9863. // Implements printing a non-reference type T by letting the compiler
  9864. // pick the right overload of PrintTo() for T.
  9865. template <typename T>
  9866. class UniversalPrinter {
  9867. public:
  9868. // MSVC warns about adding const to a function type, so we want to
  9869. // disable the warning.
  9870. GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
  9871. // Note: we deliberately don't call this PrintTo(), as that name
  9872. // conflicts with ::testing::internal::PrintTo in the body of the
  9873. // function.
  9874. static void Print(const T& value, ::std::ostream* os) {
  9875. // By default, ::testing::internal::PrintTo() is used for printing
  9876. // the value.
  9877. //
  9878. // Thanks to Koenig look-up, if T is a class and has its own
  9879. // PrintTo() function defined in its namespace, that function will
  9880. // be visible here. Since it is more specific than the generic ones
  9881. // in ::testing::internal, it will be picked by the compiler in the
  9882. // following statement - exactly what we want.
  9883. PrintTo(value, os);
  9884. }
  9885. GTEST_DISABLE_MSC_WARNINGS_POP_()
  9886. };
  9887. #if GTEST_HAS_ABSL
  9888. // Printer for absl::optional
  9889. template <typename T>
  9890. class UniversalPrinter<::absl::optional<T>> {
  9891. public:
  9892. static void Print(const ::absl::optional<T>& value, ::std::ostream* os) {
  9893. *os << '(';
  9894. if (!value) {
  9895. *os << "nullopt";
  9896. } else {
  9897. UniversalPrint(*value, os);
  9898. }
  9899. *os << ')';
  9900. }
  9901. };
  9902. // Printer for absl::variant
  9903. template <typename... T>
  9904. class UniversalPrinter<::absl::variant<T...>> {
  9905. public:
  9906. static void Print(const ::absl::variant<T...>& value, ::std::ostream* os) {
  9907. *os << '(';
  9908. absl::visit(Visitor{os}, value);
  9909. *os << ')';
  9910. }
  9911. private:
  9912. struct Visitor {
  9913. template <typename U>
  9914. void operator()(const U& u) const {
  9915. *os << "'" << GetTypeName<U>() << "' with value ";
  9916. UniversalPrint(u, os);
  9917. }
  9918. ::std::ostream* os;
  9919. };
  9920. };
  9921. #endif // GTEST_HAS_ABSL
  9922. // UniversalPrintArray(begin, len, os) prints an array of 'len'
  9923. // elements, starting at address 'begin'.
  9924. template <typename T>
  9925. void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
  9926. if (len == 0) {
  9927. *os << "{}";
  9928. } else {
  9929. *os << "{ ";
  9930. const size_t kThreshold = 18;
  9931. const size_t kChunkSize = 8;
  9932. // If the array has more than kThreshold elements, we'll have to
  9933. // omit some details by printing only the first and the last
  9934. // kChunkSize elements.
  9935. // FIXME: let the user control the threshold using a flag.
  9936. if (len <= kThreshold) {
  9937. PrintRawArrayTo(begin, len, os);
  9938. } else {
  9939. PrintRawArrayTo(begin, kChunkSize, os);
  9940. *os << ", ..., ";
  9941. PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
  9942. }
  9943. *os << " }";
  9944. }
  9945. }
  9946. // This overload prints a (const) char array compactly.
  9947. GTEST_API_ void UniversalPrintArray(
  9948. const char* begin, size_t len, ::std::ostream* os);
  9949. // This overload prints a (const) wchar_t array compactly.
  9950. GTEST_API_ void UniversalPrintArray(
  9951. const wchar_t* begin, size_t len, ::std::ostream* os);
  9952. // Implements printing an array type T[N].
  9953. template <typename T, size_t N>
  9954. class UniversalPrinter<T[N]> {
  9955. public:
  9956. // Prints the given array, omitting some elements when there are too
  9957. // many.
  9958. static void Print(const T (&a)[N], ::std::ostream* os) {
  9959. UniversalPrintArray(a, N, os);
  9960. }
  9961. };
  9962. // Implements printing a reference type T&.
  9963. template <typename T>
  9964. class UniversalPrinter<T&> {
  9965. public:
  9966. // MSVC warns about adding const to a function type, so we want to
  9967. // disable the warning.
  9968. GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
  9969. static void Print(const T& value, ::std::ostream* os) {
  9970. // Prints the address of the value. We use reinterpret_cast here
  9971. // as static_cast doesn't compile when T is a function type.
  9972. *os << "@" << reinterpret_cast<const void*>(&value) << " ";
  9973. // Then prints the value itself.
  9974. UniversalPrint(value, os);
  9975. }
  9976. GTEST_DISABLE_MSC_WARNINGS_POP_()
  9977. };
  9978. // Prints a value tersely: for a reference type, the referenced value
  9979. // (but not the address) is printed; for a (const) char pointer, the
  9980. // NUL-terminated string (but not the pointer) is printed.
  9981. template <typename T>
  9982. class UniversalTersePrinter {
  9983. public:
  9984. static void Print(const T& value, ::std::ostream* os) {
  9985. UniversalPrint(value, os);
  9986. }
  9987. };
  9988. template <typename T>
  9989. class UniversalTersePrinter<T&> {
  9990. public:
  9991. static void Print(const T& value, ::std::ostream* os) {
  9992. UniversalPrint(value, os);
  9993. }
  9994. };
  9995. template <typename T, size_t N>
  9996. class UniversalTersePrinter<T[N]> {
  9997. public:
  9998. static void Print(const T (&value)[N], ::std::ostream* os) {
  9999. UniversalPrinter<T[N]>::Print(value, os);
  10000. }
  10001. };
  10002. template <>
  10003. class UniversalTersePrinter<const char*> {
  10004. public:
  10005. static void Print(const char* str, ::std::ostream* os) {
  10006. if (str == NULL) {
  10007. *os << "NULL";
  10008. } else {
  10009. UniversalPrint(std::string(str), os);
  10010. }
  10011. }
  10012. };
  10013. template <>
  10014. class UniversalTersePrinter<char*> {
  10015. public:
  10016. static void Print(char* str, ::std::ostream* os) {
  10017. UniversalTersePrinter<const char*>::Print(str, os);
  10018. }
  10019. };
  10020. #if GTEST_HAS_STD_WSTRING
  10021. template <>
  10022. class UniversalTersePrinter<const wchar_t*> {
  10023. public:
  10024. static void Print(const wchar_t* str, ::std::ostream* os) {
  10025. if (str == NULL) {
  10026. *os << "NULL";
  10027. } else {
  10028. UniversalPrint(::std::wstring(str), os);
  10029. }
  10030. }
  10031. };
  10032. #endif
  10033. template <>
  10034. class UniversalTersePrinter<wchar_t*> {
  10035. public:
  10036. static void Print(wchar_t* str, ::std::ostream* os) {
  10037. UniversalTersePrinter<const wchar_t*>::Print(str, os);
  10038. }
  10039. };
  10040. template <typename T>
  10041. void UniversalTersePrint(const T& value, ::std::ostream* os) {
  10042. UniversalTersePrinter<T>::Print(value, os);
  10043. }
  10044. // Prints a value using the type inferred by the compiler. The
  10045. // difference between this and UniversalTersePrint() is that for a
  10046. // (const) char pointer, this prints both the pointer and the
  10047. // NUL-terminated string.
  10048. template <typename T>
  10049. void UniversalPrint(const T& value, ::std::ostream* os) {
  10050. // A workarond for the bug in VC++ 7.1 that prevents us from instantiating
  10051. // UniversalPrinter with T directly.
  10052. typedef T T1;
  10053. UniversalPrinter<T1>::Print(value, os);
  10054. }
  10055. typedef ::std::vector< ::std::string> Strings;
  10056. // TuplePolicy<TupleT> must provide:
  10057. // - tuple_size
  10058. // size of tuple TupleT.
  10059. // - get<size_t I>(const TupleT& t)
  10060. // static function extracting element I of tuple TupleT.
  10061. // - tuple_element<size_t I>::type
  10062. // type of element I of tuple TupleT.
  10063. template <typename TupleT>
  10064. struct TuplePolicy;
  10065. #if GTEST_HAS_TR1_TUPLE
  10066. template <typename TupleT>
  10067. struct TuplePolicy {
  10068. typedef TupleT Tuple;
  10069. static const size_t tuple_size = ::std::tr1::tuple_size<Tuple>::value;
  10070. template <size_t I>
  10071. struct tuple_element : ::std::tr1::tuple_element<static_cast<int>(I), Tuple> {
  10072. };
  10073. template <size_t I>
  10074. static typename AddReference<const typename ::std::tr1::tuple_element<
  10075. static_cast<int>(I), Tuple>::type>::type
  10076. get(const Tuple& tuple) {
  10077. return ::std::tr1::get<I>(tuple);
  10078. }
  10079. };
  10080. template <typename TupleT>
  10081. const size_t TuplePolicy<TupleT>::tuple_size;
  10082. #endif // GTEST_HAS_TR1_TUPLE
  10083. #if GTEST_HAS_STD_TUPLE_
  10084. template <typename... Types>
  10085. struct TuplePolicy< ::std::tuple<Types...> > {
  10086. typedef ::std::tuple<Types...> Tuple;
  10087. static const size_t tuple_size = ::std::tuple_size<Tuple>::value;
  10088. template <size_t I>
  10089. struct tuple_element : ::std::tuple_element<I, Tuple> {};
  10090. template <size_t I>
  10091. static const typename ::std::tuple_element<I, Tuple>::type& get(
  10092. const Tuple& tuple) {
  10093. return ::std::get<I>(tuple);
  10094. }
  10095. };
  10096. template <typename... Types>
  10097. const size_t TuplePolicy< ::std::tuple<Types...> >::tuple_size;
  10098. #endif // GTEST_HAS_STD_TUPLE_
  10099. #if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
  10100. // This helper template allows PrintTo() for tuples and
  10101. // UniversalTersePrintTupleFieldsToStrings() to be defined by
  10102. // induction on the number of tuple fields. The idea is that
  10103. // TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
  10104. // fields in tuple t, and can be defined in terms of
  10105. // TuplePrefixPrinter<N - 1>.
  10106. //
  10107. // The inductive case.
  10108. template <size_t N>
  10109. struct TuplePrefixPrinter {
  10110. // Prints the first N fields of a tuple.
  10111. template <typename Tuple>
  10112. static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
  10113. TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
  10114. GTEST_INTENTIONAL_CONST_COND_PUSH_()
  10115. if (N > 1) {
  10116. GTEST_INTENTIONAL_CONST_COND_POP_()
  10117. *os << ", ";
  10118. }
  10119. UniversalPrinter<
  10120. typename TuplePolicy<Tuple>::template tuple_element<N - 1>::type>
  10121. ::Print(TuplePolicy<Tuple>::template get<N - 1>(t), os);
  10122. }
  10123. // Tersely prints the first N fields of a tuple to a string vector,
  10124. // one element for each field.
  10125. template <typename Tuple>
  10126. static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
  10127. TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
  10128. ::std::stringstream ss;
  10129. UniversalTersePrint(TuplePolicy<Tuple>::template get<N - 1>(t), &ss);
  10130. strings->push_back(ss.str());
  10131. }
  10132. };
  10133. // Base case.
  10134. template <>
  10135. struct TuplePrefixPrinter<0> {
  10136. template <typename Tuple>
  10137. static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
  10138. template <typename Tuple>
  10139. static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
  10140. };
  10141. // Helper function for printing a tuple.
  10142. // Tuple must be either std::tr1::tuple or std::tuple type.
  10143. template <typename Tuple>
  10144. void PrintTupleTo(const Tuple& t, ::std::ostream* os) {
  10145. *os << "(";
  10146. TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::PrintPrefixTo(t, os);
  10147. *os << ")";
  10148. }
  10149. // Prints the fields of a tuple tersely to a string vector, one
  10150. // element for each field. See the comment before
  10151. // UniversalTersePrint() for how we define "tersely".
  10152. template <typename Tuple>
  10153. Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
  10154. Strings result;
  10155. TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::
  10156. TersePrintPrefixToStrings(value, &result);
  10157. return result;
  10158. }
  10159. #endif // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
  10160. } // namespace internal
  10161. #if GTEST_HAS_ABSL
  10162. namespace internal2 {
  10163. template <typename T>
  10164. void TypeWithoutFormatter<T, kConvertibleToStringView>::PrintValue(
  10165. const T& value, ::std::ostream* os) {
  10166. internal::PrintTo(absl::string_view(value), os);
  10167. }
  10168. } // namespace internal2
  10169. #endif
  10170. template <typename T>
  10171. ::std::string PrintToString(const T& value) {
  10172. ::std::stringstream ss;
  10173. internal::UniversalTersePrinter<T>::Print(value, &ss);
  10174. return ss.str();
  10175. }
  10176. } // namespace testing
  10177. // Include any custom printer added by the local installation.
  10178. // We must include this header at the end to make sure it can use the
  10179. // declarations from this file.
  10180. // Copyright 2015, Google Inc.
  10181. // All rights reserved.
  10182. //
  10183. // Redistribution and use in source and binary forms, with or without
  10184. // modification, are permitted provided that the following conditions are
  10185. // met:
  10186. //
  10187. // * Redistributions of source code must retain the above copyright
  10188. // notice, this list of conditions and the following disclaimer.
  10189. // * Redistributions in binary form must reproduce the above
  10190. // copyright notice, this list of conditions and the following disclaimer
  10191. // in the documentation and/or other materials provided with the
  10192. // distribution.
  10193. // * Neither the name of Google Inc. nor the names of its
  10194. // contributors may be used to endorse or promote products derived from
  10195. // this software without specific prior written permission.
  10196. //
  10197. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  10198. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  10199. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  10200. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  10201. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  10202. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  10203. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  10204. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  10205. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  10206. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  10207. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  10208. //
  10209. // This file provides an injection point for custom printers in a local
  10210. // installation of gTest.
  10211. // It will be included from gtest-printers.h and the overrides in this file
  10212. // will be visible to everyone.
  10213. //
  10214. // Injection point for custom user configurations. See README for details
  10215. //
  10216. // ** Custom implementation starts here **
  10217. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
  10218. #define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
  10219. #endif // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
  10220. #endif // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
  10221. namespace testing {
  10222. // Input to a parameterized test name generator, describing a test parameter.
  10223. // Consists of the parameter value and the integer parameter index.
  10224. template <class ParamType>
  10225. struct TestParamInfo {
  10226. TestParamInfo(const ParamType& a_param, size_t an_index) :
  10227. param(a_param),
  10228. index(an_index) {}
  10229. ParamType param;
  10230. size_t index;
  10231. };
  10232. // A builtin parameterized test name generator which returns the result of
  10233. // testing::PrintToString.
  10234. struct PrintToStringParamName {
  10235. template <class ParamType>
  10236. std::string operator()(const TestParamInfo<ParamType>& info) const {
  10237. return PrintToString(info.param);
  10238. }
  10239. };
  10240. namespace internal {
  10241. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  10242. //
  10243. // Outputs a message explaining invalid registration of different
  10244. // fixture class for the same test case. This may happen when
  10245. // TEST_P macro is used to define two tests with the same name
  10246. // but in different namespaces.
  10247. GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
  10248. CodeLocation code_location);
  10249. template <typename> class ParamGeneratorInterface;
  10250. template <typename> class ParamGenerator;
  10251. // Interface for iterating over elements provided by an implementation
  10252. // of ParamGeneratorInterface<T>.
  10253. template <typename T>
  10254. class ParamIteratorInterface {
  10255. public:
  10256. virtual ~ParamIteratorInterface() {}
  10257. // A pointer to the base generator instance.
  10258. // Used only for the purposes of iterator comparison
  10259. // to make sure that two iterators belong to the same generator.
  10260. virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
  10261. // Advances iterator to point to the next element
  10262. // provided by the generator. The caller is responsible
  10263. // for not calling Advance() on an iterator equal to
  10264. // BaseGenerator()->End().
  10265. virtual void Advance() = 0;
  10266. // Clones the iterator object. Used for implementing copy semantics
  10267. // of ParamIterator<T>.
  10268. virtual ParamIteratorInterface* Clone() const = 0;
  10269. // Dereferences the current iterator and provides (read-only) access
  10270. // to the pointed value. It is the caller's responsibility not to call
  10271. // Current() on an iterator equal to BaseGenerator()->End().
  10272. // Used for implementing ParamGenerator<T>::operator*().
  10273. virtual const T* Current() const = 0;
  10274. // Determines whether the given iterator and other point to the same
  10275. // element in the sequence generated by the generator.
  10276. // Used for implementing ParamGenerator<T>::operator==().
  10277. virtual bool Equals(const ParamIteratorInterface& other) const = 0;
  10278. };
  10279. // Class iterating over elements provided by an implementation of
  10280. // ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
  10281. // and implements the const forward iterator concept.
  10282. template <typename T>
  10283. class ParamIterator {
  10284. public:
  10285. typedef T value_type;
  10286. typedef const T& reference;
  10287. typedef ptrdiff_t difference_type;
  10288. // ParamIterator assumes ownership of the impl_ pointer.
  10289. ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
  10290. ParamIterator& operator=(const ParamIterator& other) {
  10291. if (this != &other)
  10292. impl_.reset(other.impl_->Clone());
  10293. return *this;
  10294. }
  10295. const T& operator*() const { return *impl_->Current(); }
  10296. const T* operator->() const { return impl_->Current(); }
  10297. // Prefix version of operator++.
  10298. ParamIterator& operator++() {
  10299. impl_->Advance();
  10300. return *this;
  10301. }
  10302. // Postfix version of operator++.
  10303. ParamIterator operator++(int /*unused*/) {
  10304. ParamIteratorInterface<T>* clone = impl_->Clone();
  10305. impl_->Advance();
  10306. return ParamIterator(clone);
  10307. }
  10308. bool operator==(const ParamIterator& other) const {
  10309. return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
  10310. }
  10311. bool operator!=(const ParamIterator& other) const {
  10312. return !(*this == other);
  10313. }
  10314. private:
  10315. friend class ParamGenerator<T>;
  10316. explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
  10317. scoped_ptr<ParamIteratorInterface<T> > impl_;
  10318. };
  10319. // ParamGeneratorInterface<T> is the binary interface to access generators
  10320. // defined in other translation units.
  10321. template <typename T>
  10322. class ParamGeneratorInterface {
  10323. public:
  10324. typedef T ParamType;
  10325. virtual ~ParamGeneratorInterface() {}
  10326. // Generator interface definition
  10327. virtual ParamIteratorInterface<T>* Begin() const = 0;
  10328. virtual ParamIteratorInterface<T>* End() const = 0;
  10329. };
  10330. // Wraps ParamGeneratorInterface<T> and provides general generator syntax
  10331. // compatible with the STL Container concept.
  10332. // This class implements copy initialization semantics and the contained
  10333. // ParamGeneratorInterface<T> instance is shared among all copies
  10334. // of the original object. This is possible because that instance is immutable.
  10335. template<typename T>
  10336. class ParamGenerator {
  10337. public:
  10338. typedef ParamIterator<T> iterator;
  10339. explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
  10340. ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
  10341. ParamGenerator& operator=(const ParamGenerator& other) {
  10342. impl_ = other.impl_;
  10343. return *this;
  10344. }
  10345. iterator begin() const { return iterator(impl_->Begin()); }
  10346. iterator end() const { return iterator(impl_->End()); }
  10347. private:
  10348. linked_ptr<const ParamGeneratorInterface<T> > impl_;
  10349. };
  10350. // Generates values from a range of two comparable values. Can be used to
  10351. // generate sequences of user-defined types that implement operator+() and
  10352. // operator<().
  10353. // This class is used in the Range() function.
  10354. template <typename T, typename IncrementT>
  10355. class RangeGenerator : public ParamGeneratorInterface<T> {
  10356. public:
  10357. RangeGenerator(T begin, T end, IncrementT step)
  10358. : begin_(begin), end_(end),
  10359. step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
  10360. virtual ~RangeGenerator() {}
  10361. virtual ParamIteratorInterface<T>* Begin() const {
  10362. return new Iterator(this, begin_, 0, step_);
  10363. }
  10364. virtual ParamIteratorInterface<T>* End() const {
  10365. return new Iterator(this, end_, end_index_, step_);
  10366. }
  10367. private:
  10368. class Iterator : public ParamIteratorInterface<T> {
  10369. public:
  10370. Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
  10371. IncrementT step)
  10372. : base_(base), value_(value), index_(index), step_(step) {}
  10373. virtual ~Iterator() {}
  10374. virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
  10375. return base_;
  10376. }
  10377. virtual void Advance() {
  10378. value_ = static_cast<T>(value_ + step_);
  10379. index_++;
  10380. }
  10381. virtual ParamIteratorInterface<T>* Clone() const {
  10382. return new Iterator(*this);
  10383. }
  10384. virtual const T* Current() const { return &value_; }
  10385. virtual bool Equals(const ParamIteratorInterface<T>& other) const {
  10386. // Having the same base generator guarantees that the other
  10387. // iterator is of the same type and we can downcast.
  10388. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  10389. << "The program attempted to compare iterators "
  10390. << "from different generators." << std::endl;
  10391. const int other_index =
  10392. CheckedDowncastToActualType<const Iterator>(&other)->index_;
  10393. return index_ == other_index;
  10394. }
  10395. private:
  10396. Iterator(const Iterator& other)
  10397. : ParamIteratorInterface<T>(),
  10398. base_(other.base_), value_(other.value_), index_(other.index_),
  10399. step_(other.step_) {}
  10400. // No implementation - assignment is unsupported.
  10401. void operator=(const Iterator& other);
  10402. const ParamGeneratorInterface<T>* const base_;
  10403. T value_;
  10404. int index_;
  10405. const IncrementT step_;
  10406. }; // class RangeGenerator::Iterator
  10407. static int CalculateEndIndex(const T& begin,
  10408. const T& end,
  10409. const IncrementT& step) {
  10410. int end_index = 0;
  10411. for (T i = begin; i < end; i = static_cast<T>(i + step))
  10412. end_index++;
  10413. return end_index;
  10414. }
  10415. // No implementation - assignment is unsupported.
  10416. void operator=(const RangeGenerator& other);
  10417. const T begin_;
  10418. const T end_;
  10419. const IncrementT step_;
  10420. // The index for the end() iterator. All the elements in the generated
  10421. // sequence are indexed (0-based) to aid iterator comparison.
  10422. const int end_index_;
  10423. }; // class RangeGenerator
  10424. // Generates values from a pair of STL-style iterators. Used in the
  10425. // ValuesIn() function. The elements are copied from the source range
  10426. // since the source can be located on the stack, and the generator
  10427. // is likely to persist beyond that stack frame.
  10428. template <typename T>
  10429. class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
  10430. public:
  10431. template <typename ForwardIterator>
  10432. ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
  10433. : container_(begin, end) {}
  10434. virtual ~ValuesInIteratorRangeGenerator() {}
  10435. virtual ParamIteratorInterface<T>* Begin() const {
  10436. return new Iterator(this, container_.begin());
  10437. }
  10438. virtual ParamIteratorInterface<T>* End() const {
  10439. return new Iterator(this, container_.end());
  10440. }
  10441. private:
  10442. typedef typename ::std::vector<T> ContainerType;
  10443. class Iterator : public ParamIteratorInterface<T> {
  10444. public:
  10445. Iterator(const ParamGeneratorInterface<T>* base,
  10446. typename ContainerType::const_iterator iterator)
  10447. : base_(base), iterator_(iterator) {}
  10448. virtual ~Iterator() {}
  10449. virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
  10450. return base_;
  10451. }
  10452. virtual void Advance() {
  10453. ++iterator_;
  10454. value_.reset();
  10455. }
  10456. virtual ParamIteratorInterface<T>* Clone() const {
  10457. return new Iterator(*this);
  10458. }
  10459. // We need to use cached value referenced by iterator_ because *iterator_
  10460. // can return a temporary object (and of type other then T), so just
  10461. // having "return &*iterator_;" doesn't work.
  10462. // value_ is updated here and not in Advance() because Advance()
  10463. // can advance iterator_ beyond the end of the range, and we cannot
  10464. // detect that fact. The client code, on the other hand, is
  10465. // responsible for not calling Current() on an out-of-range iterator.
  10466. virtual const T* Current() const {
  10467. if (value_.get() == NULL)
  10468. value_.reset(new T(*iterator_));
  10469. return value_.get();
  10470. }
  10471. virtual bool Equals(const ParamIteratorInterface<T>& other) const {
  10472. // Having the same base generator guarantees that the other
  10473. // iterator is of the same type and we can downcast.
  10474. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  10475. << "The program attempted to compare iterators "
  10476. << "from different generators." << std::endl;
  10477. return iterator_ ==
  10478. CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
  10479. }
  10480. private:
  10481. Iterator(const Iterator& other)
  10482. // The explicit constructor call suppresses a false warning
  10483. // emitted by gcc when supplied with the -Wextra option.
  10484. : ParamIteratorInterface<T>(),
  10485. base_(other.base_),
  10486. iterator_(other.iterator_) {}
  10487. const ParamGeneratorInterface<T>* const base_;
  10488. typename ContainerType::const_iterator iterator_;
  10489. // A cached value of *iterator_. We keep it here to allow access by
  10490. // pointer in the wrapping iterator's operator->().
  10491. // value_ needs to be mutable to be accessed in Current().
  10492. // Use of scoped_ptr helps manage cached value's lifetime,
  10493. // which is bound by the lifespan of the iterator itself.
  10494. mutable scoped_ptr<const T> value_;
  10495. }; // class ValuesInIteratorRangeGenerator::Iterator
  10496. // No implementation - assignment is unsupported.
  10497. void operator=(const ValuesInIteratorRangeGenerator& other);
  10498. const ContainerType container_;
  10499. }; // class ValuesInIteratorRangeGenerator
  10500. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  10501. //
  10502. // Default parameterized test name generator, returns a string containing the
  10503. // integer test parameter index.
  10504. template <class ParamType>
  10505. std::string DefaultParamName(const TestParamInfo<ParamType>& info) {
  10506. Message name_stream;
  10507. name_stream << info.index;
  10508. return name_stream.GetString();
  10509. }
  10510. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  10511. //
  10512. // Parameterized test name overload helpers, which help the
  10513. // INSTANTIATE_TEST_CASE_P macro choose between the default parameterized
  10514. // test name generator and user param name generator.
  10515. template <class ParamType, class ParamNameGenFunctor>
  10516. ParamNameGenFunctor GetParamNameGen(ParamNameGenFunctor func) {
  10517. return func;
  10518. }
  10519. template <class ParamType>
  10520. struct ParamNameGenFunc {
  10521. typedef std::string Type(const TestParamInfo<ParamType>&);
  10522. };
  10523. template <class ParamType>
  10524. typename ParamNameGenFunc<ParamType>::Type *GetParamNameGen() {
  10525. return DefaultParamName;
  10526. }
  10527. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  10528. //
  10529. // Stores a parameter value and later creates tests parameterized with that
  10530. // value.
  10531. template <class TestClass>
  10532. class ParameterizedTestFactory : public TestFactoryBase {
  10533. public:
  10534. typedef typename TestClass::ParamType ParamType;
  10535. explicit ParameterizedTestFactory(ParamType parameter) :
  10536. parameter_(parameter) {}
  10537. virtual Test* CreateTest() {
  10538. TestClass::SetParam(&parameter_);
  10539. return new TestClass();
  10540. }
  10541. private:
  10542. const ParamType parameter_;
  10543. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
  10544. };
  10545. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  10546. //
  10547. // TestMetaFactoryBase is a base class for meta-factories that create
  10548. // test factories for passing into MakeAndRegisterTestInfo function.
  10549. template <class ParamType>
  10550. class TestMetaFactoryBase {
  10551. public:
  10552. virtual ~TestMetaFactoryBase() {}
  10553. virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
  10554. };
  10555. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  10556. //
  10557. // TestMetaFactory creates test factories for passing into
  10558. // MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
  10559. // ownership of test factory pointer, same factory object cannot be passed
  10560. // into that method twice. But ParameterizedTestCaseInfo is going to call
  10561. // it for each Test/Parameter value combination. Thus it needs meta factory
  10562. // creator class.
  10563. template <class TestCase>
  10564. class TestMetaFactory
  10565. : public TestMetaFactoryBase<typename TestCase::ParamType> {
  10566. public:
  10567. typedef typename TestCase::ParamType ParamType;
  10568. TestMetaFactory() {}
  10569. virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
  10570. return new ParameterizedTestFactory<TestCase>(parameter);
  10571. }
  10572. private:
  10573. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
  10574. };
  10575. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  10576. //
  10577. // ParameterizedTestCaseInfoBase is a generic interface
  10578. // to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
  10579. // accumulates test information provided by TEST_P macro invocations
  10580. // and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
  10581. // and uses that information to register all resulting test instances
  10582. // in RegisterTests method. The ParameterizeTestCaseRegistry class holds
  10583. // a collection of pointers to the ParameterizedTestCaseInfo objects
  10584. // and calls RegisterTests() on each of them when asked.
  10585. class ParameterizedTestCaseInfoBase {
  10586. public:
  10587. virtual ~ParameterizedTestCaseInfoBase() {}
  10588. // Base part of test case name for display purposes.
  10589. virtual const std::string& GetTestCaseName() const = 0;
  10590. // Test case id to verify identity.
  10591. virtual TypeId GetTestCaseTypeId() const = 0;
  10592. // UnitTest class invokes this method to register tests in this
  10593. // test case right before running them in RUN_ALL_TESTS macro.
  10594. // This method should not be called more then once on any single
  10595. // instance of a ParameterizedTestCaseInfoBase derived class.
  10596. virtual void RegisterTests() = 0;
  10597. protected:
  10598. ParameterizedTestCaseInfoBase() {}
  10599. private:
  10600. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
  10601. };
  10602. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  10603. //
  10604. // ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
  10605. // macro invocations for a particular test case and generators
  10606. // obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
  10607. // test case. It registers tests with all values generated by all
  10608. // generators when asked.
  10609. template <class TestCase>
  10610. class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
  10611. public:
  10612. // ParamType and GeneratorCreationFunc are private types but are required
  10613. // for declarations of public methods AddTestPattern() and
  10614. // AddTestCaseInstantiation().
  10615. typedef typename TestCase::ParamType ParamType;
  10616. // A function that returns an instance of appropriate generator type.
  10617. typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
  10618. typedef typename ParamNameGenFunc<ParamType>::Type ParamNameGeneratorFunc;
  10619. explicit ParameterizedTestCaseInfo(
  10620. const char* name, CodeLocation code_location)
  10621. : test_case_name_(name), code_location_(code_location) {}
  10622. // Test case base name for display purposes.
  10623. virtual const std::string& GetTestCaseName() const { return test_case_name_; }
  10624. // Test case id to verify identity.
  10625. virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
  10626. // TEST_P macro uses AddTestPattern() to record information
  10627. // about a single test in a LocalTestInfo structure.
  10628. // test_case_name is the base name of the test case (without invocation
  10629. // prefix). test_base_name is the name of an individual test without
  10630. // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
  10631. // test case base name and DoBar is test base name.
  10632. void AddTestPattern(const char* test_case_name,
  10633. const char* test_base_name,
  10634. TestMetaFactoryBase<ParamType>* meta_factory) {
  10635. tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
  10636. test_base_name,
  10637. meta_factory)));
  10638. }
  10639. // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
  10640. // about a generator.
  10641. int AddTestCaseInstantiation(const std::string& instantiation_name,
  10642. GeneratorCreationFunc* func,
  10643. ParamNameGeneratorFunc* name_func,
  10644. const char* file, int line) {
  10645. instantiations_.push_back(
  10646. InstantiationInfo(instantiation_name, func, name_func, file, line));
  10647. return 0; // Return value used only to run this method in namespace scope.
  10648. }
  10649. // UnitTest class invokes this method to register tests in this test case
  10650. // test cases right before running tests in RUN_ALL_TESTS macro.
  10651. // This method should not be called more then once on any single
  10652. // instance of a ParameterizedTestCaseInfoBase derived class.
  10653. // UnitTest has a guard to prevent from calling this method more then once.
  10654. virtual void RegisterTests() {
  10655. for (typename TestInfoContainer::iterator test_it = tests_.begin();
  10656. test_it != tests_.end(); ++test_it) {
  10657. linked_ptr<TestInfo> test_info = *test_it;
  10658. for (typename InstantiationContainer::iterator gen_it =
  10659. instantiations_.begin(); gen_it != instantiations_.end();
  10660. ++gen_it) {
  10661. const std::string& instantiation_name = gen_it->name;
  10662. ParamGenerator<ParamType> generator((*gen_it->generator)());
  10663. ParamNameGeneratorFunc* name_func = gen_it->name_func;
  10664. const char* file = gen_it->file;
  10665. int line = gen_it->line;
  10666. std::string test_case_name;
  10667. if ( !instantiation_name.empty() )
  10668. test_case_name = instantiation_name + "/";
  10669. test_case_name += test_info->test_case_base_name;
  10670. size_t i = 0;
  10671. std::set<std::string> test_param_names;
  10672. for (typename ParamGenerator<ParamType>::iterator param_it =
  10673. generator.begin();
  10674. param_it != generator.end(); ++param_it, ++i) {
  10675. Message test_name_stream;
  10676. std::string param_name = name_func(
  10677. TestParamInfo<ParamType>(*param_it, i));
  10678. GTEST_CHECK_(IsValidParamName(param_name))
  10679. << "Parameterized test name '" << param_name
  10680. << "' is invalid, in " << file
  10681. << " line " << line << std::endl;
  10682. GTEST_CHECK_(test_param_names.count(param_name) == 0)
  10683. << "Duplicate parameterized test name '" << param_name
  10684. << "', in " << file << " line " << line << std::endl;
  10685. test_param_names.insert(param_name);
  10686. test_name_stream << test_info->test_base_name << "/" << param_name;
  10687. MakeAndRegisterTestInfo(
  10688. test_case_name.c_str(),
  10689. test_name_stream.GetString().c_str(),
  10690. NULL, // No type parameter.
  10691. PrintToString(*param_it).c_str(),
  10692. code_location_,
  10693. GetTestCaseTypeId(),
  10694. TestCase::SetUpTestCase,
  10695. TestCase::TearDownTestCase,
  10696. test_info->test_meta_factory->CreateTestFactory(*param_it));
  10697. } // for param_it
  10698. } // for gen_it
  10699. } // for test_it
  10700. } // RegisterTests
  10701. private:
  10702. // LocalTestInfo structure keeps information about a single test registered
  10703. // with TEST_P macro.
  10704. struct TestInfo {
  10705. TestInfo(const char* a_test_case_base_name,
  10706. const char* a_test_base_name,
  10707. TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
  10708. test_case_base_name(a_test_case_base_name),
  10709. test_base_name(a_test_base_name),
  10710. test_meta_factory(a_test_meta_factory) {}
  10711. const std::string test_case_base_name;
  10712. const std::string test_base_name;
  10713. const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
  10714. };
  10715. typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
  10716. // Records data received from INSTANTIATE_TEST_CASE_P macros:
  10717. // <Instantiation name, Sequence generator creation function,
  10718. // Name generator function, Source file, Source line>
  10719. struct InstantiationInfo {
  10720. InstantiationInfo(const std::string &name_in,
  10721. GeneratorCreationFunc* generator_in,
  10722. ParamNameGeneratorFunc* name_func_in,
  10723. const char* file_in,
  10724. int line_in)
  10725. : name(name_in),
  10726. generator(generator_in),
  10727. name_func(name_func_in),
  10728. file(file_in),
  10729. line(line_in) {}
  10730. std::string name;
  10731. GeneratorCreationFunc* generator;
  10732. ParamNameGeneratorFunc* name_func;
  10733. const char* file;
  10734. int line;
  10735. };
  10736. typedef ::std::vector<InstantiationInfo> InstantiationContainer;
  10737. static bool IsValidParamName(const std::string& name) {
  10738. // Check for empty string
  10739. if (name.empty())
  10740. return false;
  10741. // Check for invalid characters
  10742. for (std::string::size_type index = 0; index < name.size(); ++index) {
  10743. if (!isalnum(name[index]) && name[index] != '_')
  10744. return false;
  10745. }
  10746. return true;
  10747. }
  10748. const std::string test_case_name_;
  10749. CodeLocation code_location_;
  10750. TestInfoContainer tests_;
  10751. InstantiationContainer instantiations_;
  10752. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
  10753. }; // class ParameterizedTestCaseInfo
  10754. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  10755. //
  10756. // ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
  10757. // classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
  10758. // macros use it to locate their corresponding ParameterizedTestCaseInfo
  10759. // descriptors.
  10760. class ParameterizedTestCaseRegistry {
  10761. public:
  10762. ParameterizedTestCaseRegistry() {}
  10763. ~ParameterizedTestCaseRegistry() {
  10764. for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
  10765. it != test_case_infos_.end(); ++it) {
  10766. delete *it;
  10767. }
  10768. }
  10769. // Looks up or creates and returns a structure containing information about
  10770. // tests and instantiations of a particular test case.
  10771. template <class TestCase>
  10772. ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
  10773. const char* test_case_name,
  10774. CodeLocation code_location) {
  10775. ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
  10776. for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
  10777. it != test_case_infos_.end(); ++it) {
  10778. if ((*it)->GetTestCaseName() == test_case_name) {
  10779. if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
  10780. // Complain about incorrect usage of Google Test facilities
  10781. // and terminate the program since we cannot guaranty correct
  10782. // test case setup and tear-down in this case.
  10783. ReportInvalidTestCaseType(test_case_name, code_location);
  10784. posix::Abort();
  10785. } else {
  10786. // At this point we are sure that the object we found is of the same
  10787. // type we are looking for, so we downcast it to that type
  10788. // without further checks.
  10789. typed_test_info = CheckedDowncastToActualType<
  10790. ParameterizedTestCaseInfo<TestCase> >(*it);
  10791. }
  10792. break;
  10793. }
  10794. }
  10795. if (typed_test_info == NULL) {
  10796. typed_test_info = new ParameterizedTestCaseInfo<TestCase>(
  10797. test_case_name, code_location);
  10798. test_case_infos_.push_back(typed_test_info);
  10799. }
  10800. return typed_test_info;
  10801. }
  10802. void RegisterTests() {
  10803. for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
  10804. it != test_case_infos_.end(); ++it) {
  10805. (*it)->RegisterTests();
  10806. }
  10807. }
  10808. private:
  10809. typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
  10810. TestCaseInfoContainer test_case_infos_;
  10811. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
  10812. };
  10813. } // namespace internal
  10814. } // namespace testing
  10815. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
  10816. // This file was GENERATED by command:
  10817. // pump.py gtest-param-util-generated.h.pump
  10818. // DO NOT EDIT BY HAND!!!
  10819. // Copyright 2008 Google Inc.
  10820. // All Rights Reserved.
  10821. //
  10822. // Redistribution and use in source and binary forms, with or without
  10823. // modification, are permitted provided that the following conditions are
  10824. // met:
  10825. //
  10826. // * Redistributions of source code must retain the above copyright
  10827. // notice, this list of conditions and the following disclaimer.
  10828. // * Redistributions in binary form must reproduce the above
  10829. // copyright notice, this list of conditions and the following disclaimer
  10830. // in the documentation and/or other materials provided with the
  10831. // distribution.
  10832. // * Neither the name of Google Inc. nor the names of its
  10833. // contributors may be used to endorse or promote products derived from
  10834. // this software without specific prior written permission.
  10835. //
  10836. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  10837. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  10838. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  10839. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  10840. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  10841. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  10842. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  10843. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  10844. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  10845. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  10846. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  10847. // Type and function utilities for implementing parameterized tests.
  10848. // This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
  10849. //
  10850. // Currently Google Test supports at most 50 arguments in Values,
  10851. // and at most 10 arguments in Combine. Please contact
  10852. // googletestframework@googlegroups.com if you need more.
  10853. // Please note that the number of arguments to Combine is limited
  10854. // by the maximum arity of the implementation of tuple which is
  10855. // currently set at 10.
  10856. // GOOGLETEST_CM0001 DO NOT DELETE
  10857. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
  10858. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
  10859. namespace testing {
  10860. // Forward declarations of ValuesIn(), which is implemented in
  10861. // include/gtest/gtest-param-test.h.
  10862. template <typename ForwardIterator>
  10863. internal::ParamGenerator<
  10864. typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
  10865. ValuesIn(ForwardIterator begin, ForwardIterator end);
  10866. template <typename T, size_t N>
  10867. internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
  10868. template <class Container>
  10869. internal::ParamGenerator<typename Container::value_type> ValuesIn(
  10870. const Container& container);
  10871. namespace internal {
  10872. // Used in the Values() function to provide polymorphic capabilities.
  10873. template <typename T1>
  10874. class ValueArray1 {
  10875. public:
  10876. explicit ValueArray1(T1 v1) : v1_(v1) {}
  10877. template <typename T>
  10878. operator ParamGenerator<T>() const {
  10879. const T array[] = {static_cast<T>(v1_)};
  10880. return ValuesIn(array);
  10881. }
  10882. ValueArray1(const ValueArray1& other) : v1_(other.v1_) {}
  10883. private:
  10884. // No implementation - assignment is unsupported.
  10885. void operator=(const ValueArray1& other);
  10886. const T1 v1_;
  10887. };
  10888. template <typename T1, typename T2>
  10889. class ValueArray2 {
  10890. public:
  10891. ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
  10892. template <typename T>
  10893. operator ParamGenerator<T>() const {
  10894. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_)};
  10895. return ValuesIn(array);
  10896. }
  10897. ValueArray2(const ValueArray2& other) : v1_(other.v1_), v2_(other.v2_) {}
  10898. private:
  10899. // No implementation - assignment is unsupported.
  10900. void operator=(const ValueArray2& other);
  10901. const T1 v1_;
  10902. const T2 v2_;
  10903. };
  10904. template <typename T1, typename T2, typename T3>
  10905. class ValueArray3 {
  10906. public:
  10907. ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
  10908. template <typename T>
  10909. operator ParamGenerator<T>() const {
  10910. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10911. static_cast<T>(v3_)};
  10912. return ValuesIn(array);
  10913. }
  10914. ValueArray3(const ValueArray3& other) : v1_(other.v1_), v2_(other.v2_),
  10915. v3_(other.v3_) {}
  10916. private:
  10917. // No implementation - assignment is unsupported.
  10918. void operator=(const ValueArray3& other);
  10919. const T1 v1_;
  10920. const T2 v2_;
  10921. const T3 v3_;
  10922. };
  10923. template <typename T1, typename T2, typename T3, typename T4>
  10924. class ValueArray4 {
  10925. public:
  10926. ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
  10927. v4_(v4) {}
  10928. template <typename T>
  10929. operator ParamGenerator<T>() const {
  10930. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10931. static_cast<T>(v3_), static_cast<T>(v4_)};
  10932. return ValuesIn(array);
  10933. }
  10934. ValueArray4(const ValueArray4& other) : v1_(other.v1_), v2_(other.v2_),
  10935. v3_(other.v3_), v4_(other.v4_) {}
  10936. private:
  10937. // No implementation - assignment is unsupported.
  10938. void operator=(const ValueArray4& other);
  10939. const T1 v1_;
  10940. const T2 v2_;
  10941. const T3 v3_;
  10942. const T4 v4_;
  10943. };
  10944. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  10945. class ValueArray5 {
  10946. public:
  10947. ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
  10948. v4_(v4), v5_(v5) {}
  10949. template <typename T>
  10950. operator ParamGenerator<T>() const {
  10951. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10952. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_)};
  10953. return ValuesIn(array);
  10954. }
  10955. ValueArray5(const ValueArray5& other) : v1_(other.v1_), v2_(other.v2_),
  10956. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_) {}
  10957. private:
  10958. // No implementation - assignment is unsupported.
  10959. void operator=(const ValueArray5& other);
  10960. const T1 v1_;
  10961. const T2 v2_;
  10962. const T3 v3_;
  10963. const T4 v4_;
  10964. const T5 v5_;
  10965. };
  10966. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10967. typename T6>
  10968. class ValueArray6 {
  10969. public:
  10970. ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
  10971. v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
  10972. template <typename T>
  10973. operator ParamGenerator<T>() const {
  10974. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10975. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10976. static_cast<T>(v6_)};
  10977. return ValuesIn(array);
  10978. }
  10979. ValueArray6(const ValueArray6& other) : v1_(other.v1_), v2_(other.v2_),
  10980. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_) {}
  10981. private:
  10982. // No implementation - assignment is unsupported.
  10983. void operator=(const ValueArray6& other);
  10984. const T1 v1_;
  10985. const T2 v2_;
  10986. const T3 v3_;
  10987. const T4 v4_;
  10988. const T5 v5_;
  10989. const T6 v6_;
  10990. };
  10991. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10992. typename T6, typename T7>
  10993. class ValueArray7 {
  10994. public:
  10995. ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
  10996. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
  10997. template <typename T>
  10998. operator ParamGenerator<T>() const {
  10999. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11000. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11001. static_cast<T>(v6_), static_cast<T>(v7_)};
  11002. return ValuesIn(array);
  11003. }
  11004. ValueArray7(const ValueArray7& other) : v1_(other.v1_), v2_(other.v2_),
  11005. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  11006. v7_(other.v7_) {}
  11007. private:
  11008. // No implementation - assignment is unsupported.
  11009. void operator=(const ValueArray7& other);
  11010. const T1 v1_;
  11011. const T2 v2_;
  11012. const T3 v3_;
  11013. const T4 v4_;
  11014. const T5 v5_;
  11015. const T6 v6_;
  11016. const T7 v7_;
  11017. };
  11018. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11019. typename T6, typename T7, typename T8>
  11020. class ValueArray8 {
  11021. public:
  11022. ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  11023. T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11024. v8_(v8) {}
  11025. template <typename T>
  11026. operator ParamGenerator<T>() const {
  11027. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11028. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11029. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_)};
  11030. return ValuesIn(array);
  11031. }
  11032. ValueArray8(const ValueArray8& other) : v1_(other.v1_), v2_(other.v2_),
  11033. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  11034. v7_(other.v7_), v8_(other.v8_) {}
  11035. private:
  11036. // No implementation - assignment is unsupported.
  11037. void operator=(const ValueArray8& other);
  11038. const T1 v1_;
  11039. const T2 v2_;
  11040. const T3 v3_;
  11041. const T4 v4_;
  11042. const T5 v5_;
  11043. const T6 v6_;
  11044. const T7 v7_;
  11045. const T8 v8_;
  11046. };
  11047. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11048. typename T6, typename T7, typename T8, typename T9>
  11049. class ValueArray9 {
  11050. public:
  11051. ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  11052. T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11053. v8_(v8), v9_(v9) {}
  11054. template <typename T>
  11055. operator ParamGenerator<T>() const {
  11056. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11057. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11058. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11059. static_cast<T>(v9_)};
  11060. return ValuesIn(array);
  11061. }
  11062. ValueArray9(const ValueArray9& other) : v1_(other.v1_), v2_(other.v2_),
  11063. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  11064. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_) {}
  11065. private:
  11066. // No implementation - assignment is unsupported.
  11067. void operator=(const ValueArray9& other);
  11068. const T1 v1_;
  11069. const T2 v2_;
  11070. const T3 v3_;
  11071. const T4 v4_;
  11072. const T5 v5_;
  11073. const T6 v6_;
  11074. const T7 v7_;
  11075. const T8 v8_;
  11076. const T9 v9_;
  11077. };
  11078. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11079. typename T6, typename T7, typename T8, typename T9, typename T10>
  11080. class ValueArray10 {
  11081. public:
  11082. ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11083. T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11084. v8_(v8), v9_(v9), v10_(v10) {}
  11085. template <typename T>
  11086. operator ParamGenerator<T>() const {
  11087. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11088. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11089. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11090. static_cast<T>(v9_), static_cast<T>(v10_)};
  11091. return ValuesIn(array);
  11092. }
  11093. ValueArray10(const ValueArray10& other) : v1_(other.v1_), v2_(other.v2_),
  11094. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  11095. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_) {}
  11096. private:
  11097. // No implementation - assignment is unsupported.
  11098. void operator=(const ValueArray10& other);
  11099. const T1 v1_;
  11100. const T2 v2_;
  11101. const T3 v3_;
  11102. const T4 v4_;
  11103. const T5 v5_;
  11104. const T6 v6_;
  11105. const T7 v7_;
  11106. const T8 v8_;
  11107. const T9 v9_;
  11108. const T10 v10_;
  11109. };
  11110. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11111. typename T6, typename T7, typename T8, typename T9, typename T10,
  11112. typename T11>
  11113. class ValueArray11 {
  11114. public:
  11115. ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11116. T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  11117. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
  11118. template <typename T>
  11119. operator ParamGenerator<T>() const {
  11120. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11121. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11122. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11123. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_)};
  11124. return ValuesIn(array);
  11125. }
  11126. ValueArray11(const ValueArray11& other) : v1_(other.v1_), v2_(other.v2_),
  11127. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  11128. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  11129. v11_(other.v11_) {}
  11130. private:
  11131. // No implementation - assignment is unsupported.
  11132. void operator=(const ValueArray11& other);
  11133. const T1 v1_;
  11134. const T2 v2_;
  11135. const T3 v3_;
  11136. const T4 v4_;
  11137. const T5 v5_;
  11138. const T6 v6_;
  11139. const T7 v7_;
  11140. const T8 v8_;
  11141. const T9 v9_;
  11142. const T10 v10_;
  11143. const T11 v11_;
  11144. };
  11145. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11146. typename T6, typename T7, typename T8, typename T9, typename T10,
  11147. typename T11, typename T12>
  11148. class ValueArray12 {
  11149. public:
  11150. ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11151. T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  11152. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
  11153. template <typename T>
  11154. operator ParamGenerator<T>() const {
  11155. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11156. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11157. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11158. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11159. static_cast<T>(v12_)};
  11160. return ValuesIn(array);
  11161. }
  11162. ValueArray12(const ValueArray12& other) : v1_(other.v1_), v2_(other.v2_),
  11163. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  11164. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  11165. v11_(other.v11_), v12_(other.v12_) {}
  11166. private:
  11167. // No implementation - assignment is unsupported.
  11168. void operator=(const ValueArray12& other);
  11169. const T1 v1_;
  11170. const T2 v2_;
  11171. const T3 v3_;
  11172. const T4 v4_;
  11173. const T5 v5_;
  11174. const T6 v6_;
  11175. const T7 v7_;
  11176. const T8 v8_;
  11177. const T9 v9_;
  11178. const T10 v10_;
  11179. const T11 v11_;
  11180. const T12 v12_;
  11181. };
  11182. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11183. typename T6, typename T7, typename T8, typename T9, typename T10,
  11184. typename T11, typename T12, typename T13>
  11185. class ValueArray13 {
  11186. public:
  11187. ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11188. T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  11189. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  11190. v12_(v12), v13_(v13) {}
  11191. template <typename T>
  11192. operator ParamGenerator<T>() const {
  11193. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11194. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11195. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11196. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11197. static_cast<T>(v12_), static_cast<T>(v13_)};
  11198. return ValuesIn(array);
  11199. }
  11200. ValueArray13(const ValueArray13& other) : v1_(other.v1_), v2_(other.v2_),
  11201. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  11202. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  11203. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_) {}
  11204. private:
  11205. // No implementation - assignment is unsupported.
  11206. void operator=(const ValueArray13& other);
  11207. const T1 v1_;
  11208. const T2 v2_;
  11209. const T3 v3_;
  11210. const T4 v4_;
  11211. const T5 v5_;
  11212. const T6 v6_;
  11213. const T7 v7_;
  11214. const T8 v8_;
  11215. const T9 v9_;
  11216. const T10 v10_;
  11217. const T11 v11_;
  11218. const T12 v12_;
  11219. const T13 v13_;
  11220. };
  11221. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11222. typename T6, typename T7, typename T8, typename T9, typename T10,
  11223. typename T11, typename T12, typename T13, typename T14>
  11224. class ValueArray14 {
  11225. public:
  11226. ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11227. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
  11228. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11229. v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
  11230. template <typename T>
  11231. operator ParamGenerator<T>() const {
  11232. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11233. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11234. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11235. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11236. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_)};
  11237. return ValuesIn(array);
  11238. }
  11239. ValueArray14(const ValueArray14& other) : v1_(other.v1_), v2_(other.v2_),
  11240. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  11241. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  11242. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_) {}
  11243. private:
  11244. // No implementation - assignment is unsupported.
  11245. void operator=(const ValueArray14& other);
  11246. const T1 v1_;
  11247. const T2 v2_;
  11248. const T3 v3_;
  11249. const T4 v4_;
  11250. const T5 v5_;
  11251. const T6 v6_;
  11252. const T7 v7_;
  11253. const T8 v8_;
  11254. const T9 v9_;
  11255. const T10 v10_;
  11256. const T11 v11_;
  11257. const T12 v12_;
  11258. const T13 v13_;
  11259. const T14 v14_;
  11260. };
  11261. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11262. typename T6, typename T7, typename T8, typename T9, typename T10,
  11263. typename T11, typename T12, typename T13, typename T14, typename T15>
  11264. class ValueArray15 {
  11265. public:
  11266. ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11267. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
  11268. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11269. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
  11270. template <typename T>
  11271. operator ParamGenerator<T>() const {
  11272. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11273. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11274. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11275. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11276. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11277. static_cast<T>(v15_)};
  11278. return ValuesIn(array);
  11279. }
  11280. ValueArray15(const ValueArray15& other) : v1_(other.v1_), v2_(other.v2_),
  11281. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  11282. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  11283. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  11284. v15_(other.v15_) {}
  11285. private:
  11286. // No implementation - assignment is unsupported.
  11287. void operator=(const ValueArray15& other);
  11288. const T1 v1_;
  11289. const T2 v2_;
  11290. const T3 v3_;
  11291. const T4 v4_;
  11292. const T5 v5_;
  11293. const T6 v6_;
  11294. const T7 v7_;
  11295. const T8 v8_;
  11296. const T9 v9_;
  11297. const T10 v10_;
  11298. const T11 v11_;
  11299. const T12 v12_;
  11300. const T13 v13_;
  11301. const T14 v14_;
  11302. const T15 v15_;
  11303. };
  11304. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11305. typename T6, typename T7, typename T8, typename T9, typename T10,
  11306. typename T11, typename T12, typename T13, typename T14, typename T15,
  11307. typename T16>
  11308. class ValueArray16 {
  11309. public:
  11310. ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11311. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
  11312. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  11313. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  11314. v16_(v16) {}
  11315. template <typename T>
  11316. operator ParamGenerator<T>() const {
  11317. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11318. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11319. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11320. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11321. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11322. static_cast<T>(v15_), static_cast<T>(v16_)};
  11323. return ValuesIn(array);
  11324. }
  11325. ValueArray16(const ValueArray16& other) : v1_(other.v1_), v2_(other.v2_),
  11326. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  11327. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  11328. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  11329. v15_(other.v15_), v16_(other.v16_) {}
  11330. private:
  11331. // No implementation - assignment is unsupported.
  11332. void operator=(const ValueArray16& other);
  11333. const T1 v1_;
  11334. const T2 v2_;
  11335. const T3 v3_;
  11336. const T4 v4_;
  11337. const T5 v5_;
  11338. const T6 v6_;
  11339. const T7 v7_;
  11340. const T8 v8_;
  11341. const T9 v9_;
  11342. const T10 v10_;
  11343. const T11 v11_;
  11344. const T12 v12_;
  11345. const T13 v13_;
  11346. const T14 v14_;
  11347. const T15 v15_;
  11348. const T16 v16_;
  11349. };
  11350. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11351. typename T6, typename T7, typename T8, typename T9, typename T10,
  11352. typename T11, typename T12, typename T13, typename T14, typename T15,
  11353. typename T16, typename T17>
  11354. class ValueArray17 {
  11355. public:
  11356. ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11357. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
  11358. T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11359. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11360. v15_(v15), v16_(v16), v17_(v17) {}
  11361. template <typename T>
  11362. operator ParamGenerator<T>() const {
  11363. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11364. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11365. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11366. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11367. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11368. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_)};
  11369. return ValuesIn(array);
  11370. }
  11371. ValueArray17(const ValueArray17& other) : v1_(other.v1_), v2_(other.v2_),
  11372. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  11373. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  11374. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  11375. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_) {}
  11376. private:
  11377. // No implementation - assignment is unsupported.
  11378. void operator=(const ValueArray17& other);
  11379. const T1 v1_;
  11380. const T2 v2_;
  11381. const T3 v3_;
  11382. const T4 v4_;
  11383. const T5 v5_;
  11384. const T6 v6_;
  11385. const T7 v7_;
  11386. const T8 v8_;
  11387. const T9 v9_;
  11388. const T10 v10_;
  11389. const T11 v11_;
  11390. const T12 v12_;
  11391. const T13 v13_;
  11392. const T14 v14_;
  11393. const T15 v15_;
  11394. const T16 v16_;
  11395. const T17 v17_;
  11396. };
  11397. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11398. typename T6, typename T7, typename T8, typename T9, typename T10,
  11399. typename T11, typename T12, typename T13, typename T14, typename T15,
  11400. typename T16, typename T17, typename T18>
  11401. class ValueArray18 {
  11402. public:
  11403. ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11404. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11405. T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11406. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11407. v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
  11408. template <typename T>
  11409. operator ParamGenerator<T>() const {
  11410. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11411. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11412. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11413. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11414. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11415. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11416. static_cast<T>(v18_)};
  11417. return ValuesIn(array);
  11418. }
  11419. ValueArray18(const ValueArray18& other) : v1_(other.v1_), v2_(other.v2_),
  11420. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  11421. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  11422. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  11423. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_) {}
  11424. private:
  11425. // No implementation - assignment is unsupported.
  11426. void operator=(const ValueArray18& other);
  11427. const T1 v1_;
  11428. const T2 v2_;
  11429. const T3 v3_;
  11430. const T4 v4_;
  11431. const T5 v5_;
  11432. const T6 v6_;
  11433. const T7 v7_;
  11434. const T8 v8_;
  11435. const T9 v9_;
  11436. const T10 v10_;
  11437. const T11 v11_;
  11438. const T12 v12_;
  11439. const T13 v13_;
  11440. const T14 v14_;
  11441. const T15 v15_;
  11442. const T16 v16_;
  11443. const T17 v17_;
  11444. const T18 v18_;
  11445. };
  11446. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11447. typename T6, typename T7, typename T8, typename T9, typename T10,
  11448. typename T11, typename T12, typename T13, typename T14, typename T15,
  11449. typename T16, typename T17, typename T18, typename T19>
  11450. class ValueArray19 {
  11451. public:
  11452. ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11453. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11454. T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  11455. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  11456. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
  11457. template <typename T>
  11458. operator ParamGenerator<T>() const {
  11459. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11460. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11461. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11462. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11463. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11464. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11465. static_cast<T>(v18_), static_cast<T>(v19_)};
  11466. return ValuesIn(array);
  11467. }
  11468. ValueArray19(const ValueArray19& other) : v1_(other.v1_), v2_(other.v2_),
  11469. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  11470. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  11471. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  11472. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  11473. v19_(other.v19_) {}
  11474. private:
  11475. // No implementation - assignment is unsupported.
  11476. void operator=(const ValueArray19& other);
  11477. const T1 v1_;
  11478. const T2 v2_;
  11479. const T3 v3_;
  11480. const T4 v4_;
  11481. const T5 v5_;
  11482. const T6 v6_;
  11483. const T7 v7_;
  11484. const T8 v8_;
  11485. const T9 v9_;
  11486. const T10 v10_;
  11487. const T11 v11_;
  11488. const T12 v12_;
  11489. const T13 v13_;
  11490. const T14 v14_;
  11491. const T15 v15_;
  11492. const T16 v16_;
  11493. const T17 v17_;
  11494. const T18 v18_;
  11495. const T19 v19_;
  11496. };
  11497. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11498. typename T6, typename T7, typename T8, typename T9, typename T10,
  11499. typename T11, typename T12, typename T13, typename T14, typename T15,
  11500. typename T16, typename T17, typename T18, typename T19, typename T20>
  11501. class ValueArray20 {
  11502. public:
  11503. ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11504. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11505. T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  11506. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  11507. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  11508. v19_(v19), v20_(v20) {}
  11509. template <typename T>
  11510. operator ParamGenerator<T>() const {
  11511. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11512. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11513. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11514. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11515. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11516. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11517. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_)};
  11518. return ValuesIn(array);
  11519. }
  11520. ValueArray20(const ValueArray20& other) : v1_(other.v1_), v2_(other.v2_),
  11521. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  11522. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  11523. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  11524. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  11525. v19_(other.v19_), v20_(other.v20_) {}
  11526. private:
  11527. // No implementation - assignment is unsupported.
  11528. void operator=(const ValueArray20& other);
  11529. const T1 v1_;
  11530. const T2 v2_;
  11531. const T3 v3_;
  11532. const T4 v4_;
  11533. const T5 v5_;
  11534. const T6 v6_;
  11535. const T7 v7_;
  11536. const T8 v8_;
  11537. const T9 v9_;
  11538. const T10 v10_;
  11539. const T11 v11_;
  11540. const T12 v12_;
  11541. const T13 v13_;
  11542. const T14 v14_;
  11543. const T15 v15_;
  11544. const T16 v16_;
  11545. const T17 v17_;
  11546. const T18 v18_;
  11547. const T19 v19_;
  11548. const T20 v20_;
  11549. };
  11550. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11551. typename T6, typename T7, typename T8, typename T9, typename T10,
  11552. typename T11, typename T12, typename T13, typename T14, typename T15,
  11553. typename T16, typename T17, typename T18, typename T19, typename T20,
  11554. typename T21>
  11555. class ValueArray21 {
  11556. public:
  11557. ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11558. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11559. T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  11560. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  11561. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  11562. v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
  11563. template <typename T>
  11564. operator ParamGenerator<T>() const {
  11565. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11566. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11567. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11568. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11569. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11570. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11571. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11572. static_cast<T>(v21_)};
  11573. return ValuesIn(array);
  11574. }
  11575. ValueArray21(const ValueArray21& other) : v1_(other.v1_), v2_(other.v2_),
  11576. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  11577. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  11578. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  11579. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  11580. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_) {}
  11581. private:
  11582. // No implementation - assignment is unsupported.
  11583. void operator=(const ValueArray21& other);
  11584. const T1 v1_;
  11585. const T2 v2_;
  11586. const T3 v3_;
  11587. const T4 v4_;
  11588. const T5 v5_;
  11589. const T6 v6_;
  11590. const T7 v7_;
  11591. const T8 v8_;
  11592. const T9 v9_;
  11593. const T10 v10_;
  11594. const T11 v11_;
  11595. const T12 v12_;
  11596. const T13 v13_;
  11597. const T14 v14_;
  11598. const T15 v15_;
  11599. const T16 v16_;
  11600. const T17 v17_;
  11601. const T18 v18_;
  11602. const T19 v19_;
  11603. const T20 v20_;
  11604. const T21 v21_;
  11605. };
  11606. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11607. typename T6, typename T7, typename T8, typename T9, typename T10,
  11608. typename T11, typename T12, typename T13, typename T14, typename T15,
  11609. typename T16, typename T17, typename T18, typename T19, typename T20,
  11610. typename T21, typename T22>
  11611. class ValueArray22 {
  11612. public:
  11613. ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11614. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11615. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
  11616. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11617. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  11618. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
  11619. template <typename T>
  11620. operator ParamGenerator<T>() const {
  11621. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11622. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11623. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11624. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11625. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11626. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11627. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11628. static_cast<T>(v21_), static_cast<T>(v22_)};
  11629. return ValuesIn(array);
  11630. }
  11631. ValueArray22(const ValueArray22& other) : v1_(other.v1_), v2_(other.v2_),
  11632. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  11633. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  11634. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  11635. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  11636. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_) {}
  11637. private:
  11638. // No implementation - assignment is unsupported.
  11639. void operator=(const ValueArray22& other);
  11640. const T1 v1_;
  11641. const T2 v2_;
  11642. const T3 v3_;
  11643. const T4 v4_;
  11644. const T5 v5_;
  11645. const T6 v6_;
  11646. const T7 v7_;
  11647. const T8 v8_;
  11648. const T9 v9_;
  11649. const T10 v10_;
  11650. const T11 v11_;
  11651. const T12 v12_;
  11652. const T13 v13_;
  11653. const T14 v14_;
  11654. const T15 v15_;
  11655. const T16 v16_;
  11656. const T17 v17_;
  11657. const T18 v18_;
  11658. const T19 v19_;
  11659. const T20 v20_;
  11660. const T21 v21_;
  11661. const T22 v22_;
  11662. };
  11663. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11664. typename T6, typename T7, typename T8, typename T9, typename T10,
  11665. typename T11, typename T12, typename T13, typename T14, typename T15,
  11666. typename T16, typename T17, typename T18, typename T19, typename T20,
  11667. typename T21, typename T22, typename T23>
  11668. class ValueArray23 {
  11669. public:
  11670. ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11671. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11672. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
  11673. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11674. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  11675. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  11676. v23_(v23) {}
  11677. template <typename T>
  11678. operator ParamGenerator<T>() const {
  11679. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11680. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11681. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11682. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11683. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11684. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11685. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11686. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_)};
  11687. return ValuesIn(array);
  11688. }
  11689. ValueArray23(const ValueArray23& other) : v1_(other.v1_), v2_(other.v2_),
  11690. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  11691. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  11692. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  11693. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  11694. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  11695. v23_(other.v23_) {}
  11696. private:
  11697. // No implementation - assignment is unsupported.
  11698. void operator=(const ValueArray23& other);
  11699. const T1 v1_;
  11700. const T2 v2_;
  11701. const T3 v3_;
  11702. const T4 v4_;
  11703. const T5 v5_;
  11704. const T6 v6_;
  11705. const T7 v7_;
  11706. const T8 v8_;
  11707. const T9 v9_;
  11708. const T10 v10_;
  11709. const T11 v11_;
  11710. const T12 v12_;
  11711. const T13 v13_;
  11712. const T14 v14_;
  11713. const T15 v15_;
  11714. const T16 v16_;
  11715. const T17 v17_;
  11716. const T18 v18_;
  11717. const T19 v19_;
  11718. const T20 v20_;
  11719. const T21 v21_;
  11720. const T22 v22_;
  11721. const T23 v23_;
  11722. };
  11723. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11724. typename T6, typename T7, typename T8, typename T9, typename T10,
  11725. typename T11, typename T12, typename T13, typename T14, typename T15,
  11726. typename T16, typename T17, typename T18, typename T19, typename T20,
  11727. typename T21, typename T22, typename T23, typename T24>
  11728. class ValueArray24 {
  11729. public:
  11730. ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11731. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11732. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
  11733. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  11734. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  11735. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  11736. v22_(v22), v23_(v23), v24_(v24) {}
  11737. template <typename T>
  11738. operator ParamGenerator<T>() const {
  11739. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11740. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11741. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11742. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11743. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11744. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11745. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11746. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11747. static_cast<T>(v24_)};
  11748. return ValuesIn(array);
  11749. }
  11750. ValueArray24(const ValueArray24& other) : v1_(other.v1_), v2_(other.v2_),
  11751. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  11752. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  11753. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  11754. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  11755. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  11756. v23_(other.v23_), v24_(other.v24_) {}
  11757. private:
  11758. // No implementation - assignment is unsupported.
  11759. void operator=(const ValueArray24& other);
  11760. const T1 v1_;
  11761. const T2 v2_;
  11762. const T3 v3_;
  11763. const T4 v4_;
  11764. const T5 v5_;
  11765. const T6 v6_;
  11766. const T7 v7_;
  11767. const T8 v8_;
  11768. const T9 v9_;
  11769. const T10 v10_;
  11770. const T11 v11_;
  11771. const T12 v12_;
  11772. const T13 v13_;
  11773. const T14 v14_;
  11774. const T15 v15_;
  11775. const T16 v16_;
  11776. const T17 v17_;
  11777. const T18 v18_;
  11778. const T19 v19_;
  11779. const T20 v20_;
  11780. const T21 v21_;
  11781. const T22 v22_;
  11782. const T23 v23_;
  11783. const T24 v24_;
  11784. };
  11785. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11786. typename T6, typename T7, typename T8, typename T9, typename T10,
  11787. typename T11, typename T12, typename T13, typename T14, typename T15,
  11788. typename T16, typename T17, typename T18, typename T19, typename T20,
  11789. typename T21, typename T22, typename T23, typename T24, typename T25>
  11790. class ValueArray25 {
  11791. public:
  11792. ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11793. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11794. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
  11795. T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11796. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11797. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  11798. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
  11799. template <typename T>
  11800. operator ParamGenerator<T>() const {
  11801. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11802. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11803. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11804. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11805. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11806. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11807. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11808. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11809. static_cast<T>(v24_), static_cast<T>(v25_)};
  11810. return ValuesIn(array);
  11811. }
  11812. ValueArray25(const ValueArray25& other) : v1_(other.v1_), v2_(other.v2_),
  11813. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  11814. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  11815. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  11816. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  11817. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  11818. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_) {}
  11819. private:
  11820. // No implementation - assignment is unsupported.
  11821. void operator=(const ValueArray25& other);
  11822. const T1 v1_;
  11823. const T2 v2_;
  11824. const T3 v3_;
  11825. const T4 v4_;
  11826. const T5 v5_;
  11827. const T6 v6_;
  11828. const T7 v7_;
  11829. const T8 v8_;
  11830. const T9 v9_;
  11831. const T10 v10_;
  11832. const T11 v11_;
  11833. const T12 v12_;
  11834. const T13 v13_;
  11835. const T14 v14_;
  11836. const T15 v15_;
  11837. const T16 v16_;
  11838. const T17 v17_;
  11839. const T18 v18_;
  11840. const T19 v19_;
  11841. const T20 v20_;
  11842. const T21 v21_;
  11843. const T22 v22_;
  11844. const T23 v23_;
  11845. const T24 v24_;
  11846. const T25 v25_;
  11847. };
  11848. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11849. typename T6, typename T7, typename T8, typename T9, typename T10,
  11850. typename T11, typename T12, typename T13, typename T14, typename T15,
  11851. typename T16, typename T17, typename T18, typename T19, typename T20,
  11852. typename T21, typename T22, typename T23, typename T24, typename T25,
  11853. typename T26>
  11854. class ValueArray26 {
  11855. public:
  11856. ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11857. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11858. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11859. T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11860. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11861. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  11862. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
  11863. template <typename T>
  11864. operator ParamGenerator<T>() const {
  11865. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11866. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11867. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11868. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11869. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11870. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11871. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11872. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11873. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_)};
  11874. return ValuesIn(array);
  11875. }
  11876. ValueArray26(const ValueArray26& other) : v1_(other.v1_), v2_(other.v2_),
  11877. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  11878. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  11879. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  11880. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  11881. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  11882. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_) {}
  11883. private:
  11884. // No implementation - assignment is unsupported.
  11885. void operator=(const ValueArray26& other);
  11886. const T1 v1_;
  11887. const T2 v2_;
  11888. const T3 v3_;
  11889. const T4 v4_;
  11890. const T5 v5_;
  11891. const T6 v6_;
  11892. const T7 v7_;
  11893. const T8 v8_;
  11894. const T9 v9_;
  11895. const T10 v10_;
  11896. const T11 v11_;
  11897. const T12 v12_;
  11898. const T13 v13_;
  11899. const T14 v14_;
  11900. const T15 v15_;
  11901. const T16 v16_;
  11902. const T17 v17_;
  11903. const T18 v18_;
  11904. const T19 v19_;
  11905. const T20 v20_;
  11906. const T21 v21_;
  11907. const T22 v22_;
  11908. const T23 v23_;
  11909. const T24 v24_;
  11910. const T25 v25_;
  11911. const T26 v26_;
  11912. };
  11913. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11914. typename T6, typename T7, typename T8, typename T9, typename T10,
  11915. typename T11, typename T12, typename T13, typename T14, typename T15,
  11916. typename T16, typename T17, typename T18, typename T19, typename T20,
  11917. typename T21, typename T22, typename T23, typename T24, typename T25,
  11918. typename T26, typename T27>
  11919. class ValueArray27 {
  11920. public:
  11921. ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11922. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11923. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11924. T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  11925. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  11926. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
  11927. v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
  11928. v26_(v26), v27_(v27) {}
  11929. template <typename T>
  11930. operator ParamGenerator<T>() const {
  11931. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11932. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11933. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11934. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11935. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11936. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11937. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11938. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11939. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  11940. static_cast<T>(v27_)};
  11941. return ValuesIn(array);
  11942. }
  11943. ValueArray27(const ValueArray27& other) : v1_(other.v1_), v2_(other.v2_),
  11944. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  11945. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  11946. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  11947. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  11948. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  11949. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  11950. v27_(other.v27_) {}
  11951. private:
  11952. // No implementation - assignment is unsupported.
  11953. void operator=(const ValueArray27& other);
  11954. const T1 v1_;
  11955. const T2 v2_;
  11956. const T3 v3_;
  11957. const T4 v4_;
  11958. const T5 v5_;
  11959. const T6 v6_;
  11960. const T7 v7_;
  11961. const T8 v8_;
  11962. const T9 v9_;
  11963. const T10 v10_;
  11964. const T11 v11_;
  11965. const T12 v12_;
  11966. const T13 v13_;
  11967. const T14 v14_;
  11968. const T15 v15_;
  11969. const T16 v16_;
  11970. const T17 v17_;
  11971. const T18 v18_;
  11972. const T19 v19_;
  11973. const T20 v20_;
  11974. const T21 v21_;
  11975. const T22 v22_;
  11976. const T23 v23_;
  11977. const T24 v24_;
  11978. const T25 v25_;
  11979. const T26 v26_;
  11980. const T27 v27_;
  11981. };
  11982. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11983. typename T6, typename T7, typename T8, typename T9, typename T10,
  11984. typename T11, typename T12, typename T13, typename T14, typename T15,
  11985. typename T16, typename T17, typename T18, typename T19, typename T20,
  11986. typename T21, typename T22, typename T23, typename T24, typename T25,
  11987. typename T26, typename T27, typename T28>
  11988. class ValueArray28 {
  11989. public:
  11990. ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11991. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11992. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11993. T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  11994. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  11995. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  11996. v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
  11997. v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
  11998. template <typename T>
  11999. operator ParamGenerator<T>() const {
  12000. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12001. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12002. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12003. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12004. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12005. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12006. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12007. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12008. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12009. static_cast<T>(v27_), static_cast<T>(v28_)};
  12010. return ValuesIn(array);
  12011. }
  12012. ValueArray28(const ValueArray28& other) : v1_(other.v1_), v2_(other.v2_),
  12013. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  12014. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  12015. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  12016. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  12017. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  12018. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  12019. v27_(other.v27_), v28_(other.v28_) {}
  12020. private:
  12021. // No implementation - assignment is unsupported.
  12022. void operator=(const ValueArray28& other);
  12023. const T1 v1_;
  12024. const T2 v2_;
  12025. const T3 v3_;
  12026. const T4 v4_;
  12027. const T5 v5_;
  12028. const T6 v6_;
  12029. const T7 v7_;
  12030. const T8 v8_;
  12031. const T9 v9_;
  12032. const T10 v10_;
  12033. const T11 v11_;
  12034. const T12 v12_;
  12035. const T13 v13_;
  12036. const T14 v14_;
  12037. const T15 v15_;
  12038. const T16 v16_;
  12039. const T17 v17_;
  12040. const T18 v18_;
  12041. const T19 v19_;
  12042. const T20 v20_;
  12043. const T21 v21_;
  12044. const T22 v22_;
  12045. const T23 v23_;
  12046. const T24 v24_;
  12047. const T25 v25_;
  12048. const T26 v26_;
  12049. const T27 v27_;
  12050. const T28 v28_;
  12051. };
  12052. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12053. typename T6, typename T7, typename T8, typename T9, typename T10,
  12054. typename T11, typename T12, typename T13, typename T14, typename T15,
  12055. typename T16, typename T17, typename T18, typename T19, typename T20,
  12056. typename T21, typename T22, typename T23, typename T24, typename T25,
  12057. typename T26, typename T27, typename T28, typename T29>
  12058. class ValueArray29 {
  12059. public:
  12060. ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12061. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12062. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12063. T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  12064. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  12065. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  12066. v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
  12067. v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
  12068. template <typename T>
  12069. operator ParamGenerator<T>() const {
  12070. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12071. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12072. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12073. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12074. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12075. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12076. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12077. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12078. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12079. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_)};
  12080. return ValuesIn(array);
  12081. }
  12082. ValueArray29(const ValueArray29& other) : v1_(other.v1_), v2_(other.v2_),
  12083. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  12084. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  12085. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  12086. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  12087. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  12088. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  12089. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_) {}
  12090. private:
  12091. // No implementation - assignment is unsupported.
  12092. void operator=(const ValueArray29& other);
  12093. const T1 v1_;
  12094. const T2 v2_;
  12095. const T3 v3_;
  12096. const T4 v4_;
  12097. const T5 v5_;
  12098. const T6 v6_;
  12099. const T7 v7_;
  12100. const T8 v8_;
  12101. const T9 v9_;
  12102. const T10 v10_;
  12103. const T11 v11_;
  12104. const T12 v12_;
  12105. const T13 v13_;
  12106. const T14 v14_;
  12107. const T15 v15_;
  12108. const T16 v16_;
  12109. const T17 v17_;
  12110. const T18 v18_;
  12111. const T19 v19_;
  12112. const T20 v20_;
  12113. const T21 v21_;
  12114. const T22 v22_;
  12115. const T23 v23_;
  12116. const T24 v24_;
  12117. const T25 v25_;
  12118. const T26 v26_;
  12119. const T27 v27_;
  12120. const T28 v28_;
  12121. const T29 v29_;
  12122. };
  12123. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12124. typename T6, typename T7, typename T8, typename T9, typename T10,
  12125. typename T11, typename T12, typename T13, typename T14, typename T15,
  12126. typename T16, typename T17, typename T18, typename T19, typename T20,
  12127. typename T21, typename T22, typename T23, typename T24, typename T25,
  12128. typename T26, typename T27, typename T28, typename T29, typename T30>
  12129. class ValueArray30 {
  12130. public:
  12131. ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12132. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12133. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12134. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
  12135. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  12136. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  12137. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  12138. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  12139. v29_(v29), v30_(v30) {}
  12140. template <typename T>
  12141. operator ParamGenerator<T>() const {
  12142. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12143. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12144. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12145. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12146. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12147. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12148. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12149. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12150. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12151. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12152. static_cast<T>(v30_)};
  12153. return ValuesIn(array);
  12154. }
  12155. ValueArray30(const ValueArray30& other) : v1_(other.v1_), v2_(other.v2_),
  12156. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  12157. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  12158. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  12159. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  12160. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  12161. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  12162. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_) {}
  12163. private:
  12164. // No implementation - assignment is unsupported.
  12165. void operator=(const ValueArray30& other);
  12166. const T1 v1_;
  12167. const T2 v2_;
  12168. const T3 v3_;
  12169. const T4 v4_;
  12170. const T5 v5_;
  12171. const T6 v6_;
  12172. const T7 v7_;
  12173. const T8 v8_;
  12174. const T9 v9_;
  12175. const T10 v10_;
  12176. const T11 v11_;
  12177. const T12 v12_;
  12178. const T13 v13_;
  12179. const T14 v14_;
  12180. const T15 v15_;
  12181. const T16 v16_;
  12182. const T17 v17_;
  12183. const T18 v18_;
  12184. const T19 v19_;
  12185. const T20 v20_;
  12186. const T21 v21_;
  12187. const T22 v22_;
  12188. const T23 v23_;
  12189. const T24 v24_;
  12190. const T25 v25_;
  12191. const T26 v26_;
  12192. const T27 v27_;
  12193. const T28 v28_;
  12194. const T29 v29_;
  12195. const T30 v30_;
  12196. };
  12197. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12198. typename T6, typename T7, typename T8, typename T9, typename T10,
  12199. typename T11, typename T12, typename T13, typename T14, typename T15,
  12200. typename T16, typename T17, typename T18, typename T19, typename T20,
  12201. typename T21, typename T22, typename T23, typename T24, typename T25,
  12202. typename T26, typename T27, typename T28, typename T29, typename T30,
  12203. typename T31>
  12204. class ValueArray31 {
  12205. public:
  12206. ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12207. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12208. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12209. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
  12210. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  12211. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  12212. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  12213. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  12214. v29_(v29), v30_(v30), v31_(v31) {}
  12215. template <typename T>
  12216. operator ParamGenerator<T>() const {
  12217. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12218. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12219. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12220. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12221. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12222. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12223. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12224. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12225. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12226. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12227. static_cast<T>(v30_), static_cast<T>(v31_)};
  12228. return ValuesIn(array);
  12229. }
  12230. ValueArray31(const ValueArray31& other) : v1_(other.v1_), v2_(other.v2_),
  12231. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  12232. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  12233. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  12234. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  12235. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  12236. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  12237. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
  12238. v31_(other.v31_) {}
  12239. private:
  12240. // No implementation - assignment is unsupported.
  12241. void operator=(const ValueArray31& other);
  12242. const T1 v1_;
  12243. const T2 v2_;
  12244. const T3 v3_;
  12245. const T4 v4_;
  12246. const T5 v5_;
  12247. const T6 v6_;
  12248. const T7 v7_;
  12249. const T8 v8_;
  12250. const T9 v9_;
  12251. const T10 v10_;
  12252. const T11 v11_;
  12253. const T12 v12_;
  12254. const T13 v13_;
  12255. const T14 v14_;
  12256. const T15 v15_;
  12257. const T16 v16_;
  12258. const T17 v17_;
  12259. const T18 v18_;
  12260. const T19 v19_;
  12261. const T20 v20_;
  12262. const T21 v21_;
  12263. const T22 v22_;
  12264. const T23 v23_;
  12265. const T24 v24_;
  12266. const T25 v25_;
  12267. const T26 v26_;
  12268. const T27 v27_;
  12269. const T28 v28_;
  12270. const T29 v29_;
  12271. const T30 v30_;
  12272. const T31 v31_;
  12273. };
  12274. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12275. typename T6, typename T7, typename T8, typename T9, typename T10,
  12276. typename T11, typename T12, typename T13, typename T14, typename T15,
  12277. typename T16, typename T17, typename T18, typename T19, typename T20,
  12278. typename T21, typename T22, typename T23, typename T24, typename T25,
  12279. typename T26, typename T27, typename T28, typename T29, typename T30,
  12280. typename T31, typename T32>
  12281. class ValueArray32 {
  12282. public:
  12283. ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12284. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12285. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12286. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
  12287. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  12288. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  12289. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  12290. v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
  12291. v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
  12292. template <typename T>
  12293. operator ParamGenerator<T>() const {
  12294. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12295. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12296. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12297. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12298. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12299. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12300. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12301. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12302. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12303. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12304. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_)};
  12305. return ValuesIn(array);
  12306. }
  12307. ValueArray32(const ValueArray32& other) : v1_(other.v1_), v2_(other.v2_),
  12308. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  12309. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  12310. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  12311. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  12312. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  12313. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  12314. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
  12315. v31_(other.v31_), v32_(other.v32_) {}
  12316. private:
  12317. // No implementation - assignment is unsupported.
  12318. void operator=(const ValueArray32& other);
  12319. const T1 v1_;
  12320. const T2 v2_;
  12321. const T3 v3_;
  12322. const T4 v4_;
  12323. const T5 v5_;
  12324. const T6 v6_;
  12325. const T7 v7_;
  12326. const T8 v8_;
  12327. const T9 v9_;
  12328. const T10 v10_;
  12329. const T11 v11_;
  12330. const T12 v12_;
  12331. const T13 v13_;
  12332. const T14 v14_;
  12333. const T15 v15_;
  12334. const T16 v16_;
  12335. const T17 v17_;
  12336. const T18 v18_;
  12337. const T19 v19_;
  12338. const T20 v20_;
  12339. const T21 v21_;
  12340. const T22 v22_;
  12341. const T23 v23_;
  12342. const T24 v24_;
  12343. const T25 v25_;
  12344. const T26 v26_;
  12345. const T27 v27_;
  12346. const T28 v28_;
  12347. const T29 v29_;
  12348. const T30 v30_;
  12349. const T31 v31_;
  12350. const T32 v32_;
  12351. };
  12352. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12353. typename T6, typename T7, typename T8, typename T9, typename T10,
  12354. typename T11, typename T12, typename T13, typename T14, typename T15,
  12355. typename T16, typename T17, typename T18, typename T19, typename T20,
  12356. typename T21, typename T22, typename T23, typename T24, typename T25,
  12357. typename T26, typename T27, typename T28, typename T29, typename T30,
  12358. typename T31, typename T32, typename T33>
  12359. class ValueArray33 {
  12360. public:
  12361. ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12362. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12363. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12364. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
  12365. T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  12366. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  12367. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  12368. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  12369. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  12370. v33_(v33) {}
  12371. template <typename T>
  12372. operator ParamGenerator<T>() const {
  12373. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12374. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12375. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12376. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12377. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12378. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12379. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12380. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12381. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12382. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12383. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12384. static_cast<T>(v33_)};
  12385. return ValuesIn(array);
  12386. }
  12387. ValueArray33(const ValueArray33& other) : v1_(other.v1_), v2_(other.v2_),
  12388. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  12389. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  12390. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  12391. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  12392. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  12393. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  12394. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
  12395. v31_(other.v31_), v32_(other.v32_), v33_(other.v33_) {}
  12396. private:
  12397. // No implementation - assignment is unsupported.
  12398. void operator=(const ValueArray33& other);
  12399. const T1 v1_;
  12400. const T2 v2_;
  12401. const T3 v3_;
  12402. const T4 v4_;
  12403. const T5 v5_;
  12404. const T6 v6_;
  12405. const T7 v7_;
  12406. const T8 v8_;
  12407. const T9 v9_;
  12408. const T10 v10_;
  12409. const T11 v11_;
  12410. const T12 v12_;
  12411. const T13 v13_;
  12412. const T14 v14_;
  12413. const T15 v15_;
  12414. const T16 v16_;
  12415. const T17 v17_;
  12416. const T18 v18_;
  12417. const T19 v19_;
  12418. const T20 v20_;
  12419. const T21 v21_;
  12420. const T22 v22_;
  12421. const T23 v23_;
  12422. const T24 v24_;
  12423. const T25 v25_;
  12424. const T26 v26_;
  12425. const T27 v27_;
  12426. const T28 v28_;
  12427. const T29 v29_;
  12428. const T30 v30_;
  12429. const T31 v31_;
  12430. const T32 v32_;
  12431. const T33 v33_;
  12432. };
  12433. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12434. typename T6, typename T7, typename T8, typename T9, typename T10,
  12435. typename T11, typename T12, typename T13, typename T14, typename T15,
  12436. typename T16, typename T17, typename T18, typename T19, typename T20,
  12437. typename T21, typename T22, typename T23, typename T24, typename T25,
  12438. typename T26, typename T27, typename T28, typename T29, typename T30,
  12439. typename T31, typename T32, typename T33, typename T34>
  12440. class ValueArray34 {
  12441. public:
  12442. ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12443. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12444. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12445. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12446. T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  12447. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  12448. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  12449. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  12450. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  12451. v33_(v33), v34_(v34) {}
  12452. template <typename T>
  12453. operator ParamGenerator<T>() const {
  12454. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12455. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12456. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12457. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12458. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12459. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12460. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12461. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12462. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12463. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12464. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12465. static_cast<T>(v33_), static_cast<T>(v34_)};
  12466. return ValuesIn(array);
  12467. }
  12468. ValueArray34(const ValueArray34& other) : v1_(other.v1_), v2_(other.v2_),
  12469. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  12470. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  12471. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  12472. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  12473. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  12474. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  12475. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
  12476. v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_) {}
  12477. private:
  12478. // No implementation - assignment is unsupported.
  12479. void operator=(const ValueArray34& other);
  12480. const T1 v1_;
  12481. const T2 v2_;
  12482. const T3 v3_;
  12483. const T4 v4_;
  12484. const T5 v5_;
  12485. const T6 v6_;
  12486. const T7 v7_;
  12487. const T8 v8_;
  12488. const T9 v9_;
  12489. const T10 v10_;
  12490. const T11 v11_;
  12491. const T12 v12_;
  12492. const T13 v13_;
  12493. const T14 v14_;
  12494. const T15 v15_;
  12495. const T16 v16_;
  12496. const T17 v17_;
  12497. const T18 v18_;
  12498. const T19 v19_;
  12499. const T20 v20_;
  12500. const T21 v21_;
  12501. const T22 v22_;
  12502. const T23 v23_;
  12503. const T24 v24_;
  12504. const T25 v25_;
  12505. const T26 v26_;
  12506. const T27 v27_;
  12507. const T28 v28_;
  12508. const T29 v29_;
  12509. const T30 v30_;
  12510. const T31 v31_;
  12511. const T32 v32_;
  12512. const T33 v33_;
  12513. const T34 v34_;
  12514. };
  12515. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12516. typename T6, typename T7, typename T8, typename T9, typename T10,
  12517. typename T11, typename T12, typename T13, typename T14, typename T15,
  12518. typename T16, typename T17, typename T18, typename T19, typename T20,
  12519. typename T21, typename T22, typename T23, typename T24, typename T25,
  12520. typename T26, typename T27, typename T28, typename T29, typename T30,
  12521. typename T31, typename T32, typename T33, typename T34, typename T35>
  12522. class ValueArray35 {
  12523. public:
  12524. ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12525. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12526. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12527. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12528. T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  12529. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  12530. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
  12531. v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
  12532. v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
  12533. v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
  12534. template <typename T>
  12535. operator ParamGenerator<T>() const {
  12536. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12537. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12538. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12539. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12540. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12541. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12542. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12543. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12544. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12545. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12546. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12547. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_)};
  12548. return ValuesIn(array);
  12549. }
  12550. ValueArray35(const ValueArray35& other) : v1_(other.v1_), v2_(other.v2_),
  12551. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  12552. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  12553. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  12554. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  12555. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  12556. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  12557. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
  12558. v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
  12559. v35_(other.v35_) {}
  12560. private:
  12561. // No implementation - assignment is unsupported.
  12562. void operator=(const ValueArray35& other);
  12563. const T1 v1_;
  12564. const T2 v2_;
  12565. const T3 v3_;
  12566. const T4 v4_;
  12567. const T5 v5_;
  12568. const T6 v6_;
  12569. const T7 v7_;
  12570. const T8 v8_;
  12571. const T9 v9_;
  12572. const T10 v10_;
  12573. const T11 v11_;
  12574. const T12 v12_;
  12575. const T13 v13_;
  12576. const T14 v14_;
  12577. const T15 v15_;
  12578. const T16 v16_;
  12579. const T17 v17_;
  12580. const T18 v18_;
  12581. const T19 v19_;
  12582. const T20 v20_;
  12583. const T21 v21_;
  12584. const T22 v22_;
  12585. const T23 v23_;
  12586. const T24 v24_;
  12587. const T25 v25_;
  12588. const T26 v26_;
  12589. const T27 v27_;
  12590. const T28 v28_;
  12591. const T29 v29_;
  12592. const T30 v30_;
  12593. const T31 v31_;
  12594. const T32 v32_;
  12595. const T33 v33_;
  12596. const T34 v34_;
  12597. const T35 v35_;
  12598. };
  12599. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12600. typename T6, typename T7, typename T8, typename T9, typename T10,
  12601. typename T11, typename T12, typename T13, typename T14, typename T15,
  12602. typename T16, typename T17, typename T18, typename T19, typename T20,
  12603. typename T21, typename T22, typename T23, typename T24, typename T25,
  12604. typename T26, typename T27, typename T28, typename T29, typename T30,
  12605. typename T31, typename T32, typename T33, typename T34, typename T35,
  12606. typename T36>
  12607. class ValueArray36 {
  12608. public:
  12609. ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12610. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12611. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12612. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12613. T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  12614. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  12615. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  12616. v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
  12617. v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
  12618. v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
  12619. template <typename T>
  12620. operator ParamGenerator<T>() const {
  12621. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12622. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12623. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12624. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12625. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12626. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12627. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12628. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12629. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12630. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12631. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12632. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  12633. static_cast<T>(v36_)};
  12634. return ValuesIn(array);
  12635. }
  12636. ValueArray36(const ValueArray36& other) : v1_(other.v1_), v2_(other.v2_),
  12637. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  12638. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  12639. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  12640. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  12641. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  12642. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  12643. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
  12644. v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
  12645. v35_(other.v35_), v36_(other.v36_) {}
  12646. private:
  12647. // No implementation - assignment is unsupported.
  12648. void operator=(const ValueArray36& other);
  12649. const T1 v1_;
  12650. const T2 v2_;
  12651. const T3 v3_;
  12652. const T4 v4_;
  12653. const T5 v5_;
  12654. const T6 v6_;
  12655. const T7 v7_;
  12656. const T8 v8_;
  12657. const T9 v9_;
  12658. const T10 v10_;
  12659. const T11 v11_;
  12660. const T12 v12_;
  12661. const T13 v13_;
  12662. const T14 v14_;
  12663. const T15 v15_;
  12664. const T16 v16_;
  12665. const T17 v17_;
  12666. const T18 v18_;
  12667. const T19 v19_;
  12668. const T20 v20_;
  12669. const T21 v21_;
  12670. const T22 v22_;
  12671. const T23 v23_;
  12672. const T24 v24_;
  12673. const T25 v25_;
  12674. const T26 v26_;
  12675. const T27 v27_;
  12676. const T28 v28_;
  12677. const T29 v29_;
  12678. const T30 v30_;
  12679. const T31 v31_;
  12680. const T32 v32_;
  12681. const T33 v33_;
  12682. const T34 v34_;
  12683. const T35 v35_;
  12684. const T36 v36_;
  12685. };
  12686. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12687. typename T6, typename T7, typename T8, typename T9, typename T10,
  12688. typename T11, typename T12, typename T13, typename T14, typename T15,
  12689. typename T16, typename T17, typename T18, typename T19, typename T20,
  12690. typename T21, typename T22, typename T23, typename T24, typename T25,
  12691. typename T26, typename T27, typename T28, typename T29, typename T30,
  12692. typename T31, typename T32, typename T33, typename T34, typename T35,
  12693. typename T36, typename T37>
  12694. class ValueArray37 {
  12695. public:
  12696. ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12697. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12698. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12699. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12700. T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  12701. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  12702. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  12703. v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
  12704. v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
  12705. v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
  12706. v36_(v36), v37_(v37) {}
  12707. template <typename T>
  12708. operator ParamGenerator<T>() const {
  12709. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12710. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12711. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12712. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12713. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12714. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12715. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12716. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12717. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12718. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12719. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12720. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  12721. static_cast<T>(v36_), static_cast<T>(v37_)};
  12722. return ValuesIn(array);
  12723. }
  12724. ValueArray37(const ValueArray37& other) : v1_(other.v1_), v2_(other.v2_),
  12725. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  12726. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  12727. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  12728. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  12729. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  12730. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  12731. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
  12732. v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
  12733. v35_(other.v35_), v36_(other.v36_), v37_(other.v37_) {}
  12734. private:
  12735. // No implementation - assignment is unsupported.
  12736. void operator=(const ValueArray37& other);
  12737. const T1 v1_;
  12738. const T2 v2_;
  12739. const T3 v3_;
  12740. const T4 v4_;
  12741. const T5 v5_;
  12742. const T6 v6_;
  12743. const T7 v7_;
  12744. const T8 v8_;
  12745. const T9 v9_;
  12746. const T10 v10_;
  12747. const T11 v11_;
  12748. const T12 v12_;
  12749. const T13 v13_;
  12750. const T14 v14_;
  12751. const T15 v15_;
  12752. const T16 v16_;
  12753. const T17 v17_;
  12754. const T18 v18_;
  12755. const T19 v19_;
  12756. const T20 v20_;
  12757. const T21 v21_;
  12758. const T22 v22_;
  12759. const T23 v23_;
  12760. const T24 v24_;
  12761. const T25 v25_;
  12762. const T26 v26_;
  12763. const T27 v27_;
  12764. const T28 v28_;
  12765. const T29 v29_;
  12766. const T30 v30_;
  12767. const T31 v31_;
  12768. const T32 v32_;
  12769. const T33 v33_;
  12770. const T34 v34_;
  12771. const T35 v35_;
  12772. const T36 v36_;
  12773. const T37 v37_;
  12774. };
  12775. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12776. typename T6, typename T7, typename T8, typename T9, typename T10,
  12777. typename T11, typename T12, typename T13, typename T14, typename T15,
  12778. typename T16, typename T17, typename T18, typename T19, typename T20,
  12779. typename T21, typename T22, typename T23, typename T24, typename T25,
  12780. typename T26, typename T27, typename T28, typename T29, typename T30,
  12781. typename T31, typename T32, typename T33, typename T34, typename T35,
  12782. typename T36, typename T37, typename T38>
  12783. class ValueArray38 {
  12784. public:
  12785. ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12786. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12787. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12788. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12789. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
  12790. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  12791. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  12792. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  12793. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  12794. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  12795. v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
  12796. template <typename T>
  12797. operator ParamGenerator<T>() const {
  12798. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12799. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12800. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12801. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12802. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12803. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12804. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12805. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12806. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12807. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12808. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12809. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  12810. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_)};
  12811. return ValuesIn(array);
  12812. }
  12813. ValueArray38(const ValueArray38& other) : v1_(other.v1_), v2_(other.v2_),
  12814. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  12815. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  12816. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  12817. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  12818. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  12819. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  12820. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
  12821. v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
  12822. v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_) {}
  12823. private:
  12824. // No implementation - assignment is unsupported.
  12825. void operator=(const ValueArray38& other);
  12826. const T1 v1_;
  12827. const T2 v2_;
  12828. const T3 v3_;
  12829. const T4 v4_;
  12830. const T5 v5_;
  12831. const T6 v6_;
  12832. const T7 v7_;
  12833. const T8 v8_;
  12834. const T9 v9_;
  12835. const T10 v10_;
  12836. const T11 v11_;
  12837. const T12 v12_;
  12838. const T13 v13_;
  12839. const T14 v14_;
  12840. const T15 v15_;
  12841. const T16 v16_;
  12842. const T17 v17_;
  12843. const T18 v18_;
  12844. const T19 v19_;
  12845. const T20 v20_;
  12846. const T21 v21_;
  12847. const T22 v22_;
  12848. const T23 v23_;
  12849. const T24 v24_;
  12850. const T25 v25_;
  12851. const T26 v26_;
  12852. const T27 v27_;
  12853. const T28 v28_;
  12854. const T29 v29_;
  12855. const T30 v30_;
  12856. const T31 v31_;
  12857. const T32 v32_;
  12858. const T33 v33_;
  12859. const T34 v34_;
  12860. const T35 v35_;
  12861. const T36 v36_;
  12862. const T37 v37_;
  12863. const T38 v38_;
  12864. };
  12865. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12866. typename T6, typename T7, typename T8, typename T9, typename T10,
  12867. typename T11, typename T12, typename T13, typename T14, typename T15,
  12868. typename T16, typename T17, typename T18, typename T19, typename T20,
  12869. typename T21, typename T22, typename T23, typename T24, typename T25,
  12870. typename T26, typename T27, typename T28, typename T29, typename T30,
  12871. typename T31, typename T32, typename T33, typename T34, typename T35,
  12872. typename T36, typename T37, typename T38, typename T39>
  12873. class ValueArray39 {
  12874. public:
  12875. ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12876. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12877. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12878. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12879. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
  12880. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  12881. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  12882. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  12883. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  12884. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  12885. v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
  12886. template <typename T>
  12887. operator ParamGenerator<T>() const {
  12888. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12889. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12890. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12891. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12892. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12893. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12894. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12895. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12896. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12897. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12898. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12899. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  12900. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  12901. static_cast<T>(v39_)};
  12902. return ValuesIn(array);
  12903. }
  12904. ValueArray39(const ValueArray39& other) : v1_(other.v1_), v2_(other.v2_),
  12905. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  12906. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  12907. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  12908. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  12909. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  12910. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  12911. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
  12912. v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
  12913. v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
  12914. v39_(other.v39_) {}
  12915. private:
  12916. // No implementation - assignment is unsupported.
  12917. void operator=(const ValueArray39& other);
  12918. const T1 v1_;
  12919. const T2 v2_;
  12920. const T3 v3_;
  12921. const T4 v4_;
  12922. const T5 v5_;
  12923. const T6 v6_;
  12924. const T7 v7_;
  12925. const T8 v8_;
  12926. const T9 v9_;
  12927. const T10 v10_;
  12928. const T11 v11_;
  12929. const T12 v12_;
  12930. const T13 v13_;
  12931. const T14 v14_;
  12932. const T15 v15_;
  12933. const T16 v16_;
  12934. const T17 v17_;
  12935. const T18 v18_;
  12936. const T19 v19_;
  12937. const T20 v20_;
  12938. const T21 v21_;
  12939. const T22 v22_;
  12940. const T23 v23_;
  12941. const T24 v24_;
  12942. const T25 v25_;
  12943. const T26 v26_;
  12944. const T27 v27_;
  12945. const T28 v28_;
  12946. const T29 v29_;
  12947. const T30 v30_;
  12948. const T31 v31_;
  12949. const T32 v32_;
  12950. const T33 v33_;
  12951. const T34 v34_;
  12952. const T35 v35_;
  12953. const T36 v36_;
  12954. const T37 v37_;
  12955. const T38 v38_;
  12956. const T39 v39_;
  12957. };
  12958. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12959. typename T6, typename T7, typename T8, typename T9, typename T10,
  12960. typename T11, typename T12, typename T13, typename T14, typename T15,
  12961. typename T16, typename T17, typename T18, typename T19, typename T20,
  12962. typename T21, typename T22, typename T23, typename T24, typename T25,
  12963. typename T26, typename T27, typename T28, typename T29, typename T30,
  12964. typename T31, typename T32, typename T33, typename T34, typename T35,
  12965. typename T36, typename T37, typename T38, typename T39, typename T40>
  12966. class ValueArray40 {
  12967. public:
  12968. ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12969. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12970. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12971. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12972. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
  12973. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  12974. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  12975. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  12976. v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
  12977. v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
  12978. v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
  12979. v40_(v40) {}
  12980. template <typename T>
  12981. operator ParamGenerator<T>() const {
  12982. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12983. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12984. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12985. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12986. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12987. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12988. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12989. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12990. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12991. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12992. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12993. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  12994. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  12995. static_cast<T>(v39_), static_cast<T>(v40_)};
  12996. return ValuesIn(array);
  12997. }
  12998. ValueArray40(const ValueArray40& other) : v1_(other.v1_), v2_(other.v2_),
  12999. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  13000. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  13001. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  13002. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  13003. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  13004. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  13005. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
  13006. v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
  13007. v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
  13008. v39_(other.v39_), v40_(other.v40_) {}
  13009. private:
  13010. // No implementation - assignment is unsupported.
  13011. void operator=(const ValueArray40& other);
  13012. const T1 v1_;
  13013. const T2 v2_;
  13014. const T3 v3_;
  13015. const T4 v4_;
  13016. const T5 v5_;
  13017. const T6 v6_;
  13018. const T7 v7_;
  13019. const T8 v8_;
  13020. const T9 v9_;
  13021. const T10 v10_;
  13022. const T11 v11_;
  13023. const T12 v12_;
  13024. const T13 v13_;
  13025. const T14 v14_;
  13026. const T15 v15_;
  13027. const T16 v16_;
  13028. const T17 v17_;
  13029. const T18 v18_;
  13030. const T19 v19_;
  13031. const T20 v20_;
  13032. const T21 v21_;
  13033. const T22 v22_;
  13034. const T23 v23_;
  13035. const T24 v24_;
  13036. const T25 v25_;
  13037. const T26 v26_;
  13038. const T27 v27_;
  13039. const T28 v28_;
  13040. const T29 v29_;
  13041. const T30 v30_;
  13042. const T31 v31_;
  13043. const T32 v32_;
  13044. const T33 v33_;
  13045. const T34 v34_;
  13046. const T35 v35_;
  13047. const T36 v36_;
  13048. const T37 v37_;
  13049. const T38 v38_;
  13050. const T39 v39_;
  13051. const T40 v40_;
  13052. };
  13053. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13054. typename T6, typename T7, typename T8, typename T9, typename T10,
  13055. typename T11, typename T12, typename T13, typename T14, typename T15,
  13056. typename T16, typename T17, typename T18, typename T19, typename T20,
  13057. typename T21, typename T22, typename T23, typename T24, typename T25,
  13058. typename T26, typename T27, typename T28, typename T29, typename T30,
  13059. typename T31, typename T32, typename T33, typename T34, typename T35,
  13060. typename T36, typename T37, typename T38, typename T39, typename T40,
  13061. typename T41>
  13062. class ValueArray41 {
  13063. public:
  13064. ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  13065. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  13066. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  13067. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  13068. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
  13069. T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  13070. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  13071. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  13072. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  13073. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  13074. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  13075. v39_(v39), v40_(v40), v41_(v41) {}
  13076. template <typename T>
  13077. operator ParamGenerator<T>() const {
  13078. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  13079. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  13080. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  13081. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  13082. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  13083. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  13084. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  13085. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  13086. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  13087. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  13088. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  13089. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  13090. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  13091. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_)};
  13092. return ValuesIn(array);
  13093. }
  13094. ValueArray41(const ValueArray41& other) : v1_(other.v1_), v2_(other.v2_),
  13095. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  13096. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  13097. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  13098. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  13099. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  13100. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  13101. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
  13102. v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
  13103. v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
  13104. v39_(other.v39_), v40_(other.v40_), v41_(other.v41_) {}
  13105. private:
  13106. // No implementation - assignment is unsupported.
  13107. void operator=(const ValueArray41& other);
  13108. const T1 v1_;
  13109. const T2 v2_;
  13110. const T3 v3_;
  13111. const T4 v4_;
  13112. const T5 v5_;
  13113. const T6 v6_;
  13114. const T7 v7_;
  13115. const T8 v8_;
  13116. const T9 v9_;
  13117. const T10 v10_;
  13118. const T11 v11_;
  13119. const T12 v12_;
  13120. const T13 v13_;
  13121. const T14 v14_;
  13122. const T15 v15_;
  13123. const T16 v16_;
  13124. const T17 v17_;
  13125. const T18 v18_;
  13126. const T19 v19_;
  13127. const T20 v20_;
  13128. const T21 v21_;
  13129. const T22 v22_;
  13130. const T23 v23_;
  13131. const T24 v24_;
  13132. const T25 v25_;
  13133. const T26 v26_;
  13134. const T27 v27_;
  13135. const T28 v28_;
  13136. const T29 v29_;
  13137. const T30 v30_;
  13138. const T31 v31_;
  13139. const T32 v32_;
  13140. const T33 v33_;
  13141. const T34 v34_;
  13142. const T35 v35_;
  13143. const T36 v36_;
  13144. const T37 v37_;
  13145. const T38 v38_;
  13146. const T39 v39_;
  13147. const T40 v40_;
  13148. const T41 v41_;
  13149. };
  13150. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13151. typename T6, typename T7, typename T8, typename T9, typename T10,
  13152. typename T11, typename T12, typename T13, typename T14, typename T15,
  13153. typename T16, typename T17, typename T18, typename T19, typename T20,
  13154. typename T21, typename T22, typename T23, typename T24, typename T25,
  13155. typename T26, typename T27, typename T28, typename T29, typename T30,
  13156. typename T31, typename T32, typename T33, typename T34, typename T35,
  13157. typename T36, typename T37, typename T38, typename T39, typename T40,
  13158. typename T41, typename T42>
  13159. class ValueArray42 {
  13160. public:
  13161. ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  13162. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  13163. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  13164. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  13165. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  13166. T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  13167. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  13168. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  13169. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  13170. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  13171. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  13172. v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
  13173. template <typename T>
  13174. operator ParamGenerator<T>() const {
  13175. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  13176. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  13177. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  13178. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  13179. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  13180. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  13181. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  13182. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  13183. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  13184. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  13185. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  13186. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  13187. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  13188. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  13189. static_cast<T>(v42_)};
  13190. return ValuesIn(array);
  13191. }
  13192. ValueArray42(const ValueArray42& other) : v1_(other.v1_), v2_(other.v2_),
  13193. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  13194. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  13195. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  13196. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  13197. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  13198. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  13199. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
  13200. v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
  13201. v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
  13202. v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_) {}
  13203. private:
  13204. // No implementation - assignment is unsupported.
  13205. void operator=(const ValueArray42& other);
  13206. const T1 v1_;
  13207. const T2 v2_;
  13208. const T3 v3_;
  13209. const T4 v4_;
  13210. const T5 v5_;
  13211. const T6 v6_;
  13212. const T7 v7_;
  13213. const T8 v8_;
  13214. const T9 v9_;
  13215. const T10 v10_;
  13216. const T11 v11_;
  13217. const T12 v12_;
  13218. const T13 v13_;
  13219. const T14 v14_;
  13220. const T15 v15_;
  13221. const T16 v16_;
  13222. const T17 v17_;
  13223. const T18 v18_;
  13224. const T19 v19_;
  13225. const T20 v20_;
  13226. const T21 v21_;
  13227. const T22 v22_;
  13228. const T23 v23_;
  13229. const T24 v24_;
  13230. const T25 v25_;
  13231. const T26 v26_;
  13232. const T27 v27_;
  13233. const T28 v28_;
  13234. const T29 v29_;
  13235. const T30 v30_;
  13236. const T31 v31_;
  13237. const T32 v32_;
  13238. const T33 v33_;
  13239. const T34 v34_;
  13240. const T35 v35_;
  13241. const T36 v36_;
  13242. const T37 v37_;
  13243. const T38 v38_;
  13244. const T39 v39_;
  13245. const T40 v40_;
  13246. const T41 v41_;
  13247. const T42 v42_;
  13248. };
  13249. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13250. typename T6, typename T7, typename T8, typename T9, typename T10,
  13251. typename T11, typename T12, typename T13, typename T14, typename T15,
  13252. typename T16, typename T17, typename T18, typename T19, typename T20,
  13253. typename T21, typename T22, typename T23, typename T24, typename T25,
  13254. typename T26, typename T27, typename T28, typename T29, typename T30,
  13255. typename T31, typename T32, typename T33, typename T34, typename T35,
  13256. typename T36, typename T37, typename T38, typename T39, typename T40,
  13257. typename T41, typename T42, typename T43>
  13258. class ValueArray43 {
  13259. public:
  13260. ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  13261. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  13262. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  13263. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  13264. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  13265. T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  13266. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  13267. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
  13268. v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
  13269. v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
  13270. v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
  13271. v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
  13272. template <typename T>
  13273. operator ParamGenerator<T>() const {
  13274. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  13275. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  13276. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  13277. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  13278. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  13279. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  13280. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  13281. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  13282. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  13283. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  13284. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  13285. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  13286. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  13287. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  13288. static_cast<T>(v42_), static_cast<T>(v43_)};
  13289. return ValuesIn(array);
  13290. }
  13291. ValueArray43(const ValueArray43& other) : v1_(other.v1_), v2_(other.v2_),
  13292. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  13293. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  13294. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  13295. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  13296. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  13297. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  13298. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
  13299. v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
  13300. v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
  13301. v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
  13302. v43_(other.v43_) {}
  13303. private:
  13304. // No implementation - assignment is unsupported.
  13305. void operator=(const ValueArray43& other);
  13306. const T1 v1_;
  13307. const T2 v2_;
  13308. const T3 v3_;
  13309. const T4 v4_;
  13310. const T5 v5_;
  13311. const T6 v6_;
  13312. const T7 v7_;
  13313. const T8 v8_;
  13314. const T9 v9_;
  13315. const T10 v10_;
  13316. const T11 v11_;
  13317. const T12 v12_;
  13318. const T13 v13_;
  13319. const T14 v14_;
  13320. const T15 v15_;
  13321. const T16 v16_;
  13322. const T17 v17_;
  13323. const T18 v18_;
  13324. const T19 v19_;
  13325. const T20 v20_;
  13326. const T21 v21_;
  13327. const T22 v22_;
  13328. const T23 v23_;
  13329. const T24 v24_;
  13330. const T25 v25_;
  13331. const T26 v26_;
  13332. const T27 v27_;
  13333. const T28 v28_;
  13334. const T29 v29_;
  13335. const T30 v30_;
  13336. const T31 v31_;
  13337. const T32 v32_;
  13338. const T33 v33_;
  13339. const T34 v34_;
  13340. const T35 v35_;
  13341. const T36 v36_;
  13342. const T37 v37_;
  13343. const T38 v38_;
  13344. const T39 v39_;
  13345. const T40 v40_;
  13346. const T41 v41_;
  13347. const T42 v42_;
  13348. const T43 v43_;
  13349. };
  13350. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13351. typename T6, typename T7, typename T8, typename T9, typename T10,
  13352. typename T11, typename T12, typename T13, typename T14, typename T15,
  13353. typename T16, typename T17, typename T18, typename T19, typename T20,
  13354. typename T21, typename T22, typename T23, typename T24, typename T25,
  13355. typename T26, typename T27, typename T28, typename T29, typename T30,
  13356. typename T31, typename T32, typename T33, typename T34, typename T35,
  13357. typename T36, typename T37, typename T38, typename T39, typename T40,
  13358. typename T41, typename T42, typename T43, typename T44>
  13359. class ValueArray44 {
  13360. public:
  13361. ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  13362. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  13363. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  13364. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  13365. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  13366. T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  13367. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  13368. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  13369. v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
  13370. v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
  13371. v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
  13372. v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
  13373. v43_(v43), v44_(v44) {}
  13374. template <typename T>
  13375. operator ParamGenerator<T>() const {
  13376. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  13377. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  13378. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  13379. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  13380. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  13381. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  13382. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  13383. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  13384. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  13385. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  13386. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  13387. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  13388. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  13389. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  13390. static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_)};
  13391. return ValuesIn(array);
  13392. }
  13393. ValueArray44(const ValueArray44& other) : v1_(other.v1_), v2_(other.v2_),
  13394. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  13395. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  13396. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  13397. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  13398. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  13399. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  13400. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
  13401. v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
  13402. v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
  13403. v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
  13404. v43_(other.v43_), v44_(other.v44_) {}
  13405. private:
  13406. // No implementation - assignment is unsupported.
  13407. void operator=(const ValueArray44& other);
  13408. const T1 v1_;
  13409. const T2 v2_;
  13410. const T3 v3_;
  13411. const T4 v4_;
  13412. const T5 v5_;
  13413. const T6 v6_;
  13414. const T7 v7_;
  13415. const T8 v8_;
  13416. const T9 v9_;
  13417. const T10 v10_;
  13418. const T11 v11_;
  13419. const T12 v12_;
  13420. const T13 v13_;
  13421. const T14 v14_;
  13422. const T15 v15_;
  13423. const T16 v16_;
  13424. const T17 v17_;
  13425. const T18 v18_;
  13426. const T19 v19_;
  13427. const T20 v20_;
  13428. const T21 v21_;
  13429. const T22 v22_;
  13430. const T23 v23_;
  13431. const T24 v24_;
  13432. const T25 v25_;
  13433. const T26 v26_;
  13434. const T27 v27_;
  13435. const T28 v28_;
  13436. const T29 v29_;
  13437. const T30 v30_;
  13438. const T31 v31_;
  13439. const T32 v32_;
  13440. const T33 v33_;
  13441. const T34 v34_;
  13442. const T35 v35_;
  13443. const T36 v36_;
  13444. const T37 v37_;
  13445. const T38 v38_;
  13446. const T39 v39_;
  13447. const T40 v40_;
  13448. const T41 v41_;
  13449. const T42 v42_;
  13450. const T43 v43_;
  13451. const T44 v44_;
  13452. };
  13453. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13454. typename T6, typename T7, typename T8, typename T9, typename T10,
  13455. typename T11, typename T12, typename T13, typename T14, typename T15,
  13456. typename T16, typename T17, typename T18, typename T19, typename T20,
  13457. typename T21, typename T22, typename T23, typename T24, typename T25,
  13458. typename T26, typename T27, typename T28, typename T29, typename T30,
  13459. typename T31, typename T32, typename T33, typename T34, typename T35,
  13460. typename T36, typename T37, typename T38, typename T39, typename T40,
  13461. typename T41, typename T42, typename T43, typename T44, typename T45>
  13462. class ValueArray45 {
  13463. public:
  13464. ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  13465. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  13466. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  13467. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  13468. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  13469. T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  13470. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  13471. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  13472. v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
  13473. v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
  13474. v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
  13475. v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
  13476. v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
  13477. template <typename T>
  13478. operator ParamGenerator<T>() const {
  13479. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  13480. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  13481. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  13482. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  13483. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  13484. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  13485. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  13486. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  13487. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  13488. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  13489. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  13490. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  13491. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  13492. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  13493. static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
  13494. static_cast<T>(v45_)};
  13495. return ValuesIn(array);
  13496. }
  13497. ValueArray45(const ValueArray45& other) : v1_(other.v1_), v2_(other.v2_),
  13498. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  13499. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  13500. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  13501. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  13502. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  13503. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  13504. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
  13505. v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
  13506. v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
  13507. v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
  13508. v43_(other.v43_), v44_(other.v44_), v45_(other.v45_) {}
  13509. private:
  13510. // No implementation - assignment is unsupported.
  13511. void operator=(const ValueArray45& other);
  13512. const T1 v1_;
  13513. const T2 v2_;
  13514. const T3 v3_;
  13515. const T4 v4_;
  13516. const T5 v5_;
  13517. const T6 v6_;
  13518. const T7 v7_;
  13519. const T8 v8_;
  13520. const T9 v9_;
  13521. const T10 v10_;
  13522. const T11 v11_;
  13523. const T12 v12_;
  13524. const T13 v13_;
  13525. const T14 v14_;
  13526. const T15 v15_;
  13527. const T16 v16_;
  13528. const T17 v17_;
  13529. const T18 v18_;
  13530. const T19 v19_;
  13531. const T20 v20_;
  13532. const T21 v21_;
  13533. const T22 v22_;
  13534. const T23 v23_;
  13535. const T24 v24_;
  13536. const T25 v25_;
  13537. const T26 v26_;
  13538. const T27 v27_;
  13539. const T28 v28_;
  13540. const T29 v29_;
  13541. const T30 v30_;
  13542. const T31 v31_;
  13543. const T32 v32_;
  13544. const T33 v33_;
  13545. const T34 v34_;
  13546. const T35 v35_;
  13547. const T36 v36_;
  13548. const T37 v37_;
  13549. const T38 v38_;
  13550. const T39 v39_;
  13551. const T40 v40_;
  13552. const T41 v41_;
  13553. const T42 v42_;
  13554. const T43 v43_;
  13555. const T44 v44_;
  13556. const T45 v45_;
  13557. };
  13558. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13559. typename T6, typename T7, typename T8, typename T9, typename T10,
  13560. typename T11, typename T12, typename T13, typename T14, typename T15,
  13561. typename T16, typename T17, typename T18, typename T19, typename T20,
  13562. typename T21, typename T22, typename T23, typename T24, typename T25,
  13563. typename T26, typename T27, typename T28, typename T29, typename T30,
  13564. typename T31, typename T32, typename T33, typename T34, typename T35,
  13565. typename T36, typename T37, typename T38, typename T39, typename T40,
  13566. typename T41, typename T42, typename T43, typename T44, typename T45,
  13567. typename T46>
  13568. class ValueArray46 {
  13569. public:
  13570. ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  13571. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  13572. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  13573. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  13574. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  13575. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
  13576. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  13577. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  13578. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  13579. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  13580. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  13581. v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
  13582. v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
  13583. template <typename T>
  13584. operator ParamGenerator<T>() const {
  13585. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  13586. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  13587. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  13588. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  13589. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  13590. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  13591. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  13592. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  13593. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  13594. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  13595. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  13596. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  13597. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  13598. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  13599. static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
  13600. static_cast<T>(v45_), static_cast<T>(v46_)};
  13601. return ValuesIn(array);
  13602. }
  13603. ValueArray46(const ValueArray46& other) : v1_(other.v1_), v2_(other.v2_),
  13604. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  13605. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  13606. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  13607. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  13608. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  13609. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  13610. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
  13611. v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
  13612. v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
  13613. v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
  13614. v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_) {}
  13615. private:
  13616. // No implementation - assignment is unsupported.
  13617. void operator=(const ValueArray46& other);
  13618. const T1 v1_;
  13619. const T2 v2_;
  13620. const T3 v3_;
  13621. const T4 v4_;
  13622. const T5 v5_;
  13623. const T6 v6_;
  13624. const T7 v7_;
  13625. const T8 v8_;
  13626. const T9 v9_;
  13627. const T10 v10_;
  13628. const T11 v11_;
  13629. const T12 v12_;
  13630. const T13 v13_;
  13631. const T14 v14_;
  13632. const T15 v15_;
  13633. const T16 v16_;
  13634. const T17 v17_;
  13635. const T18 v18_;
  13636. const T19 v19_;
  13637. const T20 v20_;
  13638. const T21 v21_;
  13639. const T22 v22_;
  13640. const T23 v23_;
  13641. const T24 v24_;
  13642. const T25 v25_;
  13643. const T26 v26_;
  13644. const T27 v27_;
  13645. const T28 v28_;
  13646. const T29 v29_;
  13647. const T30 v30_;
  13648. const T31 v31_;
  13649. const T32 v32_;
  13650. const T33 v33_;
  13651. const T34 v34_;
  13652. const T35 v35_;
  13653. const T36 v36_;
  13654. const T37 v37_;
  13655. const T38 v38_;
  13656. const T39 v39_;
  13657. const T40 v40_;
  13658. const T41 v41_;
  13659. const T42 v42_;
  13660. const T43 v43_;
  13661. const T44 v44_;
  13662. const T45 v45_;
  13663. const T46 v46_;
  13664. };
  13665. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13666. typename T6, typename T7, typename T8, typename T9, typename T10,
  13667. typename T11, typename T12, typename T13, typename T14, typename T15,
  13668. typename T16, typename T17, typename T18, typename T19, typename T20,
  13669. typename T21, typename T22, typename T23, typename T24, typename T25,
  13670. typename T26, typename T27, typename T28, typename T29, typename T30,
  13671. typename T31, typename T32, typename T33, typename T34, typename T35,
  13672. typename T36, typename T37, typename T38, typename T39, typename T40,
  13673. typename T41, typename T42, typename T43, typename T44, typename T45,
  13674. typename T46, typename T47>
  13675. class ValueArray47 {
  13676. public:
  13677. ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  13678. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  13679. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  13680. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  13681. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  13682. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
  13683. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  13684. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  13685. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  13686. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  13687. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  13688. v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
  13689. v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
  13690. v47_(v47) {}
  13691. template <typename T>
  13692. operator ParamGenerator<T>() const {
  13693. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  13694. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  13695. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  13696. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  13697. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  13698. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  13699. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  13700. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  13701. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  13702. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  13703. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  13704. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  13705. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  13706. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  13707. static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
  13708. static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_)};
  13709. return ValuesIn(array);
  13710. }
  13711. ValueArray47(const ValueArray47& other) : v1_(other.v1_), v2_(other.v2_),
  13712. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  13713. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  13714. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  13715. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  13716. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  13717. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  13718. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
  13719. v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
  13720. v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
  13721. v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
  13722. v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_),
  13723. v47_(other.v47_) {}
  13724. private:
  13725. // No implementation - assignment is unsupported.
  13726. void operator=(const ValueArray47& other);
  13727. const T1 v1_;
  13728. const T2 v2_;
  13729. const T3 v3_;
  13730. const T4 v4_;
  13731. const T5 v5_;
  13732. const T6 v6_;
  13733. const T7 v7_;
  13734. const T8 v8_;
  13735. const T9 v9_;
  13736. const T10 v10_;
  13737. const T11 v11_;
  13738. const T12 v12_;
  13739. const T13 v13_;
  13740. const T14 v14_;
  13741. const T15 v15_;
  13742. const T16 v16_;
  13743. const T17 v17_;
  13744. const T18 v18_;
  13745. const T19 v19_;
  13746. const T20 v20_;
  13747. const T21 v21_;
  13748. const T22 v22_;
  13749. const T23 v23_;
  13750. const T24 v24_;
  13751. const T25 v25_;
  13752. const T26 v26_;
  13753. const T27 v27_;
  13754. const T28 v28_;
  13755. const T29 v29_;
  13756. const T30 v30_;
  13757. const T31 v31_;
  13758. const T32 v32_;
  13759. const T33 v33_;
  13760. const T34 v34_;
  13761. const T35 v35_;
  13762. const T36 v36_;
  13763. const T37 v37_;
  13764. const T38 v38_;
  13765. const T39 v39_;
  13766. const T40 v40_;
  13767. const T41 v41_;
  13768. const T42 v42_;
  13769. const T43 v43_;
  13770. const T44 v44_;
  13771. const T45 v45_;
  13772. const T46 v46_;
  13773. const T47 v47_;
  13774. };
  13775. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13776. typename T6, typename T7, typename T8, typename T9, typename T10,
  13777. typename T11, typename T12, typename T13, typename T14, typename T15,
  13778. typename T16, typename T17, typename T18, typename T19, typename T20,
  13779. typename T21, typename T22, typename T23, typename T24, typename T25,
  13780. typename T26, typename T27, typename T28, typename T29, typename T30,
  13781. typename T31, typename T32, typename T33, typename T34, typename T35,
  13782. typename T36, typename T37, typename T38, typename T39, typename T40,
  13783. typename T41, typename T42, typename T43, typename T44, typename T45,
  13784. typename T46, typename T47, typename T48>
  13785. class ValueArray48 {
  13786. public:
  13787. ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  13788. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  13789. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  13790. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  13791. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  13792. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
  13793. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  13794. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  13795. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  13796. v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
  13797. v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
  13798. v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
  13799. v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
  13800. v46_(v46), v47_(v47), v48_(v48) {}
  13801. template <typename T>
  13802. operator ParamGenerator<T>() const {
  13803. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  13804. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  13805. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  13806. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  13807. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  13808. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  13809. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  13810. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  13811. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  13812. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  13813. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  13814. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  13815. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  13816. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  13817. static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
  13818. static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
  13819. static_cast<T>(v48_)};
  13820. return ValuesIn(array);
  13821. }
  13822. ValueArray48(const ValueArray48& other) : v1_(other.v1_), v2_(other.v2_),
  13823. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  13824. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  13825. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  13826. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  13827. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  13828. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  13829. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
  13830. v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
  13831. v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
  13832. v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
  13833. v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_),
  13834. v47_(other.v47_), v48_(other.v48_) {}
  13835. private:
  13836. // No implementation - assignment is unsupported.
  13837. void operator=(const ValueArray48& other);
  13838. const T1 v1_;
  13839. const T2 v2_;
  13840. const T3 v3_;
  13841. const T4 v4_;
  13842. const T5 v5_;
  13843. const T6 v6_;
  13844. const T7 v7_;
  13845. const T8 v8_;
  13846. const T9 v9_;
  13847. const T10 v10_;
  13848. const T11 v11_;
  13849. const T12 v12_;
  13850. const T13 v13_;
  13851. const T14 v14_;
  13852. const T15 v15_;
  13853. const T16 v16_;
  13854. const T17 v17_;
  13855. const T18 v18_;
  13856. const T19 v19_;
  13857. const T20 v20_;
  13858. const T21 v21_;
  13859. const T22 v22_;
  13860. const T23 v23_;
  13861. const T24 v24_;
  13862. const T25 v25_;
  13863. const T26 v26_;
  13864. const T27 v27_;
  13865. const T28 v28_;
  13866. const T29 v29_;
  13867. const T30 v30_;
  13868. const T31 v31_;
  13869. const T32 v32_;
  13870. const T33 v33_;
  13871. const T34 v34_;
  13872. const T35 v35_;
  13873. const T36 v36_;
  13874. const T37 v37_;
  13875. const T38 v38_;
  13876. const T39 v39_;
  13877. const T40 v40_;
  13878. const T41 v41_;
  13879. const T42 v42_;
  13880. const T43 v43_;
  13881. const T44 v44_;
  13882. const T45 v45_;
  13883. const T46 v46_;
  13884. const T47 v47_;
  13885. const T48 v48_;
  13886. };
  13887. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13888. typename T6, typename T7, typename T8, typename T9, typename T10,
  13889. typename T11, typename T12, typename T13, typename T14, typename T15,
  13890. typename T16, typename T17, typename T18, typename T19, typename T20,
  13891. typename T21, typename T22, typename T23, typename T24, typename T25,
  13892. typename T26, typename T27, typename T28, typename T29, typename T30,
  13893. typename T31, typename T32, typename T33, typename T34, typename T35,
  13894. typename T36, typename T37, typename T38, typename T39, typename T40,
  13895. typename T41, typename T42, typename T43, typename T44, typename T45,
  13896. typename T46, typename T47, typename T48, typename T49>
  13897. class ValueArray49 {
  13898. public:
  13899. ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  13900. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  13901. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  13902. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  13903. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  13904. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
  13905. T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  13906. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  13907. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  13908. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  13909. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  13910. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  13911. v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
  13912. v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
  13913. template <typename T>
  13914. operator ParamGenerator<T>() const {
  13915. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  13916. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  13917. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  13918. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  13919. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  13920. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  13921. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  13922. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  13923. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  13924. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  13925. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  13926. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  13927. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  13928. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  13929. static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
  13930. static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
  13931. static_cast<T>(v48_), static_cast<T>(v49_)};
  13932. return ValuesIn(array);
  13933. }
  13934. ValueArray49(const ValueArray49& other) : v1_(other.v1_), v2_(other.v2_),
  13935. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  13936. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  13937. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  13938. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  13939. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  13940. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  13941. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
  13942. v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
  13943. v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
  13944. v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
  13945. v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_),
  13946. v47_(other.v47_), v48_(other.v48_), v49_(other.v49_) {}
  13947. private:
  13948. // No implementation - assignment is unsupported.
  13949. void operator=(const ValueArray49& other);
  13950. const T1 v1_;
  13951. const T2 v2_;
  13952. const T3 v3_;
  13953. const T4 v4_;
  13954. const T5 v5_;
  13955. const T6 v6_;
  13956. const T7 v7_;
  13957. const T8 v8_;
  13958. const T9 v9_;
  13959. const T10 v10_;
  13960. const T11 v11_;
  13961. const T12 v12_;
  13962. const T13 v13_;
  13963. const T14 v14_;
  13964. const T15 v15_;
  13965. const T16 v16_;
  13966. const T17 v17_;
  13967. const T18 v18_;
  13968. const T19 v19_;
  13969. const T20 v20_;
  13970. const T21 v21_;
  13971. const T22 v22_;
  13972. const T23 v23_;
  13973. const T24 v24_;
  13974. const T25 v25_;
  13975. const T26 v26_;
  13976. const T27 v27_;
  13977. const T28 v28_;
  13978. const T29 v29_;
  13979. const T30 v30_;
  13980. const T31 v31_;
  13981. const T32 v32_;
  13982. const T33 v33_;
  13983. const T34 v34_;
  13984. const T35 v35_;
  13985. const T36 v36_;
  13986. const T37 v37_;
  13987. const T38 v38_;
  13988. const T39 v39_;
  13989. const T40 v40_;
  13990. const T41 v41_;
  13991. const T42 v42_;
  13992. const T43 v43_;
  13993. const T44 v44_;
  13994. const T45 v45_;
  13995. const T46 v46_;
  13996. const T47 v47_;
  13997. const T48 v48_;
  13998. const T49 v49_;
  13999. };
  14000. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14001. typename T6, typename T7, typename T8, typename T9, typename T10,
  14002. typename T11, typename T12, typename T13, typename T14, typename T15,
  14003. typename T16, typename T17, typename T18, typename T19, typename T20,
  14004. typename T21, typename T22, typename T23, typename T24, typename T25,
  14005. typename T26, typename T27, typename T28, typename T29, typename T30,
  14006. typename T31, typename T32, typename T33, typename T34, typename T35,
  14007. typename T36, typename T37, typename T38, typename T39, typename T40,
  14008. typename T41, typename T42, typename T43, typename T44, typename T45,
  14009. typename T46, typename T47, typename T48, typename T49, typename T50>
  14010. class ValueArray50 {
  14011. public:
  14012. ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14013. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14014. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14015. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  14016. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  14017. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
  14018. T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  14019. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  14020. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  14021. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  14022. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  14023. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  14024. v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
  14025. v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
  14026. template <typename T>
  14027. operator ParamGenerator<T>() const {
  14028. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  14029. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  14030. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  14031. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  14032. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  14033. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  14034. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  14035. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  14036. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  14037. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  14038. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  14039. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  14040. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  14041. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  14042. static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
  14043. static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
  14044. static_cast<T>(v48_), static_cast<T>(v49_), static_cast<T>(v50_)};
  14045. return ValuesIn(array);
  14046. }
  14047. ValueArray50(const ValueArray50& other) : v1_(other.v1_), v2_(other.v2_),
  14048. v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
  14049. v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
  14050. v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
  14051. v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
  14052. v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
  14053. v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
  14054. v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
  14055. v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
  14056. v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
  14057. v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
  14058. v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_),
  14059. v47_(other.v47_), v48_(other.v48_), v49_(other.v49_), v50_(other.v50_) {}
  14060. private:
  14061. // No implementation - assignment is unsupported.
  14062. void operator=(const ValueArray50& other);
  14063. const T1 v1_;
  14064. const T2 v2_;
  14065. const T3 v3_;
  14066. const T4 v4_;
  14067. const T5 v5_;
  14068. const T6 v6_;
  14069. const T7 v7_;
  14070. const T8 v8_;
  14071. const T9 v9_;
  14072. const T10 v10_;
  14073. const T11 v11_;
  14074. const T12 v12_;
  14075. const T13 v13_;
  14076. const T14 v14_;
  14077. const T15 v15_;
  14078. const T16 v16_;
  14079. const T17 v17_;
  14080. const T18 v18_;
  14081. const T19 v19_;
  14082. const T20 v20_;
  14083. const T21 v21_;
  14084. const T22 v22_;
  14085. const T23 v23_;
  14086. const T24 v24_;
  14087. const T25 v25_;
  14088. const T26 v26_;
  14089. const T27 v27_;
  14090. const T28 v28_;
  14091. const T29 v29_;
  14092. const T30 v30_;
  14093. const T31 v31_;
  14094. const T32 v32_;
  14095. const T33 v33_;
  14096. const T34 v34_;
  14097. const T35 v35_;
  14098. const T36 v36_;
  14099. const T37 v37_;
  14100. const T38 v38_;
  14101. const T39 v39_;
  14102. const T40 v40_;
  14103. const T41 v41_;
  14104. const T42 v42_;
  14105. const T43 v43_;
  14106. const T44 v44_;
  14107. const T45 v45_;
  14108. const T46 v46_;
  14109. const T47 v47_;
  14110. const T48 v48_;
  14111. const T49 v49_;
  14112. const T50 v50_;
  14113. };
  14114. # if GTEST_HAS_COMBINE
  14115. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  14116. //
  14117. // Generates values from the Cartesian product of values produced
  14118. // by the argument generators.
  14119. //
  14120. template <typename T1, typename T2>
  14121. class CartesianProductGenerator2
  14122. : public ParamGeneratorInterface< ::testing::tuple<T1, T2> > {
  14123. public:
  14124. typedef ::testing::tuple<T1, T2> ParamType;
  14125. CartesianProductGenerator2(const ParamGenerator<T1>& g1,
  14126. const ParamGenerator<T2>& g2)
  14127. : g1_(g1), g2_(g2) {}
  14128. virtual ~CartesianProductGenerator2() {}
  14129. virtual ParamIteratorInterface<ParamType>* Begin() const {
  14130. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
  14131. }
  14132. virtual ParamIteratorInterface<ParamType>* End() const {
  14133. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
  14134. }
  14135. private:
  14136. class Iterator : public ParamIteratorInterface<ParamType> {
  14137. public:
  14138. Iterator(const ParamGeneratorInterface<ParamType>* base,
  14139. const ParamGenerator<T1>& g1,
  14140. const typename ParamGenerator<T1>::iterator& current1,
  14141. const ParamGenerator<T2>& g2,
  14142. const typename ParamGenerator<T2>::iterator& current2)
  14143. : base_(base),
  14144. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  14145. begin2_(g2.begin()), end2_(g2.end()), current2_(current2) {
  14146. ComputeCurrentValue();
  14147. }
  14148. virtual ~Iterator() {}
  14149. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  14150. return base_;
  14151. }
  14152. // Advance should not be called on beyond-of-range iterators
  14153. // so no component iterators must be beyond end of range, either.
  14154. virtual void Advance() {
  14155. assert(!AtEnd());
  14156. ++current2_;
  14157. if (current2_ == end2_) {
  14158. current2_ = begin2_;
  14159. ++current1_;
  14160. }
  14161. ComputeCurrentValue();
  14162. }
  14163. virtual ParamIteratorInterface<ParamType>* Clone() const {
  14164. return new Iterator(*this);
  14165. }
  14166. virtual const ParamType* Current() const { return current_value_.get(); }
  14167. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  14168. // Having the same base generator guarantees that the other
  14169. // iterator is of the same type and we can downcast.
  14170. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  14171. << "The program attempted to compare iterators "
  14172. << "from different generators." << std::endl;
  14173. const Iterator* typed_other =
  14174. CheckedDowncastToActualType<const Iterator>(&other);
  14175. // We must report iterators equal if they both point beyond their
  14176. // respective ranges. That can happen in a variety of fashions,
  14177. // so we have to consult AtEnd().
  14178. return (AtEnd() && typed_other->AtEnd()) ||
  14179. (
  14180. current1_ == typed_other->current1_ &&
  14181. current2_ == typed_other->current2_);
  14182. }
  14183. private:
  14184. Iterator(const Iterator& other)
  14185. : base_(other.base_),
  14186. begin1_(other.begin1_),
  14187. end1_(other.end1_),
  14188. current1_(other.current1_),
  14189. begin2_(other.begin2_),
  14190. end2_(other.end2_),
  14191. current2_(other.current2_) {
  14192. ComputeCurrentValue();
  14193. }
  14194. void ComputeCurrentValue() {
  14195. if (!AtEnd())
  14196. current_value_.reset(new ParamType(*current1_, *current2_));
  14197. }
  14198. bool AtEnd() const {
  14199. // We must report iterator past the end of the range when either of the
  14200. // component iterators has reached the end of its range.
  14201. return
  14202. current1_ == end1_ ||
  14203. current2_ == end2_;
  14204. }
  14205. // No implementation - assignment is unsupported.
  14206. void operator=(const Iterator& other);
  14207. const ParamGeneratorInterface<ParamType>* const base_;
  14208. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  14209. // current[i]_ is the actual traversing iterator.
  14210. const typename ParamGenerator<T1>::iterator begin1_;
  14211. const typename ParamGenerator<T1>::iterator end1_;
  14212. typename ParamGenerator<T1>::iterator current1_;
  14213. const typename ParamGenerator<T2>::iterator begin2_;
  14214. const typename ParamGenerator<T2>::iterator end2_;
  14215. typename ParamGenerator<T2>::iterator current2_;
  14216. linked_ptr<ParamType> current_value_;
  14217. }; // class CartesianProductGenerator2::Iterator
  14218. // No implementation - assignment is unsupported.
  14219. void operator=(const CartesianProductGenerator2& other);
  14220. const ParamGenerator<T1> g1_;
  14221. const ParamGenerator<T2> g2_;
  14222. }; // class CartesianProductGenerator2
  14223. template <typename T1, typename T2, typename T3>
  14224. class CartesianProductGenerator3
  14225. : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3> > {
  14226. public:
  14227. typedef ::testing::tuple<T1, T2, T3> ParamType;
  14228. CartesianProductGenerator3(const ParamGenerator<T1>& g1,
  14229. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
  14230. : g1_(g1), g2_(g2), g3_(g3) {}
  14231. virtual ~CartesianProductGenerator3() {}
  14232. virtual ParamIteratorInterface<ParamType>* Begin() const {
  14233. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  14234. g3_.begin());
  14235. }
  14236. virtual ParamIteratorInterface<ParamType>* End() const {
  14237. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
  14238. }
  14239. private:
  14240. class Iterator : public ParamIteratorInterface<ParamType> {
  14241. public:
  14242. Iterator(const ParamGeneratorInterface<ParamType>* base,
  14243. const ParamGenerator<T1>& g1,
  14244. const typename ParamGenerator<T1>::iterator& current1,
  14245. const ParamGenerator<T2>& g2,
  14246. const typename ParamGenerator<T2>::iterator& current2,
  14247. const ParamGenerator<T3>& g3,
  14248. const typename ParamGenerator<T3>::iterator& current3)
  14249. : base_(base),
  14250. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  14251. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  14252. begin3_(g3.begin()), end3_(g3.end()), current3_(current3) {
  14253. ComputeCurrentValue();
  14254. }
  14255. virtual ~Iterator() {}
  14256. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  14257. return base_;
  14258. }
  14259. // Advance should not be called on beyond-of-range iterators
  14260. // so no component iterators must be beyond end of range, either.
  14261. virtual void Advance() {
  14262. assert(!AtEnd());
  14263. ++current3_;
  14264. if (current3_ == end3_) {
  14265. current3_ = begin3_;
  14266. ++current2_;
  14267. }
  14268. if (current2_ == end2_) {
  14269. current2_ = begin2_;
  14270. ++current1_;
  14271. }
  14272. ComputeCurrentValue();
  14273. }
  14274. virtual ParamIteratorInterface<ParamType>* Clone() const {
  14275. return new Iterator(*this);
  14276. }
  14277. virtual const ParamType* Current() const { return current_value_.get(); }
  14278. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  14279. // Having the same base generator guarantees that the other
  14280. // iterator is of the same type and we can downcast.
  14281. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  14282. << "The program attempted to compare iterators "
  14283. << "from different generators." << std::endl;
  14284. const Iterator* typed_other =
  14285. CheckedDowncastToActualType<const Iterator>(&other);
  14286. // We must report iterators equal if they both point beyond their
  14287. // respective ranges. That can happen in a variety of fashions,
  14288. // so we have to consult AtEnd().
  14289. return (AtEnd() && typed_other->AtEnd()) ||
  14290. (
  14291. current1_ == typed_other->current1_ &&
  14292. current2_ == typed_other->current2_ &&
  14293. current3_ == typed_other->current3_);
  14294. }
  14295. private:
  14296. Iterator(const Iterator& other)
  14297. : base_(other.base_),
  14298. begin1_(other.begin1_),
  14299. end1_(other.end1_),
  14300. current1_(other.current1_),
  14301. begin2_(other.begin2_),
  14302. end2_(other.end2_),
  14303. current2_(other.current2_),
  14304. begin3_(other.begin3_),
  14305. end3_(other.end3_),
  14306. current3_(other.current3_) {
  14307. ComputeCurrentValue();
  14308. }
  14309. void ComputeCurrentValue() {
  14310. if (!AtEnd())
  14311. current_value_.reset(new ParamType(*current1_, *current2_, *current3_));
  14312. }
  14313. bool AtEnd() const {
  14314. // We must report iterator past the end of the range when either of the
  14315. // component iterators has reached the end of its range.
  14316. return
  14317. current1_ == end1_ ||
  14318. current2_ == end2_ ||
  14319. current3_ == end3_;
  14320. }
  14321. // No implementation - assignment is unsupported.
  14322. void operator=(const Iterator& other);
  14323. const ParamGeneratorInterface<ParamType>* const base_;
  14324. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  14325. // current[i]_ is the actual traversing iterator.
  14326. const typename ParamGenerator<T1>::iterator begin1_;
  14327. const typename ParamGenerator<T1>::iterator end1_;
  14328. typename ParamGenerator<T1>::iterator current1_;
  14329. const typename ParamGenerator<T2>::iterator begin2_;
  14330. const typename ParamGenerator<T2>::iterator end2_;
  14331. typename ParamGenerator<T2>::iterator current2_;
  14332. const typename ParamGenerator<T3>::iterator begin3_;
  14333. const typename ParamGenerator<T3>::iterator end3_;
  14334. typename ParamGenerator<T3>::iterator current3_;
  14335. linked_ptr<ParamType> current_value_;
  14336. }; // class CartesianProductGenerator3::Iterator
  14337. // No implementation - assignment is unsupported.
  14338. void operator=(const CartesianProductGenerator3& other);
  14339. const ParamGenerator<T1> g1_;
  14340. const ParamGenerator<T2> g2_;
  14341. const ParamGenerator<T3> g3_;
  14342. }; // class CartesianProductGenerator3
  14343. template <typename T1, typename T2, typename T3, typename T4>
  14344. class CartesianProductGenerator4
  14345. : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4> > {
  14346. public:
  14347. typedef ::testing::tuple<T1, T2, T3, T4> ParamType;
  14348. CartesianProductGenerator4(const ParamGenerator<T1>& g1,
  14349. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  14350. const ParamGenerator<T4>& g4)
  14351. : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
  14352. virtual ~CartesianProductGenerator4() {}
  14353. virtual ParamIteratorInterface<ParamType>* Begin() const {
  14354. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  14355. g3_.begin(), g4_, g4_.begin());
  14356. }
  14357. virtual ParamIteratorInterface<ParamType>* End() const {
  14358. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  14359. g4_, g4_.end());
  14360. }
  14361. private:
  14362. class Iterator : public ParamIteratorInterface<ParamType> {
  14363. public:
  14364. Iterator(const ParamGeneratorInterface<ParamType>* base,
  14365. const ParamGenerator<T1>& g1,
  14366. const typename ParamGenerator<T1>::iterator& current1,
  14367. const ParamGenerator<T2>& g2,
  14368. const typename ParamGenerator<T2>::iterator& current2,
  14369. const ParamGenerator<T3>& g3,
  14370. const typename ParamGenerator<T3>::iterator& current3,
  14371. const ParamGenerator<T4>& g4,
  14372. const typename ParamGenerator<T4>::iterator& current4)
  14373. : base_(base),
  14374. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  14375. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  14376. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  14377. begin4_(g4.begin()), end4_(g4.end()), current4_(current4) {
  14378. ComputeCurrentValue();
  14379. }
  14380. virtual ~Iterator() {}
  14381. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  14382. return base_;
  14383. }
  14384. // Advance should not be called on beyond-of-range iterators
  14385. // so no component iterators must be beyond end of range, either.
  14386. virtual void Advance() {
  14387. assert(!AtEnd());
  14388. ++current4_;
  14389. if (current4_ == end4_) {
  14390. current4_ = begin4_;
  14391. ++current3_;
  14392. }
  14393. if (current3_ == end3_) {
  14394. current3_ = begin3_;
  14395. ++current2_;
  14396. }
  14397. if (current2_ == end2_) {
  14398. current2_ = begin2_;
  14399. ++current1_;
  14400. }
  14401. ComputeCurrentValue();
  14402. }
  14403. virtual ParamIteratorInterface<ParamType>* Clone() const {
  14404. return new Iterator(*this);
  14405. }
  14406. virtual const ParamType* Current() const { return current_value_.get(); }
  14407. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  14408. // Having the same base generator guarantees that the other
  14409. // iterator is of the same type and we can downcast.
  14410. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  14411. << "The program attempted to compare iterators "
  14412. << "from different generators." << std::endl;
  14413. const Iterator* typed_other =
  14414. CheckedDowncastToActualType<const Iterator>(&other);
  14415. // We must report iterators equal if they both point beyond their
  14416. // respective ranges. That can happen in a variety of fashions,
  14417. // so we have to consult AtEnd().
  14418. return (AtEnd() && typed_other->AtEnd()) ||
  14419. (
  14420. current1_ == typed_other->current1_ &&
  14421. current2_ == typed_other->current2_ &&
  14422. current3_ == typed_other->current3_ &&
  14423. current4_ == typed_other->current4_);
  14424. }
  14425. private:
  14426. Iterator(const Iterator& other)
  14427. : base_(other.base_),
  14428. begin1_(other.begin1_),
  14429. end1_(other.end1_),
  14430. current1_(other.current1_),
  14431. begin2_(other.begin2_),
  14432. end2_(other.end2_),
  14433. current2_(other.current2_),
  14434. begin3_(other.begin3_),
  14435. end3_(other.end3_),
  14436. current3_(other.current3_),
  14437. begin4_(other.begin4_),
  14438. end4_(other.end4_),
  14439. current4_(other.current4_) {
  14440. ComputeCurrentValue();
  14441. }
  14442. void ComputeCurrentValue() {
  14443. if (!AtEnd())
  14444. current_value_.reset(new ParamType(*current1_, *current2_, *current3_,
  14445. *current4_));
  14446. }
  14447. bool AtEnd() const {
  14448. // We must report iterator past the end of the range when either of the
  14449. // component iterators has reached the end of its range.
  14450. return
  14451. current1_ == end1_ ||
  14452. current2_ == end2_ ||
  14453. current3_ == end3_ ||
  14454. current4_ == end4_;
  14455. }
  14456. // No implementation - assignment is unsupported.
  14457. void operator=(const Iterator& other);
  14458. const ParamGeneratorInterface<ParamType>* const base_;
  14459. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  14460. // current[i]_ is the actual traversing iterator.
  14461. const typename ParamGenerator<T1>::iterator begin1_;
  14462. const typename ParamGenerator<T1>::iterator end1_;
  14463. typename ParamGenerator<T1>::iterator current1_;
  14464. const typename ParamGenerator<T2>::iterator begin2_;
  14465. const typename ParamGenerator<T2>::iterator end2_;
  14466. typename ParamGenerator<T2>::iterator current2_;
  14467. const typename ParamGenerator<T3>::iterator begin3_;
  14468. const typename ParamGenerator<T3>::iterator end3_;
  14469. typename ParamGenerator<T3>::iterator current3_;
  14470. const typename ParamGenerator<T4>::iterator begin4_;
  14471. const typename ParamGenerator<T4>::iterator end4_;
  14472. typename ParamGenerator<T4>::iterator current4_;
  14473. linked_ptr<ParamType> current_value_;
  14474. }; // class CartesianProductGenerator4::Iterator
  14475. // No implementation - assignment is unsupported.
  14476. void operator=(const CartesianProductGenerator4& other);
  14477. const ParamGenerator<T1> g1_;
  14478. const ParamGenerator<T2> g2_;
  14479. const ParamGenerator<T3> g3_;
  14480. const ParamGenerator<T4> g4_;
  14481. }; // class CartesianProductGenerator4
  14482. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  14483. class CartesianProductGenerator5
  14484. : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5> > {
  14485. public:
  14486. typedef ::testing::tuple<T1, T2, T3, T4, T5> ParamType;
  14487. CartesianProductGenerator5(const ParamGenerator<T1>& g1,
  14488. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  14489. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
  14490. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
  14491. virtual ~CartesianProductGenerator5() {}
  14492. virtual ParamIteratorInterface<ParamType>* Begin() const {
  14493. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  14494. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
  14495. }
  14496. virtual ParamIteratorInterface<ParamType>* End() const {
  14497. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  14498. g4_, g4_.end(), g5_, g5_.end());
  14499. }
  14500. private:
  14501. class Iterator : public ParamIteratorInterface<ParamType> {
  14502. public:
  14503. Iterator(const ParamGeneratorInterface<ParamType>* base,
  14504. const ParamGenerator<T1>& g1,
  14505. const typename ParamGenerator<T1>::iterator& current1,
  14506. const ParamGenerator<T2>& g2,
  14507. const typename ParamGenerator<T2>::iterator& current2,
  14508. const ParamGenerator<T3>& g3,
  14509. const typename ParamGenerator<T3>::iterator& current3,
  14510. const ParamGenerator<T4>& g4,
  14511. const typename ParamGenerator<T4>::iterator& current4,
  14512. const ParamGenerator<T5>& g5,
  14513. const typename ParamGenerator<T5>::iterator& current5)
  14514. : base_(base),
  14515. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  14516. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  14517. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  14518. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  14519. begin5_(g5.begin()), end5_(g5.end()), current5_(current5) {
  14520. ComputeCurrentValue();
  14521. }
  14522. virtual ~Iterator() {}
  14523. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  14524. return base_;
  14525. }
  14526. // Advance should not be called on beyond-of-range iterators
  14527. // so no component iterators must be beyond end of range, either.
  14528. virtual void Advance() {
  14529. assert(!AtEnd());
  14530. ++current5_;
  14531. if (current5_ == end5_) {
  14532. current5_ = begin5_;
  14533. ++current4_;
  14534. }
  14535. if (current4_ == end4_) {
  14536. current4_ = begin4_;
  14537. ++current3_;
  14538. }
  14539. if (current3_ == end3_) {
  14540. current3_ = begin3_;
  14541. ++current2_;
  14542. }
  14543. if (current2_ == end2_) {
  14544. current2_ = begin2_;
  14545. ++current1_;
  14546. }
  14547. ComputeCurrentValue();
  14548. }
  14549. virtual ParamIteratorInterface<ParamType>* Clone() const {
  14550. return new Iterator(*this);
  14551. }
  14552. virtual const ParamType* Current() const { return current_value_.get(); }
  14553. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  14554. // Having the same base generator guarantees that the other
  14555. // iterator is of the same type and we can downcast.
  14556. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  14557. << "The program attempted to compare iterators "
  14558. << "from different generators." << std::endl;
  14559. const Iterator* typed_other =
  14560. CheckedDowncastToActualType<const Iterator>(&other);
  14561. // We must report iterators equal if they both point beyond their
  14562. // respective ranges. That can happen in a variety of fashions,
  14563. // so we have to consult AtEnd().
  14564. return (AtEnd() && typed_other->AtEnd()) ||
  14565. (
  14566. current1_ == typed_other->current1_ &&
  14567. current2_ == typed_other->current2_ &&
  14568. current3_ == typed_other->current3_ &&
  14569. current4_ == typed_other->current4_ &&
  14570. current5_ == typed_other->current5_);
  14571. }
  14572. private:
  14573. Iterator(const Iterator& other)
  14574. : base_(other.base_),
  14575. begin1_(other.begin1_),
  14576. end1_(other.end1_),
  14577. current1_(other.current1_),
  14578. begin2_(other.begin2_),
  14579. end2_(other.end2_),
  14580. current2_(other.current2_),
  14581. begin3_(other.begin3_),
  14582. end3_(other.end3_),
  14583. current3_(other.current3_),
  14584. begin4_(other.begin4_),
  14585. end4_(other.end4_),
  14586. current4_(other.current4_),
  14587. begin5_(other.begin5_),
  14588. end5_(other.end5_),
  14589. current5_(other.current5_) {
  14590. ComputeCurrentValue();
  14591. }
  14592. void ComputeCurrentValue() {
  14593. if (!AtEnd())
  14594. current_value_.reset(new ParamType(*current1_, *current2_, *current3_,
  14595. *current4_, *current5_));
  14596. }
  14597. bool AtEnd() const {
  14598. // We must report iterator past the end of the range when either of the
  14599. // component iterators has reached the end of its range.
  14600. return
  14601. current1_ == end1_ ||
  14602. current2_ == end2_ ||
  14603. current3_ == end3_ ||
  14604. current4_ == end4_ ||
  14605. current5_ == end5_;
  14606. }
  14607. // No implementation - assignment is unsupported.
  14608. void operator=(const Iterator& other);
  14609. const ParamGeneratorInterface<ParamType>* const base_;
  14610. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  14611. // current[i]_ is the actual traversing iterator.
  14612. const typename ParamGenerator<T1>::iterator begin1_;
  14613. const typename ParamGenerator<T1>::iterator end1_;
  14614. typename ParamGenerator<T1>::iterator current1_;
  14615. const typename ParamGenerator<T2>::iterator begin2_;
  14616. const typename ParamGenerator<T2>::iterator end2_;
  14617. typename ParamGenerator<T2>::iterator current2_;
  14618. const typename ParamGenerator<T3>::iterator begin3_;
  14619. const typename ParamGenerator<T3>::iterator end3_;
  14620. typename ParamGenerator<T3>::iterator current3_;
  14621. const typename ParamGenerator<T4>::iterator begin4_;
  14622. const typename ParamGenerator<T4>::iterator end4_;
  14623. typename ParamGenerator<T4>::iterator current4_;
  14624. const typename ParamGenerator<T5>::iterator begin5_;
  14625. const typename ParamGenerator<T5>::iterator end5_;
  14626. typename ParamGenerator<T5>::iterator current5_;
  14627. linked_ptr<ParamType> current_value_;
  14628. }; // class CartesianProductGenerator5::Iterator
  14629. // No implementation - assignment is unsupported.
  14630. void operator=(const CartesianProductGenerator5& other);
  14631. const ParamGenerator<T1> g1_;
  14632. const ParamGenerator<T2> g2_;
  14633. const ParamGenerator<T3> g3_;
  14634. const ParamGenerator<T4> g4_;
  14635. const ParamGenerator<T5> g5_;
  14636. }; // class CartesianProductGenerator5
  14637. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14638. typename T6>
  14639. class CartesianProductGenerator6
  14640. : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5,
  14641. T6> > {
  14642. public:
  14643. typedef ::testing::tuple<T1, T2, T3, T4, T5, T6> ParamType;
  14644. CartesianProductGenerator6(const ParamGenerator<T1>& g1,
  14645. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  14646. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  14647. const ParamGenerator<T6>& g6)
  14648. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
  14649. virtual ~CartesianProductGenerator6() {}
  14650. virtual ParamIteratorInterface<ParamType>* Begin() const {
  14651. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  14652. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
  14653. }
  14654. virtual ParamIteratorInterface<ParamType>* End() const {
  14655. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  14656. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
  14657. }
  14658. private:
  14659. class Iterator : public ParamIteratorInterface<ParamType> {
  14660. public:
  14661. Iterator(const ParamGeneratorInterface<ParamType>* base,
  14662. const ParamGenerator<T1>& g1,
  14663. const typename ParamGenerator<T1>::iterator& current1,
  14664. const ParamGenerator<T2>& g2,
  14665. const typename ParamGenerator<T2>::iterator& current2,
  14666. const ParamGenerator<T3>& g3,
  14667. const typename ParamGenerator<T3>::iterator& current3,
  14668. const ParamGenerator<T4>& g4,
  14669. const typename ParamGenerator<T4>::iterator& current4,
  14670. const ParamGenerator<T5>& g5,
  14671. const typename ParamGenerator<T5>::iterator& current5,
  14672. const ParamGenerator<T6>& g6,
  14673. const typename ParamGenerator<T6>::iterator& current6)
  14674. : base_(base),
  14675. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  14676. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  14677. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  14678. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  14679. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  14680. begin6_(g6.begin()), end6_(g6.end()), current6_(current6) {
  14681. ComputeCurrentValue();
  14682. }
  14683. virtual ~Iterator() {}
  14684. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  14685. return base_;
  14686. }
  14687. // Advance should not be called on beyond-of-range iterators
  14688. // so no component iterators must be beyond end of range, either.
  14689. virtual void Advance() {
  14690. assert(!AtEnd());
  14691. ++current6_;
  14692. if (current6_ == end6_) {
  14693. current6_ = begin6_;
  14694. ++current5_;
  14695. }
  14696. if (current5_ == end5_) {
  14697. current5_ = begin5_;
  14698. ++current4_;
  14699. }
  14700. if (current4_ == end4_) {
  14701. current4_ = begin4_;
  14702. ++current3_;
  14703. }
  14704. if (current3_ == end3_) {
  14705. current3_ = begin3_;
  14706. ++current2_;
  14707. }
  14708. if (current2_ == end2_) {
  14709. current2_ = begin2_;
  14710. ++current1_;
  14711. }
  14712. ComputeCurrentValue();
  14713. }
  14714. virtual ParamIteratorInterface<ParamType>* Clone() const {
  14715. return new Iterator(*this);
  14716. }
  14717. virtual const ParamType* Current() const { return current_value_.get(); }
  14718. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  14719. // Having the same base generator guarantees that the other
  14720. // iterator is of the same type and we can downcast.
  14721. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  14722. << "The program attempted to compare iterators "
  14723. << "from different generators." << std::endl;
  14724. const Iterator* typed_other =
  14725. CheckedDowncastToActualType<const Iterator>(&other);
  14726. // We must report iterators equal if they both point beyond their
  14727. // respective ranges. That can happen in a variety of fashions,
  14728. // so we have to consult AtEnd().
  14729. return (AtEnd() && typed_other->AtEnd()) ||
  14730. (
  14731. current1_ == typed_other->current1_ &&
  14732. current2_ == typed_other->current2_ &&
  14733. current3_ == typed_other->current3_ &&
  14734. current4_ == typed_other->current4_ &&
  14735. current5_ == typed_other->current5_ &&
  14736. current6_ == typed_other->current6_);
  14737. }
  14738. private:
  14739. Iterator(const Iterator& other)
  14740. : base_(other.base_),
  14741. begin1_(other.begin1_),
  14742. end1_(other.end1_),
  14743. current1_(other.current1_),
  14744. begin2_(other.begin2_),
  14745. end2_(other.end2_),
  14746. current2_(other.current2_),
  14747. begin3_(other.begin3_),
  14748. end3_(other.end3_),
  14749. current3_(other.current3_),
  14750. begin4_(other.begin4_),
  14751. end4_(other.end4_),
  14752. current4_(other.current4_),
  14753. begin5_(other.begin5_),
  14754. end5_(other.end5_),
  14755. current5_(other.current5_),
  14756. begin6_(other.begin6_),
  14757. end6_(other.end6_),
  14758. current6_(other.current6_) {
  14759. ComputeCurrentValue();
  14760. }
  14761. void ComputeCurrentValue() {
  14762. if (!AtEnd())
  14763. current_value_.reset(new ParamType(*current1_, *current2_, *current3_,
  14764. *current4_, *current5_, *current6_));
  14765. }
  14766. bool AtEnd() const {
  14767. // We must report iterator past the end of the range when either of the
  14768. // component iterators has reached the end of its range.
  14769. return
  14770. current1_ == end1_ ||
  14771. current2_ == end2_ ||
  14772. current3_ == end3_ ||
  14773. current4_ == end4_ ||
  14774. current5_ == end5_ ||
  14775. current6_ == end6_;
  14776. }
  14777. // No implementation - assignment is unsupported.
  14778. void operator=(const Iterator& other);
  14779. const ParamGeneratorInterface<ParamType>* const base_;
  14780. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  14781. // current[i]_ is the actual traversing iterator.
  14782. const typename ParamGenerator<T1>::iterator begin1_;
  14783. const typename ParamGenerator<T1>::iterator end1_;
  14784. typename ParamGenerator<T1>::iterator current1_;
  14785. const typename ParamGenerator<T2>::iterator begin2_;
  14786. const typename ParamGenerator<T2>::iterator end2_;
  14787. typename ParamGenerator<T2>::iterator current2_;
  14788. const typename ParamGenerator<T3>::iterator begin3_;
  14789. const typename ParamGenerator<T3>::iterator end3_;
  14790. typename ParamGenerator<T3>::iterator current3_;
  14791. const typename ParamGenerator<T4>::iterator begin4_;
  14792. const typename ParamGenerator<T4>::iterator end4_;
  14793. typename ParamGenerator<T4>::iterator current4_;
  14794. const typename ParamGenerator<T5>::iterator begin5_;
  14795. const typename ParamGenerator<T5>::iterator end5_;
  14796. typename ParamGenerator<T5>::iterator current5_;
  14797. const typename ParamGenerator<T6>::iterator begin6_;
  14798. const typename ParamGenerator<T6>::iterator end6_;
  14799. typename ParamGenerator<T6>::iterator current6_;
  14800. linked_ptr<ParamType> current_value_;
  14801. }; // class CartesianProductGenerator6::Iterator
  14802. // No implementation - assignment is unsupported.
  14803. void operator=(const CartesianProductGenerator6& other);
  14804. const ParamGenerator<T1> g1_;
  14805. const ParamGenerator<T2> g2_;
  14806. const ParamGenerator<T3> g3_;
  14807. const ParamGenerator<T4> g4_;
  14808. const ParamGenerator<T5> g5_;
  14809. const ParamGenerator<T6> g6_;
  14810. }; // class CartesianProductGenerator6
  14811. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14812. typename T6, typename T7>
  14813. class CartesianProductGenerator7
  14814. : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
  14815. T7> > {
  14816. public:
  14817. typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
  14818. CartesianProductGenerator7(const ParamGenerator<T1>& g1,
  14819. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  14820. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  14821. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
  14822. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
  14823. virtual ~CartesianProductGenerator7() {}
  14824. virtual ParamIteratorInterface<ParamType>* Begin() const {
  14825. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  14826. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  14827. g7_.begin());
  14828. }
  14829. virtual ParamIteratorInterface<ParamType>* End() const {
  14830. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  14831. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
  14832. }
  14833. private:
  14834. class Iterator : public ParamIteratorInterface<ParamType> {
  14835. public:
  14836. Iterator(const ParamGeneratorInterface<ParamType>* base,
  14837. const ParamGenerator<T1>& g1,
  14838. const typename ParamGenerator<T1>::iterator& current1,
  14839. const ParamGenerator<T2>& g2,
  14840. const typename ParamGenerator<T2>::iterator& current2,
  14841. const ParamGenerator<T3>& g3,
  14842. const typename ParamGenerator<T3>::iterator& current3,
  14843. const ParamGenerator<T4>& g4,
  14844. const typename ParamGenerator<T4>::iterator& current4,
  14845. const ParamGenerator<T5>& g5,
  14846. const typename ParamGenerator<T5>::iterator& current5,
  14847. const ParamGenerator<T6>& g6,
  14848. const typename ParamGenerator<T6>::iterator& current6,
  14849. const ParamGenerator<T7>& g7,
  14850. const typename ParamGenerator<T7>::iterator& current7)
  14851. : base_(base),
  14852. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  14853. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  14854. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  14855. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  14856. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  14857. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  14858. begin7_(g7.begin()), end7_(g7.end()), current7_(current7) {
  14859. ComputeCurrentValue();
  14860. }
  14861. virtual ~Iterator() {}
  14862. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  14863. return base_;
  14864. }
  14865. // Advance should not be called on beyond-of-range iterators
  14866. // so no component iterators must be beyond end of range, either.
  14867. virtual void Advance() {
  14868. assert(!AtEnd());
  14869. ++current7_;
  14870. if (current7_ == end7_) {
  14871. current7_ = begin7_;
  14872. ++current6_;
  14873. }
  14874. if (current6_ == end6_) {
  14875. current6_ = begin6_;
  14876. ++current5_;
  14877. }
  14878. if (current5_ == end5_) {
  14879. current5_ = begin5_;
  14880. ++current4_;
  14881. }
  14882. if (current4_ == end4_) {
  14883. current4_ = begin4_;
  14884. ++current3_;
  14885. }
  14886. if (current3_ == end3_) {
  14887. current3_ = begin3_;
  14888. ++current2_;
  14889. }
  14890. if (current2_ == end2_) {
  14891. current2_ = begin2_;
  14892. ++current1_;
  14893. }
  14894. ComputeCurrentValue();
  14895. }
  14896. virtual ParamIteratorInterface<ParamType>* Clone() const {
  14897. return new Iterator(*this);
  14898. }
  14899. virtual const ParamType* Current() const { return current_value_.get(); }
  14900. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  14901. // Having the same base generator guarantees that the other
  14902. // iterator is of the same type and we can downcast.
  14903. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  14904. << "The program attempted to compare iterators "
  14905. << "from different generators." << std::endl;
  14906. const Iterator* typed_other =
  14907. CheckedDowncastToActualType<const Iterator>(&other);
  14908. // We must report iterators equal if they both point beyond their
  14909. // respective ranges. That can happen in a variety of fashions,
  14910. // so we have to consult AtEnd().
  14911. return (AtEnd() && typed_other->AtEnd()) ||
  14912. (
  14913. current1_ == typed_other->current1_ &&
  14914. current2_ == typed_other->current2_ &&
  14915. current3_ == typed_other->current3_ &&
  14916. current4_ == typed_other->current4_ &&
  14917. current5_ == typed_other->current5_ &&
  14918. current6_ == typed_other->current6_ &&
  14919. current7_ == typed_other->current7_);
  14920. }
  14921. private:
  14922. Iterator(const Iterator& other)
  14923. : base_(other.base_),
  14924. begin1_(other.begin1_),
  14925. end1_(other.end1_),
  14926. current1_(other.current1_),
  14927. begin2_(other.begin2_),
  14928. end2_(other.end2_),
  14929. current2_(other.current2_),
  14930. begin3_(other.begin3_),
  14931. end3_(other.end3_),
  14932. current3_(other.current3_),
  14933. begin4_(other.begin4_),
  14934. end4_(other.end4_),
  14935. current4_(other.current4_),
  14936. begin5_(other.begin5_),
  14937. end5_(other.end5_),
  14938. current5_(other.current5_),
  14939. begin6_(other.begin6_),
  14940. end6_(other.end6_),
  14941. current6_(other.current6_),
  14942. begin7_(other.begin7_),
  14943. end7_(other.end7_),
  14944. current7_(other.current7_) {
  14945. ComputeCurrentValue();
  14946. }
  14947. void ComputeCurrentValue() {
  14948. if (!AtEnd())
  14949. current_value_.reset(new ParamType(*current1_, *current2_, *current3_,
  14950. *current4_, *current5_, *current6_, *current7_));
  14951. }
  14952. bool AtEnd() const {
  14953. // We must report iterator past the end of the range when either of the
  14954. // component iterators has reached the end of its range.
  14955. return
  14956. current1_ == end1_ ||
  14957. current2_ == end2_ ||
  14958. current3_ == end3_ ||
  14959. current4_ == end4_ ||
  14960. current5_ == end5_ ||
  14961. current6_ == end6_ ||
  14962. current7_ == end7_;
  14963. }
  14964. // No implementation - assignment is unsupported.
  14965. void operator=(const Iterator& other);
  14966. const ParamGeneratorInterface<ParamType>* const base_;
  14967. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  14968. // current[i]_ is the actual traversing iterator.
  14969. const typename ParamGenerator<T1>::iterator begin1_;
  14970. const typename ParamGenerator<T1>::iterator end1_;
  14971. typename ParamGenerator<T1>::iterator current1_;
  14972. const typename ParamGenerator<T2>::iterator begin2_;
  14973. const typename ParamGenerator<T2>::iterator end2_;
  14974. typename ParamGenerator<T2>::iterator current2_;
  14975. const typename ParamGenerator<T3>::iterator begin3_;
  14976. const typename ParamGenerator<T3>::iterator end3_;
  14977. typename ParamGenerator<T3>::iterator current3_;
  14978. const typename ParamGenerator<T4>::iterator begin4_;
  14979. const typename ParamGenerator<T4>::iterator end4_;
  14980. typename ParamGenerator<T4>::iterator current4_;
  14981. const typename ParamGenerator<T5>::iterator begin5_;
  14982. const typename ParamGenerator<T5>::iterator end5_;
  14983. typename ParamGenerator<T5>::iterator current5_;
  14984. const typename ParamGenerator<T6>::iterator begin6_;
  14985. const typename ParamGenerator<T6>::iterator end6_;
  14986. typename ParamGenerator<T6>::iterator current6_;
  14987. const typename ParamGenerator<T7>::iterator begin7_;
  14988. const typename ParamGenerator<T7>::iterator end7_;
  14989. typename ParamGenerator<T7>::iterator current7_;
  14990. linked_ptr<ParamType> current_value_;
  14991. }; // class CartesianProductGenerator7::Iterator
  14992. // No implementation - assignment is unsupported.
  14993. void operator=(const CartesianProductGenerator7& other);
  14994. const ParamGenerator<T1> g1_;
  14995. const ParamGenerator<T2> g2_;
  14996. const ParamGenerator<T3> g3_;
  14997. const ParamGenerator<T4> g4_;
  14998. const ParamGenerator<T5> g5_;
  14999. const ParamGenerator<T6> g6_;
  15000. const ParamGenerator<T7> g7_;
  15001. }; // class CartesianProductGenerator7
  15002. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15003. typename T6, typename T7, typename T8>
  15004. class CartesianProductGenerator8
  15005. : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
  15006. T7, T8> > {
  15007. public:
  15008. typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
  15009. CartesianProductGenerator8(const ParamGenerator<T1>& g1,
  15010. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  15011. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  15012. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
  15013. const ParamGenerator<T8>& g8)
  15014. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
  15015. g8_(g8) {}
  15016. virtual ~CartesianProductGenerator8() {}
  15017. virtual ParamIteratorInterface<ParamType>* Begin() const {
  15018. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  15019. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  15020. g7_.begin(), g8_, g8_.begin());
  15021. }
  15022. virtual ParamIteratorInterface<ParamType>* End() const {
  15023. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  15024. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
  15025. g8_.end());
  15026. }
  15027. private:
  15028. class Iterator : public ParamIteratorInterface<ParamType> {
  15029. public:
  15030. Iterator(const ParamGeneratorInterface<ParamType>* base,
  15031. const ParamGenerator<T1>& g1,
  15032. const typename ParamGenerator<T1>::iterator& current1,
  15033. const ParamGenerator<T2>& g2,
  15034. const typename ParamGenerator<T2>::iterator& current2,
  15035. const ParamGenerator<T3>& g3,
  15036. const typename ParamGenerator<T3>::iterator& current3,
  15037. const ParamGenerator<T4>& g4,
  15038. const typename ParamGenerator<T4>::iterator& current4,
  15039. const ParamGenerator<T5>& g5,
  15040. const typename ParamGenerator<T5>::iterator& current5,
  15041. const ParamGenerator<T6>& g6,
  15042. const typename ParamGenerator<T6>::iterator& current6,
  15043. const ParamGenerator<T7>& g7,
  15044. const typename ParamGenerator<T7>::iterator& current7,
  15045. const ParamGenerator<T8>& g8,
  15046. const typename ParamGenerator<T8>::iterator& current8)
  15047. : base_(base),
  15048. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  15049. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  15050. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  15051. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  15052. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  15053. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  15054. begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
  15055. begin8_(g8.begin()), end8_(g8.end()), current8_(current8) {
  15056. ComputeCurrentValue();
  15057. }
  15058. virtual ~Iterator() {}
  15059. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  15060. return base_;
  15061. }
  15062. // Advance should not be called on beyond-of-range iterators
  15063. // so no component iterators must be beyond end of range, either.
  15064. virtual void Advance() {
  15065. assert(!AtEnd());
  15066. ++current8_;
  15067. if (current8_ == end8_) {
  15068. current8_ = begin8_;
  15069. ++current7_;
  15070. }
  15071. if (current7_ == end7_) {
  15072. current7_ = begin7_;
  15073. ++current6_;
  15074. }
  15075. if (current6_ == end6_) {
  15076. current6_ = begin6_;
  15077. ++current5_;
  15078. }
  15079. if (current5_ == end5_) {
  15080. current5_ = begin5_;
  15081. ++current4_;
  15082. }
  15083. if (current4_ == end4_) {
  15084. current4_ = begin4_;
  15085. ++current3_;
  15086. }
  15087. if (current3_ == end3_) {
  15088. current3_ = begin3_;
  15089. ++current2_;
  15090. }
  15091. if (current2_ == end2_) {
  15092. current2_ = begin2_;
  15093. ++current1_;
  15094. }
  15095. ComputeCurrentValue();
  15096. }
  15097. virtual ParamIteratorInterface<ParamType>* Clone() const {
  15098. return new Iterator(*this);
  15099. }
  15100. virtual const ParamType* Current() const { return current_value_.get(); }
  15101. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  15102. // Having the same base generator guarantees that the other
  15103. // iterator is of the same type and we can downcast.
  15104. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  15105. << "The program attempted to compare iterators "
  15106. << "from different generators." << std::endl;
  15107. const Iterator* typed_other =
  15108. CheckedDowncastToActualType<const Iterator>(&other);
  15109. // We must report iterators equal if they both point beyond their
  15110. // respective ranges. That can happen in a variety of fashions,
  15111. // so we have to consult AtEnd().
  15112. return (AtEnd() && typed_other->AtEnd()) ||
  15113. (
  15114. current1_ == typed_other->current1_ &&
  15115. current2_ == typed_other->current2_ &&
  15116. current3_ == typed_other->current3_ &&
  15117. current4_ == typed_other->current4_ &&
  15118. current5_ == typed_other->current5_ &&
  15119. current6_ == typed_other->current6_ &&
  15120. current7_ == typed_other->current7_ &&
  15121. current8_ == typed_other->current8_);
  15122. }
  15123. private:
  15124. Iterator(const Iterator& other)
  15125. : base_(other.base_),
  15126. begin1_(other.begin1_),
  15127. end1_(other.end1_),
  15128. current1_(other.current1_),
  15129. begin2_(other.begin2_),
  15130. end2_(other.end2_),
  15131. current2_(other.current2_),
  15132. begin3_(other.begin3_),
  15133. end3_(other.end3_),
  15134. current3_(other.current3_),
  15135. begin4_(other.begin4_),
  15136. end4_(other.end4_),
  15137. current4_(other.current4_),
  15138. begin5_(other.begin5_),
  15139. end5_(other.end5_),
  15140. current5_(other.current5_),
  15141. begin6_(other.begin6_),
  15142. end6_(other.end6_),
  15143. current6_(other.current6_),
  15144. begin7_(other.begin7_),
  15145. end7_(other.end7_),
  15146. current7_(other.current7_),
  15147. begin8_(other.begin8_),
  15148. end8_(other.end8_),
  15149. current8_(other.current8_) {
  15150. ComputeCurrentValue();
  15151. }
  15152. void ComputeCurrentValue() {
  15153. if (!AtEnd())
  15154. current_value_.reset(new ParamType(*current1_, *current2_, *current3_,
  15155. *current4_, *current5_, *current6_, *current7_, *current8_));
  15156. }
  15157. bool AtEnd() const {
  15158. // We must report iterator past the end of the range when either of the
  15159. // component iterators has reached the end of its range.
  15160. return
  15161. current1_ == end1_ ||
  15162. current2_ == end2_ ||
  15163. current3_ == end3_ ||
  15164. current4_ == end4_ ||
  15165. current5_ == end5_ ||
  15166. current6_ == end6_ ||
  15167. current7_ == end7_ ||
  15168. current8_ == end8_;
  15169. }
  15170. // No implementation - assignment is unsupported.
  15171. void operator=(const Iterator& other);
  15172. const ParamGeneratorInterface<ParamType>* const base_;
  15173. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  15174. // current[i]_ is the actual traversing iterator.
  15175. const typename ParamGenerator<T1>::iterator begin1_;
  15176. const typename ParamGenerator<T1>::iterator end1_;
  15177. typename ParamGenerator<T1>::iterator current1_;
  15178. const typename ParamGenerator<T2>::iterator begin2_;
  15179. const typename ParamGenerator<T2>::iterator end2_;
  15180. typename ParamGenerator<T2>::iterator current2_;
  15181. const typename ParamGenerator<T3>::iterator begin3_;
  15182. const typename ParamGenerator<T3>::iterator end3_;
  15183. typename ParamGenerator<T3>::iterator current3_;
  15184. const typename ParamGenerator<T4>::iterator begin4_;
  15185. const typename ParamGenerator<T4>::iterator end4_;
  15186. typename ParamGenerator<T4>::iterator current4_;
  15187. const typename ParamGenerator<T5>::iterator begin5_;
  15188. const typename ParamGenerator<T5>::iterator end5_;
  15189. typename ParamGenerator<T5>::iterator current5_;
  15190. const typename ParamGenerator<T6>::iterator begin6_;
  15191. const typename ParamGenerator<T6>::iterator end6_;
  15192. typename ParamGenerator<T6>::iterator current6_;
  15193. const typename ParamGenerator<T7>::iterator begin7_;
  15194. const typename ParamGenerator<T7>::iterator end7_;
  15195. typename ParamGenerator<T7>::iterator current7_;
  15196. const typename ParamGenerator<T8>::iterator begin8_;
  15197. const typename ParamGenerator<T8>::iterator end8_;
  15198. typename ParamGenerator<T8>::iterator current8_;
  15199. linked_ptr<ParamType> current_value_;
  15200. }; // class CartesianProductGenerator8::Iterator
  15201. // No implementation - assignment is unsupported.
  15202. void operator=(const CartesianProductGenerator8& other);
  15203. const ParamGenerator<T1> g1_;
  15204. const ParamGenerator<T2> g2_;
  15205. const ParamGenerator<T3> g3_;
  15206. const ParamGenerator<T4> g4_;
  15207. const ParamGenerator<T5> g5_;
  15208. const ParamGenerator<T6> g6_;
  15209. const ParamGenerator<T7> g7_;
  15210. const ParamGenerator<T8> g8_;
  15211. }; // class CartesianProductGenerator8
  15212. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15213. typename T6, typename T7, typename T8, typename T9>
  15214. class CartesianProductGenerator9
  15215. : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
  15216. T7, T8, T9> > {
  15217. public:
  15218. typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
  15219. CartesianProductGenerator9(const ParamGenerator<T1>& g1,
  15220. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  15221. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  15222. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
  15223. const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
  15224. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  15225. g9_(g9) {}
  15226. virtual ~CartesianProductGenerator9() {}
  15227. virtual ParamIteratorInterface<ParamType>* Begin() const {
  15228. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  15229. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  15230. g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
  15231. }
  15232. virtual ParamIteratorInterface<ParamType>* End() const {
  15233. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  15234. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
  15235. g8_.end(), g9_, g9_.end());
  15236. }
  15237. private:
  15238. class Iterator : public ParamIteratorInterface<ParamType> {
  15239. public:
  15240. Iterator(const ParamGeneratorInterface<ParamType>* base,
  15241. const ParamGenerator<T1>& g1,
  15242. const typename ParamGenerator<T1>::iterator& current1,
  15243. const ParamGenerator<T2>& g2,
  15244. const typename ParamGenerator<T2>::iterator& current2,
  15245. const ParamGenerator<T3>& g3,
  15246. const typename ParamGenerator<T3>::iterator& current3,
  15247. const ParamGenerator<T4>& g4,
  15248. const typename ParamGenerator<T4>::iterator& current4,
  15249. const ParamGenerator<T5>& g5,
  15250. const typename ParamGenerator<T5>::iterator& current5,
  15251. const ParamGenerator<T6>& g6,
  15252. const typename ParamGenerator<T6>::iterator& current6,
  15253. const ParamGenerator<T7>& g7,
  15254. const typename ParamGenerator<T7>::iterator& current7,
  15255. const ParamGenerator<T8>& g8,
  15256. const typename ParamGenerator<T8>::iterator& current8,
  15257. const ParamGenerator<T9>& g9,
  15258. const typename ParamGenerator<T9>::iterator& current9)
  15259. : base_(base),
  15260. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  15261. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  15262. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  15263. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  15264. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  15265. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  15266. begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
  15267. begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
  15268. begin9_(g9.begin()), end9_(g9.end()), current9_(current9) {
  15269. ComputeCurrentValue();
  15270. }
  15271. virtual ~Iterator() {}
  15272. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  15273. return base_;
  15274. }
  15275. // Advance should not be called on beyond-of-range iterators
  15276. // so no component iterators must be beyond end of range, either.
  15277. virtual void Advance() {
  15278. assert(!AtEnd());
  15279. ++current9_;
  15280. if (current9_ == end9_) {
  15281. current9_ = begin9_;
  15282. ++current8_;
  15283. }
  15284. if (current8_ == end8_) {
  15285. current8_ = begin8_;
  15286. ++current7_;
  15287. }
  15288. if (current7_ == end7_) {
  15289. current7_ = begin7_;
  15290. ++current6_;
  15291. }
  15292. if (current6_ == end6_) {
  15293. current6_ = begin6_;
  15294. ++current5_;
  15295. }
  15296. if (current5_ == end5_) {
  15297. current5_ = begin5_;
  15298. ++current4_;
  15299. }
  15300. if (current4_ == end4_) {
  15301. current4_ = begin4_;
  15302. ++current3_;
  15303. }
  15304. if (current3_ == end3_) {
  15305. current3_ = begin3_;
  15306. ++current2_;
  15307. }
  15308. if (current2_ == end2_) {
  15309. current2_ = begin2_;
  15310. ++current1_;
  15311. }
  15312. ComputeCurrentValue();
  15313. }
  15314. virtual ParamIteratorInterface<ParamType>* Clone() const {
  15315. return new Iterator(*this);
  15316. }
  15317. virtual const ParamType* Current() const { return current_value_.get(); }
  15318. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  15319. // Having the same base generator guarantees that the other
  15320. // iterator is of the same type and we can downcast.
  15321. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  15322. << "The program attempted to compare iterators "
  15323. << "from different generators." << std::endl;
  15324. const Iterator* typed_other =
  15325. CheckedDowncastToActualType<const Iterator>(&other);
  15326. // We must report iterators equal if they both point beyond their
  15327. // respective ranges. That can happen in a variety of fashions,
  15328. // so we have to consult AtEnd().
  15329. return (AtEnd() && typed_other->AtEnd()) ||
  15330. (
  15331. current1_ == typed_other->current1_ &&
  15332. current2_ == typed_other->current2_ &&
  15333. current3_ == typed_other->current3_ &&
  15334. current4_ == typed_other->current4_ &&
  15335. current5_ == typed_other->current5_ &&
  15336. current6_ == typed_other->current6_ &&
  15337. current7_ == typed_other->current7_ &&
  15338. current8_ == typed_other->current8_ &&
  15339. current9_ == typed_other->current9_);
  15340. }
  15341. private:
  15342. Iterator(const Iterator& other)
  15343. : base_(other.base_),
  15344. begin1_(other.begin1_),
  15345. end1_(other.end1_),
  15346. current1_(other.current1_),
  15347. begin2_(other.begin2_),
  15348. end2_(other.end2_),
  15349. current2_(other.current2_),
  15350. begin3_(other.begin3_),
  15351. end3_(other.end3_),
  15352. current3_(other.current3_),
  15353. begin4_(other.begin4_),
  15354. end4_(other.end4_),
  15355. current4_(other.current4_),
  15356. begin5_(other.begin5_),
  15357. end5_(other.end5_),
  15358. current5_(other.current5_),
  15359. begin6_(other.begin6_),
  15360. end6_(other.end6_),
  15361. current6_(other.current6_),
  15362. begin7_(other.begin7_),
  15363. end7_(other.end7_),
  15364. current7_(other.current7_),
  15365. begin8_(other.begin8_),
  15366. end8_(other.end8_),
  15367. current8_(other.current8_),
  15368. begin9_(other.begin9_),
  15369. end9_(other.end9_),
  15370. current9_(other.current9_) {
  15371. ComputeCurrentValue();
  15372. }
  15373. void ComputeCurrentValue() {
  15374. if (!AtEnd())
  15375. current_value_.reset(new ParamType(*current1_, *current2_, *current3_,
  15376. *current4_, *current5_, *current6_, *current7_, *current8_,
  15377. *current9_));
  15378. }
  15379. bool AtEnd() const {
  15380. // We must report iterator past the end of the range when either of the
  15381. // component iterators has reached the end of its range.
  15382. return
  15383. current1_ == end1_ ||
  15384. current2_ == end2_ ||
  15385. current3_ == end3_ ||
  15386. current4_ == end4_ ||
  15387. current5_ == end5_ ||
  15388. current6_ == end6_ ||
  15389. current7_ == end7_ ||
  15390. current8_ == end8_ ||
  15391. current9_ == end9_;
  15392. }
  15393. // No implementation - assignment is unsupported.
  15394. void operator=(const Iterator& other);
  15395. const ParamGeneratorInterface<ParamType>* const base_;
  15396. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  15397. // current[i]_ is the actual traversing iterator.
  15398. const typename ParamGenerator<T1>::iterator begin1_;
  15399. const typename ParamGenerator<T1>::iterator end1_;
  15400. typename ParamGenerator<T1>::iterator current1_;
  15401. const typename ParamGenerator<T2>::iterator begin2_;
  15402. const typename ParamGenerator<T2>::iterator end2_;
  15403. typename ParamGenerator<T2>::iterator current2_;
  15404. const typename ParamGenerator<T3>::iterator begin3_;
  15405. const typename ParamGenerator<T3>::iterator end3_;
  15406. typename ParamGenerator<T3>::iterator current3_;
  15407. const typename ParamGenerator<T4>::iterator begin4_;
  15408. const typename ParamGenerator<T4>::iterator end4_;
  15409. typename ParamGenerator<T4>::iterator current4_;
  15410. const typename ParamGenerator<T5>::iterator begin5_;
  15411. const typename ParamGenerator<T5>::iterator end5_;
  15412. typename ParamGenerator<T5>::iterator current5_;
  15413. const typename ParamGenerator<T6>::iterator begin6_;
  15414. const typename ParamGenerator<T6>::iterator end6_;
  15415. typename ParamGenerator<T6>::iterator current6_;
  15416. const typename ParamGenerator<T7>::iterator begin7_;
  15417. const typename ParamGenerator<T7>::iterator end7_;
  15418. typename ParamGenerator<T7>::iterator current7_;
  15419. const typename ParamGenerator<T8>::iterator begin8_;
  15420. const typename ParamGenerator<T8>::iterator end8_;
  15421. typename ParamGenerator<T8>::iterator current8_;
  15422. const typename ParamGenerator<T9>::iterator begin9_;
  15423. const typename ParamGenerator<T9>::iterator end9_;
  15424. typename ParamGenerator<T9>::iterator current9_;
  15425. linked_ptr<ParamType> current_value_;
  15426. }; // class CartesianProductGenerator9::Iterator
  15427. // No implementation - assignment is unsupported.
  15428. void operator=(const CartesianProductGenerator9& other);
  15429. const ParamGenerator<T1> g1_;
  15430. const ParamGenerator<T2> g2_;
  15431. const ParamGenerator<T3> g3_;
  15432. const ParamGenerator<T4> g4_;
  15433. const ParamGenerator<T5> g5_;
  15434. const ParamGenerator<T6> g6_;
  15435. const ParamGenerator<T7> g7_;
  15436. const ParamGenerator<T8> g8_;
  15437. const ParamGenerator<T9> g9_;
  15438. }; // class CartesianProductGenerator9
  15439. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15440. typename T6, typename T7, typename T8, typename T9, typename T10>
  15441. class CartesianProductGenerator10
  15442. : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
  15443. T7, T8, T9, T10> > {
  15444. public:
  15445. typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
  15446. CartesianProductGenerator10(const ParamGenerator<T1>& g1,
  15447. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  15448. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  15449. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
  15450. const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
  15451. const ParamGenerator<T10>& g10)
  15452. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  15453. g9_(g9), g10_(g10) {}
  15454. virtual ~CartesianProductGenerator10() {}
  15455. virtual ParamIteratorInterface<ParamType>* Begin() const {
  15456. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  15457. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  15458. g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
  15459. }
  15460. virtual ParamIteratorInterface<ParamType>* End() const {
  15461. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  15462. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
  15463. g8_.end(), g9_, g9_.end(), g10_, g10_.end());
  15464. }
  15465. private:
  15466. class Iterator : public ParamIteratorInterface<ParamType> {
  15467. public:
  15468. Iterator(const ParamGeneratorInterface<ParamType>* base,
  15469. const ParamGenerator<T1>& g1,
  15470. const typename ParamGenerator<T1>::iterator& current1,
  15471. const ParamGenerator<T2>& g2,
  15472. const typename ParamGenerator<T2>::iterator& current2,
  15473. const ParamGenerator<T3>& g3,
  15474. const typename ParamGenerator<T3>::iterator& current3,
  15475. const ParamGenerator<T4>& g4,
  15476. const typename ParamGenerator<T4>::iterator& current4,
  15477. const ParamGenerator<T5>& g5,
  15478. const typename ParamGenerator<T5>::iterator& current5,
  15479. const ParamGenerator<T6>& g6,
  15480. const typename ParamGenerator<T6>::iterator& current6,
  15481. const ParamGenerator<T7>& g7,
  15482. const typename ParamGenerator<T7>::iterator& current7,
  15483. const ParamGenerator<T8>& g8,
  15484. const typename ParamGenerator<T8>::iterator& current8,
  15485. const ParamGenerator<T9>& g9,
  15486. const typename ParamGenerator<T9>::iterator& current9,
  15487. const ParamGenerator<T10>& g10,
  15488. const typename ParamGenerator<T10>::iterator& current10)
  15489. : base_(base),
  15490. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  15491. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  15492. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  15493. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  15494. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  15495. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  15496. begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
  15497. begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
  15498. begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
  15499. begin10_(g10.begin()), end10_(g10.end()), current10_(current10) {
  15500. ComputeCurrentValue();
  15501. }
  15502. virtual ~Iterator() {}
  15503. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  15504. return base_;
  15505. }
  15506. // Advance should not be called on beyond-of-range iterators
  15507. // so no component iterators must be beyond end of range, either.
  15508. virtual void Advance() {
  15509. assert(!AtEnd());
  15510. ++current10_;
  15511. if (current10_ == end10_) {
  15512. current10_ = begin10_;
  15513. ++current9_;
  15514. }
  15515. if (current9_ == end9_) {
  15516. current9_ = begin9_;
  15517. ++current8_;
  15518. }
  15519. if (current8_ == end8_) {
  15520. current8_ = begin8_;
  15521. ++current7_;
  15522. }
  15523. if (current7_ == end7_) {
  15524. current7_ = begin7_;
  15525. ++current6_;
  15526. }
  15527. if (current6_ == end6_) {
  15528. current6_ = begin6_;
  15529. ++current5_;
  15530. }
  15531. if (current5_ == end5_) {
  15532. current5_ = begin5_;
  15533. ++current4_;
  15534. }
  15535. if (current4_ == end4_) {
  15536. current4_ = begin4_;
  15537. ++current3_;
  15538. }
  15539. if (current3_ == end3_) {
  15540. current3_ = begin3_;
  15541. ++current2_;
  15542. }
  15543. if (current2_ == end2_) {
  15544. current2_ = begin2_;
  15545. ++current1_;
  15546. }
  15547. ComputeCurrentValue();
  15548. }
  15549. virtual ParamIteratorInterface<ParamType>* Clone() const {
  15550. return new Iterator(*this);
  15551. }
  15552. virtual const ParamType* Current() const { return current_value_.get(); }
  15553. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  15554. // Having the same base generator guarantees that the other
  15555. // iterator is of the same type and we can downcast.
  15556. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  15557. << "The program attempted to compare iterators "
  15558. << "from different generators." << std::endl;
  15559. const Iterator* typed_other =
  15560. CheckedDowncastToActualType<const Iterator>(&other);
  15561. // We must report iterators equal if they both point beyond their
  15562. // respective ranges. That can happen in a variety of fashions,
  15563. // so we have to consult AtEnd().
  15564. return (AtEnd() && typed_other->AtEnd()) ||
  15565. (
  15566. current1_ == typed_other->current1_ &&
  15567. current2_ == typed_other->current2_ &&
  15568. current3_ == typed_other->current3_ &&
  15569. current4_ == typed_other->current4_ &&
  15570. current5_ == typed_other->current5_ &&
  15571. current6_ == typed_other->current6_ &&
  15572. current7_ == typed_other->current7_ &&
  15573. current8_ == typed_other->current8_ &&
  15574. current9_ == typed_other->current9_ &&
  15575. current10_ == typed_other->current10_);
  15576. }
  15577. private:
  15578. Iterator(const Iterator& other)
  15579. : base_(other.base_),
  15580. begin1_(other.begin1_),
  15581. end1_(other.end1_),
  15582. current1_(other.current1_),
  15583. begin2_(other.begin2_),
  15584. end2_(other.end2_),
  15585. current2_(other.current2_),
  15586. begin3_(other.begin3_),
  15587. end3_(other.end3_),
  15588. current3_(other.current3_),
  15589. begin4_(other.begin4_),
  15590. end4_(other.end4_),
  15591. current4_(other.current4_),
  15592. begin5_(other.begin5_),
  15593. end5_(other.end5_),
  15594. current5_(other.current5_),
  15595. begin6_(other.begin6_),
  15596. end6_(other.end6_),
  15597. current6_(other.current6_),
  15598. begin7_(other.begin7_),
  15599. end7_(other.end7_),
  15600. current7_(other.current7_),
  15601. begin8_(other.begin8_),
  15602. end8_(other.end8_),
  15603. current8_(other.current8_),
  15604. begin9_(other.begin9_),
  15605. end9_(other.end9_),
  15606. current9_(other.current9_),
  15607. begin10_(other.begin10_),
  15608. end10_(other.end10_),
  15609. current10_(other.current10_) {
  15610. ComputeCurrentValue();
  15611. }
  15612. void ComputeCurrentValue() {
  15613. if (!AtEnd())
  15614. current_value_.reset(new ParamType(*current1_, *current2_, *current3_,
  15615. *current4_, *current5_, *current6_, *current7_, *current8_,
  15616. *current9_, *current10_));
  15617. }
  15618. bool AtEnd() const {
  15619. // We must report iterator past the end of the range when either of the
  15620. // component iterators has reached the end of its range.
  15621. return
  15622. current1_ == end1_ ||
  15623. current2_ == end2_ ||
  15624. current3_ == end3_ ||
  15625. current4_ == end4_ ||
  15626. current5_ == end5_ ||
  15627. current6_ == end6_ ||
  15628. current7_ == end7_ ||
  15629. current8_ == end8_ ||
  15630. current9_ == end9_ ||
  15631. current10_ == end10_;
  15632. }
  15633. // No implementation - assignment is unsupported.
  15634. void operator=(const Iterator& other);
  15635. const ParamGeneratorInterface<ParamType>* const base_;
  15636. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  15637. // current[i]_ is the actual traversing iterator.
  15638. const typename ParamGenerator<T1>::iterator begin1_;
  15639. const typename ParamGenerator<T1>::iterator end1_;
  15640. typename ParamGenerator<T1>::iterator current1_;
  15641. const typename ParamGenerator<T2>::iterator begin2_;
  15642. const typename ParamGenerator<T2>::iterator end2_;
  15643. typename ParamGenerator<T2>::iterator current2_;
  15644. const typename ParamGenerator<T3>::iterator begin3_;
  15645. const typename ParamGenerator<T3>::iterator end3_;
  15646. typename ParamGenerator<T3>::iterator current3_;
  15647. const typename ParamGenerator<T4>::iterator begin4_;
  15648. const typename ParamGenerator<T4>::iterator end4_;
  15649. typename ParamGenerator<T4>::iterator current4_;
  15650. const typename ParamGenerator<T5>::iterator begin5_;
  15651. const typename ParamGenerator<T5>::iterator end5_;
  15652. typename ParamGenerator<T5>::iterator current5_;
  15653. const typename ParamGenerator<T6>::iterator begin6_;
  15654. const typename ParamGenerator<T6>::iterator end6_;
  15655. typename ParamGenerator<T6>::iterator current6_;
  15656. const typename ParamGenerator<T7>::iterator begin7_;
  15657. const typename ParamGenerator<T7>::iterator end7_;
  15658. typename ParamGenerator<T7>::iterator current7_;
  15659. const typename ParamGenerator<T8>::iterator begin8_;
  15660. const typename ParamGenerator<T8>::iterator end8_;
  15661. typename ParamGenerator<T8>::iterator current8_;
  15662. const typename ParamGenerator<T9>::iterator begin9_;
  15663. const typename ParamGenerator<T9>::iterator end9_;
  15664. typename ParamGenerator<T9>::iterator current9_;
  15665. const typename ParamGenerator<T10>::iterator begin10_;
  15666. const typename ParamGenerator<T10>::iterator end10_;
  15667. typename ParamGenerator<T10>::iterator current10_;
  15668. linked_ptr<ParamType> current_value_;
  15669. }; // class CartesianProductGenerator10::Iterator
  15670. // No implementation - assignment is unsupported.
  15671. void operator=(const CartesianProductGenerator10& other);
  15672. const ParamGenerator<T1> g1_;
  15673. const ParamGenerator<T2> g2_;
  15674. const ParamGenerator<T3> g3_;
  15675. const ParamGenerator<T4> g4_;
  15676. const ParamGenerator<T5> g5_;
  15677. const ParamGenerator<T6> g6_;
  15678. const ParamGenerator<T7> g7_;
  15679. const ParamGenerator<T8> g8_;
  15680. const ParamGenerator<T9> g9_;
  15681. const ParamGenerator<T10> g10_;
  15682. }; // class CartesianProductGenerator10
  15683. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  15684. //
  15685. // Helper classes providing Combine() with polymorphic features. They allow
  15686. // casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
  15687. // convertible to U.
  15688. //
  15689. template <class Generator1, class Generator2>
  15690. class CartesianProductHolder2 {
  15691. public:
  15692. CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
  15693. : g1_(g1), g2_(g2) {}
  15694. template <typename T1, typename T2>
  15695. operator ParamGenerator< ::testing::tuple<T1, T2> >() const {
  15696. return ParamGenerator< ::testing::tuple<T1, T2> >(
  15697. new CartesianProductGenerator2<T1, T2>(
  15698. static_cast<ParamGenerator<T1> >(g1_),
  15699. static_cast<ParamGenerator<T2> >(g2_)));
  15700. }
  15701. private:
  15702. // No implementation - assignment is unsupported.
  15703. void operator=(const CartesianProductHolder2& other);
  15704. const Generator1 g1_;
  15705. const Generator2 g2_;
  15706. }; // class CartesianProductHolder2
  15707. template <class Generator1, class Generator2, class Generator3>
  15708. class CartesianProductHolder3 {
  15709. public:
  15710. CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
  15711. const Generator3& g3)
  15712. : g1_(g1), g2_(g2), g3_(g3) {}
  15713. template <typename T1, typename T2, typename T3>
  15714. operator ParamGenerator< ::testing::tuple<T1, T2, T3> >() const {
  15715. return ParamGenerator< ::testing::tuple<T1, T2, T3> >(
  15716. new CartesianProductGenerator3<T1, T2, T3>(
  15717. static_cast<ParamGenerator<T1> >(g1_),
  15718. static_cast<ParamGenerator<T2> >(g2_),
  15719. static_cast<ParamGenerator<T3> >(g3_)));
  15720. }
  15721. private:
  15722. // No implementation - assignment is unsupported.
  15723. void operator=(const CartesianProductHolder3& other);
  15724. const Generator1 g1_;
  15725. const Generator2 g2_;
  15726. const Generator3 g3_;
  15727. }; // class CartesianProductHolder3
  15728. template <class Generator1, class Generator2, class Generator3,
  15729. class Generator4>
  15730. class CartesianProductHolder4 {
  15731. public:
  15732. CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
  15733. const Generator3& g3, const Generator4& g4)
  15734. : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
  15735. template <typename T1, typename T2, typename T3, typename T4>
  15736. operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4> >() const {
  15737. return ParamGenerator< ::testing::tuple<T1, T2, T3, T4> >(
  15738. new CartesianProductGenerator4<T1, T2, T3, T4>(
  15739. static_cast<ParamGenerator<T1> >(g1_),
  15740. static_cast<ParamGenerator<T2> >(g2_),
  15741. static_cast<ParamGenerator<T3> >(g3_),
  15742. static_cast<ParamGenerator<T4> >(g4_)));
  15743. }
  15744. private:
  15745. // No implementation - assignment is unsupported.
  15746. void operator=(const CartesianProductHolder4& other);
  15747. const Generator1 g1_;
  15748. const Generator2 g2_;
  15749. const Generator3 g3_;
  15750. const Generator4 g4_;
  15751. }; // class CartesianProductHolder4
  15752. template <class Generator1, class Generator2, class Generator3,
  15753. class Generator4, class Generator5>
  15754. class CartesianProductHolder5 {
  15755. public:
  15756. CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
  15757. const Generator3& g3, const Generator4& g4, const Generator5& g5)
  15758. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
  15759. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  15760. operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5> >() const {
  15761. return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5> >(
  15762. new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
  15763. static_cast<ParamGenerator<T1> >(g1_),
  15764. static_cast<ParamGenerator<T2> >(g2_),
  15765. static_cast<ParamGenerator<T3> >(g3_),
  15766. static_cast<ParamGenerator<T4> >(g4_),
  15767. static_cast<ParamGenerator<T5> >(g5_)));
  15768. }
  15769. private:
  15770. // No implementation - assignment is unsupported.
  15771. void operator=(const CartesianProductHolder5& other);
  15772. const Generator1 g1_;
  15773. const Generator2 g2_;
  15774. const Generator3 g3_;
  15775. const Generator4 g4_;
  15776. const Generator5 g5_;
  15777. }; // class CartesianProductHolder5
  15778. template <class Generator1, class Generator2, class Generator3,
  15779. class Generator4, class Generator5, class Generator6>
  15780. class CartesianProductHolder6 {
  15781. public:
  15782. CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
  15783. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  15784. const Generator6& g6)
  15785. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
  15786. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15787. typename T6>
  15788. operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6> >() const {
  15789. return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6> >(
  15790. new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
  15791. static_cast<ParamGenerator<T1> >(g1_),
  15792. static_cast<ParamGenerator<T2> >(g2_),
  15793. static_cast<ParamGenerator<T3> >(g3_),
  15794. static_cast<ParamGenerator<T4> >(g4_),
  15795. static_cast<ParamGenerator<T5> >(g5_),
  15796. static_cast<ParamGenerator<T6> >(g6_)));
  15797. }
  15798. private:
  15799. // No implementation - assignment is unsupported.
  15800. void operator=(const CartesianProductHolder6& other);
  15801. const Generator1 g1_;
  15802. const Generator2 g2_;
  15803. const Generator3 g3_;
  15804. const Generator4 g4_;
  15805. const Generator5 g5_;
  15806. const Generator6 g6_;
  15807. }; // class CartesianProductHolder6
  15808. template <class Generator1, class Generator2, class Generator3,
  15809. class Generator4, class Generator5, class Generator6, class Generator7>
  15810. class CartesianProductHolder7 {
  15811. public:
  15812. CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
  15813. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  15814. const Generator6& g6, const Generator7& g7)
  15815. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
  15816. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15817. typename T6, typename T7>
  15818. operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6,
  15819. T7> >() const {
  15820. return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7> >(
  15821. new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
  15822. static_cast<ParamGenerator<T1> >(g1_),
  15823. static_cast<ParamGenerator<T2> >(g2_),
  15824. static_cast<ParamGenerator<T3> >(g3_),
  15825. static_cast<ParamGenerator<T4> >(g4_),
  15826. static_cast<ParamGenerator<T5> >(g5_),
  15827. static_cast<ParamGenerator<T6> >(g6_),
  15828. static_cast<ParamGenerator<T7> >(g7_)));
  15829. }
  15830. private:
  15831. // No implementation - assignment is unsupported.
  15832. void operator=(const CartesianProductHolder7& other);
  15833. const Generator1 g1_;
  15834. const Generator2 g2_;
  15835. const Generator3 g3_;
  15836. const Generator4 g4_;
  15837. const Generator5 g5_;
  15838. const Generator6 g6_;
  15839. const Generator7 g7_;
  15840. }; // class CartesianProductHolder7
  15841. template <class Generator1, class Generator2, class Generator3,
  15842. class Generator4, class Generator5, class Generator6, class Generator7,
  15843. class Generator8>
  15844. class CartesianProductHolder8 {
  15845. public:
  15846. CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
  15847. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  15848. const Generator6& g6, const Generator7& g7, const Generator8& g8)
  15849. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
  15850. g8_(g8) {}
  15851. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15852. typename T6, typename T7, typename T8>
  15853. operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7,
  15854. T8> >() const {
  15855. return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
  15856. new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
  15857. static_cast<ParamGenerator<T1> >(g1_),
  15858. static_cast<ParamGenerator<T2> >(g2_),
  15859. static_cast<ParamGenerator<T3> >(g3_),
  15860. static_cast<ParamGenerator<T4> >(g4_),
  15861. static_cast<ParamGenerator<T5> >(g5_),
  15862. static_cast<ParamGenerator<T6> >(g6_),
  15863. static_cast<ParamGenerator<T7> >(g7_),
  15864. static_cast<ParamGenerator<T8> >(g8_)));
  15865. }
  15866. private:
  15867. // No implementation - assignment is unsupported.
  15868. void operator=(const CartesianProductHolder8& other);
  15869. const Generator1 g1_;
  15870. const Generator2 g2_;
  15871. const Generator3 g3_;
  15872. const Generator4 g4_;
  15873. const Generator5 g5_;
  15874. const Generator6 g6_;
  15875. const Generator7 g7_;
  15876. const Generator8 g8_;
  15877. }; // class CartesianProductHolder8
  15878. template <class Generator1, class Generator2, class Generator3,
  15879. class Generator4, class Generator5, class Generator6, class Generator7,
  15880. class Generator8, class Generator9>
  15881. class CartesianProductHolder9 {
  15882. public:
  15883. CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
  15884. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  15885. const Generator6& g6, const Generator7& g7, const Generator8& g8,
  15886. const Generator9& g9)
  15887. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  15888. g9_(g9) {}
  15889. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15890. typename T6, typename T7, typename T8, typename T9>
  15891. operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
  15892. T9> >() const {
  15893. return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
  15894. T9> >(
  15895. new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
  15896. static_cast<ParamGenerator<T1> >(g1_),
  15897. static_cast<ParamGenerator<T2> >(g2_),
  15898. static_cast<ParamGenerator<T3> >(g3_),
  15899. static_cast<ParamGenerator<T4> >(g4_),
  15900. static_cast<ParamGenerator<T5> >(g5_),
  15901. static_cast<ParamGenerator<T6> >(g6_),
  15902. static_cast<ParamGenerator<T7> >(g7_),
  15903. static_cast<ParamGenerator<T8> >(g8_),
  15904. static_cast<ParamGenerator<T9> >(g9_)));
  15905. }
  15906. private:
  15907. // No implementation - assignment is unsupported.
  15908. void operator=(const CartesianProductHolder9& other);
  15909. const Generator1 g1_;
  15910. const Generator2 g2_;
  15911. const Generator3 g3_;
  15912. const Generator4 g4_;
  15913. const Generator5 g5_;
  15914. const Generator6 g6_;
  15915. const Generator7 g7_;
  15916. const Generator8 g8_;
  15917. const Generator9 g9_;
  15918. }; // class CartesianProductHolder9
  15919. template <class Generator1, class Generator2, class Generator3,
  15920. class Generator4, class Generator5, class Generator6, class Generator7,
  15921. class Generator8, class Generator9, class Generator10>
  15922. class CartesianProductHolder10 {
  15923. public:
  15924. CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
  15925. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  15926. const Generator6& g6, const Generator7& g7, const Generator8& g8,
  15927. const Generator9& g9, const Generator10& g10)
  15928. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  15929. g9_(g9), g10_(g10) {}
  15930. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15931. typename T6, typename T7, typename T8, typename T9, typename T10>
  15932. operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9,
  15933. T10> >() const {
  15934. return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9,
  15935. T10> >(
  15936. new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
  15937. T10>(
  15938. static_cast<ParamGenerator<T1> >(g1_),
  15939. static_cast<ParamGenerator<T2> >(g2_),
  15940. static_cast<ParamGenerator<T3> >(g3_),
  15941. static_cast<ParamGenerator<T4> >(g4_),
  15942. static_cast<ParamGenerator<T5> >(g5_),
  15943. static_cast<ParamGenerator<T6> >(g6_),
  15944. static_cast<ParamGenerator<T7> >(g7_),
  15945. static_cast<ParamGenerator<T8> >(g8_),
  15946. static_cast<ParamGenerator<T9> >(g9_),
  15947. static_cast<ParamGenerator<T10> >(g10_)));
  15948. }
  15949. private:
  15950. // No implementation - assignment is unsupported.
  15951. void operator=(const CartesianProductHolder10& other);
  15952. const Generator1 g1_;
  15953. const Generator2 g2_;
  15954. const Generator3 g3_;
  15955. const Generator4 g4_;
  15956. const Generator5 g5_;
  15957. const Generator6 g6_;
  15958. const Generator7 g7_;
  15959. const Generator8 g8_;
  15960. const Generator9 g9_;
  15961. const Generator10 g10_;
  15962. }; // class CartesianProductHolder10
  15963. # endif // GTEST_HAS_COMBINE
  15964. } // namespace internal
  15965. } // namespace testing
  15966. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
  15967. namespace testing {
  15968. // Functions producing parameter generators.
  15969. //
  15970. // Google Test uses these generators to produce parameters for value-
  15971. // parameterized tests. When a parameterized test case is instantiated
  15972. // with a particular generator, Google Test creates and runs tests
  15973. // for each element in the sequence produced by the generator.
  15974. //
  15975. // In the following sample, tests from test case FooTest are instantiated
  15976. // each three times with parameter values 3, 5, and 8:
  15977. //
  15978. // class FooTest : public TestWithParam<int> { ... };
  15979. //
  15980. // TEST_P(FooTest, TestThis) {
  15981. // }
  15982. // TEST_P(FooTest, TestThat) {
  15983. // }
  15984. // INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
  15985. //
  15986. // Range() returns generators providing sequences of values in a range.
  15987. //
  15988. // Synopsis:
  15989. // Range(start, end)
  15990. // - returns a generator producing a sequence of values {start, start+1,
  15991. // start+2, ..., }.
  15992. // Range(start, end, step)
  15993. // - returns a generator producing a sequence of values {start, start+step,
  15994. // start+step+step, ..., }.
  15995. // Notes:
  15996. // * The generated sequences never include end. For example, Range(1, 5)
  15997. // returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
  15998. // returns a generator producing {1, 3, 5, 7}.
  15999. // * start and end must have the same type. That type may be any integral or
  16000. // floating-point type or a user defined type satisfying these conditions:
  16001. // * It must be assignable (have operator=() defined).
  16002. // * It must have operator+() (operator+(int-compatible type) for
  16003. // two-operand version).
  16004. // * It must have operator<() defined.
  16005. // Elements in the resulting sequences will also have that type.
  16006. // * Condition start < end must be satisfied in order for resulting sequences
  16007. // to contain any elements.
  16008. //
  16009. template <typename T, typename IncrementT>
  16010. internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
  16011. return internal::ParamGenerator<T>(
  16012. new internal::RangeGenerator<T, IncrementT>(start, end, step));
  16013. }
  16014. template <typename T>
  16015. internal::ParamGenerator<T> Range(T start, T end) {
  16016. return Range(start, end, 1);
  16017. }
  16018. // ValuesIn() function allows generation of tests with parameters coming from
  16019. // a container.
  16020. //
  16021. // Synopsis:
  16022. // ValuesIn(const T (&array)[N])
  16023. // - returns a generator producing sequences with elements from
  16024. // a C-style array.
  16025. // ValuesIn(const Container& container)
  16026. // - returns a generator producing sequences with elements from
  16027. // an STL-style container.
  16028. // ValuesIn(Iterator begin, Iterator end)
  16029. // - returns a generator producing sequences with elements from
  16030. // a range [begin, end) defined by a pair of STL-style iterators. These
  16031. // iterators can also be plain C pointers.
  16032. //
  16033. // Please note that ValuesIn copies the values from the containers
  16034. // passed in and keeps them to generate tests in RUN_ALL_TESTS().
  16035. //
  16036. // Examples:
  16037. //
  16038. // This instantiates tests from test case StringTest
  16039. // each with C-string values of "foo", "bar", and "baz":
  16040. //
  16041. // const char* strings[] = {"foo", "bar", "baz"};
  16042. // INSTANTIATE_TEST_CASE_P(StringSequence, StringTest, ValuesIn(strings));
  16043. //
  16044. // This instantiates tests from test case StlStringTest
  16045. // each with STL strings with values "a" and "b":
  16046. //
  16047. // ::std::vector< ::std::string> GetParameterStrings() {
  16048. // ::std::vector< ::std::string> v;
  16049. // v.push_back("a");
  16050. // v.push_back("b");
  16051. // return v;
  16052. // }
  16053. //
  16054. // INSTANTIATE_TEST_CASE_P(CharSequence,
  16055. // StlStringTest,
  16056. // ValuesIn(GetParameterStrings()));
  16057. //
  16058. //
  16059. // This will also instantiate tests from CharTest
  16060. // each with parameter values 'a' and 'b':
  16061. //
  16062. // ::std::list<char> GetParameterChars() {
  16063. // ::std::list<char> list;
  16064. // list.push_back('a');
  16065. // list.push_back('b');
  16066. // return list;
  16067. // }
  16068. // ::std::list<char> l = GetParameterChars();
  16069. // INSTANTIATE_TEST_CASE_P(CharSequence2,
  16070. // CharTest,
  16071. // ValuesIn(l.begin(), l.end()));
  16072. //
  16073. template <typename ForwardIterator>
  16074. internal::ParamGenerator<
  16075. typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
  16076. ValuesIn(ForwardIterator begin, ForwardIterator end) {
  16077. typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
  16078. ::value_type ParamType;
  16079. return internal::ParamGenerator<ParamType>(
  16080. new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
  16081. }
  16082. template <typename T, size_t N>
  16083. internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
  16084. return ValuesIn(array, array + N);
  16085. }
  16086. template <class Container>
  16087. internal::ParamGenerator<typename Container::value_type> ValuesIn(
  16088. const Container& container) {
  16089. return ValuesIn(container.begin(), container.end());
  16090. }
  16091. // Values() allows generating tests from explicitly specified list of
  16092. // parameters.
  16093. //
  16094. // Synopsis:
  16095. // Values(T v1, T v2, ..., T vN)
  16096. // - returns a generator producing sequences with elements v1, v2, ..., vN.
  16097. //
  16098. // For example, this instantiates tests from test case BarTest each
  16099. // with values "one", "two", and "three":
  16100. //
  16101. // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
  16102. //
  16103. // This instantiates tests from test case BazTest each with values 1, 2, 3.5.
  16104. // The exact type of values will depend on the type of parameter in BazTest.
  16105. //
  16106. // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
  16107. //
  16108. // Currently, Values() supports from 1 to 50 parameters.
  16109. //
  16110. template <typename T1>
  16111. internal::ValueArray1<T1> Values(T1 v1) {
  16112. return internal::ValueArray1<T1>(v1);
  16113. }
  16114. template <typename T1, typename T2>
  16115. internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
  16116. return internal::ValueArray2<T1, T2>(v1, v2);
  16117. }
  16118. template <typename T1, typename T2, typename T3>
  16119. internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
  16120. return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
  16121. }
  16122. template <typename T1, typename T2, typename T3, typename T4>
  16123. internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
  16124. return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
  16125. }
  16126. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  16127. internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  16128. T5 v5) {
  16129. return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
  16130. }
  16131. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16132. typename T6>
  16133. internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
  16134. T4 v4, T5 v5, T6 v6) {
  16135. return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
  16136. }
  16137. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16138. typename T6, typename T7>
  16139. internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
  16140. T4 v4, T5 v5, T6 v6, T7 v7) {
  16141. return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
  16142. v6, v7);
  16143. }
  16144. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16145. typename T6, typename T7, typename T8>
  16146. internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
  16147. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
  16148. return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
  16149. v5, v6, v7, v8);
  16150. }
  16151. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16152. typename T6, typename T7, typename T8, typename T9>
  16153. internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
  16154. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
  16155. return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
  16156. v4, v5, v6, v7, v8, v9);
  16157. }
  16158. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16159. typename T6, typename T7, typename T8, typename T9, typename T10>
  16160. internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
  16161. T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
  16162. return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
  16163. v2, v3, v4, v5, v6, v7, v8, v9, v10);
  16164. }
  16165. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16166. typename T6, typename T7, typename T8, typename T9, typename T10,
  16167. typename T11>
  16168. internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
  16169. T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  16170. T10 v10, T11 v11) {
  16171. return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
  16172. T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
  16173. }
  16174. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16175. typename T6, typename T7, typename T8, typename T9, typename T10,
  16176. typename T11, typename T12>
  16177. internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16178. T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  16179. T10 v10, T11 v11, T12 v12) {
  16180. return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16181. T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
  16182. }
  16183. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16184. typename T6, typename T7, typename T8, typename T9, typename T10,
  16185. typename T11, typename T12, typename T13>
  16186. internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  16187. T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  16188. T10 v10, T11 v11, T12 v12, T13 v13) {
  16189. return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16190. T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
  16191. }
  16192. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16193. typename T6, typename T7, typename T8, typename T9, typename T10,
  16194. typename T11, typename T12, typename T13, typename T14>
  16195. internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16196. T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  16197. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
  16198. return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16199. T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
  16200. v14);
  16201. }
  16202. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16203. typename T6, typename T7, typename T8, typename T9, typename T10,
  16204. typename T11, typename T12, typename T13, typename T14, typename T15>
  16205. internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16206. T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  16207. T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
  16208. return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16209. T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
  16210. v13, v14, v15);
  16211. }
  16212. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16213. typename T6, typename T7, typename T8, typename T9, typename T10,
  16214. typename T11, typename T12, typename T13, typename T14, typename T15,
  16215. typename T16>
  16216. internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16217. T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  16218. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  16219. T16 v16) {
  16220. return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16221. T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
  16222. v12, v13, v14, v15, v16);
  16223. }
  16224. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16225. typename T6, typename T7, typename T8, typename T9, typename T10,
  16226. typename T11, typename T12, typename T13, typename T14, typename T15,
  16227. typename T16, typename T17>
  16228. internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16229. T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  16230. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  16231. T16 v16, T17 v17) {
  16232. return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16233. T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
  16234. v11, v12, v13, v14, v15, v16, v17);
  16235. }
  16236. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16237. typename T6, typename T7, typename T8, typename T9, typename T10,
  16238. typename T11, typename T12, typename T13, typename T14, typename T15,
  16239. typename T16, typename T17, typename T18>
  16240. internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16241. T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
  16242. T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  16243. T16 v16, T17 v17, T18 v18) {
  16244. return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16245. T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
  16246. v10, v11, v12, v13, v14, v15, v16, v17, v18);
  16247. }
  16248. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16249. typename T6, typename T7, typename T8, typename T9, typename T10,
  16250. typename T11, typename T12, typename T13, typename T14, typename T15,
  16251. typename T16, typename T17, typename T18, typename T19>
  16252. internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16253. T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
  16254. T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
  16255. T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
  16256. return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16257. T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
  16258. v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
  16259. }
  16260. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16261. typename T6, typename T7, typename T8, typename T9, typename T10,
  16262. typename T11, typename T12, typename T13, typename T14, typename T15,
  16263. typename T16, typename T17, typename T18, typename T19, typename T20>
  16264. internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16265. T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  16266. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  16267. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
  16268. return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16269. T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
  16270. v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
  16271. }
  16272. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16273. typename T6, typename T7, typename T8, typename T9, typename T10,
  16274. typename T11, typename T12, typename T13, typename T14, typename T15,
  16275. typename T16, typename T17, typename T18, typename T19, typename T20,
  16276. typename T21>
  16277. internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16278. T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  16279. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  16280. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
  16281. return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16282. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
  16283. v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
  16284. }
  16285. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16286. typename T6, typename T7, typename T8, typename T9, typename T10,
  16287. typename T11, typename T12, typename T13, typename T14, typename T15,
  16288. typename T16, typename T17, typename T18, typename T19, typename T20,
  16289. typename T21, typename T22>
  16290. internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16291. T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
  16292. T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  16293. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  16294. T21 v21, T22 v22) {
  16295. return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16296. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
  16297. v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  16298. v20, v21, v22);
  16299. }
  16300. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16301. typename T6, typename T7, typename T8, typename T9, typename T10,
  16302. typename T11, typename T12, typename T13, typename T14, typename T15,
  16303. typename T16, typename T17, typename T18, typename T19, typename T20,
  16304. typename T21, typename T22, typename T23>
  16305. internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16306. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
  16307. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  16308. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  16309. T21 v21, T22 v22, T23 v23) {
  16310. return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16311. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
  16312. v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  16313. v20, v21, v22, v23);
  16314. }
  16315. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16316. typename T6, typename T7, typename T8, typename T9, typename T10,
  16317. typename T11, typename T12, typename T13, typename T14, typename T15,
  16318. typename T16, typename T17, typename T18, typename T19, typename T20,
  16319. typename T21, typename T22, typename T23, typename T24>
  16320. internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16321. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
  16322. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  16323. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  16324. T21 v21, T22 v22, T23 v23, T24 v24) {
  16325. return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16326. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
  16327. v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
  16328. v19, v20, v21, v22, v23, v24);
  16329. }
  16330. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16331. typename T6, typename T7, typename T8, typename T9, typename T10,
  16332. typename T11, typename T12, typename T13, typename T14, typename T15,
  16333. typename T16, typename T17, typename T18, typename T19, typename T20,
  16334. typename T21, typename T22, typename T23, typename T24, typename T25>
  16335. internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16336. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
  16337. T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
  16338. T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
  16339. T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
  16340. return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16341. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
  16342. v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
  16343. v18, v19, v20, v21, v22, v23, v24, v25);
  16344. }
  16345. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16346. typename T6, typename T7, typename T8, typename T9, typename T10,
  16347. typename T11, typename T12, typename T13, typename T14, typename T15,
  16348. typename T16, typename T17, typename T18, typename T19, typename T20,
  16349. typename T21, typename T22, typename T23, typename T24, typename T25,
  16350. typename T26>
  16351. internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16352. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16353. T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  16354. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  16355. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  16356. T26 v26) {
  16357. return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16358. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16359. T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
  16360. v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
  16361. }
  16362. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16363. typename T6, typename T7, typename T8, typename T9, typename T10,
  16364. typename T11, typename T12, typename T13, typename T14, typename T15,
  16365. typename T16, typename T17, typename T18, typename T19, typename T20,
  16366. typename T21, typename T22, typename T23, typename T24, typename T25,
  16367. typename T26, typename T27>
  16368. internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16369. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  16370. T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  16371. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  16372. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  16373. T26 v26, T27 v27) {
  16374. return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16375. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16376. T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
  16377. v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
  16378. }
  16379. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16380. typename T6, typename T7, typename T8, typename T9, typename T10,
  16381. typename T11, typename T12, typename T13, typename T14, typename T15,
  16382. typename T16, typename T17, typename T18, typename T19, typename T20,
  16383. typename T21, typename T22, typename T23, typename T24, typename T25,
  16384. typename T26, typename T27, typename T28>
  16385. internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16386. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  16387. T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  16388. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  16389. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  16390. T26 v26, T27 v27, T28 v28) {
  16391. return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16392. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16393. T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
  16394. v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
  16395. v28);
  16396. }
  16397. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16398. typename T6, typename T7, typename T8, typename T9, typename T10,
  16399. typename T11, typename T12, typename T13, typename T14, typename T15,
  16400. typename T16, typename T17, typename T18, typename T19, typename T20,
  16401. typename T21, typename T22, typename T23, typename T24, typename T25,
  16402. typename T26, typename T27, typename T28, typename T29>
  16403. internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16404. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16405. T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  16406. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  16407. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  16408. T26 v26, T27 v27, T28 v28, T29 v29) {
  16409. return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16410. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16411. T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
  16412. v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
  16413. v27, v28, v29);
  16414. }
  16415. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16416. typename T6, typename T7, typename T8, typename T9, typename T10,
  16417. typename T11, typename T12, typename T13, typename T14, typename T15,
  16418. typename T16, typename T17, typename T18, typename T19, typename T20,
  16419. typename T21, typename T22, typename T23, typename T24, typename T25,
  16420. typename T26, typename T27, typename T28, typename T29, typename T30>
  16421. internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16422. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16423. T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  16424. T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
  16425. T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
  16426. T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
  16427. return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16428. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16429. T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
  16430. v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
  16431. v26, v27, v28, v29, v30);
  16432. }
  16433. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16434. typename T6, typename T7, typename T8, typename T9, typename T10,
  16435. typename T11, typename T12, typename T13, typename T14, typename T15,
  16436. typename T16, typename T17, typename T18, typename T19, typename T20,
  16437. typename T21, typename T22, typename T23, typename T24, typename T25,
  16438. typename T26, typename T27, typename T28, typename T29, typename T30,
  16439. typename T31>
  16440. internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16441. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16442. T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  16443. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  16444. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  16445. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
  16446. return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16447. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16448. T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
  16449. v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
  16450. v25, v26, v27, v28, v29, v30, v31);
  16451. }
  16452. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16453. typename T6, typename T7, typename T8, typename T9, typename T10,
  16454. typename T11, typename T12, typename T13, typename T14, typename T15,
  16455. typename T16, typename T17, typename T18, typename T19, typename T20,
  16456. typename T21, typename T22, typename T23, typename T24, typename T25,
  16457. typename T26, typename T27, typename T28, typename T29, typename T30,
  16458. typename T31, typename T32>
  16459. internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16460. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16461. T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  16462. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  16463. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  16464. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  16465. T32 v32) {
  16466. return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16467. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16468. T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
  16469. v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  16470. v24, v25, v26, v27, v28, v29, v30, v31, v32);
  16471. }
  16472. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16473. typename T6, typename T7, typename T8, typename T9, typename T10,
  16474. typename T11, typename T12, typename T13, typename T14, typename T15,
  16475. typename T16, typename T17, typename T18, typename T19, typename T20,
  16476. typename T21, typename T22, typename T23, typename T24, typename T25,
  16477. typename T26, typename T27, typename T28, typename T29, typename T30,
  16478. typename T31, typename T32, typename T33>
  16479. internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16480. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16481. T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
  16482. T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  16483. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  16484. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  16485. T32 v32, T33 v33) {
  16486. return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16487. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16488. T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
  16489. v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  16490. v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
  16491. }
  16492. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16493. typename T6, typename T7, typename T8, typename T9, typename T10,
  16494. typename T11, typename T12, typename T13, typename T14, typename T15,
  16495. typename T16, typename T17, typename T18, typename T19, typename T20,
  16496. typename T21, typename T22, typename T23, typename T24, typename T25,
  16497. typename T26, typename T27, typename T28, typename T29, typename T30,
  16498. typename T31, typename T32, typename T33, typename T34>
  16499. internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16500. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16501. T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
  16502. T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
  16503. T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
  16504. T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
  16505. T31 v31, T32 v32, T33 v33, T34 v34) {
  16506. return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16507. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16508. T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
  16509. v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
  16510. v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
  16511. }
  16512. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16513. typename T6, typename T7, typename T8, typename T9, typename T10,
  16514. typename T11, typename T12, typename T13, typename T14, typename T15,
  16515. typename T16, typename T17, typename T18, typename T19, typename T20,
  16516. typename T21, typename T22, typename T23, typename T24, typename T25,
  16517. typename T26, typename T27, typename T28, typename T29, typename T30,
  16518. typename T31, typename T32, typename T33, typename T34, typename T35>
  16519. internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16520. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16521. T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  16522. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  16523. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
  16524. T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
  16525. T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
  16526. return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16527. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16528. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
  16529. v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
  16530. v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
  16531. }
  16532. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16533. typename T6, typename T7, typename T8, typename T9, typename T10,
  16534. typename T11, typename T12, typename T13, typename T14, typename T15,
  16535. typename T16, typename T17, typename T18, typename T19, typename T20,
  16536. typename T21, typename T22, typename T23, typename T24, typename T25,
  16537. typename T26, typename T27, typename T28, typename T29, typename T30,
  16538. typename T31, typename T32, typename T33, typename T34, typename T35,
  16539. typename T36>
  16540. internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16541. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16542. T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  16543. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  16544. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
  16545. T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
  16546. T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
  16547. return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16548. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16549. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
  16550. v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  16551. v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
  16552. v34, v35, v36);
  16553. }
  16554. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16555. typename T6, typename T7, typename T8, typename T9, typename T10,
  16556. typename T11, typename T12, typename T13, typename T14, typename T15,
  16557. typename T16, typename T17, typename T18, typename T19, typename T20,
  16558. typename T21, typename T22, typename T23, typename T24, typename T25,
  16559. typename T26, typename T27, typename T28, typename T29, typename T30,
  16560. typename T31, typename T32, typename T33, typename T34, typename T35,
  16561. typename T36, typename T37>
  16562. internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16563. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16564. T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
  16565. T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  16566. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  16567. T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
  16568. T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
  16569. T37 v37) {
  16570. return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16571. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16572. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
  16573. v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  16574. v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
  16575. v34, v35, v36, v37);
  16576. }
  16577. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16578. typename T6, typename T7, typename T8, typename T9, typename T10,
  16579. typename T11, typename T12, typename T13, typename T14, typename T15,
  16580. typename T16, typename T17, typename T18, typename T19, typename T20,
  16581. typename T21, typename T22, typename T23, typename T24, typename T25,
  16582. typename T26, typename T27, typename T28, typename T29, typename T30,
  16583. typename T31, typename T32, typename T33, typename T34, typename T35,
  16584. typename T36, typename T37, typename T38>
  16585. internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16586. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16587. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
  16588. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  16589. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  16590. T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
  16591. T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
  16592. T37 v37, T38 v38) {
  16593. return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16594. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16595. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
  16596. v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
  16597. v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
  16598. v33, v34, v35, v36, v37, v38);
  16599. }
  16600. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16601. typename T6, typename T7, typename T8, typename T9, typename T10,
  16602. typename T11, typename T12, typename T13, typename T14, typename T15,
  16603. typename T16, typename T17, typename T18, typename T19, typename T20,
  16604. typename T21, typename T22, typename T23, typename T24, typename T25,
  16605. typename T26, typename T27, typename T28, typename T29, typename T30,
  16606. typename T31, typename T32, typename T33, typename T34, typename T35,
  16607. typename T36, typename T37, typename T38, typename T39>
  16608. internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16609. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16610. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
  16611. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  16612. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  16613. T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
  16614. T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
  16615. T37 v37, T38 v38, T39 v39) {
  16616. return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16617. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16618. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
  16619. v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
  16620. v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
  16621. v32, v33, v34, v35, v36, v37, v38, v39);
  16622. }
  16623. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16624. typename T6, typename T7, typename T8, typename T9, typename T10,
  16625. typename T11, typename T12, typename T13, typename T14, typename T15,
  16626. typename T16, typename T17, typename T18, typename T19, typename T20,
  16627. typename T21, typename T22, typename T23, typename T24, typename T25,
  16628. typename T26, typename T27, typename T28, typename T29, typename T30,
  16629. typename T31, typename T32, typename T33, typename T34, typename T35,
  16630. typename T36, typename T37, typename T38, typename T39, typename T40>
  16631. internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16632. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16633. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
  16634. T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
  16635. T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
  16636. T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
  16637. T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
  16638. T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
  16639. return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16640. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16641. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  16642. T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
  16643. v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
  16644. v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
  16645. }
  16646. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16647. typename T6, typename T7, typename T8, typename T9, typename T10,
  16648. typename T11, typename T12, typename T13, typename T14, typename T15,
  16649. typename T16, typename T17, typename T18, typename T19, typename T20,
  16650. typename T21, typename T22, typename T23, typename T24, typename T25,
  16651. typename T26, typename T27, typename T28, typename T29, typename T30,
  16652. typename T31, typename T32, typename T33, typename T34, typename T35,
  16653. typename T36, typename T37, typename T38, typename T39, typename T40,
  16654. typename T41>
  16655. internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16656. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16657. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  16658. T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  16659. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  16660. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  16661. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  16662. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
  16663. return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16664. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16665. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  16666. T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
  16667. v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
  16668. v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
  16669. }
  16670. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16671. typename T6, typename T7, typename T8, typename T9, typename T10,
  16672. typename T11, typename T12, typename T13, typename T14, typename T15,
  16673. typename T16, typename T17, typename T18, typename T19, typename T20,
  16674. typename T21, typename T22, typename T23, typename T24, typename T25,
  16675. typename T26, typename T27, typename T28, typename T29, typename T30,
  16676. typename T31, typename T32, typename T33, typename T34, typename T35,
  16677. typename T36, typename T37, typename T38, typename T39, typename T40,
  16678. typename T41, typename T42>
  16679. internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16680. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16681. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  16682. T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  16683. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  16684. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  16685. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  16686. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  16687. T42 v42) {
  16688. return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16689. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16690. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  16691. T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
  16692. v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
  16693. v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
  16694. v42);
  16695. }
  16696. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16697. typename T6, typename T7, typename T8, typename T9, typename T10,
  16698. typename T11, typename T12, typename T13, typename T14, typename T15,
  16699. typename T16, typename T17, typename T18, typename T19, typename T20,
  16700. typename T21, typename T22, typename T23, typename T24, typename T25,
  16701. typename T26, typename T27, typename T28, typename T29, typename T30,
  16702. typename T31, typename T32, typename T33, typename T34, typename T35,
  16703. typename T36, typename T37, typename T38, typename T39, typename T40,
  16704. typename T41, typename T42, typename T43>
  16705. internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16706. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16707. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  16708. T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  16709. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  16710. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  16711. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  16712. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  16713. T42 v42, T43 v43) {
  16714. return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16715. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16716. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  16717. T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
  16718. v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
  16719. v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
  16720. v41, v42, v43);
  16721. }
  16722. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16723. typename T6, typename T7, typename T8, typename T9, typename T10,
  16724. typename T11, typename T12, typename T13, typename T14, typename T15,
  16725. typename T16, typename T17, typename T18, typename T19, typename T20,
  16726. typename T21, typename T22, typename T23, typename T24, typename T25,
  16727. typename T26, typename T27, typename T28, typename T29, typename T30,
  16728. typename T31, typename T32, typename T33, typename T34, typename T35,
  16729. typename T36, typename T37, typename T38, typename T39, typename T40,
  16730. typename T41, typename T42, typename T43, typename T44>
  16731. internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16732. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16733. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  16734. T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  16735. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  16736. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  16737. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  16738. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  16739. T42 v42, T43 v43, T44 v44) {
  16740. return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16741. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16742. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  16743. T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
  16744. v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
  16745. v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
  16746. v40, v41, v42, v43, v44);
  16747. }
  16748. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16749. typename T6, typename T7, typename T8, typename T9, typename T10,
  16750. typename T11, typename T12, typename T13, typename T14, typename T15,
  16751. typename T16, typename T17, typename T18, typename T19, typename T20,
  16752. typename T21, typename T22, typename T23, typename T24, typename T25,
  16753. typename T26, typename T27, typename T28, typename T29, typename T30,
  16754. typename T31, typename T32, typename T33, typename T34, typename T35,
  16755. typename T36, typename T37, typename T38, typename T39, typename T40,
  16756. typename T41, typename T42, typename T43, typename T44, typename T45>
  16757. internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16758. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16759. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  16760. T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  16761. T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
  16762. T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
  16763. T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
  16764. T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
  16765. T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
  16766. return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16767. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16768. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  16769. T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
  16770. v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
  16771. v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
  16772. v39, v40, v41, v42, v43, v44, v45);
  16773. }
  16774. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16775. typename T6, typename T7, typename T8, typename T9, typename T10,
  16776. typename T11, typename T12, typename T13, typename T14, typename T15,
  16777. typename T16, typename T17, typename T18, typename T19, typename T20,
  16778. typename T21, typename T22, typename T23, typename T24, typename T25,
  16779. typename T26, typename T27, typename T28, typename T29, typename T30,
  16780. typename T31, typename T32, typename T33, typename T34, typename T35,
  16781. typename T36, typename T37, typename T38, typename T39, typename T40,
  16782. typename T41, typename T42, typename T43, typename T44, typename T45,
  16783. typename T46>
  16784. internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16785. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16786. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  16787. T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  16788. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  16789. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  16790. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  16791. T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
  16792. T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
  16793. return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16794. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16795. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  16796. T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
  16797. v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  16798. v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
  16799. v38, v39, v40, v41, v42, v43, v44, v45, v46);
  16800. }
  16801. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16802. typename T6, typename T7, typename T8, typename T9, typename T10,
  16803. typename T11, typename T12, typename T13, typename T14, typename T15,
  16804. typename T16, typename T17, typename T18, typename T19, typename T20,
  16805. typename T21, typename T22, typename T23, typename T24, typename T25,
  16806. typename T26, typename T27, typename T28, typename T29, typename T30,
  16807. typename T31, typename T32, typename T33, typename T34, typename T35,
  16808. typename T36, typename T37, typename T38, typename T39, typename T40,
  16809. typename T41, typename T42, typename T43, typename T44, typename T45,
  16810. typename T46, typename T47>
  16811. internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16812. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16813. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  16814. T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  16815. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  16816. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  16817. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  16818. T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
  16819. T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
  16820. return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16821. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16822. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  16823. T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
  16824. v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  16825. v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
  16826. v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
  16827. }
  16828. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16829. typename T6, typename T7, typename T8, typename T9, typename T10,
  16830. typename T11, typename T12, typename T13, typename T14, typename T15,
  16831. typename T16, typename T17, typename T18, typename T19, typename T20,
  16832. typename T21, typename T22, typename T23, typename T24, typename T25,
  16833. typename T26, typename T27, typename T28, typename T29, typename T30,
  16834. typename T31, typename T32, typename T33, typename T34, typename T35,
  16835. typename T36, typename T37, typename T38, typename T39, typename T40,
  16836. typename T41, typename T42, typename T43, typename T44, typename T45,
  16837. typename T46, typename T47, typename T48>
  16838. internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16839. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16840. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  16841. T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
  16842. T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  16843. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  16844. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  16845. T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
  16846. T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
  16847. T48 v48) {
  16848. return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16849. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16850. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  16851. T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
  16852. v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
  16853. v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
  16854. v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
  16855. }
  16856. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16857. typename T6, typename T7, typename T8, typename T9, typename T10,
  16858. typename T11, typename T12, typename T13, typename T14, typename T15,
  16859. typename T16, typename T17, typename T18, typename T19, typename T20,
  16860. typename T21, typename T22, typename T23, typename T24, typename T25,
  16861. typename T26, typename T27, typename T28, typename T29, typename T30,
  16862. typename T31, typename T32, typename T33, typename T34, typename T35,
  16863. typename T36, typename T37, typename T38, typename T39, typename T40,
  16864. typename T41, typename T42, typename T43, typename T44, typename T45,
  16865. typename T46, typename T47, typename T48, typename T49>
  16866. internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16867. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16868. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  16869. T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
  16870. T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
  16871. T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
  16872. T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
  16873. T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
  16874. T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
  16875. T47 v47, T48 v48, T49 v49) {
  16876. return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16877. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16878. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  16879. T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
  16880. v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
  16881. v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
  16882. v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
  16883. }
  16884. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16885. typename T6, typename T7, typename T8, typename T9, typename T10,
  16886. typename T11, typename T12, typename T13, typename T14, typename T15,
  16887. typename T16, typename T17, typename T18, typename T19, typename T20,
  16888. typename T21, typename T22, typename T23, typename T24, typename T25,
  16889. typename T26, typename T27, typename T28, typename T29, typename T30,
  16890. typename T31, typename T32, typename T33, typename T34, typename T35,
  16891. typename T36, typename T37, typename T38, typename T39, typename T40,
  16892. typename T41, typename T42, typename T43, typename T44, typename T45,
  16893. typename T46, typename T47, typename T48, typename T49, typename T50>
  16894. internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16895. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16896. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  16897. T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  16898. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  16899. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
  16900. T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
  16901. T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
  16902. T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
  16903. T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
  16904. return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16905. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16906. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  16907. T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
  16908. v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  16909. v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
  16910. v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
  16911. v48, v49, v50);
  16912. }
  16913. // Bool() allows generating tests with parameters in a set of (false, true).
  16914. //
  16915. // Synopsis:
  16916. // Bool()
  16917. // - returns a generator producing sequences with elements {false, true}.
  16918. //
  16919. // It is useful when testing code that depends on Boolean flags. Combinations
  16920. // of multiple flags can be tested when several Bool()'s are combined using
  16921. // Combine() function.
  16922. //
  16923. // In the following example all tests in the test case FlagDependentTest
  16924. // will be instantiated twice with parameters false and true.
  16925. //
  16926. // class FlagDependentTest : public testing::TestWithParam<bool> {
  16927. // virtual void SetUp() {
  16928. // external_flag = GetParam();
  16929. // }
  16930. // }
  16931. // INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
  16932. //
  16933. inline internal::ParamGenerator<bool> Bool() {
  16934. return Values(false, true);
  16935. }
  16936. # if GTEST_HAS_COMBINE
  16937. // Combine() allows the user to combine two or more sequences to produce
  16938. // values of a Cartesian product of those sequences' elements.
  16939. //
  16940. // Synopsis:
  16941. // Combine(gen1, gen2, ..., genN)
  16942. // - returns a generator producing sequences with elements coming from
  16943. // the Cartesian product of elements from the sequences generated by
  16944. // gen1, gen2, ..., genN. The sequence elements will have a type of
  16945. // tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
  16946. // of elements from sequences produces by gen1, gen2, ..., genN.
  16947. //
  16948. // Combine can have up to 10 arguments. This number is currently limited
  16949. // by the maximum number of elements in the tuple implementation used by Google
  16950. // Test.
  16951. //
  16952. // Example:
  16953. //
  16954. // This will instantiate tests in test case AnimalTest each one with
  16955. // the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
  16956. // tuple("dog", BLACK), and tuple("dog", WHITE):
  16957. //
  16958. // enum Color { BLACK, GRAY, WHITE };
  16959. // class AnimalTest
  16960. // : public testing::TestWithParam<tuple<const char*, Color> > {...};
  16961. //
  16962. // TEST_P(AnimalTest, AnimalLooksNice) {...}
  16963. //
  16964. // INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
  16965. // Combine(Values("cat", "dog"),
  16966. // Values(BLACK, WHITE)));
  16967. //
  16968. // This will instantiate tests in FlagDependentTest with all variations of two
  16969. // Boolean flags:
  16970. //
  16971. // class FlagDependentTest
  16972. // : public testing::TestWithParam<tuple<bool, bool> > {
  16973. // virtual void SetUp() {
  16974. // // Assigns external_flag_1 and external_flag_2 values from the tuple.
  16975. // tie(external_flag_1, external_flag_2) = GetParam();
  16976. // }
  16977. // };
  16978. //
  16979. // TEST_P(FlagDependentTest, TestFeature1) {
  16980. // // Test your code using external_flag_1 and external_flag_2 here.
  16981. // }
  16982. // INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
  16983. // Combine(Bool(), Bool()));
  16984. //
  16985. template <typename Generator1, typename Generator2>
  16986. internal::CartesianProductHolder2<Generator1, Generator2> Combine(
  16987. const Generator1& g1, const Generator2& g2) {
  16988. return internal::CartesianProductHolder2<Generator1, Generator2>(
  16989. g1, g2);
  16990. }
  16991. template <typename Generator1, typename Generator2, typename Generator3>
  16992. internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
  16993. const Generator1& g1, const Generator2& g2, const Generator3& g3) {
  16994. return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
  16995. g1, g2, g3);
  16996. }
  16997. template <typename Generator1, typename Generator2, typename Generator3,
  16998. typename Generator4>
  16999. internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
  17000. Generator4> Combine(
  17001. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  17002. const Generator4& g4) {
  17003. return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
  17004. Generator4>(
  17005. g1, g2, g3, g4);
  17006. }
  17007. template <typename Generator1, typename Generator2, typename Generator3,
  17008. typename Generator4, typename Generator5>
  17009. internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
  17010. Generator4, Generator5> Combine(
  17011. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  17012. const Generator4& g4, const Generator5& g5) {
  17013. return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
  17014. Generator4, Generator5>(
  17015. g1, g2, g3, g4, g5);
  17016. }
  17017. template <typename Generator1, typename Generator2, typename Generator3,
  17018. typename Generator4, typename Generator5, typename Generator6>
  17019. internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
  17020. Generator4, Generator5, Generator6> Combine(
  17021. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  17022. const Generator4& g4, const Generator5& g5, const Generator6& g6) {
  17023. return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
  17024. Generator4, Generator5, Generator6>(
  17025. g1, g2, g3, g4, g5, g6);
  17026. }
  17027. template <typename Generator1, typename Generator2, typename Generator3,
  17028. typename Generator4, typename Generator5, typename Generator6,
  17029. typename Generator7>
  17030. internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
  17031. Generator4, Generator5, Generator6, Generator7> Combine(
  17032. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  17033. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  17034. const Generator7& g7) {
  17035. return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
  17036. Generator4, Generator5, Generator6, Generator7>(
  17037. g1, g2, g3, g4, g5, g6, g7);
  17038. }
  17039. template <typename Generator1, typename Generator2, typename Generator3,
  17040. typename Generator4, typename Generator5, typename Generator6,
  17041. typename Generator7, typename Generator8>
  17042. internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
  17043. Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
  17044. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  17045. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  17046. const Generator7& g7, const Generator8& g8) {
  17047. return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
  17048. Generator4, Generator5, Generator6, Generator7, Generator8>(
  17049. g1, g2, g3, g4, g5, g6, g7, g8);
  17050. }
  17051. template <typename Generator1, typename Generator2, typename Generator3,
  17052. typename Generator4, typename Generator5, typename Generator6,
  17053. typename Generator7, typename Generator8, typename Generator9>
  17054. internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
  17055. Generator4, Generator5, Generator6, Generator7, Generator8,
  17056. Generator9> Combine(
  17057. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  17058. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  17059. const Generator7& g7, const Generator8& g8, const Generator9& g9) {
  17060. return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
  17061. Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
  17062. g1, g2, g3, g4, g5, g6, g7, g8, g9);
  17063. }
  17064. template <typename Generator1, typename Generator2, typename Generator3,
  17065. typename Generator4, typename Generator5, typename Generator6,
  17066. typename Generator7, typename Generator8, typename Generator9,
  17067. typename Generator10>
  17068. internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
  17069. Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
  17070. Generator10> Combine(
  17071. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  17072. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  17073. const Generator7& g7, const Generator8& g8, const Generator9& g9,
  17074. const Generator10& g10) {
  17075. return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
  17076. Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
  17077. Generator10>(
  17078. g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
  17079. }
  17080. # endif // GTEST_HAS_COMBINE
  17081. # define TEST_P(test_case_name, test_name) \
  17082. class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
  17083. : public test_case_name { \
  17084. public: \
  17085. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
  17086. virtual void TestBody(); \
  17087. private: \
  17088. static int AddToRegistry() { \
  17089. ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
  17090. GetTestCasePatternHolder<test_case_name>(\
  17091. #test_case_name, \
  17092. ::testing::internal::CodeLocation(\
  17093. __FILE__, __LINE__))->AddTestPattern(\
  17094. GTEST_STRINGIFY_(test_case_name), \
  17095. GTEST_STRINGIFY_(test_name), \
  17096. new ::testing::internal::TestMetaFactory< \
  17097. GTEST_TEST_CLASS_NAME_(\
  17098. test_case_name, test_name)>()); \
  17099. return 0; \
  17100. } \
  17101. static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \
  17102. GTEST_DISALLOW_COPY_AND_ASSIGN_(\
  17103. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
  17104. }; \
  17105. int GTEST_TEST_CLASS_NAME_(test_case_name, \
  17106. test_name)::gtest_registering_dummy_ = \
  17107. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
  17108. void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
  17109. // The optional last argument to INSTANTIATE_TEST_CASE_P allows the user
  17110. // to specify a function or functor that generates custom test name suffixes
  17111. // based on the test parameters. The function should accept one argument of
  17112. // type testing::TestParamInfo<class ParamType>, and return std::string.
  17113. //
  17114. // testing::PrintToStringParamName is a builtin test suffix generator that
  17115. // returns the value of testing::PrintToString(GetParam()).
  17116. //
  17117. // Note: test names must be non-empty, unique, and may only contain ASCII
  17118. // alphanumeric characters or underscore. Because PrintToString adds quotes
  17119. // to std::string and C strings, it won't work for these types.
  17120. # define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \
  17121. static ::testing::internal::ParamGenerator<test_case_name::ParamType> \
  17122. gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
  17123. static ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \
  17124. const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \
  17125. return ::testing::internal::GetParamNameGen<test_case_name::ParamType> \
  17126. (__VA_ARGS__)(info); \
  17127. } \
  17128. static int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
  17129. ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
  17130. GetTestCasePatternHolder<test_case_name>(\
  17131. #test_case_name, \
  17132. ::testing::internal::CodeLocation(\
  17133. __FILE__, __LINE__))->AddTestCaseInstantiation(\
  17134. #prefix, \
  17135. &gtest_##prefix##test_case_name##_EvalGenerator_, \
  17136. &gtest_##prefix##test_case_name##_EvalGenerateName_, \
  17137. __FILE__, __LINE__)
  17138. } // namespace testing
  17139. #endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
  17140. // Copyright 2006, Google Inc.
  17141. // All rights reserved.
  17142. //
  17143. // Redistribution and use in source and binary forms, with or without
  17144. // modification, are permitted provided that the following conditions are
  17145. // met:
  17146. //
  17147. // * Redistributions of source code must retain the above copyright
  17148. // notice, this list of conditions and the following disclaimer.
  17149. // * Redistributions in binary form must reproduce the above
  17150. // copyright notice, this list of conditions and the following disclaimer
  17151. // in the documentation and/or other materials provided with the
  17152. // distribution.
  17153. // * Neither the name of Google Inc. nor the names of its
  17154. // contributors may be used to endorse or promote products derived from
  17155. // this software without specific prior written permission.
  17156. //
  17157. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  17158. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  17159. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  17160. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  17161. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17162. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17163. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  17164. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  17165. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  17166. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  17167. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  17168. //
  17169. // Google C++ Testing and Mocking Framework definitions useful in production code.
  17170. // GOOGLETEST_CM0003 DO NOT DELETE
  17171. #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
  17172. #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
  17173. // When you need to test the private or protected members of a class,
  17174. // use the FRIEND_TEST macro to declare your tests as friends of the
  17175. // class. For example:
  17176. //
  17177. // class MyClass {
  17178. // private:
  17179. // void PrivateMethod();
  17180. // FRIEND_TEST(MyClassTest, PrivateMethodWorks);
  17181. // };
  17182. //
  17183. // class MyClassTest : public testing::Test {
  17184. // // ...
  17185. // };
  17186. //
  17187. // TEST_F(MyClassTest, PrivateMethodWorks) {
  17188. // // Can call MyClass::PrivateMethod() here.
  17189. // }
  17190. //
  17191. // Note: The test class must be in the same namespace as the class being tested.
  17192. // For example, putting MyClassTest in an anonymous namespace will not work.
  17193. #define FRIEND_TEST(test_case_name, test_name)\
  17194. friend class test_case_name##_##test_name##_Test
  17195. #endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
  17196. // Copyright 2008, Google Inc.
  17197. // All rights reserved.
  17198. //
  17199. // Redistribution and use in source and binary forms, with or without
  17200. // modification, are permitted provided that the following conditions are
  17201. // met:
  17202. //
  17203. // * Redistributions of source code must retain the above copyright
  17204. // notice, this list of conditions and the following disclaimer.
  17205. // * Redistributions in binary form must reproduce the above
  17206. // copyright notice, this list of conditions and the following disclaimer
  17207. // in the documentation and/or other materials provided with the
  17208. // distribution.
  17209. // * Neither the name of Google Inc. nor the names of its
  17210. // contributors may be used to endorse or promote products derived from
  17211. // this software without specific prior written permission.
  17212. //
  17213. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  17214. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  17215. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  17216. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  17217. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17218. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17219. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  17220. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  17221. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  17222. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  17223. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  17224. //
  17225. // GOOGLETEST_CM0001 DO NOT DELETE
  17226. #ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
  17227. #define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
  17228. #include <iosfwd>
  17229. #include <vector>
  17230. GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
  17231. /* class A needs to have dll-interface to be used by clients of class B */)
  17232. namespace testing {
  17233. // A copyable object representing the result of a test part (i.e. an
  17234. // assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
  17235. //
  17236. // Don't inherit from TestPartResult as its destructor is not virtual.
  17237. class GTEST_API_ TestPartResult {
  17238. public:
  17239. // The possible outcomes of a test part (i.e. an assertion or an
  17240. // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
  17241. enum Type {
  17242. kSuccess, // Succeeded.
  17243. kNonFatalFailure, // Failed but the test can continue.
  17244. kFatalFailure // Failed and the test should be terminated.
  17245. };
  17246. // C'tor. TestPartResult does NOT have a default constructor.
  17247. // Always use this constructor (with parameters) to create a
  17248. // TestPartResult object.
  17249. TestPartResult(Type a_type,
  17250. const char* a_file_name,
  17251. int a_line_number,
  17252. const char* a_message)
  17253. : type_(a_type),
  17254. file_name_(a_file_name == NULL ? "" : a_file_name),
  17255. line_number_(a_line_number),
  17256. summary_(ExtractSummary(a_message)),
  17257. message_(a_message) {
  17258. }
  17259. // Gets the outcome of the test part.
  17260. Type type() const { return type_; }
  17261. // Gets the name of the source file where the test part took place, or
  17262. // NULL if it's unknown.
  17263. const char* file_name() const {
  17264. return file_name_.empty() ? NULL : file_name_.c_str();
  17265. }
  17266. // Gets the line in the source file where the test part took place,
  17267. // or -1 if it's unknown.
  17268. int line_number() const { return line_number_; }
  17269. // Gets the summary of the failure message.
  17270. const char* summary() const { return summary_.c_str(); }
  17271. // Gets the message associated with the test part.
  17272. const char* message() const { return message_.c_str(); }
  17273. // Returns true iff the test part passed.
  17274. bool passed() const { return type_ == kSuccess; }
  17275. // Returns true iff the test part failed.
  17276. bool failed() const { return type_ != kSuccess; }
  17277. // Returns true iff the test part non-fatally failed.
  17278. bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
  17279. // Returns true iff the test part fatally failed.
  17280. bool fatally_failed() const { return type_ == kFatalFailure; }
  17281. private:
  17282. Type type_;
  17283. // Gets the summary of the failure message by omitting the stack
  17284. // trace in it.
  17285. static std::string ExtractSummary(const char* message);
  17286. // The name of the source file where the test part took place, or
  17287. // "" if the source file is unknown.
  17288. std::string file_name_;
  17289. // The line in the source file where the test part took place, or -1
  17290. // if the line number is unknown.
  17291. int line_number_;
  17292. std::string summary_; // The test failure summary.
  17293. std::string message_; // The test failure message.
  17294. };
  17295. // Prints a TestPartResult object.
  17296. std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
  17297. // An array of TestPartResult objects.
  17298. //
  17299. // Don't inherit from TestPartResultArray as its destructor is not
  17300. // virtual.
  17301. class GTEST_API_ TestPartResultArray {
  17302. public:
  17303. TestPartResultArray() {}
  17304. // Appends the given TestPartResult to the array.
  17305. void Append(const TestPartResult& result);
  17306. // Returns the TestPartResult at the given index (0-based).
  17307. const TestPartResult& GetTestPartResult(int index) const;
  17308. // Returns the number of TestPartResult objects in the array.
  17309. int size() const;
  17310. private:
  17311. std::vector<TestPartResult> array_;
  17312. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
  17313. };
  17314. // This interface knows how to report a test part result.
  17315. class GTEST_API_ TestPartResultReporterInterface {
  17316. public:
  17317. virtual ~TestPartResultReporterInterface() {}
  17318. virtual void ReportTestPartResult(const TestPartResult& result) = 0;
  17319. };
  17320. namespace internal {
  17321. // This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
  17322. // statement generates new fatal failures. To do so it registers itself as the
  17323. // current test part result reporter. Besides checking if fatal failures were
  17324. // reported, it only delegates the reporting to the former result reporter.
  17325. // The original result reporter is restored in the destructor.
  17326. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  17327. class GTEST_API_ HasNewFatalFailureHelper
  17328. : public TestPartResultReporterInterface {
  17329. public:
  17330. HasNewFatalFailureHelper();
  17331. virtual ~HasNewFatalFailureHelper();
  17332. virtual void ReportTestPartResult(const TestPartResult& result);
  17333. bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
  17334. private:
  17335. bool has_new_fatal_failure_;
  17336. TestPartResultReporterInterface* original_reporter_;
  17337. GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
  17338. };
  17339. } // namespace internal
  17340. } // namespace testing
  17341. GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
  17342. #endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
  17343. // Copyright 2008 Google Inc.
  17344. // All Rights Reserved.
  17345. //
  17346. // Redistribution and use in source and binary forms, with or without
  17347. // modification, are permitted provided that the following conditions are
  17348. // met:
  17349. //
  17350. // * Redistributions of source code must retain the above copyright
  17351. // notice, this list of conditions and the following disclaimer.
  17352. // * Redistributions in binary form must reproduce the above
  17353. // copyright notice, this list of conditions and the following disclaimer
  17354. // in the documentation and/or other materials provided with the
  17355. // distribution.
  17356. // * Neither the name of Google Inc. nor the names of its
  17357. // contributors may be used to endorse or promote products derived from
  17358. // this software without specific prior written permission.
  17359. //
  17360. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  17361. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  17362. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  17363. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  17364. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17365. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17366. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  17367. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  17368. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  17369. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  17370. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  17371. // GOOGLETEST_CM0001 DO NOT DELETE
  17372. #ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
  17373. #define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
  17374. // This header implements typed tests and type-parameterized tests.
  17375. // Typed (aka type-driven) tests repeat the same test for types in a
  17376. // list. You must know which types you want to test with when writing
  17377. // typed tests. Here's how you do it:
  17378. #if 0
  17379. // First, define a fixture class template. It should be parameterized
  17380. // by a type. Remember to derive it from testing::Test.
  17381. template <typename T>
  17382. class FooTest : public testing::Test {
  17383. public:
  17384. ...
  17385. typedef std::list<T> List;
  17386. static T shared_;
  17387. T value_;
  17388. };
  17389. // Next, associate a list of types with the test case, which will be
  17390. // repeated for each type in the list. The typedef is necessary for
  17391. // the macro to parse correctly.
  17392. typedef testing::Types<char, int, unsigned int> MyTypes;
  17393. TYPED_TEST_CASE(FooTest, MyTypes);
  17394. // If the type list contains only one type, you can write that type
  17395. // directly without Types<...>:
  17396. // TYPED_TEST_CASE(FooTest, int);
  17397. // Then, use TYPED_TEST() instead of TEST_F() to define as many typed
  17398. // tests for this test case as you want.
  17399. TYPED_TEST(FooTest, DoesBlah) {
  17400. // Inside a test, refer to TypeParam to get the type parameter.
  17401. // Since we are inside a derived class template, C++ requires use to
  17402. // visit the members of FooTest via 'this'.
  17403. TypeParam n = this->value_;
  17404. // To visit static members of the fixture, add the TestFixture::
  17405. // prefix.
  17406. n += TestFixture::shared_;
  17407. // To refer to typedefs in the fixture, add the "typename
  17408. // TestFixture::" prefix.
  17409. typename TestFixture::List values;
  17410. values.push_back(n);
  17411. ...
  17412. }
  17413. TYPED_TEST(FooTest, HasPropertyA) { ... }
  17414. // TYPED_TEST_CASE takes an optional third argument which allows to specify a
  17415. // class that generates custom test name suffixes based on the type. This should
  17416. // be a class which has a static template function GetName(int index) returning
  17417. // a string for each type. The provided integer index equals the index of the
  17418. // type in the provided type list. In many cases the index can be ignored.
  17419. //
  17420. // For example:
  17421. // class MyTypeNames {
  17422. // public:
  17423. // template <typename T>
  17424. // static std::string GetName(int) {
  17425. // if (std::is_same<T, char>()) return "char";
  17426. // if (std::is_same<T, int>()) return "int";
  17427. // if (std::is_same<T, unsigned int>()) return "unsignedInt";
  17428. // }
  17429. // };
  17430. // TYPED_TEST_CASE(FooTest, MyTypes, MyTypeNames);
  17431. #endif // 0
  17432. // Type-parameterized tests are abstract test patterns parameterized
  17433. // by a type. Compared with typed tests, type-parameterized tests
  17434. // allow you to define the test pattern without knowing what the type
  17435. // parameters are. The defined pattern can be instantiated with
  17436. // different types any number of times, in any number of translation
  17437. // units.
  17438. //
  17439. // If you are designing an interface or concept, you can define a
  17440. // suite of type-parameterized tests to verify properties that any
  17441. // valid implementation of the interface/concept should have. Then,
  17442. // each implementation can easily instantiate the test suite to verify
  17443. // that it conforms to the requirements, without having to write
  17444. // similar tests repeatedly. Here's an example:
  17445. #if 0
  17446. // First, define a fixture class template. It should be parameterized
  17447. // by a type. Remember to derive it from testing::Test.
  17448. template <typename T>
  17449. class FooTest : public testing::Test {
  17450. ...
  17451. };
  17452. // Next, declare that you will define a type-parameterized test case
  17453. // (the _P suffix is for "parameterized" or "pattern", whichever you
  17454. // prefer):
  17455. TYPED_TEST_CASE_P(FooTest);
  17456. // Then, use TYPED_TEST_P() to define as many type-parameterized tests
  17457. // for this type-parameterized test case as you want.
  17458. TYPED_TEST_P(FooTest, DoesBlah) {
  17459. // Inside a test, refer to TypeParam to get the type parameter.
  17460. TypeParam n = 0;
  17461. ...
  17462. }
  17463. TYPED_TEST_P(FooTest, HasPropertyA) { ... }
  17464. // Now the tricky part: you need to register all test patterns before
  17465. // you can instantiate them. The first argument of the macro is the
  17466. // test case name; the rest are the names of the tests in this test
  17467. // case.
  17468. REGISTER_TYPED_TEST_CASE_P(FooTest,
  17469. DoesBlah, HasPropertyA);
  17470. // Finally, you are free to instantiate the pattern with the types you
  17471. // want. If you put the above code in a header file, you can #include
  17472. // it in multiple C++ source files and instantiate it multiple times.
  17473. //
  17474. // To distinguish different instances of the pattern, the first
  17475. // argument to the INSTANTIATE_* macro is a prefix that will be added
  17476. // to the actual test case name. Remember to pick unique prefixes for
  17477. // different instances.
  17478. typedef testing::Types<char, int, unsigned int> MyTypes;
  17479. INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
  17480. // If the type list contains only one type, you can write that type
  17481. // directly without Types<...>:
  17482. // INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
  17483. //
  17484. // Similar to the optional argument of TYPED_TEST_CASE above,
  17485. // INSTANTIATE_TEST_CASE_P takes an optional fourth argument which allows to
  17486. // generate custom names.
  17487. // INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes, MyTypeNames);
  17488. #endif // 0
  17489. // Implements typed tests.
  17490. #if GTEST_HAS_TYPED_TEST
  17491. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  17492. //
  17493. // Expands to the name of the typedef for the type parameters of the
  17494. // given test case.
  17495. # define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
  17496. // Expands to the name of the typedef for the NameGenerator, responsible for
  17497. // creating the suffixes of the name.
  17498. #define GTEST_NAME_GENERATOR_(TestCaseName) \
  17499. gtest_type_params_##TestCaseName##_NameGenerator
  17500. // The 'Types' template argument below must have spaces around it
  17501. // since some compilers may choke on '>>' when passing a template
  17502. // instance (e.g. Types<int>)
  17503. # define TYPED_TEST_CASE(CaseName, Types, ...) \
  17504. typedef ::testing::internal::TypeList< Types >::type GTEST_TYPE_PARAMS_( \
  17505. CaseName); \
  17506. typedef ::testing::internal::NameGeneratorSelector<__VA_ARGS__>::type \
  17507. GTEST_NAME_GENERATOR_(CaseName)
  17508. # define TYPED_TEST(CaseName, TestName) \
  17509. template <typename gtest_TypeParam_> \
  17510. class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
  17511. : public CaseName<gtest_TypeParam_> { \
  17512. private: \
  17513. typedef CaseName<gtest_TypeParam_> TestFixture; \
  17514. typedef gtest_TypeParam_ TypeParam; \
  17515. virtual void TestBody(); \
  17516. }; \
  17517. static bool gtest_##CaseName##_##TestName##_registered_ \
  17518. GTEST_ATTRIBUTE_UNUSED_ = \
  17519. ::testing::internal::TypeParameterizedTest< \
  17520. CaseName, \
  17521. ::testing::internal::TemplateSel<GTEST_TEST_CLASS_NAME_(CaseName, \
  17522. TestName)>, \
  17523. GTEST_TYPE_PARAMS_( \
  17524. CaseName)>::Register("", \
  17525. ::testing::internal::CodeLocation( \
  17526. __FILE__, __LINE__), \
  17527. #CaseName, #TestName, 0, \
  17528. ::testing::internal::GenerateNames< \
  17529. GTEST_NAME_GENERATOR_(CaseName), \
  17530. GTEST_TYPE_PARAMS_(CaseName)>()); \
  17531. template <typename gtest_TypeParam_> \
  17532. void GTEST_TEST_CLASS_NAME_(CaseName, \
  17533. TestName)<gtest_TypeParam_>::TestBody()
  17534. #endif // GTEST_HAS_TYPED_TEST
  17535. // Implements type-parameterized tests.
  17536. #if GTEST_HAS_TYPED_TEST_P
  17537. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  17538. //
  17539. // Expands to the namespace name that the type-parameterized tests for
  17540. // the given type-parameterized test case are defined in. The exact
  17541. // name of the namespace is subject to change without notice.
  17542. # define GTEST_CASE_NAMESPACE_(TestCaseName) \
  17543. gtest_case_##TestCaseName##_
  17544. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  17545. //
  17546. // Expands to the name of the variable used to remember the names of
  17547. // the defined tests in the given test case.
  17548. # define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
  17549. gtest_typed_test_case_p_state_##TestCaseName##_
  17550. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
  17551. //
  17552. // Expands to the name of the variable used to remember the names of
  17553. // the registered tests in the given test case.
  17554. # define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
  17555. gtest_registered_test_names_##TestCaseName##_
  17556. // The variables defined in the type-parameterized test macros are
  17557. // static as typically these macros are used in a .h file that can be
  17558. // #included in multiple translation units linked together.
  17559. # define TYPED_TEST_CASE_P(CaseName) \
  17560. static ::testing::internal::TypedTestCasePState \
  17561. GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
  17562. # define TYPED_TEST_P(CaseName, TestName) \
  17563. namespace GTEST_CASE_NAMESPACE_(CaseName) { \
  17564. template <typename gtest_TypeParam_> \
  17565. class TestName : public CaseName<gtest_TypeParam_> { \
  17566. private: \
  17567. typedef CaseName<gtest_TypeParam_> TestFixture; \
  17568. typedef gtest_TypeParam_ TypeParam; \
  17569. virtual void TestBody(); \
  17570. }; \
  17571. static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
  17572. GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
  17573. __FILE__, __LINE__, #CaseName, #TestName); \
  17574. } \
  17575. template <typename gtest_TypeParam_> \
  17576. void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
  17577. # define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
  17578. namespace GTEST_CASE_NAMESPACE_(CaseName) { \
  17579. typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
  17580. } \
  17581. static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) \
  17582. GTEST_ATTRIBUTE_UNUSED_ = \
  17583. GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames( \
  17584. __FILE__, __LINE__, #__VA_ARGS__)
  17585. // The 'Types' template argument below must have spaces around it
  17586. // since some compilers may choke on '>>' when passing a template
  17587. // instance (e.g. Types<int>)
  17588. # define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types, ...) \
  17589. static bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
  17590. ::testing::internal::TypeParameterizedTestCase< \
  17591. CaseName, GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
  17592. ::testing::internal::TypeList< Types >::type>:: \
  17593. Register(#Prefix, \
  17594. ::testing::internal::CodeLocation(__FILE__, __LINE__), \
  17595. &GTEST_TYPED_TEST_CASE_P_STATE_(CaseName), #CaseName, \
  17596. GTEST_REGISTERED_TEST_NAMES_(CaseName), \
  17597. ::testing::internal::GenerateNames< \
  17598. ::testing::internal::NameGeneratorSelector< \
  17599. __VA_ARGS__>::type, \
  17600. ::testing::internal::TypeList< Types >::type>())
  17601. #endif // GTEST_HAS_TYPED_TEST_P
  17602. #endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
  17603. GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
  17604. /* class A needs to have dll-interface to be used by clients of class B */)
  17605. // Depending on the platform, different string classes are available.
  17606. // On Linux, in addition to ::std::string, Google also makes use of
  17607. // class ::string, which has the same interface as ::std::string, but
  17608. // has a different implementation.
  17609. //
  17610. // You can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
  17611. // ::string is available AND is a distinct type to ::std::string, or
  17612. // define it to 0 to indicate otherwise.
  17613. //
  17614. // If ::std::string and ::string are the same class on your platform
  17615. // due to aliasing, you should define GTEST_HAS_GLOBAL_STRING to 0.
  17616. //
  17617. // If you do not define GTEST_HAS_GLOBAL_STRING, it is defined
  17618. // heuristically.
  17619. namespace testing {
  17620. // Silence C4100 (unreferenced formal parameter) and 4805
  17621. // unsafe mix of type 'const int' and type 'const bool'
  17622. #ifdef _MSC_VER
  17623. # pragma warning(push)
  17624. # pragma warning(disable:4805)
  17625. # pragma warning(disable:4100)
  17626. #endif
  17627. // Declares the flags.
  17628. // This flag temporary enables the disabled tests.
  17629. GTEST_DECLARE_bool_(also_run_disabled_tests);
  17630. // This flag brings the debugger on an assertion failure.
  17631. GTEST_DECLARE_bool_(break_on_failure);
  17632. // This flag controls whether Google Test catches all test-thrown exceptions
  17633. // and logs them as failures.
  17634. GTEST_DECLARE_bool_(catch_exceptions);
  17635. // This flag enables using colors in terminal output. Available values are
  17636. // "yes" to enable colors, "no" (disable colors), or "auto" (the default)
  17637. // to let Google Test decide.
  17638. GTEST_DECLARE_string_(color);
  17639. // This flag sets up the filter to select by name using a glob pattern
  17640. // the tests to run. If the filter is not given all tests are executed.
  17641. GTEST_DECLARE_string_(filter);
  17642. // This flag controls whether Google Test installs a signal handler that dumps
  17643. // debugging information when fatal signals are raised.
  17644. GTEST_DECLARE_bool_(install_failure_signal_handler);
  17645. // This flag causes the Google Test to list tests. None of the tests listed
  17646. // are actually run if the flag is provided.
  17647. GTEST_DECLARE_bool_(list_tests);
  17648. // This flag controls whether Google Test emits a detailed XML report to a file
  17649. // in addition to its normal textual output.
  17650. GTEST_DECLARE_string_(output);
  17651. // This flags control whether Google Test prints the elapsed time for each
  17652. // test.
  17653. GTEST_DECLARE_bool_(print_time);
  17654. // This flags control whether Google Test prints UTF8 characters as text.
  17655. GTEST_DECLARE_bool_(print_utf8);
  17656. // This flag specifies the random number seed.
  17657. GTEST_DECLARE_int32_(random_seed);
  17658. // This flag sets how many times the tests are repeated. The default value
  17659. // is 1. If the value is -1 the tests are repeating forever.
  17660. GTEST_DECLARE_int32_(repeat);
  17661. // This flag controls whether Google Test includes Google Test internal
  17662. // stack frames in failure stack traces.
  17663. GTEST_DECLARE_bool_(show_internal_stack_frames);
  17664. // When this flag is specified, tests' order is randomized on every iteration.
  17665. GTEST_DECLARE_bool_(shuffle);
  17666. // This flag specifies the maximum number of stack frames to be
  17667. // printed in a failure message.
  17668. GTEST_DECLARE_int32_(stack_trace_depth);
  17669. // When this flag is specified, a failed assertion will throw an
  17670. // exception if exceptions are enabled, or exit the program with a
  17671. // non-zero code otherwise. For use with an external test framework.
  17672. GTEST_DECLARE_bool_(throw_on_failure);
  17673. // When this flag is set with a "host:port" string, on supported
  17674. // platforms test results are streamed to the specified port on
  17675. // the specified host machine.
  17676. GTEST_DECLARE_string_(stream_result_to);
  17677. #if GTEST_USE_OWN_FLAGFILE_FLAG_
  17678. GTEST_DECLARE_string_(flagfile);
  17679. #endif // GTEST_USE_OWN_FLAGFILE_FLAG_
  17680. // The upper limit for valid stack trace depths.
  17681. const int kMaxStackTraceDepth = 100;
  17682. namespace internal {
  17683. class AssertHelper;
  17684. class DefaultGlobalTestPartResultReporter;
  17685. class ExecDeathTest;
  17686. class NoExecDeathTest;
  17687. class FinalSuccessChecker;
  17688. class GTestFlagSaver;
  17689. class StreamingListenerTest;
  17690. class TestResultAccessor;
  17691. class TestEventListenersAccessor;
  17692. class TestEventRepeater;
  17693. class UnitTestRecordPropertyTestHelper;
  17694. class WindowsDeathTest;
  17695. class FuchsiaDeathTest;
  17696. class UnitTestImpl* GetUnitTestImpl();
  17697. void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
  17698. const std::string& message);
  17699. } // namespace internal
  17700. // The friend relationship of some of these classes is cyclic.
  17701. // If we don't forward declare them the compiler might confuse the classes
  17702. // in friendship clauses with same named classes on the scope.
  17703. class Test;
  17704. class TestCase;
  17705. class TestInfo;
  17706. class UnitTest;
  17707. // A class for indicating whether an assertion was successful. When
  17708. // the assertion wasn't successful, the AssertionResult object
  17709. // remembers a non-empty message that describes how it failed.
  17710. //
  17711. // To create an instance of this class, use one of the factory functions
  17712. // (AssertionSuccess() and AssertionFailure()).
  17713. //
  17714. // This class is useful for two purposes:
  17715. // 1. Defining predicate functions to be used with Boolean test assertions
  17716. // EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
  17717. // 2. Defining predicate-format functions to be
  17718. // used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
  17719. //
  17720. // For example, if you define IsEven predicate:
  17721. //
  17722. // testing::AssertionResult IsEven(int n) {
  17723. // if ((n % 2) == 0)
  17724. // return testing::AssertionSuccess();
  17725. // else
  17726. // return testing::AssertionFailure() << n << " is odd";
  17727. // }
  17728. //
  17729. // Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
  17730. // will print the message
  17731. //
  17732. // Value of: IsEven(Fib(5))
  17733. // Actual: false (5 is odd)
  17734. // Expected: true
  17735. //
  17736. // instead of a more opaque
  17737. //
  17738. // Value of: IsEven(Fib(5))
  17739. // Actual: false
  17740. // Expected: true
  17741. //
  17742. // in case IsEven is a simple Boolean predicate.
  17743. //
  17744. // If you expect your predicate to be reused and want to support informative
  17745. // messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
  17746. // about half as often as positive ones in our tests), supply messages for
  17747. // both success and failure cases:
  17748. //
  17749. // testing::AssertionResult IsEven(int n) {
  17750. // if ((n % 2) == 0)
  17751. // return testing::AssertionSuccess() << n << " is even";
  17752. // else
  17753. // return testing::AssertionFailure() << n << " is odd";
  17754. // }
  17755. //
  17756. // Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
  17757. //
  17758. // Value of: IsEven(Fib(6))
  17759. // Actual: true (8 is even)
  17760. // Expected: false
  17761. //
  17762. // NB: Predicates that support negative Boolean assertions have reduced
  17763. // performance in positive ones so be careful not to use them in tests
  17764. // that have lots (tens of thousands) of positive Boolean assertions.
  17765. //
  17766. // To use this class with EXPECT_PRED_FORMAT assertions such as:
  17767. //
  17768. // // Verifies that Foo() returns an even number.
  17769. // EXPECT_PRED_FORMAT1(IsEven, Foo());
  17770. //
  17771. // you need to define:
  17772. //
  17773. // testing::AssertionResult IsEven(const char* expr, int n) {
  17774. // if ((n % 2) == 0)
  17775. // return testing::AssertionSuccess();
  17776. // else
  17777. // return testing::AssertionFailure()
  17778. // << "Expected: " << expr << " is even\n Actual: it's " << n;
  17779. // }
  17780. //
  17781. // If Foo() returns 5, you will see the following message:
  17782. //
  17783. // Expected: Foo() is even
  17784. // Actual: it's 5
  17785. //
  17786. class GTEST_API_ AssertionResult {
  17787. public:
  17788. // Copy constructor.
  17789. // Used in EXPECT_TRUE/FALSE(assertion_result).
  17790. AssertionResult(const AssertionResult& other);
  17791. #if defined(_MSC_VER) && _MSC_VER < 1910
  17792. GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 /* forcing value to bool */)
  17793. #endif
  17794. // Used in the EXPECT_TRUE/FALSE(bool_expression).
  17795. //
  17796. // T must be contextually convertible to bool.
  17797. //
  17798. // The second parameter prevents this overload from being considered if
  17799. // the argument is implicitly convertible to AssertionResult. In that case
  17800. // we want AssertionResult's copy constructor to be used.
  17801. template <typename T>
  17802. explicit AssertionResult(
  17803. const T& success,
  17804. typename internal::EnableIf<
  17805. !internal::ImplicitlyConvertible<T, AssertionResult>::value>::type*
  17806. /*enabler*/ = NULL)
  17807. : success_(success) {}
  17808. #if defined(_MSC_VER) && _MSC_VER < 1910
  17809. GTEST_DISABLE_MSC_WARNINGS_POP_()
  17810. #endif
  17811. // Assignment operator.
  17812. AssertionResult& operator=(AssertionResult other) {
  17813. swap(other);
  17814. return *this;
  17815. }
  17816. // Returns true iff the assertion succeeded.
  17817. operator bool() const { return success_; } // NOLINT
  17818. // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
  17819. AssertionResult operator!() const;
  17820. // Returns the text streamed into this AssertionResult. Test assertions
  17821. // use it when they fail (i.e., the predicate's outcome doesn't match the
  17822. // assertion's expectation). When nothing has been streamed into the
  17823. // object, returns an empty string.
  17824. const char* message() const {
  17825. return message_.get() != NULL ? message_->c_str() : "";
  17826. }
  17827. // FIXME: Remove this after making sure no clients use it.
  17828. // Deprecated; please use message() instead.
  17829. const char* failure_message() const { return message(); }
  17830. // Streams a custom failure message into this object.
  17831. template <typename T> AssertionResult& operator<<(const T& value) {
  17832. AppendMessage(Message() << value);
  17833. return *this;
  17834. }
  17835. // Allows streaming basic output manipulators such as endl or flush into
  17836. // this object.
  17837. AssertionResult& operator<<(
  17838. ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
  17839. AppendMessage(Message() << basic_manipulator);
  17840. return *this;
  17841. }
  17842. private:
  17843. // Appends the contents of message to message_.
  17844. void AppendMessage(const Message& a_message) {
  17845. if (message_.get() == NULL)
  17846. message_.reset(new ::std::string);
  17847. message_->append(a_message.GetString().c_str());
  17848. }
  17849. // Swap the contents of this AssertionResult with other.
  17850. void swap(AssertionResult& other);
  17851. // Stores result of the assertion predicate.
  17852. bool success_;
  17853. // Stores the message describing the condition in case the expectation
  17854. // construct is not satisfied with the predicate's outcome.
  17855. // Referenced via a pointer to avoid taking too much stack frame space
  17856. // with test assertions.
  17857. internal::scoped_ptr< ::std::string> message_;
  17858. };
  17859. // Makes a successful assertion result.
  17860. GTEST_API_ AssertionResult AssertionSuccess();
  17861. // Makes a failed assertion result.
  17862. GTEST_API_ AssertionResult AssertionFailure();
  17863. // Makes a failed assertion result with the given failure message.
  17864. // Deprecated; use AssertionFailure() << msg.
  17865. GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
  17866. } // namespace testing
  17867. // Includes the auto-generated header that implements a family of generic
  17868. // predicate assertion macros. This include comes late because it relies on
  17869. // APIs declared above.
  17870. // Copyright 2006, Google Inc.
  17871. // All rights reserved.
  17872. //
  17873. // Redistribution and use in source and binary forms, with or without
  17874. // modification, are permitted provided that the following conditions are
  17875. // met:
  17876. //
  17877. // * Redistributions of source code must retain the above copyright
  17878. // notice, this list of conditions and the following disclaimer.
  17879. // * Redistributions in binary form must reproduce the above
  17880. // copyright notice, this list of conditions and the following disclaimer
  17881. // in the documentation and/or other materials provided with the
  17882. // distribution.
  17883. // * Neither the name of Google Inc. nor the names of its
  17884. // contributors may be used to endorse or promote products derived from
  17885. // this software without specific prior written permission.
  17886. //
  17887. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  17888. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  17889. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  17890. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  17891. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17892. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17893. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  17894. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  17895. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  17896. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  17897. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  17898. // This file is AUTOMATICALLY GENERATED on 01/02/2018 by command
  17899. // 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
  17900. //
  17901. // Implements a family of generic predicate assertion macros.
  17902. // GOOGLETEST_CM0001 DO NOT DELETE
  17903. #ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
  17904. #define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
  17905. namespace testing {
  17906. // This header implements a family of generic predicate assertion
  17907. // macros:
  17908. //
  17909. // ASSERT_PRED_FORMAT1(pred_format, v1)
  17910. // ASSERT_PRED_FORMAT2(pred_format, v1, v2)
  17911. // ...
  17912. //
  17913. // where pred_format is a function or functor that takes n (in the
  17914. // case of ASSERT_PRED_FORMATn) values and their source expression
  17915. // text, and returns a testing::AssertionResult. See the definition
  17916. // of ASSERT_EQ in gtest.h for an example.
  17917. //
  17918. // If you don't care about formatting, you can use the more
  17919. // restrictive version:
  17920. //
  17921. // ASSERT_PRED1(pred, v1)
  17922. // ASSERT_PRED2(pred, v1, v2)
  17923. // ...
  17924. //
  17925. // where pred is an n-ary function or functor that returns bool,
  17926. // and the values v1, v2, ..., must support the << operator for
  17927. // streaming to std::ostream.
  17928. //
  17929. // We also define the EXPECT_* variations.
  17930. //
  17931. // For now we only support predicates whose arity is at most 5.
  17932. // GTEST_ASSERT_ is the basic statement to which all of the assertions
  17933. // in this file reduce. Don't use this in your code.
  17934. #define GTEST_ASSERT_(expression, on_failure) \
  17935. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  17936. if (const ::testing::AssertionResult gtest_ar = (expression)) \
  17937. ; \
  17938. else \
  17939. on_failure(gtest_ar.failure_message())
  17940. // Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use
  17941. // this in your code.
  17942. template <typename Pred,
  17943. typename T1>
  17944. AssertionResult AssertPred1Helper(const char* pred_text,
  17945. const char* e1,
  17946. Pred pred,
  17947. const T1& v1) {
  17948. if (pred(v1)) return AssertionSuccess();
  17949. return AssertionFailure() << pred_text << "("
  17950. << e1 << ") evaluates to false, where"
  17951. << "\n" << e1 << " evaluates to " << v1;
  17952. }
  17953. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
  17954. // Don't use this in your code.
  17955. #define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
  17956. GTEST_ASSERT_(pred_format(#v1, v1), \
  17957. on_failure)
  17958. // Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use
  17959. // this in your code.
  17960. #define GTEST_PRED1_(pred, v1, on_failure)\
  17961. GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
  17962. #v1, \
  17963. pred, \
  17964. v1), on_failure)
  17965. // Unary predicate assertion macros.
  17966. #define EXPECT_PRED_FORMAT1(pred_format, v1) \
  17967. GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
  17968. #define EXPECT_PRED1(pred, v1) \
  17969. GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
  17970. #define ASSERT_PRED_FORMAT1(pred_format, v1) \
  17971. GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
  17972. #define ASSERT_PRED1(pred, v1) \
  17973. GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
  17974. // Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use
  17975. // this in your code.
  17976. template <typename Pred,
  17977. typename T1,
  17978. typename T2>
  17979. AssertionResult AssertPred2Helper(const char* pred_text,
  17980. const char* e1,
  17981. const char* e2,
  17982. Pred pred,
  17983. const T1& v1,
  17984. const T2& v2) {
  17985. if (pred(v1, v2)) return AssertionSuccess();
  17986. return AssertionFailure() << pred_text << "("
  17987. << e1 << ", "
  17988. << e2 << ") evaluates to false, where"
  17989. << "\n" << e1 << " evaluates to " << v1
  17990. << "\n" << e2 << " evaluates to " << v2;
  17991. }
  17992. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
  17993. // Don't use this in your code.
  17994. #define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
  17995. GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \
  17996. on_failure)
  17997. // Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use
  17998. // this in your code.
  17999. #define GTEST_PRED2_(pred, v1, v2, on_failure)\
  18000. GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
  18001. #v1, \
  18002. #v2, \
  18003. pred, \
  18004. v1, \
  18005. v2), on_failure)
  18006. // Binary predicate assertion macros.
  18007. #define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
  18008. GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
  18009. #define EXPECT_PRED2(pred, v1, v2) \
  18010. GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
  18011. #define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
  18012. GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
  18013. #define ASSERT_PRED2(pred, v1, v2) \
  18014. GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
  18015. // Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use
  18016. // this in your code.
  18017. template <typename Pred,
  18018. typename T1,
  18019. typename T2,
  18020. typename T3>
  18021. AssertionResult AssertPred3Helper(const char* pred_text,
  18022. const char* e1,
  18023. const char* e2,
  18024. const char* e3,
  18025. Pred pred,
  18026. const T1& v1,
  18027. const T2& v2,
  18028. const T3& v3) {
  18029. if (pred(v1, v2, v3)) return AssertionSuccess();
  18030. return AssertionFailure() << pred_text << "("
  18031. << e1 << ", "
  18032. << e2 << ", "
  18033. << e3 << ") evaluates to false, where"
  18034. << "\n" << e1 << " evaluates to " << v1
  18035. << "\n" << e2 << " evaluates to " << v2
  18036. << "\n" << e3 << " evaluates to " << v3;
  18037. }
  18038. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
  18039. // Don't use this in your code.
  18040. #define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
  18041. GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \
  18042. on_failure)
  18043. // Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use
  18044. // this in your code.
  18045. #define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
  18046. GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
  18047. #v1, \
  18048. #v2, \
  18049. #v3, \
  18050. pred, \
  18051. v1, \
  18052. v2, \
  18053. v3), on_failure)
  18054. // Ternary predicate assertion macros.
  18055. #define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
  18056. GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
  18057. #define EXPECT_PRED3(pred, v1, v2, v3) \
  18058. GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
  18059. #define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
  18060. GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
  18061. #define ASSERT_PRED3(pred, v1, v2, v3) \
  18062. GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
  18063. // Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use
  18064. // this in your code.
  18065. template <typename Pred,
  18066. typename T1,
  18067. typename T2,
  18068. typename T3,
  18069. typename T4>
  18070. AssertionResult AssertPred4Helper(const char* pred_text,
  18071. const char* e1,
  18072. const char* e2,
  18073. const char* e3,
  18074. const char* e4,
  18075. Pred pred,
  18076. const T1& v1,
  18077. const T2& v2,
  18078. const T3& v3,
  18079. const T4& v4) {
  18080. if (pred(v1, v2, v3, v4)) return AssertionSuccess();
  18081. return AssertionFailure() << pred_text << "("
  18082. << e1 << ", "
  18083. << e2 << ", "
  18084. << e3 << ", "
  18085. << e4 << ") evaluates to false, where"
  18086. << "\n" << e1 << " evaluates to " << v1
  18087. << "\n" << e2 << " evaluates to " << v2
  18088. << "\n" << e3 << " evaluates to " << v3
  18089. << "\n" << e4 << " evaluates to " << v4;
  18090. }
  18091. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
  18092. // Don't use this in your code.
  18093. #define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
  18094. GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \
  18095. on_failure)
  18096. // Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use
  18097. // this in your code.
  18098. #define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
  18099. GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
  18100. #v1, \
  18101. #v2, \
  18102. #v3, \
  18103. #v4, \
  18104. pred, \
  18105. v1, \
  18106. v2, \
  18107. v3, \
  18108. v4), on_failure)
  18109. // 4-ary predicate assertion macros.
  18110. #define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
  18111. GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
  18112. #define EXPECT_PRED4(pred, v1, v2, v3, v4) \
  18113. GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
  18114. #define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
  18115. GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
  18116. #define ASSERT_PRED4(pred, v1, v2, v3, v4) \
  18117. GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
  18118. // Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use
  18119. // this in your code.
  18120. template <typename Pred,
  18121. typename T1,
  18122. typename T2,
  18123. typename T3,
  18124. typename T4,
  18125. typename T5>
  18126. AssertionResult AssertPred5Helper(const char* pred_text,
  18127. const char* e1,
  18128. const char* e2,
  18129. const char* e3,
  18130. const char* e4,
  18131. const char* e5,
  18132. Pred pred,
  18133. const T1& v1,
  18134. const T2& v2,
  18135. const T3& v3,
  18136. const T4& v4,
  18137. const T5& v5) {
  18138. if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
  18139. return AssertionFailure() << pred_text << "("
  18140. << e1 << ", "
  18141. << e2 << ", "
  18142. << e3 << ", "
  18143. << e4 << ", "
  18144. << e5 << ") evaluates to false, where"
  18145. << "\n" << e1 << " evaluates to " << v1
  18146. << "\n" << e2 << " evaluates to " << v2
  18147. << "\n" << e3 << " evaluates to " << v3
  18148. << "\n" << e4 << " evaluates to " << v4
  18149. << "\n" << e5 << " evaluates to " << v5;
  18150. }
  18151. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
  18152. // Don't use this in your code.
  18153. #define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
  18154. GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \
  18155. on_failure)
  18156. // Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use
  18157. // this in your code.
  18158. #define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
  18159. GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
  18160. #v1, \
  18161. #v2, \
  18162. #v3, \
  18163. #v4, \
  18164. #v5, \
  18165. pred, \
  18166. v1, \
  18167. v2, \
  18168. v3, \
  18169. v4, \
  18170. v5), on_failure)
  18171. // 5-ary predicate assertion macros.
  18172. #define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
  18173. GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
  18174. #define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
  18175. GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
  18176. #define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
  18177. GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
  18178. #define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
  18179. GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
  18180. } // namespace testing
  18181. #endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
  18182. namespace testing {
  18183. // The abstract class that all tests inherit from.
  18184. //
  18185. // In Google Test, a unit test program contains one or many TestCases, and
  18186. // each TestCase contains one or many Tests.
  18187. //
  18188. // When you define a test using the TEST macro, you don't need to
  18189. // explicitly derive from Test - the TEST macro automatically does
  18190. // this for you.
  18191. //
  18192. // The only time you derive from Test is when defining a test fixture
  18193. // to be used in a TEST_F. For example:
  18194. //
  18195. // class FooTest : public testing::Test {
  18196. // protected:
  18197. // void SetUp() override { ... }
  18198. // void TearDown() override { ... }
  18199. // ...
  18200. // };
  18201. //
  18202. // TEST_F(FooTest, Bar) { ... }
  18203. // TEST_F(FooTest, Baz) { ... }
  18204. //
  18205. // Test is not copyable.
  18206. class GTEST_API_ Test {
  18207. public:
  18208. friend class TestInfo;
  18209. // Defines types for pointers to functions that set up and tear down
  18210. // a test case.
  18211. typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
  18212. typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
  18213. // The d'tor is virtual as we intend to inherit from Test.
  18214. virtual ~Test();
  18215. // Sets up the stuff shared by all tests in this test case.
  18216. //
  18217. // Google Test will call Foo::SetUpTestCase() before running the first
  18218. // test in test case Foo. Hence a sub-class can define its own
  18219. // SetUpTestCase() method to shadow the one defined in the super
  18220. // class.
  18221. static void SetUpTestCase() {}
  18222. // Tears down the stuff shared by all tests in this test case.
  18223. //
  18224. // Google Test will call Foo::TearDownTestCase() after running the last
  18225. // test in test case Foo. Hence a sub-class can define its own
  18226. // TearDownTestCase() method to shadow the one defined in the super
  18227. // class.
  18228. static void TearDownTestCase() {}
  18229. // Returns true iff the current test has a fatal failure.
  18230. static bool HasFatalFailure();
  18231. // Returns true iff the current test has a non-fatal failure.
  18232. static bool HasNonfatalFailure();
  18233. // Returns true iff the current test has a (either fatal or
  18234. // non-fatal) failure.
  18235. static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
  18236. // Logs a property for the current test, test case, or for the entire
  18237. // invocation of the test program when used outside of the context of a
  18238. // test case. Only the last value for a given key is remembered. These
  18239. // are public static so they can be called from utility functions that are
  18240. // not members of the test fixture. Calls to RecordProperty made during
  18241. // lifespan of the test (from the moment its constructor starts to the
  18242. // moment its destructor finishes) will be output in XML as attributes of
  18243. // the <testcase> element. Properties recorded from fixture's
  18244. // SetUpTestCase or TearDownTestCase are logged as attributes of the
  18245. // corresponding <testsuite> element. Calls to RecordProperty made in the
  18246. // global context (before or after invocation of RUN_ALL_TESTS and from
  18247. // SetUp/TearDown method of Environment objects registered with Google
  18248. // Test) will be output as attributes of the <testsuites> element.
  18249. static void RecordProperty(const std::string& key, const std::string& value);
  18250. static void RecordProperty(const std::string& key, int value);
  18251. protected:
  18252. // Creates a Test object.
  18253. Test();
  18254. // Sets up the test fixture.
  18255. virtual void SetUp();
  18256. // Tears down the test fixture.
  18257. virtual void TearDown();
  18258. private:
  18259. // Returns true iff the current test has the same fixture class as
  18260. // the first test in the current test case.
  18261. static bool HasSameFixtureClass();
  18262. // Runs the test after the test fixture has been set up.
  18263. //
  18264. // A sub-class must implement this to define the test logic.
  18265. //
  18266. // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
  18267. // Instead, use the TEST or TEST_F macro.
  18268. virtual void TestBody() = 0;
  18269. // Sets up, executes, and tears down the test.
  18270. void Run();
  18271. // Deletes self. We deliberately pick an unusual name for this
  18272. // internal method to avoid clashing with names used in user TESTs.
  18273. void DeleteSelf_() { delete this; }
  18274. const internal::scoped_ptr< GTEST_FLAG_SAVER_ > gtest_flag_saver_;
  18275. // Often a user misspells SetUp() as Setup() and spends a long time
  18276. // wondering why it is never called by Google Test. The declaration of
  18277. // the following method is solely for catching such an error at
  18278. // compile time:
  18279. //
  18280. // - The return type is deliberately chosen to be not void, so it
  18281. // will be a conflict if void Setup() is declared in the user's
  18282. // test fixture.
  18283. //
  18284. // - This method is private, so it will be another compiler error
  18285. // if the method is called from the user's test fixture.
  18286. //
  18287. // DO NOT OVERRIDE THIS FUNCTION.
  18288. //
  18289. // If you see an error about overriding the following function or
  18290. // about it being private, you have mis-spelled SetUp() as Setup().
  18291. struct Setup_should_be_spelled_SetUp {};
  18292. virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
  18293. // We disallow copying Tests.
  18294. GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
  18295. };
  18296. typedef internal::TimeInMillis TimeInMillis;
  18297. // A copyable object representing a user specified test property which can be
  18298. // output as a key/value string pair.
  18299. //
  18300. // Don't inherit from TestProperty as its destructor is not virtual.
  18301. class TestProperty {
  18302. public:
  18303. // C'tor. TestProperty does NOT have a default constructor.
  18304. // Always use this constructor (with parameters) to create a
  18305. // TestProperty object.
  18306. TestProperty(const std::string& a_key, const std::string& a_value) :
  18307. key_(a_key), value_(a_value) {
  18308. }
  18309. // Gets the user supplied key.
  18310. const char* key() const {
  18311. return key_.c_str();
  18312. }
  18313. // Gets the user supplied value.
  18314. const char* value() const {
  18315. return value_.c_str();
  18316. }
  18317. // Sets a new value, overriding the one supplied in the constructor.
  18318. void SetValue(const std::string& new_value) {
  18319. value_ = new_value;
  18320. }
  18321. private:
  18322. // The key supplied by the user.
  18323. std::string key_;
  18324. // The value supplied by the user.
  18325. std::string value_;
  18326. };
  18327. // The result of a single Test. This includes a list of
  18328. // TestPartResults, a list of TestProperties, a count of how many
  18329. // death tests there are in the Test, and how much time it took to run
  18330. // the Test.
  18331. //
  18332. // TestResult is not copyable.
  18333. class GTEST_API_ TestResult {
  18334. public:
  18335. // Creates an empty TestResult.
  18336. TestResult();
  18337. // D'tor. Do not inherit from TestResult.
  18338. ~TestResult();
  18339. // Gets the number of all test parts. This is the sum of the number
  18340. // of successful test parts and the number of failed test parts.
  18341. int total_part_count() const;
  18342. // Returns the number of the test properties.
  18343. int test_property_count() const;
  18344. // Returns true iff the test passed (i.e. no test part failed).
  18345. bool Passed() const { return !Failed(); }
  18346. // Returns true iff the test failed.
  18347. bool Failed() const;
  18348. // Returns true iff the test fatally failed.
  18349. bool HasFatalFailure() const;
  18350. // Returns true iff the test has a non-fatal failure.
  18351. bool HasNonfatalFailure() const;
  18352. // Returns the elapsed time, in milliseconds.
  18353. TimeInMillis elapsed_time() const { return elapsed_time_; }
  18354. // Returns the i-th test part result among all the results. i can range from 0
  18355. // to total_part_count() - 1. If i is not in that range, aborts the program.
  18356. const TestPartResult& GetTestPartResult(int i) const;
  18357. // Returns the i-th test property. i can range from 0 to
  18358. // test_property_count() - 1. If i is not in that range, aborts the
  18359. // program.
  18360. const TestProperty& GetTestProperty(int i) const;
  18361. private:
  18362. friend class TestInfo;
  18363. friend class TestCase;
  18364. friend class UnitTest;
  18365. friend class internal::DefaultGlobalTestPartResultReporter;
  18366. friend class internal::ExecDeathTest;
  18367. friend class internal::TestResultAccessor;
  18368. friend class internal::UnitTestImpl;
  18369. friend class internal::WindowsDeathTest;
  18370. friend class internal::FuchsiaDeathTest;
  18371. // Gets the vector of TestPartResults.
  18372. const std::vector<TestPartResult>& test_part_results() const {
  18373. return test_part_results_;
  18374. }
  18375. // Gets the vector of TestProperties.
  18376. const std::vector<TestProperty>& test_properties() const {
  18377. return test_properties_;
  18378. }
  18379. // Sets the elapsed time.
  18380. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
  18381. // Adds a test property to the list. The property is validated and may add
  18382. // a non-fatal failure if invalid (e.g., if it conflicts with reserved
  18383. // key names). If a property is already recorded for the same key, the
  18384. // value will be updated, rather than storing multiple values for the same
  18385. // key. xml_element specifies the element for which the property is being
  18386. // recorded and is used for validation.
  18387. void RecordProperty(const std::string& xml_element,
  18388. const TestProperty& test_property);
  18389. // Adds a failure if the key is a reserved attribute of Google Test
  18390. // testcase tags. Returns true if the property is valid.
  18391. // FIXME: Validate attribute names are legal and human readable.
  18392. static bool ValidateTestProperty(const std::string& xml_element,
  18393. const TestProperty& test_property);
  18394. // Adds a test part result to the list.
  18395. void AddTestPartResult(const TestPartResult& test_part_result);
  18396. // Returns the death test count.
  18397. int death_test_count() const { return death_test_count_; }
  18398. // Increments the death test count, returning the new count.
  18399. int increment_death_test_count() { return ++death_test_count_; }
  18400. // Clears the test part results.
  18401. void ClearTestPartResults();
  18402. // Clears the object.
  18403. void Clear();
  18404. // Protects mutable state of the property vector and of owned
  18405. // properties, whose values may be updated.
  18406. internal::Mutex test_properites_mutex_;
  18407. // The vector of TestPartResults
  18408. std::vector<TestPartResult> test_part_results_;
  18409. // The vector of TestProperties
  18410. std::vector<TestProperty> test_properties_;
  18411. // Running count of death tests.
  18412. int death_test_count_;
  18413. // The elapsed time, in milliseconds.
  18414. TimeInMillis elapsed_time_;
  18415. // We disallow copying TestResult.
  18416. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
  18417. }; // class TestResult
  18418. // A TestInfo object stores the following information about a test:
  18419. //
  18420. // Test case name
  18421. // Test name
  18422. // Whether the test should be run
  18423. // A function pointer that creates the test object when invoked
  18424. // Test result
  18425. //
  18426. // The constructor of TestInfo registers itself with the UnitTest
  18427. // singleton such that the RUN_ALL_TESTS() macro knows which tests to
  18428. // run.
  18429. class GTEST_API_ TestInfo {
  18430. public:
  18431. // Destructs a TestInfo object. This function is not virtual, so
  18432. // don't inherit from TestInfo.
  18433. ~TestInfo();
  18434. // Returns the test case name.
  18435. const char* test_case_name() const { return test_case_name_.c_str(); }
  18436. // Returns the test name.
  18437. const char* name() const { return name_.c_str(); }
  18438. // Returns the name of the parameter type, or NULL if this is not a typed
  18439. // or a type-parameterized test.
  18440. const char* type_param() const {
  18441. if (type_param_.get() != NULL)
  18442. return type_param_->c_str();
  18443. return NULL;
  18444. }
  18445. // Returns the text representation of the value parameter, or NULL if this
  18446. // is not a value-parameterized test.
  18447. const char* value_param() const {
  18448. if (value_param_.get() != NULL)
  18449. return value_param_->c_str();
  18450. return NULL;
  18451. }
  18452. // Returns the file name where this test is defined.
  18453. const char* file() const { return location_.file.c_str(); }
  18454. // Returns the line where this test is defined.
  18455. int line() const { return location_.line; }
  18456. // Return true if this test should not be run because it's in another shard.
  18457. bool is_in_another_shard() const { return is_in_another_shard_; }
  18458. // Returns true if this test should run, that is if the test is not
  18459. // disabled (or it is disabled but the also_run_disabled_tests flag has
  18460. // been specified) and its full name matches the user-specified filter.
  18461. //
  18462. // Google Test allows the user to filter the tests by their full names.
  18463. // The full name of a test Bar in test case Foo is defined as
  18464. // "Foo.Bar". Only the tests that match the filter will run.
  18465. //
  18466. // A filter is a colon-separated list of glob (not regex) patterns,
  18467. // optionally followed by a '-' and a colon-separated list of
  18468. // negative patterns (tests to exclude). A test is run if it
  18469. // matches one of the positive patterns and does not match any of
  18470. // the negative patterns.
  18471. //
  18472. // For example, *A*:Foo.* is a filter that matches any string that
  18473. // contains the character 'A' or starts with "Foo.".
  18474. bool should_run() const { return should_run_; }
  18475. // Returns true iff this test will appear in the XML report.
  18476. bool is_reportable() const {
  18477. // The XML report includes tests matching the filter, excluding those
  18478. // run in other shards.
  18479. return matches_filter_ && !is_in_another_shard_;
  18480. }
  18481. // Returns the result of the test.
  18482. const TestResult* result() const { return &result_; }
  18483. private:
  18484. #if GTEST_HAS_DEATH_TEST
  18485. friend class internal::DefaultDeathTestFactory;
  18486. #endif // GTEST_HAS_DEATH_TEST
  18487. friend class Test;
  18488. friend class TestCase;
  18489. friend class internal::UnitTestImpl;
  18490. friend class internal::StreamingListenerTest;
  18491. friend TestInfo* internal::MakeAndRegisterTestInfo(
  18492. const char* test_case_name,
  18493. const char* name,
  18494. const char* type_param,
  18495. const char* value_param,
  18496. internal::CodeLocation code_location,
  18497. internal::TypeId fixture_class_id,
  18498. Test::SetUpTestCaseFunc set_up_tc,
  18499. Test::TearDownTestCaseFunc tear_down_tc,
  18500. internal::TestFactoryBase* factory);
  18501. // Constructs a TestInfo object. The newly constructed instance assumes
  18502. // ownership of the factory object.
  18503. TestInfo(const std::string& test_case_name,
  18504. const std::string& name,
  18505. const char* a_type_param, // NULL if not a type-parameterized test
  18506. const char* a_value_param, // NULL if not a value-parameterized test
  18507. internal::CodeLocation a_code_location,
  18508. internal::TypeId fixture_class_id,
  18509. internal::TestFactoryBase* factory);
  18510. // Increments the number of death tests encountered in this test so
  18511. // far.
  18512. int increment_death_test_count() {
  18513. return result_.increment_death_test_count();
  18514. }
  18515. // Creates the test object, runs it, records its result, and then
  18516. // deletes it.
  18517. void Run();
  18518. static void ClearTestResult(TestInfo* test_info) {
  18519. test_info->result_.Clear();
  18520. }
  18521. // These fields are immutable properties of the test.
  18522. const std::string test_case_name_; // Test case name
  18523. const std::string name_; // Test name
  18524. // Name of the parameter type, or NULL if this is not a typed or a
  18525. // type-parameterized test.
  18526. const internal::scoped_ptr<const ::std::string> type_param_;
  18527. // Text representation of the value parameter, or NULL if this is not a
  18528. // value-parameterized test.
  18529. const internal::scoped_ptr<const ::std::string> value_param_;
  18530. internal::CodeLocation location_;
  18531. const internal::TypeId fixture_class_id_; // ID of the test fixture class
  18532. bool should_run_; // True iff this test should run
  18533. bool is_disabled_; // True iff this test is disabled
  18534. bool matches_filter_; // True if this test matches the
  18535. // user-specified filter.
  18536. bool is_in_another_shard_; // Will be run in another shard.
  18537. internal::TestFactoryBase* const factory_; // The factory that creates
  18538. // the test object
  18539. // This field is mutable and needs to be reset before running the
  18540. // test for the second time.
  18541. TestResult result_;
  18542. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
  18543. };
  18544. // A test case, which consists of a vector of TestInfos.
  18545. //
  18546. // TestCase is not copyable.
  18547. class GTEST_API_ TestCase {
  18548. public:
  18549. // Creates a TestCase with the given name.
  18550. //
  18551. // TestCase does NOT have a default constructor. Always use this
  18552. // constructor to create a TestCase object.
  18553. //
  18554. // Arguments:
  18555. //
  18556. // name: name of the test case
  18557. // a_type_param: the name of the test's type parameter, or NULL if
  18558. // this is not a type-parameterized test.
  18559. // set_up_tc: pointer to the function that sets up the test case
  18560. // tear_down_tc: pointer to the function that tears down the test case
  18561. TestCase(const char* name, const char* a_type_param,
  18562. Test::SetUpTestCaseFunc set_up_tc,
  18563. Test::TearDownTestCaseFunc tear_down_tc);
  18564. // Destructor of TestCase.
  18565. virtual ~TestCase();
  18566. // Gets the name of the TestCase.
  18567. const char* name() const { return name_.c_str(); }
  18568. // Returns the name of the parameter type, or NULL if this is not a
  18569. // type-parameterized test case.
  18570. const char* type_param() const {
  18571. if (type_param_.get() != NULL)
  18572. return type_param_->c_str();
  18573. return NULL;
  18574. }
  18575. // Returns true if any test in this test case should run.
  18576. bool should_run() const { return should_run_; }
  18577. // Gets the number of successful tests in this test case.
  18578. int successful_test_count() const;
  18579. // Gets the number of failed tests in this test case.
  18580. int failed_test_count() const;
  18581. // Gets the number of disabled tests that will be reported in the XML report.
  18582. int reportable_disabled_test_count() const;
  18583. // Gets the number of disabled tests in this test case.
  18584. int disabled_test_count() const;
  18585. // Gets the number of tests to be printed in the XML report.
  18586. int reportable_test_count() const;
  18587. // Get the number of tests in this test case that should run.
  18588. int test_to_run_count() const;
  18589. // Gets the number of all tests in this test case.
  18590. int total_test_count() const;
  18591. // Returns true iff the test case passed.
  18592. bool Passed() const { return !Failed(); }
  18593. // Returns true iff the test case failed.
  18594. bool Failed() const { return failed_test_count() > 0; }
  18595. // Returns the elapsed time, in milliseconds.
  18596. TimeInMillis elapsed_time() const { return elapsed_time_; }
  18597. // Returns the i-th test among all the tests. i can range from 0 to
  18598. // total_test_count() - 1. If i is not in that range, returns NULL.
  18599. const TestInfo* GetTestInfo(int i) const;
  18600. // Returns the TestResult that holds test properties recorded during
  18601. // execution of SetUpTestCase and TearDownTestCase.
  18602. const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; }
  18603. private:
  18604. friend class Test;
  18605. friend class internal::UnitTestImpl;
  18606. // Gets the (mutable) vector of TestInfos in this TestCase.
  18607. std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
  18608. // Gets the (immutable) vector of TestInfos in this TestCase.
  18609. const std::vector<TestInfo*>& test_info_list() const {
  18610. return test_info_list_;
  18611. }
  18612. // Returns the i-th test among all the tests. i can range from 0 to
  18613. // total_test_count() - 1. If i is not in that range, returns NULL.
  18614. TestInfo* GetMutableTestInfo(int i);
  18615. // Sets the should_run member.
  18616. void set_should_run(bool should) { should_run_ = should; }
  18617. // Adds a TestInfo to this test case. Will delete the TestInfo upon
  18618. // destruction of the TestCase object.
  18619. void AddTestInfo(TestInfo * test_info);
  18620. // Clears the results of all tests in this test case.
  18621. void ClearResult();
  18622. // Clears the results of all tests in the given test case.
  18623. static void ClearTestCaseResult(TestCase* test_case) {
  18624. test_case->ClearResult();
  18625. }
  18626. // Runs every test in this TestCase.
  18627. void Run();
  18628. // Runs SetUpTestCase() for this TestCase. This wrapper is needed
  18629. // for catching exceptions thrown from SetUpTestCase().
  18630. void RunSetUpTestCase() { (*set_up_tc_)(); }
  18631. // Runs TearDownTestCase() for this TestCase. This wrapper is
  18632. // needed for catching exceptions thrown from TearDownTestCase().
  18633. void RunTearDownTestCase() { (*tear_down_tc_)(); }
  18634. // Returns true iff test passed.
  18635. static bool TestPassed(const TestInfo* test_info) {
  18636. return test_info->should_run() && test_info->result()->Passed();
  18637. }
  18638. // Returns true iff test failed.
  18639. static bool TestFailed(const TestInfo* test_info) {
  18640. return test_info->should_run() && test_info->result()->Failed();
  18641. }
  18642. // Returns true iff the test is disabled and will be reported in the XML
  18643. // report.
  18644. static bool TestReportableDisabled(const TestInfo* test_info) {
  18645. return test_info->is_reportable() && test_info->is_disabled_;
  18646. }
  18647. // Returns true iff test is disabled.
  18648. static bool TestDisabled(const TestInfo* test_info) {
  18649. return test_info->is_disabled_;
  18650. }
  18651. // Returns true iff this test will appear in the XML report.
  18652. static bool TestReportable(const TestInfo* test_info) {
  18653. return test_info->is_reportable();
  18654. }
  18655. // Returns true if the given test should run.
  18656. static bool ShouldRunTest(const TestInfo* test_info) {
  18657. return test_info->should_run();
  18658. }
  18659. // Shuffles the tests in this test case.
  18660. void ShuffleTests(internal::Random* random);
  18661. // Restores the test order to before the first shuffle.
  18662. void UnshuffleTests();
  18663. // Name of the test case.
  18664. std::string name_;
  18665. // Name of the parameter type, or NULL if this is not a typed or a
  18666. // type-parameterized test.
  18667. const internal::scoped_ptr<const ::std::string> type_param_;
  18668. // The vector of TestInfos in their original order. It owns the
  18669. // elements in the vector.
  18670. std::vector<TestInfo*> test_info_list_;
  18671. // Provides a level of indirection for the test list to allow easy
  18672. // shuffling and restoring the test order. The i-th element in this
  18673. // vector is the index of the i-th test in the shuffled test list.
  18674. std::vector<int> test_indices_;
  18675. // Pointer to the function that sets up the test case.
  18676. Test::SetUpTestCaseFunc set_up_tc_;
  18677. // Pointer to the function that tears down the test case.
  18678. Test::TearDownTestCaseFunc tear_down_tc_;
  18679. // True iff any test in this test case should run.
  18680. bool should_run_;
  18681. // Elapsed time, in milliseconds.
  18682. TimeInMillis elapsed_time_;
  18683. // Holds test properties recorded during execution of SetUpTestCase and
  18684. // TearDownTestCase.
  18685. TestResult ad_hoc_test_result_;
  18686. // We disallow copying TestCases.
  18687. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
  18688. };
  18689. // An Environment object is capable of setting up and tearing down an
  18690. // environment. You should subclass this to define your own
  18691. // environment(s).
  18692. //
  18693. // An Environment object does the set-up and tear-down in virtual
  18694. // methods SetUp() and TearDown() instead of the constructor and the
  18695. // destructor, as:
  18696. //
  18697. // 1. You cannot safely throw from a destructor. This is a problem
  18698. // as in some cases Google Test is used where exceptions are enabled, and
  18699. // we may want to implement ASSERT_* using exceptions where they are
  18700. // available.
  18701. // 2. You cannot use ASSERT_* directly in a constructor or
  18702. // destructor.
  18703. class Environment {
  18704. public:
  18705. // The d'tor is virtual as we need to subclass Environment.
  18706. virtual ~Environment() {}
  18707. // Override this to define how to set up the environment.
  18708. virtual void SetUp() {}
  18709. // Override this to define how to tear down the environment.
  18710. virtual void TearDown() {}
  18711. private:
  18712. // If you see an error about overriding the following function or
  18713. // about it being private, you have mis-spelled SetUp() as Setup().
  18714. struct Setup_should_be_spelled_SetUp {};
  18715. virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
  18716. };
  18717. #if GTEST_HAS_EXCEPTIONS
  18718. // Exception which can be thrown from TestEventListener::OnTestPartResult.
  18719. class GTEST_API_ AssertionException
  18720. : public internal::GoogleTestFailureException {
  18721. public:
  18722. explicit AssertionException(const TestPartResult& result)
  18723. : GoogleTestFailureException(result) {}
  18724. };
  18725. #endif // GTEST_HAS_EXCEPTIONS
  18726. // The interface for tracing execution of tests. The methods are organized in
  18727. // the order the corresponding events are fired.
  18728. class TestEventListener {
  18729. public:
  18730. virtual ~TestEventListener() {}
  18731. // Fired before any test activity starts.
  18732. virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
  18733. // Fired before each iteration of tests starts. There may be more than
  18734. // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
  18735. // index, starting from 0.
  18736. virtual void OnTestIterationStart(const UnitTest& unit_test,
  18737. int iteration) = 0;
  18738. // Fired before environment set-up for each iteration of tests starts.
  18739. virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
  18740. // Fired after environment set-up for each iteration of tests ends.
  18741. virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
  18742. // Fired before the test case starts.
  18743. virtual void OnTestCaseStart(const TestCase& test_case) = 0;
  18744. // Fired before the test starts.
  18745. virtual void OnTestStart(const TestInfo& test_info) = 0;
  18746. // Fired after a failed assertion or a SUCCEED() invocation.
  18747. // If you want to throw an exception from this function to skip to the next
  18748. // TEST, it must be AssertionException defined above, or inherited from it.
  18749. virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
  18750. // Fired after the test ends.
  18751. virtual void OnTestEnd(const TestInfo& test_info) = 0;
  18752. // Fired after the test case ends.
  18753. virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
  18754. // Fired before environment tear-down for each iteration of tests starts.
  18755. virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
  18756. // Fired after environment tear-down for each iteration of tests ends.
  18757. virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
  18758. // Fired after each iteration of tests finishes.
  18759. virtual void OnTestIterationEnd(const UnitTest& unit_test,
  18760. int iteration) = 0;
  18761. // Fired after all test activities have ended.
  18762. virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
  18763. };
  18764. // The convenience class for users who need to override just one or two
  18765. // methods and are not concerned that a possible change to a signature of
  18766. // the methods they override will not be caught during the build. For
  18767. // comments about each method please see the definition of TestEventListener
  18768. // above.
  18769. class EmptyTestEventListener : public TestEventListener {
  18770. public:
  18771. virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
  18772. virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
  18773. int /*iteration*/) {}
  18774. virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
  18775. virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
  18776. virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
  18777. virtual void OnTestStart(const TestInfo& /*test_info*/) {}
  18778. virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
  18779. virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
  18780. virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
  18781. virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
  18782. virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
  18783. virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
  18784. int /*iteration*/) {}
  18785. virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
  18786. };
  18787. // TestEventListeners lets users add listeners to track events in Google Test.
  18788. class GTEST_API_ TestEventListeners {
  18789. public:
  18790. TestEventListeners();
  18791. ~TestEventListeners();
  18792. // Appends an event listener to the end of the list. Google Test assumes
  18793. // the ownership of the listener (i.e. it will delete the listener when
  18794. // the test program finishes).
  18795. void Append(TestEventListener* listener);
  18796. // Removes the given event listener from the list and returns it. It then
  18797. // becomes the caller's responsibility to delete the listener. Returns
  18798. // NULL if the listener is not found in the list.
  18799. TestEventListener* Release(TestEventListener* listener);
  18800. // Returns the standard listener responsible for the default console
  18801. // output. Can be removed from the listeners list to shut down default
  18802. // console output. Note that removing this object from the listener list
  18803. // with Release transfers its ownership to the caller and makes this
  18804. // function return NULL the next time.
  18805. TestEventListener* default_result_printer() const {
  18806. return default_result_printer_;
  18807. }
  18808. // Returns the standard listener responsible for the default XML output
  18809. // controlled by the --gtest_output=xml flag. Can be removed from the
  18810. // listeners list by users who want to shut down the default XML output
  18811. // controlled by this flag and substitute it with custom one. Note that
  18812. // removing this object from the listener list with Release transfers its
  18813. // ownership to the caller and makes this function return NULL the next
  18814. // time.
  18815. TestEventListener* default_xml_generator() const {
  18816. return default_xml_generator_;
  18817. }
  18818. private:
  18819. friend class TestCase;
  18820. friend class TestInfo;
  18821. friend class internal::DefaultGlobalTestPartResultReporter;
  18822. friend class internal::NoExecDeathTest;
  18823. friend class internal::TestEventListenersAccessor;
  18824. friend class internal::UnitTestImpl;
  18825. // Returns repeater that broadcasts the TestEventListener events to all
  18826. // subscribers.
  18827. TestEventListener* repeater();
  18828. // Sets the default_result_printer attribute to the provided listener.
  18829. // The listener is also added to the listener list and previous
  18830. // default_result_printer is removed from it and deleted. The listener can
  18831. // also be NULL in which case it will not be added to the list. Does
  18832. // nothing if the previous and the current listener objects are the same.
  18833. void SetDefaultResultPrinter(TestEventListener* listener);
  18834. // Sets the default_xml_generator attribute to the provided listener. The
  18835. // listener is also added to the listener list and previous
  18836. // default_xml_generator is removed from it and deleted. The listener can
  18837. // also be NULL in which case it will not be added to the list. Does
  18838. // nothing if the previous and the current listener objects are the same.
  18839. void SetDefaultXmlGenerator(TestEventListener* listener);
  18840. // Controls whether events will be forwarded by the repeater to the
  18841. // listeners in the list.
  18842. bool EventForwardingEnabled() const;
  18843. void SuppressEventForwarding();
  18844. // The actual list of listeners.
  18845. internal::TestEventRepeater* repeater_;
  18846. // Listener responsible for the standard result output.
  18847. TestEventListener* default_result_printer_;
  18848. // Listener responsible for the creation of the XML output file.
  18849. TestEventListener* default_xml_generator_;
  18850. // We disallow copying TestEventListeners.
  18851. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
  18852. };
  18853. // A UnitTest consists of a vector of TestCases.
  18854. //
  18855. // This is a singleton class. The only instance of UnitTest is
  18856. // created when UnitTest::GetInstance() is first called. This
  18857. // instance is never deleted.
  18858. //
  18859. // UnitTest is not copyable.
  18860. //
  18861. // This class is thread-safe as long as the methods are called
  18862. // according to their specification.
  18863. class GTEST_API_ UnitTest {
  18864. public:
  18865. // Gets the singleton UnitTest object. The first time this method
  18866. // is called, a UnitTest object is constructed and returned.
  18867. // Consecutive calls will return the same object.
  18868. static UnitTest* GetInstance();
  18869. // Runs all tests in this UnitTest object and prints the result.
  18870. // Returns 0 if successful, or 1 otherwise.
  18871. //
  18872. // This method can only be called from the main thread.
  18873. //
  18874. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  18875. int Run() GTEST_MUST_USE_RESULT_;
  18876. // Returns the working directory when the first TEST() or TEST_F()
  18877. // was executed. The UnitTest object owns the string.
  18878. const char* original_working_dir() const;
  18879. // Returns the TestCase object for the test that's currently running,
  18880. // or NULL if no test is running.
  18881. const TestCase* current_test_case() const
  18882. GTEST_LOCK_EXCLUDED_(mutex_);
  18883. // Returns the TestInfo object for the test that's currently running,
  18884. // or NULL if no test is running.
  18885. const TestInfo* current_test_info() const
  18886. GTEST_LOCK_EXCLUDED_(mutex_);
  18887. // Returns the random seed used at the start of the current test run.
  18888. int random_seed() const;
  18889. // Returns the ParameterizedTestCaseRegistry object used to keep track of
  18890. // value-parameterized tests and instantiate and register them.
  18891. //
  18892. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  18893. internal::ParameterizedTestCaseRegistry& parameterized_test_registry()
  18894. GTEST_LOCK_EXCLUDED_(mutex_);
  18895. // Gets the number of successful test cases.
  18896. int successful_test_case_count() const;
  18897. // Gets the number of failed test cases.
  18898. int failed_test_case_count() const;
  18899. // Gets the number of all test cases.
  18900. int total_test_case_count() const;
  18901. // Gets the number of all test cases that contain at least one test
  18902. // that should run.
  18903. int test_case_to_run_count() const;
  18904. // Gets the number of successful tests.
  18905. int successful_test_count() const;
  18906. // Gets the number of failed tests.
  18907. int failed_test_count() const;
  18908. // Gets the number of disabled tests that will be reported in the XML report.
  18909. int reportable_disabled_test_count() const;
  18910. // Gets the number of disabled tests.
  18911. int disabled_test_count() const;
  18912. // Gets the number of tests to be printed in the XML report.
  18913. int reportable_test_count() const;
  18914. // Gets the number of all tests.
  18915. int total_test_count() const;
  18916. // Gets the number of tests that should run.
  18917. int test_to_run_count() const;
  18918. // Gets the time of the test program start, in ms from the start of the
  18919. // UNIX epoch.
  18920. TimeInMillis start_timestamp() const;
  18921. // Gets the elapsed time, in milliseconds.
  18922. TimeInMillis elapsed_time() const;
  18923. // Returns true iff the unit test passed (i.e. all test cases passed).
  18924. bool Passed() const;
  18925. // Returns true iff the unit test failed (i.e. some test case failed
  18926. // or something outside of all tests failed).
  18927. bool Failed() const;
  18928. // Gets the i-th test case among all the test cases. i can range from 0 to
  18929. // total_test_case_count() - 1. If i is not in that range, returns NULL.
  18930. const TestCase* GetTestCase(int i) const;
  18931. // Returns the TestResult containing information on test failures and
  18932. // properties logged outside of individual test cases.
  18933. const TestResult& ad_hoc_test_result() const;
  18934. // Returns the list of event listeners that can be used to track events
  18935. // inside Google Test.
  18936. TestEventListeners& listeners();
  18937. private:
  18938. // Registers and returns a global test environment. When a test
  18939. // program is run, all global test environments will be set-up in
  18940. // the order they were registered. After all tests in the program
  18941. // have finished, all global test environments will be torn-down in
  18942. // the *reverse* order they were registered.
  18943. //
  18944. // The UnitTest object takes ownership of the given environment.
  18945. //
  18946. // This method can only be called from the main thread.
  18947. Environment* AddEnvironment(Environment* env);
  18948. // Adds a TestPartResult to the current TestResult object. All
  18949. // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
  18950. // eventually call this to report their results. The user code
  18951. // should use the assertion macros instead of calling this directly.
  18952. void AddTestPartResult(TestPartResult::Type result_type,
  18953. const char* file_name,
  18954. int line_number,
  18955. const std::string& message,
  18956. const std::string& os_stack_trace)
  18957. GTEST_LOCK_EXCLUDED_(mutex_);
  18958. // Adds a TestProperty to the current TestResult object when invoked from
  18959. // inside a test, to current TestCase's ad_hoc_test_result_ when invoked
  18960. // from SetUpTestCase or TearDownTestCase, or to the global property set
  18961. // when invoked elsewhere. If the result already contains a property with
  18962. // the same key, the value will be updated.
  18963. void RecordProperty(const std::string& key, const std::string& value);
  18964. // Gets the i-th test case among all the test cases. i can range from 0 to
  18965. // total_test_case_count() - 1. If i is not in that range, returns NULL.
  18966. TestCase* GetMutableTestCase(int i);
  18967. // Accessors for the implementation object.
  18968. internal::UnitTestImpl* impl() { return impl_; }
  18969. const internal::UnitTestImpl* impl() const { return impl_; }
  18970. // These classes and functions are friends as they need to access private
  18971. // members of UnitTest.
  18972. friend class ScopedTrace;
  18973. friend class Test;
  18974. friend class internal::AssertHelper;
  18975. friend class internal::StreamingListenerTest;
  18976. friend class internal::UnitTestRecordPropertyTestHelper;
  18977. friend Environment* AddGlobalTestEnvironment(Environment* env);
  18978. friend internal::UnitTestImpl* internal::GetUnitTestImpl();
  18979. friend void internal::ReportFailureInUnknownLocation(
  18980. TestPartResult::Type result_type,
  18981. const std::string& message);
  18982. // Creates an empty UnitTest.
  18983. UnitTest();
  18984. // D'tor
  18985. virtual ~UnitTest();
  18986. // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
  18987. // Google Test trace stack.
  18988. void PushGTestTrace(const internal::TraceInfo& trace)
  18989. GTEST_LOCK_EXCLUDED_(mutex_);
  18990. // Pops a trace from the per-thread Google Test trace stack.
  18991. void PopGTestTrace()
  18992. GTEST_LOCK_EXCLUDED_(mutex_);
  18993. // Protects mutable state in *impl_. This is mutable as some const
  18994. // methods need to lock it too.
  18995. mutable internal::Mutex mutex_;
  18996. // Opaque implementation object. This field is never changed once
  18997. // the object is constructed. We don't mark it as const here, as
  18998. // doing so will cause a warning in the constructor of UnitTest.
  18999. // Mutable state in *impl_ is protected by mutex_.
  19000. internal::UnitTestImpl* impl_;
  19001. // We disallow copying UnitTest.
  19002. GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
  19003. };
  19004. // A convenient wrapper for adding an environment for the test
  19005. // program.
  19006. //
  19007. // You should call this before RUN_ALL_TESTS() is called, probably in
  19008. // main(). If you use gtest_main, you need to call this before main()
  19009. // starts for it to take effect. For example, you can define a global
  19010. // variable like this:
  19011. //
  19012. // testing::Environment* const foo_env =
  19013. // testing::AddGlobalTestEnvironment(new FooEnvironment);
  19014. //
  19015. // However, we strongly recommend you to write your own main() and
  19016. // call AddGlobalTestEnvironment() there, as relying on initialization
  19017. // of global variables makes the code harder to read and may cause
  19018. // problems when you register multiple environments from different
  19019. // translation units and the environments have dependencies among them
  19020. // (remember that the compiler doesn't guarantee the order in which
  19021. // global variables from different translation units are initialized).
  19022. inline Environment* AddGlobalTestEnvironment(Environment* env) {
  19023. return UnitTest::GetInstance()->AddEnvironment(env);
  19024. }
  19025. // Initializes Google Test. This must be called before calling
  19026. // RUN_ALL_TESTS(). In particular, it parses a command line for the
  19027. // flags that Google Test recognizes. Whenever a Google Test flag is
  19028. // seen, it is removed from argv, and *argc is decremented.
  19029. //
  19030. // No value is returned. Instead, the Google Test flag variables are
  19031. // updated.
  19032. //
  19033. // Calling the function for the second time has no user-visible effect.
  19034. GTEST_API_ void InitGoogleTest(int* argc, char** argv);
  19035. // This overloaded version can be used in Windows programs compiled in
  19036. // UNICODE mode.
  19037. GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
  19038. namespace internal {
  19039. // Separate the error generating code from the code path to reduce the stack
  19040. // frame size of CmpHelperEQ. This helps reduce the overhead of some sanitizers
  19041. // when calling EXPECT_* in a tight loop.
  19042. template <typename T1, typename T2>
  19043. AssertionResult CmpHelperEQFailure(const char* lhs_expression,
  19044. const char* rhs_expression,
  19045. const T1& lhs, const T2& rhs) {
  19046. return EqFailure(lhs_expression,
  19047. rhs_expression,
  19048. FormatForComparisonFailureMessage(lhs, rhs),
  19049. FormatForComparisonFailureMessage(rhs, lhs),
  19050. false);
  19051. }
  19052. // The helper function for {ASSERT|EXPECT}_EQ.
  19053. template <typename T1, typename T2>
  19054. AssertionResult CmpHelperEQ(const char* lhs_expression,
  19055. const char* rhs_expression,
  19056. const T1& lhs,
  19057. const T2& rhs) {
  19058. if (lhs == rhs) {
  19059. return AssertionSuccess();
  19060. }
  19061. return CmpHelperEQFailure(lhs_expression, rhs_expression, lhs, rhs);
  19062. }
  19063. // With this overloaded version, we allow anonymous enums to be used
  19064. // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
  19065. // can be implicitly cast to BiggestInt.
  19066. GTEST_API_ AssertionResult CmpHelperEQ(const char* lhs_expression,
  19067. const char* rhs_expression,
  19068. BiggestInt lhs,
  19069. BiggestInt rhs);
  19070. // The helper class for {ASSERT|EXPECT}_EQ. The template argument
  19071. // lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
  19072. // is a null pointer literal. The following default implementation is
  19073. // for lhs_is_null_literal being false.
  19074. template <bool lhs_is_null_literal>
  19075. class EqHelper {
  19076. public:
  19077. // This templatized version is for the general case.
  19078. template <typename T1, typename T2>
  19079. static AssertionResult Compare(const char* lhs_expression,
  19080. const char* rhs_expression,
  19081. const T1& lhs,
  19082. const T2& rhs) {
  19083. return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
  19084. }
  19085. // With this overloaded version, we allow anonymous enums to be used
  19086. // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
  19087. // enums can be implicitly cast to BiggestInt.
  19088. //
  19089. // Even though its body looks the same as the above version, we
  19090. // cannot merge the two, as it will make anonymous enums unhappy.
  19091. static AssertionResult Compare(const char* lhs_expression,
  19092. const char* rhs_expression,
  19093. BiggestInt lhs,
  19094. BiggestInt rhs) {
  19095. return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
  19096. }
  19097. };
  19098. // This specialization is used when the first argument to ASSERT_EQ()
  19099. // is a null pointer literal, like NULL, false, or 0.
  19100. template <>
  19101. class EqHelper<true> {
  19102. public:
  19103. // We define two overloaded versions of Compare(). The first
  19104. // version will be picked when the second argument to ASSERT_EQ() is
  19105. // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
  19106. // EXPECT_EQ(false, a_bool).
  19107. template <typename T1, typename T2>
  19108. static AssertionResult Compare(
  19109. const char* lhs_expression,
  19110. const char* rhs_expression,
  19111. const T1& lhs,
  19112. const T2& rhs,
  19113. // The following line prevents this overload from being considered if T2
  19114. // is not a pointer type. We need this because ASSERT_EQ(NULL, my_ptr)
  19115. // expands to Compare("", "", NULL, my_ptr), which requires a conversion
  19116. // to match the Secret* in the other overload, which would otherwise make
  19117. // this template match better.
  19118. typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
  19119. return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
  19120. }
  19121. // This version will be picked when the second argument to ASSERT_EQ() is a
  19122. // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
  19123. template <typename T>
  19124. static AssertionResult Compare(
  19125. const char* lhs_expression,
  19126. const char* rhs_expression,
  19127. // We used to have a second template parameter instead of Secret*. That
  19128. // template parameter would deduce to 'long', making this a better match
  19129. // than the first overload even without the first overload's EnableIf.
  19130. // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
  19131. // non-pointer argument" (even a deduced integral argument), so the old
  19132. // implementation caused warnings in user code.
  19133. Secret* /* lhs (NULL) */,
  19134. T* rhs) {
  19135. // We already know that 'lhs' is a null pointer.
  19136. return CmpHelperEQ(lhs_expression, rhs_expression,
  19137. static_cast<T*>(NULL), rhs);
  19138. }
  19139. };
  19140. // Separate the error generating code from the code path to reduce the stack
  19141. // frame size of CmpHelperOP. This helps reduce the overhead of some sanitizers
  19142. // when calling EXPECT_OP in a tight loop.
  19143. template <typename T1, typename T2>
  19144. AssertionResult CmpHelperOpFailure(const char* expr1, const char* expr2,
  19145. const T1& val1, const T2& val2,
  19146. const char* op) {
  19147. return AssertionFailure()
  19148. << "Expected: (" << expr1 << ") " << op << " (" << expr2
  19149. << "), actual: " << FormatForComparisonFailureMessage(val1, val2)
  19150. << " vs " << FormatForComparisonFailureMessage(val2, val1);
  19151. }
  19152. // A macro for implementing the helper functions needed to implement
  19153. // ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste
  19154. // of similar code.
  19155. //
  19156. // For each templatized helper function, we also define an overloaded
  19157. // version for BiggestInt in order to reduce code bloat and allow
  19158. // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
  19159. // with gcc 4.
  19160. //
  19161. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  19162. #define GTEST_IMPL_CMP_HELPER_(op_name, op)\
  19163. template <typename T1, typename T2>\
  19164. AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
  19165. const T1& val1, const T2& val2) {\
  19166. if (val1 op val2) {\
  19167. return AssertionSuccess();\
  19168. } else {\
  19169. return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\
  19170. }\
  19171. }\
  19172. GTEST_API_ AssertionResult CmpHelper##op_name(\
  19173. const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
  19174. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  19175. // Implements the helper function for {ASSERT|EXPECT}_NE
  19176. GTEST_IMPL_CMP_HELPER_(NE, !=);
  19177. // Implements the helper function for {ASSERT|EXPECT}_LE
  19178. GTEST_IMPL_CMP_HELPER_(LE, <=);
  19179. // Implements the helper function for {ASSERT|EXPECT}_LT
  19180. GTEST_IMPL_CMP_HELPER_(LT, <);
  19181. // Implements the helper function for {ASSERT|EXPECT}_GE
  19182. GTEST_IMPL_CMP_HELPER_(GE, >=);
  19183. // Implements the helper function for {ASSERT|EXPECT}_GT
  19184. GTEST_IMPL_CMP_HELPER_(GT, >);
  19185. #undef GTEST_IMPL_CMP_HELPER_
  19186. // The helper function for {ASSERT|EXPECT}_STREQ.
  19187. //
  19188. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  19189. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
  19190. const char* s2_expression,
  19191. const char* s1,
  19192. const char* s2);
  19193. // The helper function for {ASSERT|EXPECT}_STRCASEEQ.
  19194. //
  19195. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  19196. GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression,
  19197. const char* s2_expression,
  19198. const char* s1,
  19199. const char* s2);
  19200. // The helper function for {ASSERT|EXPECT}_STRNE.
  19201. //
  19202. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  19203. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
  19204. const char* s2_expression,
  19205. const char* s1,
  19206. const char* s2);
  19207. // The helper function for {ASSERT|EXPECT}_STRCASENE.
  19208. //
  19209. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  19210. GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
  19211. const char* s2_expression,
  19212. const char* s1,
  19213. const char* s2);
  19214. // Helper function for *_STREQ on wide strings.
  19215. //
  19216. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  19217. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
  19218. const char* s2_expression,
  19219. const wchar_t* s1,
  19220. const wchar_t* s2);
  19221. // Helper function for *_STRNE on wide strings.
  19222. //
  19223. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  19224. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
  19225. const char* s2_expression,
  19226. const wchar_t* s1,
  19227. const wchar_t* s2);
  19228. } // namespace internal
  19229. // IsSubstring() and IsNotSubstring() are intended to be used as the
  19230. // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
  19231. // themselves. They check whether needle is a substring of haystack
  19232. // (NULL is considered a substring of itself only), and return an
  19233. // appropriate error message when they fail.
  19234. //
  19235. // The {needle,haystack}_expr arguments are the stringified
  19236. // expressions that generated the two real arguments.
  19237. GTEST_API_ AssertionResult IsSubstring(
  19238. const char* needle_expr, const char* haystack_expr,
  19239. const char* needle, const char* haystack);
  19240. GTEST_API_ AssertionResult IsSubstring(
  19241. const char* needle_expr, const char* haystack_expr,
  19242. const wchar_t* needle, const wchar_t* haystack);
  19243. GTEST_API_ AssertionResult IsNotSubstring(
  19244. const char* needle_expr, const char* haystack_expr,
  19245. const char* needle, const char* haystack);
  19246. GTEST_API_ AssertionResult IsNotSubstring(
  19247. const char* needle_expr, const char* haystack_expr,
  19248. const wchar_t* needle, const wchar_t* haystack);
  19249. GTEST_API_ AssertionResult IsSubstring(
  19250. const char* needle_expr, const char* haystack_expr,
  19251. const ::std::string& needle, const ::std::string& haystack);
  19252. GTEST_API_ AssertionResult IsNotSubstring(
  19253. const char* needle_expr, const char* haystack_expr,
  19254. const ::std::string& needle, const ::std::string& haystack);
  19255. #if GTEST_HAS_STD_WSTRING
  19256. GTEST_API_ AssertionResult IsSubstring(
  19257. const char* needle_expr, const char* haystack_expr,
  19258. const ::std::wstring& needle, const ::std::wstring& haystack);
  19259. GTEST_API_ AssertionResult IsNotSubstring(
  19260. const char* needle_expr, const char* haystack_expr,
  19261. const ::std::wstring& needle, const ::std::wstring& haystack);
  19262. #endif // GTEST_HAS_STD_WSTRING
  19263. namespace internal {
  19264. // Helper template function for comparing floating-points.
  19265. //
  19266. // Template parameter:
  19267. //
  19268. // RawType: the raw floating-point type (either float or double)
  19269. //
  19270. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  19271. template <typename RawType>
  19272. AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression,
  19273. const char* rhs_expression,
  19274. RawType lhs_value,
  19275. RawType rhs_value);
  19276. // Helper function for implementing ASSERT_NEAR.
  19277. //
  19278. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  19279. GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
  19280. const char* expr2,
  19281. const char* abs_error_expr,
  19282. double val1,
  19283. double val2,
  19284. double abs_error);
  19285. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  19286. // A class that enables one to stream messages to assertion macros
  19287. class GTEST_API_ AssertHelper {
  19288. public:
  19289. // Constructor.
  19290. AssertHelper(TestPartResult::Type type,
  19291. const char* file,
  19292. int line,
  19293. const char* message);
  19294. ~AssertHelper();
  19295. // Message assignment is a semantic trick to enable assertion
  19296. // streaming; see the GTEST_MESSAGE_ macro below.
  19297. void operator=(const Message& message) const;
  19298. private:
  19299. // We put our data in a struct so that the size of the AssertHelper class can
  19300. // be as small as possible. This is important because gcc is incapable of
  19301. // re-using stack space even for temporary variables, so every EXPECT_EQ
  19302. // reserves stack space for another AssertHelper.
  19303. struct AssertHelperData {
  19304. AssertHelperData(TestPartResult::Type t,
  19305. const char* srcfile,
  19306. int line_num,
  19307. const char* msg)
  19308. : type(t), file(srcfile), line(line_num), message(msg) { }
  19309. TestPartResult::Type const type;
  19310. const char* const file;
  19311. int const line;
  19312. std::string const message;
  19313. private:
  19314. GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
  19315. };
  19316. AssertHelperData* const data_;
  19317. GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
  19318. };
  19319. } // namespace internal
  19320. // The pure interface class that all value-parameterized tests inherit from.
  19321. // A value-parameterized class must inherit from both ::testing::Test and
  19322. // ::testing::WithParamInterface. In most cases that just means inheriting
  19323. // from ::testing::TestWithParam, but more complicated test hierarchies
  19324. // may need to inherit from Test and WithParamInterface at different levels.
  19325. //
  19326. // This interface has support for accessing the test parameter value via
  19327. // the GetParam() method.
  19328. //
  19329. // Use it with one of the parameter generator defining functions, like Range(),
  19330. // Values(), ValuesIn(), Bool(), and Combine().
  19331. //
  19332. // class FooTest : public ::testing::TestWithParam<int> {
  19333. // protected:
  19334. // FooTest() {
  19335. // // Can use GetParam() here.
  19336. // }
  19337. // virtual ~FooTest() {
  19338. // // Can use GetParam() here.
  19339. // }
  19340. // virtual void SetUp() {
  19341. // // Can use GetParam() here.
  19342. // }
  19343. // virtual void TearDown {
  19344. // // Can use GetParam() here.
  19345. // }
  19346. // };
  19347. // TEST_P(FooTest, DoesBar) {
  19348. // // Can use GetParam() method here.
  19349. // Foo foo;
  19350. // ASSERT_TRUE(foo.DoesBar(GetParam()));
  19351. // }
  19352. // INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
  19353. template <typename T>
  19354. class WithParamInterface {
  19355. public:
  19356. typedef T ParamType;
  19357. virtual ~WithParamInterface() {}
  19358. // The current parameter value. Is also available in the test fixture's
  19359. // constructor. This member function is non-static, even though it only
  19360. // references static data, to reduce the opportunity for incorrect uses
  19361. // like writing 'WithParamInterface<bool>::GetParam()' for a test that
  19362. // uses a fixture whose parameter type is int.
  19363. const ParamType& GetParam() const {
  19364. GTEST_CHECK_(parameter_ != NULL)
  19365. << "GetParam() can only be called inside a value-parameterized test "
  19366. << "-- did you intend to write TEST_P instead of TEST_F?";
  19367. return *parameter_;
  19368. }
  19369. private:
  19370. // Sets parameter value. The caller is responsible for making sure the value
  19371. // remains alive and unchanged throughout the current test.
  19372. static void SetParam(const ParamType* parameter) {
  19373. parameter_ = parameter;
  19374. }
  19375. // Static value used for accessing parameter during a test lifetime.
  19376. static const ParamType* parameter_;
  19377. // TestClass must be a subclass of WithParamInterface<T> and Test.
  19378. template <class TestClass> friend class internal::ParameterizedTestFactory;
  19379. };
  19380. template <typename T>
  19381. const T* WithParamInterface<T>::parameter_ = NULL;
  19382. // Most value-parameterized classes can ignore the existence of
  19383. // WithParamInterface, and can just inherit from ::testing::TestWithParam.
  19384. template <typename T>
  19385. class TestWithParam : public Test, public WithParamInterface<T> {
  19386. };
  19387. // Macros for indicating success/failure in test code.
  19388. // ADD_FAILURE unconditionally adds a failure to the current test.
  19389. // SUCCEED generates a success - it doesn't automatically make the
  19390. // current test successful, as a test is only successful when it has
  19391. // no failure.
  19392. //
  19393. // EXPECT_* verifies that a certain condition is satisfied. If not,
  19394. // it behaves like ADD_FAILURE. In particular:
  19395. //
  19396. // EXPECT_TRUE verifies that a Boolean condition is true.
  19397. // EXPECT_FALSE verifies that a Boolean condition is false.
  19398. //
  19399. // FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
  19400. // that they will also abort the current function on failure. People
  19401. // usually want the fail-fast behavior of FAIL and ASSERT_*, but those
  19402. // writing data-driven tests often find themselves using ADD_FAILURE
  19403. // and EXPECT_* more.
  19404. // Generates a nonfatal failure with a generic message.
  19405. #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
  19406. // Generates a nonfatal failure at the given source file location with
  19407. // a generic message.
  19408. #define ADD_FAILURE_AT(file, line) \
  19409. GTEST_MESSAGE_AT_(file, line, "Failed", \
  19410. ::testing::TestPartResult::kNonFatalFailure)
  19411. // Generates a fatal failure with a generic message.
  19412. #define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
  19413. // Define this macro to 1 to omit the definition of FAIL(), which is a
  19414. // generic name and clashes with some other libraries.
  19415. #if !GTEST_DONT_DEFINE_FAIL
  19416. # define FAIL() GTEST_FAIL()
  19417. #endif
  19418. // Generates a success with a generic message.
  19419. #define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
  19420. // Define this macro to 1 to omit the definition of SUCCEED(), which
  19421. // is a generic name and clashes with some other libraries.
  19422. #if !GTEST_DONT_DEFINE_SUCCEED
  19423. # define SUCCEED() GTEST_SUCCEED()
  19424. #endif
  19425. // Macros for testing exceptions.
  19426. //
  19427. // * {ASSERT|EXPECT}_THROW(statement, expected_exception):
  19428. // Tests that the statement throws the expected exception.
  19429. // * {ASSERT|EXPECT}_NO_THROW(statement):
  19430. // Tests that the statement doesn't throw any exception.
  19431. // * {ASSERT|EXPECT}_ANY_THROW(statement):
  19432. // Tests that the statement throws an exception.
  19433. #define EXPECT_THROW(statement, expected_exception) \
  19434. GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
  19435. #define EXPECT_NO_THROW(statement) \
  19436. GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
  19437. #define EXPECT_ANY_THROW(statement) \
  19438. GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
  19439. #define ASSERT_THROW(statement, expected_exception) \
  19440. GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
  19441. #define ASSERT_NO_THROW(statement) \
  19442. GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
  19443. #define ASSERT_ANY_THROW(statement) \
  19444. GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
  19445. // Boolean assertions. Condition can be either a Boolean expression or an
  19446. // AssertionResult. For more information on how to use AssertionResult with
  19447. // these macros see comments on that class.
  19448. #define EXPECT_TRUE(condition) \
  19449. GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
  19450. GTEST_NONFATAL_FAILURE_)
  19451. #define EXPECT_FALSE(condition) \
  19452. GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
  19453. GTEST_NONFATAL_FAILURE_)
  19454. #define ASSERT_TRUE(condition) \
  19455. GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
  19456. GTEST_FATAL_FAILURE_)
  19457. #define ASSERT_FALSE(condition) \
  19458. GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
  19459. GTEST_FATAL_FAILURE_)
  19460. // Macros for testing equalities and inequalities.
  19461. //
  19462. // * {ASSERT|EXPECT}_EQ(v1, v2): Tests that v1 == v2
  19463. // * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
  19464. // * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2
  19465. // * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2
  19466. // * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2
  19467. // * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2
  19468. //
  19469. // When they are not, Google Test prints both the tested expressions and
  19470. // their actual values. The values must be compatible built-in types,
  19471. // or you will get a compiler error. By "compatible" we mean that the
  19472. // values can be compared by the respective operator.
  19473. //
  19474. // Note:
  19475. //
  19476. // 1. It is possible to make a user-defined type work with
  19477. // {ASSERT|EXPECT}_??(), but that requires overloading the
  19478. // comparison operators and is thus discouraged by the Google C++
  19479. // Usage Guide. Therefore, you are advised to use the
  19480. // {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
  19481. // equal.
  19482. //
  19483. // 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
  19484. // pointers (in particular, C strings). Therefore, if you use it
  19485. // with two C strings, you are testing how their locations in memory
  19486. // are related, not how their content is related. To compare two C
  19487. // strings by content, use {ASSERT|EXPECT}_STR*().
  19488. //
  19489. // 3. {ASSERT|EXPECT}_EQ(v1, v2) is preferred to
  19490. // {ASSERT|EXPECT}_TRUE(v1 == v2), as the former tells you
  19491. // what the actual value is when it fails, and similarly for the
  19492. // other comparisons.
  19493. //
  19494. // 4. Do not depend on the order in which {ASSERT|EXPECT}_??()
  19495. // evaluate their arguments, which is undefined.
  19496. //
  19497. // 5. These macros evaluate their arguments exactly once.
  19498. //
  19499. // Examples:
  19500. //
  19501. // EXPECT_NE(Foo(), 5);
  19502. // EXPECT_EQ(a_pointer, NULL);
  19503. // ASSERT_LT(i, array_size);
  19504. // ASSERT_GT(records.size(), 0) << "There is no record left.";
  19505. #define EXPECT_EQ(val1, val2) \
  19506. EXPECT_PRED_FORMAT2(::testing::internal:: \
  19507. EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
  19508. val1, val2)
  19509. #define EXPECT_NE(val1, val2) \
  19510. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
  19511. #define EXPECT_LE(val1, val2) \
  19512. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
  19513. #define EXPECT_LT(val1, val2) \
  19514. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
  19515. #define EXPECT_GE(val1, val2) \
  19516. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
  19517. #define EXPECT_GT(val1, val2) \
  19518. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
  19519. #define GTEST_ASSERT_EQ(val1, val2) \
  19520. ASSERT_PRED_FORMAT2(::testing::internal:: \
  19521. EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
  19522. val1, val2)
  19523. #define GTEST_ASSERT_NE(val1, val2) \
  19524. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
  19525. #define GTEST_ASSERT_LE(val1, val2) \
  19526. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
  19527. #define GTEST_ASSERT_LT(val1, val2) \
  19528. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
  19529. #define GTEST_ASSERT_GE(val1, val2) \
  19530. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
  19531. #define GTEST_ASSERT_GT(val1, val2) \
  19532. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
  19533. // Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
  19534. // ASSERT_XY(), which clashes with some users' own code.
  19535. #if !GTEST_DONT_DEFINE_ASSERT_EQ
  19536. # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
  19537. #endif
  19538. #if !GTEST_DONT_DEFINE_ASSERT_NE
  19539. # define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
  19540. #endif
  19541. #if !GTEST_DONT_DEFINE_ASSERT_LE
  19542. # define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
  19543. #endif
  19544. #if !GTEST_DONT_DEFINE_ASSERT_LT
  19545. # define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
  19546. #endif
  19547. #if !GTEST_DONT_DEFINE_ASSERT_GE
  19548. # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
  19549. #endif
  19550. #if !GTEST_DONT_DEFINE_ASSERT_GT
  19551. # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
  19552. #endif
  19553. // C-string Comparisons. All tests treat NULL and any non-NULL string
  19554. // as different. Two NULLs are equal.
  19555. //
  19556. // * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2
  19557. // * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2
  19558. // * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
  19559. // * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
  19560. //
  19561. // For wide or narrow string objects, you can use the
  19562. // {ASSERT|EXPECT}_??() macros.
  19563. //
  19564. // Don't depend on the order in which the arguments are evaluated,
  19565. // which is undefined.
  19566. //
  19567. // These macros evaluate their arguments exactly once.
  19568. #define EXPECT_STREQ(s1, s2) \
  19569. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
  19570. #define EXPECT_STRNE(s1, s2) \
  19571. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
  19572. #define EXPECT_STRCASEEQ(s1, s2) \
  19573. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
  19574. #define EXPECT_STRCASENE(s1, s2)\
  19575. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
  19576. #define ASSERT_STREQ(s1, s2) \
  19577. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
  19578. #define ASSERT_STRNE(s1, s2) \
  19579. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
  19580. #define ASSERT_STRCASEEQ(s1, s2) \
  19581. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
  19582. #define ASSERT_STRCASENE(s1, s2)\
  19583. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
  19584. // Macros for comparing floating-point numbers.
  19585. //
  19586. // * {ASSERT|EXPECT}_FLOAT_EQ(val1, val2):
  19587. // Tests that two float values are almost equal.
  19588. // * {ASSERT|EXPECT}_DOUBLE_EQ(val1, val2):
  19589. // Tests that two double values are almost equal.
  19590. // * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
  19591. // Tests that v1 and v2 are within the given distance to each other.
  19592. //
  19593. // Google Test uses ULP-based comparison to automatically pick a default
  19594. // error bound that is appropriate for the operands. See the
  19595. // FloatingPoint template class in gtest-internal.h if you are
  19596. // interested in the implementation details.
  19597. #define EXPECT_FLOAT_EQ(val1, val2)\
  19598. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
  19599. val1, val2)
  19600. #define EXPECT_DOUBLE_EQ(val1, val2)\
  19601. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
  19602. val1, val2)
  19603. #define ASSERT_FLOAT_EQ(val1, val2)\
  19604. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
  19605. val1, val2)
  19606. #define ASSERT_DOUBLE_EQ(val1, val2)\
  19607. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
  19608. val1, val2)
  19609. #define EXPECT_NEAR(val1, val2, abs_error)\
  19610. EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
  19611. val1, val2, abs_error)
  19612. #define ASSERT_NEAR(val1, val2, abs_error)\
  19613. ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
  19614. val1, val2, abs_error)
  19615. // These predicate format functions work on floating-point values, and
  19616. // can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
  19617. //
  19618. // EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
  19619. // Asserts that val1 is less than, or almost equal to, val2. Fails
  19620. // otherwise. In particular, it fails if either val1 or val2 is NaN.
  19621. GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
  19622. float val1, float val2);
  19623. GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
  19624. double val1, double val2);
  19625. #if GTEST_OS_WINDOWS
  19626. // Macros that test for HRESULT failure and success, these are only useful
  19627. // on Windows, and rely on Windows SDK macros and APIs to compile.
  19628. //
  19629. // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
  19630. //
  19631. // When expr unexpectedly fails or succeeds, Google Test prints the
  19632. // expected result and the actual result with both a human-readable
  19633. // string representation of the error, if available, as well as the
  19634. // hex result code.
  19635. # define EXPECT_HRESULT_SUCCEEDED(expr) \
  19636. EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
  19637. # define ASSERT_HRESULT_SUCCEEDED(expr) \
  19638. ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
  19639. # define EXPECT_HRESULT_FAILED(expr) \
  19640. EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
  19641. # define ASSERT_HRESULT_FAILED(expr) \
  19642. ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
  19643. #endif // GTEST_OS_WINDOWS
  19644. // Macros that execute statement and check that it doesn't generate new fatal
  19645. // failures in the current thread.
  19646. //
  19647. // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
  19648. //
  19649. // Examples:
  19650. //
  19651. // EXPECT_NO_FATAL_FAILURE(Process());
  19652. // ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
  19653. //
  19654. #define ASSERT_NO_FATAL_FAILURE(statement) \
  19655. GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
  19656. #define EXPECT_NO_FATAL_FAILURE(statement) \
  19657. GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
  19658. // Causes a trace (including the given source file path and line number,
  19659. // and the given message) to be included in every test failure message generated
  19660. // by code in the scope of the lifetime of an instance of this class. The effect
  19661. // is undone with the destruction of the instance.
  19662. //
  19663. // The message argument can be anything streamable to std::ostream.
  19664. //
  19665. // Example:
  19666. // testing::ScopedTrace trace("file.cc", 123, "message");
  19667. //
  19668. class GTEST_API_ ScopedTrace {
  19669. public:
  19670. // The c'tor pushes the given source file location and message onto
  19671. // a trace stack maintained by Google Test.
  19672. // Template version. Uses Message() to convert the values into strings.
  19673. // Slow, but flexible.
  19674. template <typename T>
  19675. ScopedTrace(const char* file, int line, const T& message) {
  19676. PushTrace(file, line, (Message() << message).GetString());
  19677. }
  19678. // Optimize for some known types.
  19679. ScopedTrace(const char* file, int line, const char* message) {
  19680. PushTrace(file, line, message ? message : "(null)");
  19681. }
  19682. #if GTEST_HAS_GLOBAL_STRING
  19683. ScopedTrace(const char* file, int line, const ::string& message) {
  19684. PushTrace(file, line, message);
  19685. }
  19686. #endif
  19687. ScopedTrace(const char* file, int line, const std::string& message) {
  19688. PushTrace(file, line, message);
  19689. }
  19690. // The d'tor pops the info pushed by the c'tor.
  19691. //
  19692. // Note that the d'tor is not virtual in order to be efficient.
  19693. // Don't inherit from ScopedTrace!
  19694. ~ScopedTrace();
  19695. private:
  19696. void PushTrace(const char* file, int line, std::string message);
  19697. GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
  19698. } GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its
  19699. // c'tor and d'tor. Therefore it doesn't
  19700. // need to be used otherwise.
  19701. // Causes a trace (including the source file path, the current line
  19702. // number, and the given message) to be included in every test failure
  19703. // message generated by code in the current scope. The effect is
  19704. // undone when the control leaves the current scope.
  19705. //
  19706. // The message argument can be anything streamable to std::ostream.
  19707. //
  19708. // In the implementation, we include the current line number as part
  19709. // of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
  19710. // to appear in the same block - as long as they are on different
  19711. // lines.
  19712. //
  19713. // Assuming that each thread maintains its own stack of traces.
  19714. // Therefore, a SCOPED_TRACE() would (correctly) only affect the
  19715. // assertions in its own thread.
  19716. #define SCOPED_TRACE(message) \
  19717. ::testing::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
  19718. __FILE__, __LINE__, (message))
  19719. // Compile-time assertion for type equality.
  19720. // StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
  19721. // the same type. The value it returns is not interesting.
  19722. //
  19723. // Instead of making StaticAssertTypeEq a class template, we make it a
  19724. // function template that invokes a helper class template. This
  19725. // prevents a user from misusing StaticAssertTypeEq<T1, T2> by
  19726. // defining objects of that type.
  19727. //
  19728. // CAVEAT:
  19729. //
  19730. // When used inside a method of a class template,
  19731. // StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
  19732. // instantiated. For example, given:
  19733. //
  19734. // template <typename T> class Foo {
  19735. // public:
  19736. // void Bar() { testing::StaticAssertTypeEq<int, T>(); }
  19737. // };
  19738. //
  19739. // the code:
  19740. //
  19741. // void Test1() { Foo<bool> foo; }
  19742. //
  19743. // will NOT generate a compiler error, as Foo<bool>::Bar() is never
  19744. // actually instantiated. Instead, you need:
  19745. //
  19746. // void Test2() { Foo<bool> foo; foo.Bar(); }
  19747. //
  19748. // to cause a compiler error.
  19749. template <typename T1, typename T2>
  19750. bool StaticAssertTypeEq() {
  19751. (void)internal::StaticAssertTypeEqHelper<T1, T2>();
  19752. return true;
  19753. }
  19754. // Defines a test.
  19755. //
  19756. // The first parameter is the name of the test case, and the second
  19757. // parameter is the name of the test within the test case.
  19758. //
  19759. // The convention is to end the test case name with "Test". For
  19760. // example, a test case for the Foo class can be named FooTest.
  19761. //
  19762. // Test code should appear between braces after an invocation of
  19763. // this macro. Example:
  19764. //
  19765. // TEST(FooTest, InitializesCorrectly) {
  19766. // Foo foo;
  19767. // EXPECT_TRUE(foo.StatusIsOK());
  19768. // }
  19769. // Note that we call GetTestTypeId() instead of GetTypeId<
  19770. // ::testing::Test>() here to get the type ID of testing::Test. This
  19771. // is to work around a suspected linker bug when using Google Test as
  19772. // a framework on Mac OS X. The bug causes GetTypeId<
  19773. // ::testing::Test>() to return different values depending on whether
  19774. // the call is from the Google Test framework itself or from user test
  19775. // code. GetTestTypeId() is guaranteed to always return the same
  19776. // value, as it always calls GetTypeId<>() from the Google Test
  19777. // framework.
  19778. #define GTEST_TEST(test_case_name, test_name)\
  19779. GTEST_TEST_(test_case_name, test_name, \
  19780. ::testing::Test, ::testing::internal::GetTestTypeId())
  19781. // Define this macro to 1 to omit the definition of TEST(), which
  19782. // is a generic name and clashes with some other libraries.
  19783. #if !GTEST_DONT_DEFINE_TEST
  19784. # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
  19785. #endif
  19786. // Defines a test that uses a test fixture.
  19787. //
  19788. // The first parameter is the name of the test fixture class, which
  19789. // also doubles as the test case name. The second parameter is the
  19790. // name of the test within the test case.
  19791. //
  19792. // A test fixture class must be declared earlier. The user should put
  19793. // the test code between braces after using this macro. Example:
  19794. //
  19795. // class FooTest : public testing::Test {
  19796. // protected:
  19797. // virtual void SetUp() { b_.AddElement(3); }
  19798. //
  19799. // Foo a_;
  19800. // Foo b_;
  19801. // };
  19802. //
  19803. // TEST_F(FooTest, InitializesCorrectly) {
  19804. // EXPECT_TRUE(a_.StatusIsOK());
  19805. // }
  19806. //
  19807. // TEST_F(FooTest, ReturnsElementCountCorrectly) {
  19808. // EXPECT_EQ(a_.size(), 0);
  19809. // EXPECT_EQ(b_.size(), 1);
  19810. // }
  19811. #define TEST_F(test_fixture, test_name)\
  19812. GTEST_TEST_(test_fixture, test_name, test_fixture, \
  19813. ::testing::internal::GetTypeId<test_fixture>())
  19814. // Returns a path to temporary directory.
  19815. // Tries to determine an appropriate directory for the platform.
  19816. GTEST_API_ std::string TempDir();
  19817. #ifdef _MSC_VER
  19818. # pragma warning(pop)
  19819. #endif
  19820. } // namespace testing
  19821. // Use this function in main() to run all tests. It returns 0 if all
  19822. // tests are successful, or 1 otherwise.
  19823. //
  19824. // RUN_ALL_TESTS() should be invoked after the command line has been
  19825. // parsed by InitGoogleTest().
  19826. //
  19827. // This function was formerly a macro; thus, it is in the global
  19828. // namespace and has an all-caps name.
  19829. int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;
  19830. inline int RUN_ALL_TESTS() {
  19831. return ::testing::UnitTest::GetInstance()->Run();
  19832. }
  19833. GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
  19834. #endif // GTEST_INCLUDE_GTEST_GTEST_H_