gtest.h 811 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061
  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. // Author: wan@google.com (Zhanyong Wan)
  31. //
  32. // The Google C++ Testing Framework (Google Test)
  33. //
  34. // This header file defines the public API for Google Test. It should be
  35. // included by any test program that uses Google Test.
  36. //
  37. // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
  38. // leave some internal implementation details in this header file.
  39. // They are clearly marked by comments like this:
  40. //
  41. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  42. //
  43. // Such code is NOT meant to be used by a user directly, and is subject
  44. // to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
  45. // program!
  46. //
  47. // Acknowledgment: Google Test borrowed the idea of automatic test
  48. // registration from Barthelemy Dagenais' (barthelemy@prologique.com)
  49. // easyUnit framework.
  50. #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
  51. #define GTEST_INCLUDE_GTEST_GTEST_H_
  52. #include <limits>
  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. // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
  85. //
  86. // The Google C++ Testing Framework (Google Test)
  87. //
  88. // This header file declares functions and macros used internally by
  89. // Google Test. They are subject to change without notice.
  90. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
  91. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
  92. // Copyright 2005, Google Inc.
  93. // All rights reserved.
  94. //
  95. // Redistribution and use in source and binary forms, with or without
  96. // modification, are permitted provided that the following conditions are
  97. // met:
  98. //
  99. // * Redistributions of source code must retain the above copyright
  100. // notice, this list of conditions and the following disclaimer.
  101. // * Redistributions in binary form must reproduce the above
  102. // copyright notice, this list of conditions and the following disclaimer
  103. // in the documentation and/or other materials provided with the
  104. // distribution.
  105. // * Neither the name of Google Inc. nor the names of its
  106. // contributors may be used to endorse or promote products derived from
  107. // this software without specific prior written permission.
  108. //
  109. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  110. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  111. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  112. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  113. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  114. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  115. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  116. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  117. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  118. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  119. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  120. //
  121. // Authors: wan@google.com (Zhanyong Wan)
  122. //
  123. // Low-level types and utilities for porting Google Test to various
  124. // platforms. They are subject to change without notice. DO NOT USE
  125. // THEM IN USER CODE.
  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. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
  131. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
  132. // The user can define the following macros in the build script to
  133. // control Google Test's behavior. If the user doesn't define a macro
  134. // in this list, Google Test will define it.
  135. //
  136. // GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2)
  137. // is/isn't available.
  138. // GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions
  139. // are enabled.
  140. // GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string
  141. // is/isn't available (some systems define
  142. // ::string, which is different to std::string).
  143. // GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
  144. // is/isn't available (some systems define
  145. // ::wstring, which is different to std::wstring).
  146. // GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular
  147. // expressions are/aren't available.
  148. // GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that <pthread.h>
  149. // is/isn't available.
  150. // GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't
  151. // enabled.
  152. // GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that
  153. // std::wstring does/doesn't work (Google Test can
  154. // be used where std::wstring is unavailable).
  155. // GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple
  156. // is/isn't available.
  157. // GTEST_HAS_SEH - Define it to 1/0 to indicate whether the
  158. // compiler supports Microsoft's "Structured
  159. // Exception Handling".
  160. // GTEST_HAS_STREAM_REDIRECTION
  161. // - Define it to 1/0 to indicate whether the
  162. // platform supports I/O stream redirection using
  163. // dup() and dup2().
  164. // GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google
  165. // Test's own tr1 tuple implementation should be
  166. // used. Unused when the user sets
  167. // GTEST_HAS_TR1_TUPLE to 0.
  168. // GTEST_LANG_CXX11 - Define it to 1/0 to indicate that Google Test
  169. // is building in C++11/C++98 mode.
  170. // GTEST_LINKED_AS_SHARED_LIBRARY
  171. // - Define to 1 when compiling tests that use
  172. // Google Test as a shared library (known as
  173. // DLL on Windows).
  174. // GTEST_CREATE_SHARED_LIBRARY
  175. // - Define to 1 when compiling Google Test itself
  176. // as a shared library.
  177. // This header defines the following utilities:
  178. //
  179. // Macros indicating the current platform (defined to 1 if compiled on
  180. // the given platform; otherwise undefined):
  181. // GTEST_OS_AIX - IBM AIX
  182. // GTEST_OS_CYGWIN - Cygwin
  183. // GTEST_OS_HPUX - HP-UX
  184. // GTEST_OS_LINUX - Linux
  185. // GTEST_OS_LINUX_ANDROID - Google Android
  186. // GTEST_OS_MAC - Mac OS X
  187. // GTEST_OS_IOS - iOS
  188. // GTEST_OS_IOS_SIMULATOR - iOS simulator
  189. // GTEST_OS_NACL - Google Native Client (NaCl)
  190. // GTEST_OS_OPENBSD - OpenBSD
  191. // GTEST_OS_QNX - QNX
  192. // GTEST_OS_SOLARIS - Sun Solaris
  193. // GTEST_OS_SYMBIAN - Symbian
  194. // GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile)
  195. // GTEST_OS_WINDOWS_DESKTOP - Windows Desktop
  196. // GTEST_OS_WINDOWS_MINGW - MinGW
  197. // GTEST_OS_WINDOWS_MOBILE - Windows Mobile
  198. // GTEST_OS_ZOS - z/OS
  199. //
  200. // Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
  201. // most stable support. Since core members of the Google Test project
  202. // don't have access to other platforms, support for them may be less
  203. // stable. If you notice any problems on your platform, please notify
  204. // googletestframework@googlegroups.com (patches for fixing them are
  205. // even more welcome!).
  206. //
  207. // Note that it is possible that none of the GTEST_OS_* macros are defined.
  208. //
  209. // Macros indicating available Google Test features (defined to 1 if
  210. // the corresponding feature is supported; otherwise undefined):
  211. // GTEST_HAS_COMBINE - the Combine() function (for value-parameterized
  212. // tests)
  213. // GTEST_HAS_DEATH_TEST - death tests
  214. // GTEST_HAS_PARAM_TEST - value-parameterized tests
  215. // GTEST_HAS_TYPED_TEST - typed tests
  216. // GTEST_HAS_TYPED_TEST_P - type-parameterized tests
  217. // GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with
  218. // GTEST_HAS_POSIX_RE (see above) which users can
  219. // define themselves.
  220. // GTEST_USES_SIMPLE_RE - our own simple regex is used;
  221. // the above two are mutually exclusive.
  222. // GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
  223. //
  224. // Macros for basic C++ coding:
  225. // GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
  226. // GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a
  227. // variable don't have to be used.
  228. // GTEST_DISALLOW_ASSIGN_ - disables operator=.
  229. // GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
  230. // GTEST_MUST_USE_RESULT_ - declares that a function's result must be used.
  231. //
  232. // Synchronization:
  233. // Mutex, MutexLock, ThreadLocal, GetThreadCount()
  234. // - synchronization primitives.
  235. // GTEST_IS_THREADSAFE - defined to 1 to indicate that the above
  236. // synchronization primitives have real implementations
  237. // and Google Test is thread-safe; or 0 otherwise.
  238. //
  239. // Template meta programming:
  240. // is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only.
  241. // IteratorTraits - partial implementation of std::iterator_traits, which
  242. // is not available in libCstd when compiled with Sun C++.
  243. //
  244. // Smart pointers:
  245. // scoped_ptr - as in TR2.
  246. //
  247. // Regular expressions:
  248. // RE - a simple regular expression class using the POSIX
  249. // Extended Regular Expression syntax on UNIX-like
  250. // platforms, or a reduced regular exception syntax on
  251. // other platforms, including Windows.
  252. //
  253. // Logging:
  254. // GTEST_LOG_() - logs messages at the specified severity level.
  255. // LogToStderr() - directs all log messages to stderr.
  256. // FlushInfoLog() - flushes informational log messages.
  257. //
  258. // Stdout and stderr capturing:
  259. // CaptureStdout() - starts capturing stdout.
  260. // GetCapturedStdout() - stops capturing stdout and returns the captured
  261. // string.
  262. // CaptureStderr() - starts capturing stderr.
  263. // GetCapturedStderr() - stops capturing stderr and returns the captured
  264. // string.
  265. //
  266. // Integer types:
  267. // TypeWithSize - maps an integer to a int type.
  268. // Int32, UInt32, Int64, UInt64, TimeInMillis
  269. // - integers of known sizes.
  270. // BiggestInt - the biggest signed integer type.
  271. //
  272. // Command-line utilities:
  273. // GTEST_FLAG() - references a flag.
  274. // GTEST_DECLARE_*() - declares a flag.
  275. // GTEST_DEFINE_*() - defines a flag.
  276. // GetInjectableArgvs() - returns the command line as a vector of strings.
  277. //
  278. // Environment variable utilities:
  279. // GetEnv() - gets the value of an environment variable.
  280. // BoolFromGTestEnv() - parses a bool environment variable.
  281. // Int32FromGTestEnv() - parses an Int32 environment variable.
  282. // StringFromGTestEnv() - parses a string environment variable.
  283. #include <ctype.h> // for isspace, etc
  284. #include <stddef.h> // for ptrdiff_t
  285. #include <stdlib.h>
  286. #include <stdio.h>
  287. #include <string.h>
  288. #ifndef _WIN32_WCE
  289. # include <sys/types.h>
  290. # include <sys/stat.h>
  291. #endif // !_WIN32_WCE
  292. #if defined __APPLE__
  293. # include <AvailabilityMacros.h>
  294. # include <TargetConditionals.h>
  295. #endif
  296. #include <iostream> // NOLINT
  297. #include <sstream> // NOLINT
  298. #include <string> // NOLINT
  299. #define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
  300. #define GTEST_FLAG_PREFIX_ "gtest_"
  301. #define GTEST_FLAG_PREFIX_DASH_ "gtest-"
  302. #define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
  303. #define GTEST_NAME_ "Google Test"
  304. #define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/"
  305. // Determines the version of gcc that is used to compile this.
  306. #ifdef __GNUC__
  307. // 40302 means version 4.3.2.
  308. # define GTEST_GCC_VER_ \
  309. (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
  310. #endif // __GNUC__
  311. // Determines the platform on which Google Test is compiled.
  312. #ifdef __CYGWIN__
  313. # define GTEST_OS_CYGWIN 1
  314. #elif defined __SYMBIAN32__
  315. # define GTEST_OS_SYMBIAN 1
  316. #elif defined _WIN32
  317. # define GTEST_OS_WINDOWS 1
  318. # ifdef _WIN32_WCE
  319. # define GTEST_OS_WINDOWS_MOBILE 1
  320. # elif defined(__MINGW__) || defined(__MINGW32__)
  321. # define GTEST_OS_WINDOWS_MINGW 1
  322. # else
  323. # define GTEST_OS_WINDOWS_DESKTOP 1
  324. # endif // _WIN32_WCE
  325. #elif defined __APPLE__
  326. # define GTEST_OS_MAC 1
  327. # if TARGET_OS_IPHONE
  328. # define GTEST_OS_IOS 1
  329. # if TARGET_IPHONE_SIMULATOR
  330. # define GTEST_OS_IOS_SIMULATOR 1
  331. # endif
  332. # endif
  333. #elif defined __linux__
  334. # define GTEST_OS_LINUX 1
  335. # if defined __ANDROID__
  336. # define GTEST_OS_LINUX_ANDROID 1
  337. # endif
  338. #elif defined __MVS__
  339. # define GTEST_OS_ZOS 1
  340. #elif defined(__sun) && defined(__SVR4)
  341. # define GTEST_OS_SOLARIS 1
  342. #elif defined(_AIX)
  343. # define GTEST_OS_AIX 1
  344. #elif defined(__hpux)
  345. # define GTEST_OS_HPUX 1
  346. #elif defined __native_client__
  347. # define GTEST_OS_NACL 1
  348. #elif defined __OpenBSD__
  349. # define GTEST_OS_OPENBSD 1
  350. #elif defined __QNX__
  351. # define GTEST_OS_QNX 1
  352. #endif // __CYGWIN__
  353. #ifndef GTEST_LANG_CXX11
  354. // gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when
  355. // -std={c,gnu}++{0x,11} is passed. The C++11 standard specifies a
  356. // value for __cplusplus, and recent versions of clang, gcc, and
  357. // probably other compilers set that too in C++11 mode.
  358. # if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L
  359. // Compiling in at least C++11 mode.
  360. # define GTEST_LANG_CXX11 1
  361. # else
  362. # define GTEST_LANG_CXX11 0
  363. # endif
  364. #endif
  365. // Brings in definitions for functions used in the testing::internal::posix
  366. // namespace (read, write, close, chdir, isatty, stat). We do not currently
  367. // use them on Windows Mobile.
  368. #if !GTEST_OS_WINDOWS
  369. // This assumes that non-Windows OSes provide unistd.h. For OSes where this
  370. // is not the case, we need to include headers that provide the functions
  371. // mentioned above.
  372. # include <unistd.h>
  373. # include <strings.h>
  374. #elif !GTEST_OS_WINDOWS_MOBILE
  375. # include <direct.h>
  376. # include <io.h>
  377. #endif
  378. #if GTEST_OS_LINUX_ANDROID
  379. // Used to define __ANDROID_API__ matching the target NDK API level.
  380. # include <android/api-level.h> // NOLINT
  381. #endif
  382. // Defines this to true iff Google Test can use POSIX regular expressions.
  383. #ifndef GTEST_HAS_POSIX_RE
  384. # if GTEST_OS_LINUX_ANDROID
  385. // On Android, <regex.h> is only available starting with Gingerbread.
  386. # define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 9)
  387. # else
  388. # define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)
  389. # endif
  390. #endif
  391. #if GTEST_HAS_POSIX_RE
  392. // On some platforms, <regex.h> needs someone to define size_t, and
  393. // won't compile otherwise. We can #include it here as we already
  394. // included <stdlib.h>, which is guaranteed to define size_t through
  395. // <stddef.h>.
  396. # include <regex.h> // NOLINT
  397. # define GTEST_USES_POSIX_RE 1
  398. #elif GTEST_OS_WINDOWS
  399. // <regex.h> is not available on Windows. Use our own simple regex
  400. // implementation instead.
  401. # define GTEST_USES_SIMPLE_RE 1
  402. #else
  403. // <regex.h> may not be available on this platform. Use our own
  404. // simple regex implementation instead.
  405. # define GTEST_USES_SIMPLE_RE 1
  406. #endif // GTEST_HAS_POSIX_RE
  407. #ifndef GTEST_HAS_EXCEPTIONS
  408. // The user didn't tell us whether exceptions are enabled, so we need
  409. // to figure it out.
  410. # if defined(_MSC_VER) || defined(__BORLANDC__)
  411. // MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS
  412. // macro to enable exceptions, so we'll do the same.
  413. // Assumes that exceptions are enabled by default.
  414. # ifndef _HAS_EXCEPTIONS
  415. # define _HAS_EXCEPTIONS 1
  416. # endif // _HAS_EXCEPTIONS
  417. # define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
  418. # elif defined(__GNUC__) && __EXCEPTIONS
  419. // gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
  420. # define GTEST_HAS_EXCEPTIONS 1
  421. # elif defined(__SUNPRO_CC)
  422. // Sun Pro CC supports exceptions. However, there is no compile-time way of
  423. // detecting whether they are enabled or not. Therefore, we assume that
  424. // they are enabled unless the user tells us otherwise.
  425. # define GTEST_HAS_EXCEPTIONS 1
  426. # elif defined(__IBMCPP__) && __EXCEPTIONS
  427. // xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
  428. # define GTEST_HAS_EXCEPTIONS 1
  429. # elif defined(__HP_aCC)
  430. // Exception handling is in effect by default in HP aCC compiler. It has to
  431. // be turned of by +noeh compiler option if desired.
  432. # define GTEST_HAS_EXCEPTIONS 1
  433. # else
  434. // For other compilers, we assume exceptions are disabled to be
  435. // conservative.
  436. # define GTEST_HAS_EXCEPTIONS 0
  437. # endif // defined(_MSC_VER) || defined(__BORLANDC__)
  438. #endif // GTEST_HAS_EXCEPTIONS
  439. #if !defined(GTEST_HAS_STD_STRING)
  440. // Even though we don't use this macro any longer, we keep it in case
  441. // some clients still depend on it.
  442. # define GTEST_HAS_STD_STRING 1
  443. #elif !GTEST_HAS_STD_STRING
  444. // The user told us that ::std::string isn't available.
  445. # error "Google Test cannot be used where ::std::string isn't available."
  446. #endif // !defined(GTEST_HAS_STD_STRING)
  447. #ifndef GTEST_HAS_GLOBAL_STRING
  448. // The user didn't tell us whether ::string is available, so we need
  449. // to figure it out.
  450. # define GTEST_HAS_GLOBAL_STRING 0
  451. #endif // GTEST_HAS_GLOBAL_STRING
  452. #ifndef GTEST_HAS_STD_WSTRING
  453. // The user didn't tell us whether ::std::wstring is available, so we need
  454. // to figure it out.
  455. // TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
  456. // is available.
  457. // Cygwin 1.7 and below doesn't support ::std::wstring.
  458. // Solaris' libc++ doesn't support it either. Android has
  459. // no support for it at least as recent as Froyo (2.2).
  460. # define GTEST_HAS_STD_WSTRING \
  461. (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
  462. #endif // GTEST_HAS_STD_WSTRING
  463. #ifndef GTEST_HAS_GLOBAL_WSTRING
  464. // The user didn't tell us whether ::wstring is available, so we need
  465. // to figure it out.
  466. # define GTEST_HAS_GLOBAL_WSTRING \
  467. (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
  468. #endif // GTEST_HAS_GLOBAL_WSTRING
  469. // Determines whether RTTI is available.
  470. #ifndef GTEST_HAS_RTTI
  471. // The user didn't tell us whether RTTI is enabled, so we need to
  472. // figure it out.
  473. # ifdef _MSC_VER
  474. # ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled.
  475. # define GTEST_HAS_RTTI 1
  476. # else
  477. # define GTEST_HAS_RTTI 0
  478. # endif
  479. // Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
  480. # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
  481. # ifdef __GXX_RTTI
  482. // When building against STLport with the Android NDK and with
  483. // -frtti -fno-exceptions, the build fails at link time with undefined
  484. // references to __cxa_bad_typeid. Note sure if STL or toolchain bug,
  485. // so disable RTTI when detected.
  486. # if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \
  487. !defined(__EXCEPTIONS)
  488. # define GTEST_HAS_RTTI 0
  489. # else
  490. # define GTEST_HAS_RTTI 1
  491. # endif // GTEST_OS_LINUX_ANDROID && __STLPORT_MAJOR && !__EXCEPTIONS
  492. # else
  493. # define GTEST_HAS_RTTI 0
  494. # endif // __GXX_RTTI
  495. // Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends
  496. // using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the
  497. // first version with C++ support.
  498. # elif defined(__clang__)
  499. # define GTEST_HAS_RTTI __has_feature(cxx_rtti)
  500. // Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
  501. // both the typeid and dynamic_cast features are present.
  502. # elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
  503. # ifdef __RTTI_ALL__
  504. # define GTEST_HAS_RTTI 1
  505. # else
  506. # define GTEST_HAS_RTTI 0
  507. # endif
  508. # else
  509. // For all other compilers, we assume RTTI is enabled.
  510. # define GTEST_HAS_RTTI 1
  511. # endif // _MSC_VER
  512. #endif // GTEST_HAS_RTTI
  513. // It's this header's responsibility to #include <typeinfo> when RTTI
  514. // is enabled.
  515. #if GTEST_HAS_RTTI
  516. # include <typeinfo>
  517. #endif
  518. // Determines whether Google Test can use the pthreads library.
  519. #ifndef GTEST_HAS_PTHREAD
  520. // The user didn't tell us explicitly, so we assume pthreads support is
  521. // available on Linux and Mac.
  522. //
  523. // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
  524. // to your compiler flags.
  525. # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \
  526. || GTEST_OS_QNX)
  527. #endif // GTEST_HAS_PTHREAD
  528. #if GTEST_HAS_PTHREAD
  529. // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
  530. // true.
  531. # include <pthread.h> // NOLINT
  532. // For timespec and nanosleep, used below.
  533. # include <time.h> // NOLINT
  534. #endif
  535. // Determines whether Google Test can use tr1/tuple. You can define
  536. // this macro to 0 to prevent Google Test from using tuple (any
  537. // feature depending on tuple with be disabled in this mode).
  538. #ifndef GTEST_HAS_TR1_TUPLE
  539. # if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR)
  540. // STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>.
  541. # define GTEST_HAS_TR1_TUPLE 0
  542. # else
  543. // The user didn't tell us not to do it, so we assume it's OK.
  544. # define GTEST_HAS_TR1_TUPLE 1
  545. # endif
  546. #endif // GTEST_HAS_TR1_TUPLE
  547. // Determines whether Google Test's own tr1 tuple implementation
  548. // should be used.
  549. #ifndef GTEST_USE_OWN_TR1_TUPLE
  550. // The user didn't tell us, so we need to figure it out.
  551. // We use our own TR1 tuple if we aren't sure the user has an
  552. // implementation of it already. At this time, libstdc++ 4.0.0+ and
  553. // MSVC 2010 are the only mainstream standard libraries that come
  554. // with a TR1 tuple implementation. NVIDIA's CUDA NVCC compiler
  555. // pretends to be GCC by defining __GNUC__ and friends, but cannot
  556. // compile GCC's tuple implementation. MSVC 2008 (9.0) provides TR1
  557. // tuple in a 323 MB Feature Pack download, which we cannot assume the
  558. // user has. QNX's QCC compiler is a modified GCC but it doesn't
  559. // support TR1 tuple. libc++ only provides std::tuple, in C++11 mode,
  560. // and it can be used with some compilers that define __GNUC__.
  561. # if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \
  562. && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) || _MSC_VER >= 1600
  563. # define GTEST_ENV_HAS_TR1_TUPLE_ 1
  564. # endif
  565. // C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used
  566. // in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6
  567. // can build with clang but need to use gcc4.2's libstdc++).
  568. # if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325)
  569. # define GTEST_ENV_HAS_STD_TUPLE_ 1
  570. # endif
  571. # if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_
  572. # define GTEST_USE_OWN_TR1_TUPLE 0
  573. # else
  574. # define GTEST_USE_OWN_TR1_TUPLE 1
  575. # endif
  576. #endif // GTEST_USE_OWN_TR1_TUPLE
  577. // To avoid conditional compilation everywhere, we make it
  578. // gtest-port.h's responsibility to #include the header implementing
  579. // tr1/tuple.
  580. #if GTEST_HAS_TR1_TUPLE
  581. # if GTEST_USE_OWN_TR1_TUPLE
  582. // This file was GENERATED by command:
  583. // pump.py gtest-tuple.h.pump
  584. // DO NOT EDIT BY HAND!!!
  585. // Copyright 2009 Google Inc.
  586. // All Rights Reserved.
  587. //
  588. // Redistribution and use in source and binary forms, with or without
  589. // modification, are permitted provided that the following conditions are
  590. // met:
  591. //
  592. // * Redistributions of source code must retain the above copyright
  593. // notice, this list of conditions and the following disclaimer.
  594. // * Redistributions in binary form must reproduce the above
  595. // copyright notice, this list of conditions and the following disclaimer
  596. // in the documentation and/or other materials provided with the
  597. // distribution.
  598. // * Neither the name of Google Inc. nor the names of its
  599. // contributors may be used to endorse or promote products derived from
  600. // this software without specific prior written permission.
  601. //
  602. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  603. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  604. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  605. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  606. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  607. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  608. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  609. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  610. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  611. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  612. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  613. //
  614. // Author: wan@google.com (Zhanyong Wan)
  615. // Implements a subset of TR1 tuple needed by Google Test and Google Mock.
  616. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
  617. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
  618. #include <utility> // For ::std::pair.
  619. // The compiler used in Symbian has a bug that prevents us from declaring the
  620. // tuple template as a friend (it complains that tuple is redefined). This
  621. // hack bypasses the bug by declaring the members that should otherwise be
  622. // private as public.
  623. // Sun Studio versions < 12 also have the above bug.
  624. #if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
  625. # define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
  626. #else
  627. # define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
  628. template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
  629. private:
  630. #endif
  631. // GTEST_n_TUPLE_(T) is the type of an n-tuple.
  632. #define GTEST_0_TUPLE_(T) tuple<>
  633. #define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
  634. void, void, void>
  635. #define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
  636. void, void, void>
  637. #define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
  638. void, void, void>
  639. #define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
  640. void, void, void>
  641. #define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
  642. void, void, void>
  643. #define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
  644. void, void, void>
  645. #define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  646. void, void, void>
  647. #define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  648. T##7, void, void>
  649. #define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  650. T##7, T##8, void>
  651. #define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  652. T##7, T##8, T##9>
  653. // GTEST_n_TYPENAMES_(T) declares a list of n typenames.
  654. #define GTEST_0_TYPENAMES_(T)
  655. #define GTEST_1_TYPENAMES_(T) typename T##0
  656. #define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
  657. #define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
  658. #define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  659. typename T##3
  660. #define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  661. typename T##3, typename T##4
  662. #define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  663. typename T##3, typename T##4, typename T##5
  664. #define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  665. typename T##3, typename T##4, typename T##5, typename T##6
  666. #define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  667. typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
  668. #define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  669. typename T##3, typename T##4, typename T##5, typename T##6, \
  670. typename T##7, typename T##8
  671. #define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  672. typename T##3, typename T##4, typename T##5, typename T##6, \
  673. typename T##7, typename T##8, typename T##9
  674. // In theory, defining stuff in the ::std namespace is undefined
  675. // behavior. We can do this as we are playing the role of a standard
  676. // library vendor.
  677. namespace std {
  678. namespace tr1 {
  679. template <typename T0 = void, typename T1 = void, typename T2 = void,
  680. typename T3 = void, typename T4 = void, typename T5 = void,
  681. typename T6 = void, typename T7 = void, typename T8 = void,
  682. typename T9 = void>
  683. class tuple;
  684. // Anything in namespace gtest_internal is Google Test's INTERNAL
  685. // IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
  686. namespace gtest_internal {
  687. // ByRef<T>::type is T if T is a reference; otherwise it's const T&.
  688. template <typename T>
  689. struct ByRef { typedef const T& type; }; // NOLINT
  690. template <typename T>
  691. struct ByRef<T&> { typedef T& type; }; // NOLINT
  692. // A handy wrapper for ByRef.
  693. #define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
  694. // AddRef<T>::type is T if T is a reference; otherwise it's T&. This
  695. // is the same as tr1::add_reference<T>::type.
  696. template <typename T>
  697. struct AddRef { typedef T& type; }; // NOLINT
  698. template <typename T>
  699. struct AddRef<T&> { typedef T& type; }; // NOLINT
  700. // A handy wrapper for AddRef.
  701. #define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
  702. // A helper for implementing get<k>().
  703. template <int k> class Get;
  704. // A helper for implementing tuple_element<k, T>. kIndexValid is true
  705. // iff k < the number of fields in tuple type T.
  706. template <bool kIndexValid, int kIndex, class Tuple>
  707. struct TupleElement;
  708. template <GTEST_10_TYPENAMES_(T)>
  709. struct TupleElement<true, 0, GTEST_10_TUPLE_(T) > {
  710. typedef T0 type;
  711. };
  712. template <GTEST_10_TYPENAMES_(T)>
  713. struct TupleElement<true, 1, GTEST_10_TUPLE_(T) > {
  714. typedef T1 type;
  715. };
  716. template <GTEST_10_TYPENAMES_(T)>
  717. struct TupleElement<true, 2, GTEST_10_TUPLE_(T) > {
  718. typedef T2 type;
  719. };
  720. template <GTEST_10_TYPENAMES_(T)>
  721. struct TupleElement<true, 3, GTEST_10_TUPLE_(T) > {
  722. typedef T3 type;
  723. };
  724. template <GTEST_10_TYPENAMES_(T)>
  725. struct TupleElement<true, 4, GTEST_10_TUPLE_(T) > {
  726. typedef T4 type;
  727. };
  728. template <GTEST_10_TYPENAMES_(T)>
  729. struct TupleElement<true, 5, GTEST_10_TUPLE_(T) > {
  730. typedef T5 type;
  731. };
  732. template <GTEST_10_TYPENAMES_(T)>
  733. struct TupleElement<true, 6, GTEST_10_TUPLE_(T) > {
  734. typedef T6 type;
  735. };
  736. template <GTEST_10_TYPENAMES_(T)>
  737. struct TupleElement<true, 7, GTEST_10_TUPLE_(T) > {
  738. typedef T7 type;
  739. };
  740. template <GTEST_10_TYPENAMES_(T)>
  741. struct TupleElement<true, 8, GTEST_10_TUPLE_(T) > {
  742. typedef T8 type;
  743. };
  744. template <GTEST_10_TYPENAMES_(T)>
  745. struct TupleElement<true, 9, GTEST_10_TUPLE_(T) > {
  746. typedef T9 type;
  747. };
  748. } // namespace gtest_internal
  749. template <>
  750. class tuple<> {
  751. public:
  752. tuple() {}
  753. tuple(const tuple& /* t */) {}
  754. tuple& operator=(const tuple& /* t */) { return *this; }
  755. };
  756. template <GTEST_1_TYPENAMES_(T)>
  757. class GTEST_1_TUPLE_(T) {
  758. public:
  759. template <int k> friend class gtest_internal::Get;
  760. tuple() : f0_() {}
  761. explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
  762. tuple(const tuple& t) : f0_(t.f0_) {}
  763. template <GTEST_1_TYPENAMES_(U)>
  764. tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
  765. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  766. template <GTEST_1_TYPENAMES_(U)>
  767. tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
  768. return CopyFrom(t);
  769. }
  770. GTEST_DECLARE_TUPLE_AS_FRIEND_
  771. template <GTEST_1_TYPENAMES_(U)>
  772. tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
  773. f0_ = t.f0_;
  774. return *this;
  775. }
  776. T0 f0_;
  777. };
  778. template <GTEST_2_TYPENAMES_(T)>
  779. class GTEST_2_TUPLE_(T) {
  780. public:
  781. template <int k> friend class gtest_internal::Get;
  782. tuple() : f0_(), f1_() {}
  783. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
  784. f1_(f1) {}
  785. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
  786. template <GTEST_2_TYPENAMES_(U)>
  787. tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
  788. template <typename U0, typename U1>
  789. tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
  790. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  791. template <GTEST_2_TYPENAMES_(U)>
  792. tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
  793. return CopyFrom(t);
  794. }
  795. template <typename U0, typename U1>
  796. tuple& operator=(const ::std::pair<U0, U1>& p) {
  797. f0_ = p.first;
  798. f1_ = p.second;
  799. return *this;
  800. }
  801. GTEST_DECLARE_TUPLE_AS_FRIEND_
  802. template <GTEST_2_TYPENAMES_(U)>
  803. tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
  804. f0_ = t.f0_;
  805. f1_ = t.f1_;
  806. return *this;
  807. }
  808. T0 f0_;
  809. T1 f1_;
  810. };
  811. template <GTEST_3_TYPENAMES_(T)>
  812. class GTEST_3_TUPLE_(T) {
  813. public:
  814. template <int k> friend class gtest_internal::Get;
  815. tuple() : f0_(), f1_(), f2_() {}
  816. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  817. GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
  818. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
  819. template <GTEST_3_TYPENAMES_(U)>
  820. tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
  821. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  822. template <GTEST_3_TYPENAMES_(U)>
  823. tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
  824. return CopyFrom(t);
  825. }
  826. GTEST_DECLARE_TUPLE_AS_FRIEND_
  827. template <GTEST_3_TYPENAMES_(U)>
  828. tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
  829. f0_ = t.f0_;
  830. f1_ = t.f1_;
  831. f2_ = t.f2_;
  832. return *this;
  833. }
  834. T0 f0_;
  835. T1 f1_;
  836. T2 f2_;
  837. };
  838. template <GTEST_4_TYPENAMES_(T)>
  839. class GTEST_4_TUPLE_(T) {
  840. public:
  841. template <int k> friend class gtest_internal::Get;
  842. tuple() : f0_(), f1_(), f2_(), f3_() {}
  843. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  844. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
  845. f3_(f3) {}
  846. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
  847. template <GTEST_4_TYPENAMES_(U)>
  848. tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  849. f3_(t.f3_) {}
  850. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  851. template <GTEST_4_TYPENAMES_(U)>
  852. tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
  853. return CopyFrom(t);
  854. }
  855. GTEST_DECLARE_TUPLE_AS_FRIEND_
  856. template <GTEST_4_TYPENAMES_(U)>
  857. tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
  858. f0_ = t.f0_;
  859. f1_ = t.f1_;
  860. f2_ = t.f2_;
  861. f3_ = t.f3_;
  862. return *this;
  863. }
  864. T0 f0_;
  865. T1 f1_;
  866. T2 f2_;
  867. T3 f3_;
  868. };
  869. template <GTEST_5_TYPENAMES_(T)>
  870. class GTEST_5_TUPLE_(T) {
  871. public:
  872. template <int k> friend class gtest_internal::Get;
  873. tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
  874. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  875. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
  876. GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
  877. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  878. f4_(t.f4_) {}
  879. template <GTEST_5_TYPENAMES_(U)>
  880. tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  881. f3_(t.f3_), f4_(t.f4_) {}
  882. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  883. template <GTEST_5_TYPENAMES_(U)>
  884. tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
  885. return CopyFrom(t);
  886. }
  887. GTEST_DECLARE_TUPLE_AS_FRIEND_
  888. template <GTEST_5_TYPENAMES_(U)>
  889. tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
  890. f0_ = t.f0_;
  891. f1_ = t.f1_;
  892. f2_ = t.f2_;
  893. f3_ = t.f3_;
  894. f4_ = t.f4_;
  895. return *this;
  896. }
  897. T0 f0_;
  898. T1 f1_;
  899. T2 f2_;
  900. T3 f3_;
  901. T4 f4_;
  902. };
  903. template <GTEST_6_TYPENAMES_(T)>
  904. class GTEST_6_TUPLE_(T) {
  905. public:
  906. template <int k> friend class gtest_internal::Get;
  907. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
  908. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  909. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  910. GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
  911. f5_(f5) {}
  912. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  913. f4_(t.f4_), f5_(t.f5_) {}
  914. template <GTEST_6_TYPENAMES_(U)>
  915. tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  916. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
  917. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  918. template <GTEST_6_TYPENAMES_(U)>
  919. tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
  920. return CopyFrom(t);
  921. }
  922. GTEST_DECLARE_TUPLE_AS_FRIEND_
  923. template <GTEST_6_TYPENAMES_(U)>
  924. tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
  925. f0_ = t.f0_;
  926. f1_ = t.f1_;
  927. f2_ = t.f2_;
  928. f3_ = t.f3_;
  929. f4_ = t.f4_;
  930. f5_ = t.f5_;
  931. return *this;
  932. }
  933. T0 f0_;
  934. T1 f1_;
  935. T2 f2_;
  936. T3 f3_;
  937. T4 f4_;
  938. T5 f5_;
  939. };
  940. template <GTEST_7_TYPENAMES_(T)>
  941. class GTEST_7_TUPLE_(T) {
  942. public:
  943. template <int k> friend class gtest_internal::Get;
  944. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
  945. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  946. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  947. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
  948. f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
  949. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  950. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
  951. template <GTEST_7_TYPENAMES_(U)>
  952. tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  953. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
  954. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  955. template <GTEST_7_TYPENAMES_(U)>
  956. tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
  957. return CopyFrom(t);
  958. }
  959. GTEST_DECLARE_TUPLE_AS_FRIEND_
  960. template <GTEST_7_TYPENAMES_(U)>
  961. tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
  962. f0_ = t.f0_;
  963. f1_ = t.f1_;
  964. f2_ = t.f2_;
  965. f3_ = t.f3_;
  966. f4_ = t.f4_;
  967. f5_ = t.f5_;
  968. f6_ = t.f6_;
  969. return *this;
  970. }
  971. T0 f0_;
  972. T1 f1_;
  973. T2 f2_;
  974. T3 f3_;
  975. T4 f4_;
  976. T5 f5_;
  977. T6 f6_;
  978. };
  979. template <GTEST_8_TYPENAMES_(T)>
  980. class GTEST_8_TUPLE_(T) {
  981. public:
  982. template <int k> friend class gtest_internal::Get;
  983. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
  984. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  985. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  986. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
  987. GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
  988. f5_(f5), f6_(f6), f7_(f7) {}
  989. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  990. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
  991. template <GTEST_8_TYPENAMES_(U)>
  992. tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  993. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
  994. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  995. template <GTEST_8_TYPENAMES_(U)>
  996. tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
  997. return CopyFrom(t);
  998. }
  999. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1000. template <GTEST_8_TYPENAMES_(U)>
  1001. tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
  1002. f0_ = t.f0_;
  1003. f1_ = t.f1_;
  1004. f2_ = t.f2_;
  1005. f3_ = t.f3_;
  1006. f4_ = t.f4_;
  1007. f5_ = t.f5_;
  1008. f6_ = t.f6_;
  1009. f7_ = t.f7_;
  1010. return *this;
  1011. }
  1012. T0 f0_;
  1013. T1 f1_;
  1014. T2 f2_;
  1015. T3 f3_;
  1016. T4 f4_;
  1017. T5 f5_;
  1018. T6 f6_;
  1019. T7 f7_;
  1020. };
  1021. template <GTEST_9_TYPENAMES_(T)>
  1022. class GTEST_9_TUPLE_(T) {
  1023. public:
  1024. template <int k> friend class gtest_internal::Get;
  1025. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
  1026. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  1027. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  1028. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
  1029. GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
  1030. f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
  1031. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  1032. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
  1033. template <GTEST_9_TYPENAMES_(U)>
  1034. tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  1035. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
  1036. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1037. template <GTEST_9_TYPENAMES_(U)>
  1038. tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
  1039. return CopyFrom(t);
  1040. }
  1041. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1042. template <GTEST_9_TYPENAMES_(U)>
  1043. tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
  1044. f0_ = t.f0_;
  1045. f1_ = t.f1_;
  1046. f2_ = t.f2_;
  1047. f3_ = t.f3_;
  1048. f4_ = t.f4_;
  1049. f5_ = t.f5_;
  1050. f6_ = t.f6_;
  1051. f7_ = t.f7_;
  1052. f8_ = t.f8_;
  1053. return *this;
  1054. }
  1055. T0 f0_;
  1056. T1 f1_;
  1057. T2 f2_;
  1058. T3 f3_;
  1059. T4 f4_;
  1060. T5 f5_;
  1061. T6 f6_;
  1062. T7 f7_;
  1063. T8 f8_;
  1064. };
  1065. template <GTEST_10_TYPENAMES_(T)>
  1066. class tuple {
  1067. public:
  1068. template <int k> friend class gtest_internal::Get;
  1069. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
  1070. f9_() {}
  1071. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  1072. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  1073. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
  1074. GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
  1075. f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
  1076. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  1077. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
  1078. template <GTEST_10_TYPENAMES_(U)>
  1079. tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  1080. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
  1081. f9_(t.f9_) {}
  1082. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1083. template <GTEST_10_TYPENAMES_(U)>
  1084. tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
  1085. return CopyFrom(t);
  1086. }
  1087. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1088. template <GTEST_10_TYPENAMES_(U)>
  1089. tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
  1090. f0_ = t.f0_;
  1091. f1_ = t.f1_;
  1092. f2_ = t.f2_;
  1093. f3_ = t.f3_;
  1094. f4_ = t.f4_;
  1095. f5_ = t.f5_;
  1096. f6_ = t.f6_;
  1097. f7_ = t.f7_;
  1098. f8_ = t.f8_;
  1099. f9_ = t.f9_;
  1100. return *this;
  1101. }
  1102. T0 f0_;
  1103. T1 f1_;
  1104. T2 f2_;
  1105. T3 f3_;
  1106. T4 f4_;
  1107. T5 f5_;
  1108. T6 f6_;
  1109. T7 f7_;
  1110. T8 f8_;
  1111. T9 f9_;
  1112. };
  1113. // 6.1.3.2 Tuple creation functions.
  1114. // Known limitations: we don't support passing an
  1115. // std::tr1::reference_wrapper<T> to make_tuple(). And we don't
  1116. // implement tie().
  1117. inline tuple<> make_tuple() { return tuple<>(); }
  1118. template <GTEST_1_TYPENAMES_(T)>
  1119. inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
  1120. return GTEST_1_TUPLE_(T)(f0);
  1121. }
  1122. template <GTEST_2_TYPENAMES_(T)>
  1123. inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
  1124. return GTEST_2_TUPLE_(T)(f0, f1);
  1125. }
  1126. template <GTEST_3_TYPENAMES_(T)>
  1127. inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
  1128. return GTEST_3_TUPLE_(T)(f0, f1, f2);
  1129. }
  1130. template <GTEST_4_TYPENAMES_(T)>
  1131. inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1132. const T3& f3) {
  1133. return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
  1134. }
  1135. template <GTEST_5_TYPENAMES_(T)>
  1136. inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1137. const T3& f3, const T4& f4) {
  1138. return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
  1139. }
  1140. template <GTEST_6_TYPENAMES_(T)>
  1141. inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1142. const T3& f3, const T4& f4, const T5& f5) {
  1143. return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
  1144. }
  1145. template <GTEST_7_TYPENAMES_(T)>
  1146. inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1147. const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
  1148. return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
  1149. }
  1150. template <GTEST_8_TYPENAMES_(T)>
  1151. inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1152. const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
  1153. return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
  1154. }
  1155. template <GTEST_9_TYPENAMES_(T)>
  1156. inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1157. const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
  1158. const T8& f8) {
  1159. return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
  1160. }
  1161. template <GTEST_10_TYPENAMES_(T)>
  1162. inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1163. const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
  1164. const T8& f8, const T9& f9) {
  1165. return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
  1166. }
  1167. // 6.1.3.3 Tuple helper classes.
  1168. template <typename Tuple> struct tuple_size;
  1169. template <GTEST_0_TYPENAMES_(T)>
  1170. struct tuple_size<GTEST_0_TUPLE_(T) > {
  1171. static const int value = 0;
  1172. };
  1173. template <GTEST_1_TYPENAMES_(T)>
  1174. struct tuple_size<GTEST_1_TUPLE_(T) > {
  1175. static const int value = 1;
  1176. };
  1177. template <GTEST_2_TYPENAMES_(T)>
  1178. struct tuple_size<GTEST_2_TUPLE_(T) > {
  1179. static const int value = 2;
  1180. };
  1181. template <GTEST_3_TYPENAMES_(T)>
  1182. struct tuple_size<GTEST_3_TUPLE_(T) > {
  1183. static const int value = 3;
  1184. };
  1185. template <GTEST_4_TYPENAMES_(T)>
  1186. struct tuple_size<GTEST_4_TUPLE_(T) > {
  1187. static const int value = 4;
  1188. };
  1189. template <GTEST_5_TYPENAMES_(T)>
  1190. struct tuple_size<GTEST_5_TUPLE_(T) > {
  1191. static const int value = 5;
  1192. };
  1193. template <GTEST_6_TYPENAMES_(T)>
  1194. struct tuple_size<GTEST_6_TUPLE_(T) > {
  1195. static const int value = 6;
  1196. };
  1197. template <GTEST_7_TYPENAMES_(T)>
  1198. struct tuple_size<GTEST_7_TUPLE_(T) > {
  1199. static const int value = 7;
  1200. };
  1201. template <GTEST_8_TYPENAMES_(T)>
  1202. struct tuple_size<GTEST_8_TUPLE_(T) > {
  1203. static const int value = 8;
  1204. };
  1205. template <GTEST_9_TYPENAMES_(T)>
  1206. struct tuple_size<GTEST_9_TUPLE_(T) > {
  1207. static const int value = 9;
  1208. };
  1209. template <GTEST_10_TYPENAMES_(T)>
  1210. struct tuple_size<GTEST_10_TUPLE_(T) > {
  1211. static const int value = 10;
  1212. };
  1213. template <int k, class Tuple>
  1214. struct tuple_element {
  1215. typedef typename gtest_internal::TupleElement<
  1216. k < (tuple_size<Tuple>::value), k, Tuple>::type type;
  1217. };
  1218. #define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
  1219. // 6.1.3.4 Element access.
  1220. namespace gtest_internal {
  1221. template <>
  1222. class Get<0> {
  1223. public:
  1224. template <class Tuple>
  1225. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
  1226. Field(Tuple& t) { return t.f0_; } // NOLINT
  1227. template <class Tuple>
  1228. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
  1229. ConstField(const Tuple& t) { return t.f0_; }
  1230. };
  1231. template <>
  1232. class Get<1> {
  1233. public:
  1234. template <class Tuple>
  1235. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
  1236. Field(Tuple& t) { return t.f1_; } // NOLINT
  1237. template <class Tuple>
  1238. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
  1239. ConstField(const Tuple& t) { return t.f1_; }
  1240. };
  1241. template <>
  1242. class Get<2> {
  1243. public:
  1244. template <class Tuple>
  1245. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
  1246. Field(Tuple& t) { return t.f2_; } // NOLINT
  1247. template <class Tuple>
  1248. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
  1249. ConstField(const Tuple& t) { return t.f2_; }
  1250. };
  1251. template <>
  1252. class Get<3> {
  1253. public:
  1254. template <class Tuple>
  1255. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
  1256. Field(Tuple& t) { return t.f3_; } // NOLINT
  1257. template <class Tuple>
  1258. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
  1259. ConstField(const Tuple& t) { return t.f3_; }
  1260. };
  1261. template <>
  1262. class Get<4> {
  1263. public:
  1264. template <class Tuple>
  1265. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
  1266. Field(Tuple& t) { return t.f4_; } // NOLINT
  1267. template <class Tuple>
  1268. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
  1269. ConstField(const Tuple& t) { return t.f4_; }
  1270. };
  1271. template <>
  1272. class Get<5> {
  1273. public:
  1274. template <class Tuple>
  1275. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
  1276. Field(Tuple& t) { return t.f5_; } // NOLINT
  1277. template <class Tuple>
  1278. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
  1279. ConstField(const Tuple& t) { return t.f5_; }
  1280. };
  1281. template <>
  1282. class Get<6> {
  1283. public:
  1284. template <class Tuple>
  1285. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
  1286. Field(Tuple& t) { return t.f6_; } // NOLINT
  1287. template <class Tuple>
  1288. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
  1289. ConstField(const Tuple& t) { return t.f6_; }
  1290. };
  1291. template <>
  1292. class Get<7> {
  1293. public:
  1294. template <class Tuple>
  1295. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
  1296. Field(Tuple& t) { return t.f7_; } // NOLINT
  1297. template <class Tuple>
  1298. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
  1299. ConstField(const Tuple& t) { return t.f7_; }
  1300. };
  1301. template <>
  1302. class Get<8> {
  1303. public:
  1304. template <class Tuple>
  1305. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
  1306. Field(Tuple& t) { return t.f8_; } // NOLINT
  1307. template <class Tuple>
  1308. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
  1309. ConstField(const Tuple& t) { return t.f8_; }
  1310. };
  1311. template <>
  1312. class Get<9> {
  1313. public:
  1314. template <class Tuple>
  1315. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
  1316. Field(Tuple& t) { return t.f9_; } // NOLINT
  1317. template <class Tuple>
  1318. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
  1319. ConstField(const Tuple& t) { return t.f9_; }
  1320. };
  1321. } // namespace gtest_internal
  1322. template <int k, GTEST_10_TYPENAMES_(T)>
  1323. GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
  1324. get(GTEST_10_TUPLE_(T)& t) {
  1325. return gtest_internal::Get<k>::Field(t);
  1326. }
  1327. template <int k, GTEST_10_TYPENAMES_(T)>
  1328. GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
  1329. get(const GTEST_10_TUPLE_(T)& t) {
  1330. return gtest_internal::Get<k>::ConstField(t);
  1331. }
  1332. // 6.1.3.5 Relational operators
  1333. // We only implement == and !=, as we don't have a need for the rest yet.
  1334. namespace gtest_internal {
  1335. // SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
  1336. // first k fields of t1 equals the first k fields of t2.
  1337. // SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
  1338. // k1 != k2.
  1339. template <int kSize1, int kSize2>
  1340. struct SameSizeTuplePrefixComparator;
  1341. template <>
  1342. struct SameSizeTuplePrefixComparator<0, 0> {
  1343. template <class Tuple1, class Tuple2>
  1344. static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
  1345. return true;
  1346. }
  1347. };
  1348. template <int k>
  1349. struct SameSizeTuplePrefixComparator<k, k> {
  1350. template <class Tuple1, class Tuple2>
  1351. static bool Eq(const Tuple1& t1, const Tuple2& t2) {
  1352. return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
  1353. ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
  1354. }
  1355. };
  1356. } // namespace gtest_internal
  1357. template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
  1358. inline bool operator==(const GTEST_10_TUPLE_(T)& t,
  1359. const GTEST_10_TUPLE_(U)& u) {
  1360. return gtest_internal::SameSizeTuplePrefixComparator<
  1361. tuple_size<GTEST_10_TUPLE_(T) >::value,
  1362. tuple_size<GTEST_10_TUPLE_(U) >::value>::Eq(t, u);
  1363. }
  1364. template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
  1365. inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
  1366. const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
  1367. // 6.1.4 Pairs.
  1368. // Unimplemented.
  1369. } // namespace tr1
  1370. } // namespace std
  1371. #undef GTEST_0_TUPLE_
  1372. #undef GTEST_1_TUPLE_
  1373. #undef GTEST_2_TUPLE_
  1374. #undef GTEST_3_TUPLE_
  1375. #undef GTEST_4_TUPLE_
  1376. #undef GTEST_5_TUPLE_
  1377. #undef GTEST_6_TUPLE_
  1378. #undef GTEST_7_TUPLE_
  1379. #undef GTEST_8_TUPLE_
  1380. #undef GTEST_9_TUPLE_
  1381. #undef GTEST_10_TUPLE_
  1382. #undef GTEST_0_TYPENAMES_
  1383. #undef GTEST_1_TYPENAMES_
  1384. #undef GTEST_2_TYPENAMES_
  1385. #undef GTEST_3_TYPENAMES_
  1386. #undef GTEST_4_TYPENAMES_
  1387. #undef GTEST_5_TYPENAMES_
  1388. #undef GTEST_6_TYPENAMES_
  1389. #undef GTEST_7_TYPENAMES_
  1390. #undef GTEST_8_TYPENAMES_
  1391. #undef GTEST_9_TYPENAMES_
  1392. #undef GTEST_10_TYPENAMES_
  1393. #undef GTEST_DECLARE_TUPLE_AS_FRIEND_
  1394. #undef GTEST_BY_REF_
  1395. #undef GTEST_ADD_REF_
  1396. #undef GTEST_TUPLE_ELEMENT_
  1397. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
  1398. # elif GTEST_ENV_HAS_STD_TUPLE_
  1399. # include <tuple>
  1400. // C++11 puts its tuple into the ::std namespace rather than
  1401. // ::std::tr1. gtest expects tuple to live in ::std::tr1, so put it there.
  1402. // This causes undefined behavior, but supported compilers react in
  1403. // the way we intend.
  1404. namespace std {
  1405. namespace tr1 {
  1406. using ::std::get;
  1407. using ::std::make_tuple;
  1408. using ::std::tuple;
  1409. using ::std::tuple_element;
  1410. using ::std::tuple_size;
  1411. }
  1412. }
  1413. # elif GTEST_OS_SYMBIAN
  1414. // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
  1415. // use STLport's tuple implementation, which unfortunately doesn't
  1416. // work as the copy of STLport distributed with Symbian is incomplete.
  1417. // By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
  1418. // use its own tuple implementation.
  1419. # ifdef BOOST_HAS_TR1_TUPLE
  1420. # undef BOOST_HAS_TR1_TUPLE
  1421. # endif // BOOST_HAS_TR1_TUPLE
  1422. // This prevents <boost/tr1/detail/config.hpp>, which defines
  1423. // BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
  1424. # define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
  1425. # include <tuple>
  1426. # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
  1427. // GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header. This does
  1428. // not conform to the TR1 spec, which requires the header to be <tuple>.
  1429. # if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
  1430. // Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
  1431. // which is #included by <tr1/tuple>, to not compile when RTTI is
  1432. // disabled. _TR1_FUNCTIONAL is the header guard for
  1433. // <tr1/functional>. Hence the following #define is a hack to prevent
  1434. // <tr1/functional> from being included.
  1435. # define _TR1_FUNCTIONAL 1
  1436. # include <tr1/tuple>
  1437. # undef _TR1_FUNCTIONAL // Allows the user to #include
  1438. // <tr1/functional> if he chooses to.
  1439. # else
  1440. # include <tr1/tuple> // NOLINT
  1441. # endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
  1442. # else
  1443. // If the compiler is not GCC 4.0+, we assume the user is using a
  1444. // spec-conforming TR1 implementation.
  1445. # include <tuple> // NOLINT
  1446. # endif // GTEST_USE_OWN_TR1_TUPLE
  1447. #endif // GTEST_HAS_TR1_TUPLE
  1448. // Determines whether clone(2) is supported.
  1449. // Usually it will only be available on Linux, excluding
  1450. // Linux on the Itanium architecture.
  1451. // Also see http://linux.die.net/man/2/clone.
  1452. #ifndef GTEST_HAS_CLONE
  1453. // The user didn't tell us, so we need to figure it out.
  1454. # if GTEST_OS_LINUX && !defined(__ia64__)
  1455. # if GTEST_OS_LINUX_ANDROID
  1456. // On Android, clone() is only available on ARM starting with Gingerbread.
  1457. # if defined(__arm__) && __ANDROID_API__ >= 9
  1458. # define GTEST_HAS_CLONE 1
  1459. # else
  1460. # define GTEST_HAS_CLONE 0
  1461. # endif
  1462. # else
  1463. # define GTEST_HAS_CLONE 1
  1464. # endif
  1465. # else
  1466. # define GTEST_HAS_CLONE 0
  1467. # endif // GTEST_OS_LINUX && !defined(__ia64__)
  1468. #endif // GTEST_HAS_CLONE
  1469. // Determines whether to support stream redirection. This is used to test
  1470. // output correctness and to implement death tests.
  1471. #ifndef GTEST_HAS_STREAM_REDIRECTION
  1472. // By default, we assume that stream redirection is supported on all
  1473. // platforms except known mobile ones.
  1474. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN
  1475. # define GTEST_HAS_STREAM_REDIRECTION 0
  1476. # else
  1477. # define GTEST_HAS_STREAM_REDIRECTION 1
  1478. # endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
  1479. #endif // GTEST_HAS_STREAM_REDIRECTION
  1480. // Determines whether to support death tests.
  1481. // Google Test does not support death tests for VC 7.1 and earlier as
  1482. // abort() in a VC 7.1 application compiled as GUI in debug config
  1483. // pops up a dialog window that cannot be suppressed programmatically.
  1484. #if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
  1485. (GTEST_OS_MAC && !GTEST_OS_IOS) || GTEST_OS_IOS_SIMULATOR || \
  1486. (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
  1487. GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
  1488. GTEST_OS_OPENBSD || GTEST_OS_QNX)
  1489. # define GTEST_HAS_DEATH_TEST 1
  1490. # include <vector> // NOLINT
  1491. #endif
  1492. // We don't support MSVC 7.1 with exceptions disabled now. Therefore
  1493. // all the compilers we care about are adequate for supporting
  1494. // value-parameterized tests.
  1495. #define GTEST_HAS_PARAM_TEST 1
  1496. // Determines whether to support type-driven tests.
  1497. // Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
  1498. // Sun Pro CC, IBM Visual Age, and HP aCC support.
  1499. #if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
  1500. defined(__IBMCPP__) || defined(__HP_aCC)
  1501. # define GTEST_HAS_TYPED_TEST 1
  1502. # define GTEST_HAS_TYPED_TEST_P 1
  1503. #endif
  1504. // Determines whether to support Combine(). This only makes sense when
  1505. // value-parameterized tests are enabled. The implementation doesn't
  1506. // work on Sun Studio since it doesn't understand templated conversion
  1507. // operators.
  1508. #if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)
  1509. # define GTEST_HAS_COMBINE 1
  1510. #endif
  1511. // Determines whether the system compiler uses UTF-16 for encoding wide strings.
  1512. #define GTEST_WIDE_STRING_USES_UTF16_ \
  1513. (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
  1514. // Determines whether test results can be streamed to a socket.
  1515. #if GTEST_OS_LINUX
  1516. # define GTEST_CAN_STREAM_RESULTS_ 1
  1517. #endif
  1518. // Defines some utility macros.
  1519. // The GNU compiler emits a warning if nested "if" statements are followed by
  1520. // an "else" statement and braces are not used to explicitly disambiguate the
  1521. // "else" binding. This leads to problems with code like:
  1522. //
  1523. // if (gate)
  1524. // ASSERT_*(condition) << "Some message";
  1525. //
  1526. // The "switch (0) case 0:" idiom is used to suppress this.
  1527. #ifdef __INTEL_COMPILER
  1528. # define GTEST_AMBIGUOUS_ELSE_BLOCKER_
  1529. #else
  1530. # define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default: // NOLINT
  1531. #endif
  1532. // Use this annotation at the end of a struct/class definition to
  1533. // prevent the compiler from optimizing away instances that are never
  1534. // used. This is useful when all interesting logic happens inside the
  1535. // c'tor and / or d'tor. Example:
  1536. //
  1537. // struct Foo {
  1538. // Foo() { ... }
  1539. // } GTEST_ATTRIBUTE_UNUSED_;
  1540. //
  1541. // Also use it after a variable or parameter declaration to tell the
  1542. // compiler the variable/parameter does not have to be used.
  1543. #if defined(__GNUC__) && !defined(COMPILER_ICC)
  1544. # define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
  1545. #else
  1546. # define GTEST_ATTRIBUTE_UNUSED_
  1547. #endif
  1548. // A macro to disallow operator=
  1549. // This should be used in the private: declarations for a class.
  1550. #define GTEST_DISALLOW_ASSIGN_(type)\
  1551. void operator=(type const &)
  1552. // A macro to disallow copy constructor and operator=
  1553. // This should be used in the private: declarations for a class.
  1554. #define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
  1555. type(type const &);\
  1556. GTEST_DISALLOW_ASSIGN_(type)
  1557. // Tell the compiler to warn about unused return values for functions declared
  1558. // with this macro. The macro should be used on function declarations
  1559. // following the argument list:
  1560. //
  1561. // Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
  1562. #if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
  1563. # define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
  1564. #else
  1565. # define GTEST_MUST_USE_RESULT_
  1566. #endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
  1567. // Determine whether the compiler supports Microsoft's Structured Exception
  1568. // Handling. This is supported by several Windows compilers but generally
  1569. // does not exist on any other system.
  1570. #ifndef GTEST_HAS_SEH
  1571. // The user didn't tell us, so we need to figure it out.
  1572. # if defined(_MSC_VER) || defined(__BORLANDC__)
  1573. // These two compilers are known to support SEH.
  1574. # define GTEST_HAS_SEH 1
  1575. # else
  1576. // Assume no SEH.
  1577. # define GTEST_HAS_SEH 0
  1578. # endif
  1579. #endif // GTEST_HAS_SEH
  1580. #ifdef _MSC_VER
  1581. # if GTEST_LINKED_AS_SHARED_LIBRARY
  1582. # define GTEST_API_ __declspec(dllimport)
  1583. # elif GTEST_CREATE_SHARED_LIBRARY
  1584. # define GTEST_API_ __declspec(dllexport)
  1585. # endif
  1586. #endif // _MSC_VER
  1587. #ifndef GTEST_API_
  1588. # define GTEST_API_
  1589. #endif
  1590. #ifdef __GNUC__
  1591. // Ask the compiler to never inline a given function.
  1592. # define GTEST_NO_INLINE_ __attribute__((noinline))
  1593. #else
  1594. # define GTEST_NO_INLINE_
  1595. #endif
  1596. // _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.
  1597. #if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION)
  1598. # define GTEST_HAS_CXXABI_H_ 1
  1599. #else
  1600. # define GTEST_HAS_CXXABI_H_ 0
  1601. #endif
  1602. namespace testing {
  1603. class Message;
  1604. namespace internal {
  1605. // A secret type that Google Test users don't know about. It has no
  1606. // definition on purpose. Therefore it's impossible to create a
  1607. // Secret object, which is what we want.
  1608. class Secret;
  1609. // The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
  1610. // expression is true. For example, you could use it to verify the
  1611. // size of a static array:
  1612. //
  1613. // GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,
  1614. // content_type_names_incorrect_size);
  1615. //
  1616. // or to make sure a struct is smaller than a certain size:
  1617. //
  1618. // GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
  1619. //
  1620. // The second argument to the macro is the name of the variable. If
  1621. // the expression is false, most compilers will issue a warning/error
  1622. // containing the name of the variable.
  1623. template <bool>
  1624. struct CompileAssert {
  1625. };
  1626. #define GTEST_COMPILE_ASSERT_(expr, msg) \
  1627. typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \
  1628. msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_
  1629. // Implementation details of GTEST_COMPILE_ASSERT_:
  1630. //
  1631. // - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
  1632. // elements (and thus is invalid) when the expression is false.
  1633. //
  1634. // - The simpler definition
  1635. //
  1636. // #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
  1637. //
  1638. // does not work, as gcc supports variable-length arrays whose sizes
  1639. // are determined at run-time (this is gcc's extension and not part
  1640. // of the C++ standard). As a result, gcc fails to reject the
  1641. // following code with the simple definition:
  1642. //
  1643. // int foo;
  1644. // GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
  1645. // // not a compile-time constant.
  1646. //
  1647. // - By using the type CompileAssert<(bool(expr))>, we ensures that
  1648. // expr is a compile-time constant. (Template arguments must be
  1649. // determined at compile-time.)
  1650. //
  1651. // - The outter parentheses in CompileAssert<(bool(expr))> are necessary
  1652. // to work around a bug in gcc 3.4.4 and 4.0.1. If we had written
  1653. //
  1654. // CompileAssert<bool(expr)>
  1655. //
  1656. // instead, these compilers will refuse to compile
  1657. //
  1658. // GTEST_COMPILE_ASSERT_(5 > 0, some_message);
  1659. //
  1660. // (They seem to think the ">" in "5 > 0" marks the end of the
  1661. // template argument list.)
  1662. //
  1663. // - The array size is (bool(expr) ? 1 : -1), instead of simply
  1664. //
  1665. // ((expr) ? 1 : -1).
  1666. //
  1667. // This is to avoid running into a bug in MS VC 7.1, which
  1668. // causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
  1669. // StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
  1670. //
  1671. // This template is declared, but intentionally undefined.
  1672. template <typename T1, typename T2>
  1673. struct StaticAssertTypeEqHelper;
  1674. template <typename T>
  1675. struct StaticAssertTypeEqHelper<T, T> {};
  1676. #if GTEST_HAS_GLOBAL_STRING
  1677. typedef ::string string;
  1678. #else
  1679. typedef ::std::string string;
  1680. #endif // GTEST_HAS_GLOBAL_STRING
  1681. #if GTEST_HAS_GLOBAL_WSTRING
  1682. typedef ::wstring wstring;
  1683. #elif GTEST_HAS_STD_WSTRING
  1684. typedef ::std::wstring wstring;
  1685. #endif // GTEST_HAS_GLOBAL_WSTRING
  1686. // A helper for suppressing warnings on constant condition. It just
  1687. // returns 'condition'.
  1688. GTEST_API_ bool IsTrue(bool condition);
  1689. // Defines scoped_ptr.
  1690. // This implementation of scoped_ptr is PARTIAL - it only contains
  1691. // enough stuff to satisfy Google Test's need.
  1692. template <typename T>
  1693. class scoped_ptr {
  1694. public:
  1695. typedef T element_type;
  1696. explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
  1697. ~scoped_ptr() { reset(); }
  1698. T& operator*() const { return *ptr_; }
  1699. T* operator->() const { return ptr_; }
  1700. T* get() const { return ptr_; }
  1701. T* release() {
  1702. T* const ptr = ptr_;
  1703. ptr_ = NULL;
  1704. return ptr;
  1705. }
  1706. void reset(T* p = NULL) {
  1707. if (p != ptr_) {
  1708. if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type.
  1709. delete ptr_;
  1710. }
  1711. ptr_ = p;
  1712. }
  1713. }
  1714. private:
  1715. T* ptr_;
  1716. GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
  1717. };
  1718. // Defines RE.
  1719. // A simple C++ wrapper for <regex.h>. It uses the POSIX Extended
  1720. // Regular Expression syntax.
  1721. class GTEST_API_ RE {
  1722. public:
  1723. // A copy constructor is required by the Standard to initialize object
  1724. // references from r-values.
  1725. RE(const RE& other) { Init(other.pattern()); }
  1726. // Constructs an RE from a string.
  1727. RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT
  1728. #if GTEST_HAS_GLOBAL_STRING
  1729. RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT
  1730. #endif // GTEST_HAS_GLOBAL_STRING
  1731. RE(const char* regex) { Init(regex); } // NOLINT
  1732. ~RE();
  1733. // Returns the string representation of the regex.
  1734. const char* pattern() const { return pattern_; }
  1735. // FullMatch(str, re) returns true iff regular expression re matches
  1736. // the entire str.
  1737. // PartialMatch(str, re) returns true iff regular expression re
  1738. // matches a substring of str (including str itself).
  1739. //
  1740. // TODO(wan@google.com): make FullMatch() and PartialMatch() work
  1741. // when str contains NUL characters.
  1742. static bool FullMatch(const ::std::string& str, const RE& re) {
  1743. return FullMatch(str.c_str(), re);
  1744. }
  1745. static bool PartialMatch(const ::std::string& str, const RE& re) {
  1746. return PartialMatch(str.c_str(), re);
  1747. }
  1748. #if GTEST_HAS_GLOBAL_STRING
  1749. static bool FullMatch(const ::string& str, const RE& re) {
  1750. return FullMatch(str.c_str(), re);
  1751. }
  1752. static bool PartialMatch(const ::string& str, const RE& re) {
  1753. return PartialMatch(str.c_str(), re);
  1754. }
  1755. #endif // GTEST_HAS_GLOBAL_STRING
  1756. static bool FullMatch(const char* str, const RE& re);
  1757. static bool PartialMatch(const char* str, const RE& re);
  1758. private:
  1759. void Init(const char* regex);
  1760. // We use a const char* instead of an std::string, as Google Test used to be
  1761. // used where std::string is not available. TODO(wan@google.com): change to
  1762. // std::string.
  1763. const char* pattern_;
  1764. bool is_valid_;
  1765. #if GTEST_USES_POSIX_RE
  1766. regex_t full_regex_; // For FullMatch().
  1767. regex_t partial_regex_; // For PartialMatch().
  1768. #else // GTEST_USES_SIMPLE_RE
  1769. const char* full_pattern_; // For FullMatch();
  1770. #endif
  1771. GTEST_DISALLOW_ASSIGN_(RE);
  1772. };
  1773. // Formats a source file path and a line number as they would appear
  1774. // in an error message from the compiler used to compile this code.
  1775. GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
  1776. // Formats a file location for compiler-independent XML output.
  1777. // Although this function is not platform dependent, we put it next to
  1778. // FormatFileLocation in order to contrast the two functions.
  1779. GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
  1780. int line);
  1781. // Defines logging utilities:
  1782. // GTEST_LOG_(severity) - logs messages at the specified severity level. The
  1783. // message itself is streamed into the macro.
  1784. // LogToStderr() - directs all log messages to stderr.
  1785. // FlushInfoLog() - flushes informational log messages.
  1786. enum GTestLogSeverity {
  1787. GTEST_INFO,
  1788. GTEST_WARNING,
  1789. GTEST_ERROR,
  1790. GTEST_FATAL
  1791. };
  1792. // Formats log entry severity, provides a stream object for streaming the
  1793. // log message, and terminates the message with a newline when going out of
  1794. // scope.
  1795. class GTEST_API_ GTestLog {
  1796. public:
  1797. GTestLog(GTestLogSeverity severity, const char* file, int line);
  1798. // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
  1799. ~GTestLog();
  1800. ::std::ostream& GetStream() { return ::std::cerr; }
  1801. private:
  1802. const GTestLogSeverity severity_;
  1803. GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
  1804. };
  1805. #define GTEST_LOG_(severity) \
  1806. ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
  1807. __FILE__, __LINE__).GetStream()
  1808. inline void LogToStderr() {}
  1809. inline void FlushInfoLog() { fflush(NULL); }
  1810. // INTERNAL IMPLEMENTATION - DO NOT USE.
  1811. //
  1812. // GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
  1813. // is not satisfied.
  1814. // Synopsys:
  1815. // GTEST_CHECK_(boolean_condition);
  1816. // or
  1817. // GTEST_CHECK_(boolean_condition) << "Additional message";
  1818. //
  1819. // This checks the condition and if the condition is not satisfied
  1820. // it prints message about the condition violation, including the
  1821. // condition itself, plus additional message streamed into it, if any,
  1822. // and then it aborts the program. It aborts the program irrespective of
  1823. // whether it is built in the debug mode or not.
  1824. #define GTEST_CHECK_(condition) \
  1825. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  1826. if (::testing::internal::IsTrue(condition)) \
  1827. ; \
  1828. else \
  1829. GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
  1830. // An all-mode assert to verify that the given POSIX-style function
  1831. // call returns 0 (indicating success). Known limitation: this
  1832. // doesn't expand to a balanced 'if' statement, so enclose the macro
  1833. // in {} if you need to use it as the only statement in an 'if'
  1834. // branch.
  1835. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
  1836. if (const int gtest_error = (posix_call)) \
  1837. GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
  1838. << gtest_error
  1839. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  1840. //
  1841. // Use ImplicitCast_ as a safe version of static_cast for upcasting in
  1842. // the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
  1843. // const Foo*). When you use ImplicitCast_, the compiler checks that
  1844. // the cast is safe. Such explicit ImplicitCast_s are necessary in
  1845. // surprisingly many situations where C++ demands an exact type match
  1846. // instead of an argument type convertable to a target type.
  1847. //
  1848. // The syntax for using ImplicitCast_ is the same as for static_cast:
  1849. //
  1850. // ImplicitCast_<ToType>(expr)
  1851. //
  1852. // ImplicitCast_ would have been part of the C++ standard library,
  1853. // but the proposal was submitted too late. It will probably make
  1854. // its way into the language in the future.
  1855. //
  1856. // This relatively ugly name is intentional. It prevents clashes with
  1857. // similar functions users may have (e.g., implicit_cast). The internal
  1858. // namespace alone is not enough because the function can be found by ADL.
  1859. template<typename To>
  1860. inline To ImplicitCast_(To x) { return x; }
  1861. // When you upcast (that is, cast a pointer from type Foo to type
  1862. // SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
  1863. // always succeed. When you downcast (that is, cast a pointer from
  1864. // type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
  1865. // how do you know the pointer is really of type SubclassOfFoo? It
  1866. // could be a bare Foo, or of type DifferentSubclassOfFoo. Thus,
  1867. // when you downcast, you should use this macro. In debug mode, we
  1868. // use dynamic_cast<> to double-check the downcast is legal (we die
  1869. // if it's not). In normal mode, we do the efficient static_cast<>
  1870. // instead. Thus, it's important to test in debug mode to make sure
  1871. // the cast is legal!
  1872. // This is the only place in the code we should use dynamic_cast<>.
  1873. // In particular, you SHOULDN'T be using dynamic_cast<> in order to
  1874. // do RTTI (eg code like this:
  1875. // if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
  1876. // if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
  1877. // You should design the code some other way not to need this.
  1878. //
  1879. // This relatively ugly name is intentional. It prevents clashes with
  1880. // similar functions users may have (e.g., down_cast). The internal
  1881. // namespace alone is not enough because the function can be found by ADL.
  1882. template<typename To, typename From> // use like this: DownCast_<T*>(foo);
  1883. inline To DownCast_(From* f) { // so we only accept pointers
  1884. // Ensures that To is a sub-type of From *. This test is here only
  1885. // for compile-time type checking, and has no overhead in an
  1886. // optimized build at run-time, as it will be optimized away
  1887. // completely.
  1888. if (false) {
  1889. const To to = NULL;
  1890. ::testing::internal::ImplicitCast_<From*>(to);
  1891. }
  1892. #if GTEST_HAS_RTTI
  1893. // RTTI: debug mode only!
  1894. GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
  1895. #endif
  1896. return static_cast<To>(f);
  1897. }
  1898. // Downcasts the pointer of type Base to Derived.
  1899. // Derived must be a subclass of Base. The parameter MUST
  1900. // point to a class of type Derived, not any subclass of it.
  1901. // When RTTI is available, the function performs a runtime
  1902. // check to enforce this.
  1903. template <class Derived, class Base>
  1904. Derived* CheckedDowncastToActualType(Base* base) {
  1905. #if GTEST_HAS_RTTI
  1906. GTEST_CHECK_(typeid(*base) == typeid(Derived));
  1907. return dynamic_cast<Derived*>(base); // NOLINT
  1908. #else
  1909. return static_cast<Derived*>(base); // Poor man's downcast.
  1910. #endif
  1911. }
  1912. #if GTEST_HAS_STREAM_REDIRECTION
  1913. // Defines the stderr capturer:
  1914. // CaptureStdout - starts capturing stdout.
  1915. // GetCapturedStdout - stops capturing stdout and returns the captured string.
  1916. // CaptureStderr - starts capturing stderr.
  1917. // GetCapturedStderr - stops capturing stderr and returns the captured string.
  1918. //
  1919. GTEST_API_ void CaptureStdout();
  1920. GTEST_API_ std::string GetCapturedStdout();
  1921. GTEST_API_ void CaptureStderr();
  1922. GTEST_API_ std::string GetCapturedStderr();
  1923. #endif // GTEST_HAS_STREAM_REDIRECTION
  1924. #if GTEST_HAS_DEATH_TEST
  1925. const ::std::vector<testing::internal::string>& GetInjectableArgvs();
  1926. void SetInjectableArgvs(const ::std::vector<testing::internal::string>*
  1927. new_argvs);
  1928. // A copy of all command line arguments. Set by InitGoogleTest().
  1929. extern ::std::vector<testing::internal::string> g_argvs;
  1930. #endif // GTEST_HAS_DEATH_TEST
  1931. // Defines synchronization primitives.
  1932. #if GTEST_HAS_PTHREAD
  1933. // Sleeps for (roughly) n milli-seconds. This function is only for
  1934. // testing Google Test's own constructs. Don't use it in user tests,
  1935. // either directly or indirectly.
  1936. inline void SleepMilliseconds(int n) {
  1937. const timespec time = {
  1938. 0, // 0 seconds.
  1939. n * 1000L * 1000L, // And n ms.
  1940. };
  1941. nanosleep(&time, NULL);
  1942. }
  1943. // Allows a controller thread to pause execution of newly created
  1944. // threads until notified. Instances of this class must be created
  1945. // and destroyed in the controller thread.
  1946. //
  1947. // This class is only for testing Google Test's own constructs. Do not
  1948. // use it in user tests, either directly or indirectly.
  1949. class Notification {
  1950. public:
  1951. Notification() : notified_(false) {
  1952. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
  1953. }
  1954. ~Notification() {
  1955. pthread_mutex_destroy(&mutex_);
  1956. }
  1957. // Notifies all threads created with this notification to start. Must
  1958. // be called from the controller thread.
  1959. void Notify() {
  1960. pthread_mutex_lock(&mutex_);
  1961. notified_ = true;
  1962. pthread_mutex_unlock(&mutex_);
  1963. }
  1964. // Blocks until the controller thread notifies. Must be called from a test
  1965. // thread.
  1966. void WaitForNotification() {
  1967. for (;;) {
  1968. pthread_mutex_lock(&mutex_);
  1969. const bool notified = notified_;
  1970. pthread_mutex_unlock(&mutex_);
  1971. if (notified)
  1972. break;
  1973. SleepMilliseconds(10);
  1974. }
  1975. }
  1976. private:
  1977. pthread_mutex_t mutex_;
  1978. bool notified_;
  1979. GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
  1980. };
  1981. // As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
  1982. // Consequently, it cannot select a correct instantiation of ThreadWithParam
  1983. // in order to call its Run(). Introducing ThreadWithParamBase as a
  1984. // non-templated base class for ThreadWithParam allows us to bypass this
  1985. // problem.
  1986. class ThreadWithParamBase {
  1987. public:
  1988. virtual ~ThreadWithParamBase() {}
  1989. virtual void Run() = 0;
  1990. };
  1991. // pthread_create() accepts a pointer to a function type with the C linkage.
  1992. // According to the Standard (7.5/1), function types with different linkages
  1993. // are different even if they are otherwise identical. Some compilers (for
  1994. // example, SunStudio) treat them as different types. Since class methods
  1995. // cannot be defined with C-linkage we need to define a free C-function to
  1996. // pass into pthread_create().
  1997. extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
  1998. static_cast<ThreadWithParamBase*>(thread)->Run();
  1999. return NULL;
  2000. }
  2001. // Helper class for testing Google Test's multi-threading constructs.
  2002. // To use it, write:
  2003. //
  2004. // void ThreadFunc(int param) { /* Do things with param */ }
  2005. // Notification thread_can_start;
  2006. // ...
  2007. // // The thread_can_start parameter is optional; you can supply NULL.
  2008. // ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
  2009. // thread_can_start.Notify();
  2010. //
  2011. // These classes are only for testing Google Test's own constructs. Do
  2012. // not use them in user tests, either directly or indirectly.
  2013. template <typename T>
  2014. class ThreadWithParam : public ThreadWithParamBase {
  2015. public:
  2016. typedef void (*UserThreadFunc)(T);
  2017. ThreadWithParam(
  2018. UserThreadFunc func, T param, Notification* thread_can_start)
  2019. : func_(func),
  2020. param_(param),
  2021. thread_can_start_(thread_can_start),
  2022. finished_(false) {
  2023. ThreadWithParamBase* const base = this;
  2024. // The thread can be created only after all fields except thread_
  2025. // have been initialized.
  2026. GTEST_CHECK_POSIX_SUCCESS_(
  2027. pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
  2028. }
  2029. ~ThreadWithParam() { Join(); }
  2030. void Join() {
  2031. if (!finished_) {
  2032. GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
  2033. finished_ = true;
  2034. }
  2035. }
  2036. virtual void Run() {
  2037. if (thread_can_start_ != NULL)
  2038. thread_can_start_->WaitForNotification();
  2039. func_(param_);
  2040. }
  2041. private:
  2042. const UserThreadFunc func_; // User-supplied thread function.
  2043. const T param_; // User-supplied parameter to the thread function.
  2044. // When non-NULL, used to block execution until the controller thread
  2045. // notifies.
  2046. Notification* const thread_can_start_;
  2047. bool finished_; // true iff we know that the thread function has finished.
  2048. pthread_t thread_; // The native thread object.
  2049. GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
  2050. };
  2051. // MutexBase and Mutex implement mutex on pthreads-based platforms. They
  2052. // are used in conjunction with class MutexLock:
  2053. //
  2054. // Mutex mutex;
  2055. // ...
  2056. // MutexLock lock(&mutex); // Acquires the mutex and releases it at the end
  2057. // // of the current scope.
  2058. //
  2059. // MutexBase implements behavior for both statically and dynamically
  2060. // allocated mutexes. Do not use MutexBase directly. Instead, write
  2061. // the following to define a static mutex:
  2062. //
  2063. // GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
  2064. //
  2065. // You can forward declare a static mutex like this:
  2066. //
  2067. // GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
  2068. //
  2069. // To create a dynamic mutex, just define an object of type Mutex.
  2070. class MutexBase {
  2071. public:
  2072. // Acquires this mutex.
  2073. void Lock() {
  2074. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
  2075. owner_ = pthread_self();
  2076. has_owner_ = true;
  2077. }
  2078. // Releases this mutex.
  2079. void Unlock() {
  2080. // Since the lock is being released the owner_ field should no longer be
  2081. // considered valid. We don't protect writing to has_owner_ here, as it's
  2082. // the caller's responsibility to ensure that the current thread holds the
  2083. // mutex when this is called.
  2084. has_owner_ = false;
  2085. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
  2086. }
  2087. // Does nothing if the current thread holds the mutex. Otherwise, crashes
  2088. // with high probability.
  2089. void AssertHeld() const {
  2090. GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))
  2091. << "The current thread is not holding the mutex @" << this;
  2092. }
  2093. // A static mutex may be used before main() is entered. It may even
  2094. // be used before the dynamic initialization stage. Therefore we
  2095. // must be able to initialize a static mutex object at link time.
  2096. // This means MutexBase has to be a POD and its member variables
  2097. // have to be public.
  2098. public:
  2099. pthread_mutex_t mutex_; // The underlying pthread mutex.
  2100. // has_owner_ indicates whether the owner_ field below contains a valid thread
  2101. // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All
  2102. // accesses to the owner_ field should be protected by a check of this field.
  2103. // An alternative might be to memset() owner_ to all zeros, but there's no
  2104. // guarantee that a zero'd pthread_t is necessarily invalid or even different
  2105. // from pthread_self().
  2106. bool has_owner_;
  2107. pthread_t owner_; // The thread holding the mutex.
  2108. };
  2109. // Forward-declares a static mutex.
  2110. # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
  2111. extern ::testing::internal::MutexBase mutex
  2112. // Defines and statically (i.e. at link time) initializes a static mutex.
  2113. // The initialization list here does not explicitly initialize each field,
  2114. // instead relying on default initialization for the unspecified fields. In
  2115. // particular, the owner_ field (a pthread_t) is not explicitly initialized.
  2116. // This allows initialization to work whether pthread_t is a scalar or struct.
  2117. // The flag -Wmissing-field-initializers must not be specified for this to work.
  2118. # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
  2119. ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false }
  2120. // The Mutex class can only be used for mutexes created at runtime. It
  2121. // shares its API with MutexBase otherwise.
  2122. class Mutex : public MutexBase {
  2123. public:
  2124. Mutex() {
  2125. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
  2126. has_owner_ = false;
  2127. }
  2128. ~Mutex() {
  2129. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
  2130. }
  2131. private:
  2132. GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
  2133. };
  2134. // We cannot name this class MutexLock as the ctor declaration would
  2135. // conflict with a macro named MutexLock, which is defined on some
  2136. // platforms. Hence the typedef trick below.
  2137. class GTestMutexLock {
  2138. public:
  2139. explicit GTestMutexLock(MutexBase* mutex)
  2140. : mutex_(mutex) { mutex_->Lock(); }
  2141. ~GTestMutexLock() { mutex_->Unlock(); }
  2142. private:
  2143. MutexBase* const mutex_;
  2144. GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
  2145. };
  2146. typedef GTestMutexLock MutexLock;
  2147. // Helpers for ThreadLocal.
  2148. // pthread_key_create() requires DeleteThreadLocalValue() to have
  2149. // C-linkage. Therefore it cannot be templatized to access
  2150. // ThreadLocal<T>. Hence the need for class
  2151. // ThreadLocalValueHolderBase.
  2152. class ThreadLocalValueHolderBase {
  2153. public:
  2154. virtual ~ThreadLocalValueHolderBase() {}
  2155. };
  2156. // Called by pthread to delete thread-local data stored by
  2157. // pthread_setspecific().
  2158. extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
  2159. delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
  2160. }
  2161. // Implements thread-local storage on pthreads-based systems.
  2162. //
  2163. // // Thread 1
  2164. // ThreadLocal<int> tl(100); // 100 is the default value for each thread.
  2165. //
  2166. // // Thread 2
  2167. // tl.set(150); // Changes the value for thread 2 only.
  2168. // EXPECT_EQ(150, tl.get());
  2169. //
  2170. // // Thread 1
  2171. // EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value.
  2172. // tl.set(200);
  2173. // EXPECT_EQ(200, tl.get());
  2174. //
  2175. // The template type argument T must have a public copy constructor.
  2176. // In addition, the default ThreadLocal constructor requires T to have
  2177. // a public default constructor.
  2178. //
  2179. // An object managed for a thread by a ThreadLocal instance is deleted
  2180. // when the thread exits. Or, if the ThreadLocal instance dies in
  2181. // that thread, when the ThreadLocal dies. It's the user's
  2182. // responsibility to ensure that all other threads using a ThreadLocal
  2183. // have exited when it dies, or the per-thread objects for those
  2184. // threads will not be deleted.
  2185. //
  2186. // Google Test only uses global ThreadLocal objects. That means they
  2187. // will die after main() has returned. Therefore, no per-thread
  2188. // object managed by Google Test will be leaked as long as all threads
  2189. // using Google Test have exited when main() returns.
  2190. template <typename T>
  2191. class ThreadLocal {
  2192. public:
  2193. ThreadLocal() : key_(CreateKey()),
  2194. default_() {}
  2195. explicit ThreadLocal(const T& value) : key_(CreateKey()),
  2196. default_(value) {}
  2197. ~ThreadLocal() {
  2198. // Destroys the managed object for the current thread, if any.
  2199. DeleteThreadLocalValue(pthread_getspecific(key_));
  2200. // Releases resources associated with the key. This will *not*
  2201. // delete managed objects for other threads.
  2202. GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
  2203. }
  2204. T* pointer() { return GetOrCreateValue(); }
  2205. const T* pointer() const { return GetOrCreateValue(); }
  2206. const T& get() const { return *pointer(); }
  2207. void set(const T& value) { *pointer() = value; }
  2208. private:
  2209. // Holds a value of type T.
  2210. class ValueHolder : public ThreadLocalValueHolderBase {
  2211. public:
  2212. explicit ValueHolder(const T& value) : value_(value) {}
  2213. T* pointer() { return &value_; }
  2214. private:
  2215. T value_;
  2216. GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
  2217. };
  2218. static pthread_key_t CreateKey() {
  2219. pthread_key_t key;
  2220. // When a thread exits, DeleteThreadLocalValue() will be called on
  2221. // the object managed for that thread.
  2222. GTEST_CHECK_POSIX_SUCCESS_(
  2223. pthread_key_create(&key, &DeleteThreadLocalValue));
  2224. return key;
  2225. }
  2226. T* GetOrCreateValue() const {
  2227. ThreadLocalValueHolderBase* const holder =
  2228. static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
  2229. if (holder != NULL) {
  2230. return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
  2231. }
  2232. ValueHolder* const new_holder = new ValueHolder(default_);
  2233. ThreadLocalValueHolderBase* const holder_base = new_holder;
  2234. GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
  2235. return new_holder->pointer();
  2236. }
  2237. // A key pthreads uses for looking up per-thread values.
  2238. const pthread_key_t key_;
  2239. const T default_; // The default value for each thread.
  2240. GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
  2241. };
  2242. # define GTEST_IS_THREADSAFE 1
  2243. #else // GTEST_HAS_PTHREAD
  2244. // A dummy implementation of synchronization primitives (mutex, lock,
  2245. // and thread-local variable). Necessary for compiling Google Test where
  2246. // mutex is not supported - using Google Test in multiple threads is not
  2247. // supported on such platforms.
  2248. class Mutex {
  2249. public:
  2250. Mutex() {}
  2251. void Lock() {}
  2252. void Unlock() {}
  2253. void AssertHeld() const {}
  2254. };
  2255. # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
  2256. extern ::testing::internal::Mutex mutex
  2257. # define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
  2258. class GTestMutexLock {
  2259. public:
  2260. explicit GTestMutexLock(Mutex*) {} // NOLINT
  2261. };
  2262. typedef GTestMutexLock MutexLock;
  2263. template <typename T>
  2264. class ThreadLocal {
  2265. public:
  2266. ThreadLocal() : value_() {}
  2267. explicit ThreadLocal(const T& value) : value_(value) {}
  2268. T* pointer() { return &value_; }
  2269. const T* pointer() const { return &value_; }
  2270. const T& get() const { return value_; }
  2271. void set(const T& value) { value_ = value; }
  2272. private:
  2273. T value_;
  2274. };
  2275. // The above synchronization primitives have dummy implementations.
  2276. // Therefore Google Test is not thread-safe.
  2277. # define GTEST_IS_THREADSAFE 0
  2278. #endif // GTEST_HAS_PTHREAD
  2279. // Returns the number of threads running in the process, or 0 to indicate that
  2280. // we cannot detect it.
  2281. GTEST_API_ size_t GetThreadCount();
  2282. // Passing non-POD classes through ellipsis (...) crashes the ARM
  2283. // compiler and generates a warning in Sun Studio. The Nokia Symbian
  2284. // and the IBM XL C/C++ compiler try to instantiate a copy constructor
  2285. // for objects passed through ellipsis (...), failing for uncopyable
  2286. // objects. We define this to ensure that only POD is passed through
  2287. // ellipsis on these systems.
  2288. #if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
  2289. // We lose support for NULL detection where the compiler doesn't like
  2290. // passing non-POD classes through ellipsis (...).
  2291. # define GTEST_ELLIPSIS_NEEDS_POD_ 1
  2292. #else
  2293. # define GTEST_CAN_COMPARE_NULL 1
  2294. #endif
  2295. // The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
  2296. // const T& and const T* in a function template. These compilers
  2297. // _can_ decide between class template specializations for T and T*,
  2298. // so a tr1::type_traits-like is_pointer works.
  2299. #if defined(__SYMBIAN32__) || defined(__IBMCPP__)
  2300. # define GTEST_NEEDS_IS_POINTER_ 1
  2301. #endif
  2302. template <bool bool_value>
  2303. struct bool_constant {
  2304. typedef bool_constant<bool_value> type;
  2305. static const bool value = bool_value;
  2306. };
  2307. template <bool bool_value> const bool bool_constant<bool_value>::value;
  2308. typedef bool_constant<false> false_type;
  2309. typedef bool_constant<true> true_type;
  2310. template <typename T>
  2311. struct is_pointer : public false_type {};
  2312. template <typename T>
  2313. struct is_pointer<T*> : public true_type {};
  2314. template <typename Iterator>
  2315. struct IteratorTraits {
  2316. typedef typename Iterator::value_type value_type;
  2317. };
  2318. template <typename T>
  2319. struct IteratorTraits<T*> {
  2320. typedef T value_type;
  2321. };
  2322. template <typename T>
  2323. struct IteratorTraits<const T*> {
  2324. typedef T value_type;
  2325. };
  2326. #if GTEST_OS_WINDOWS
  2327. # define GTEST_PATH_SEP_ "\\"
  2328. # define GTEST_HAS_ALT_PATH_SEP_ 1
  2329. // The biggest signed integer type the compiler supports.
  2330. typedef __int64 BiggestInt;
  2331. #else
  2332. # define GTEST_PATH_SEP_ "/"
  2333. # define GTEST_HAS_ALT_PATH_SEP_ 0
  2334. typedef long long BiggestInt; // NOLINT
  2335. #endif // GTEST_OS_WINDOWS
  2336. // Utilities for char.
  2337. // isspace(int ch) and friends accept an unsigned char or EOF. char
  2338. // may be signed, depending on the compiler (or compiler flags).
  2339. // Therefore we need to cast a char to unsigned char before calling
  2340. // isspace(), etc.
  2341. inline bool IsAlpha(char ch) {
  2342. return isalpha(static_cast<unsigned char>(ch)) != 0;
  2343. }
  2344. inline bool IsAlNum(char ch) {
  2345. return isalnum(static_cast<unsigned char>(ch)) != 0;
  2346. }
  2347. inline bool IsDigit(char ch) {
  2348. return isdigit(static_cast<unsigned char>(ch)) != 0;
  2349. }
  2350. inline bool IsLower(char ch) {
  2351. return islower(static_cast<unsigned char>(ch)) != 0;
  2352. }
  2353. inline bool IsSpace(char ch) {
  2354. return isspace(static_cast<unsigned char>(ch)) != 0;
  2355. }
  2356. inline bool IsUpper(char ch) {
  2357. return isupper(static_cast<unsigned char>(ch)) != 0;
  2358. }
  2359. inline bool IsXDigit(char ch) {
  2360. return isxdigit(static_cast<unsigned char>(ch)) != 0;
  2361. }
  2362. inline bool IsXDigit(wchar_t ch) {
  2363. const unsigned char low_byte = static_cast<unsigned char>(ch);
  2364. return ch == low_byte && isxdigit(low_byte) != 0;
  2365. }
  2366. inline char ToLower(char ch) {
  2367. return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
  2368. }
  2369. inline char ToUpper(char ch) {
  2370. return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
  2371. }
  2372. // The testing::internal::posix namespace holds wrappers for common
  2373. // POSIX functions. These wrappers hide the differences between
  2374. // Windows/MSVC and POSIX systems. Since some compilers define these
  2375. // standard functions as macros, the wrapper cannot have the same name
  2376. // as the wrapped function.
  2377. namespace posix {
  2378. // Functions with a different name on Windows.
  2379. #if GTEST_OS_WINDOWS
  2380. typedef struct _stat StatStruct;
  2381. # ifdef __BORLANDC__
  2382. inline int IsATTY(int fd) { return isatty(fd); }
  2383. inline int StrCaseCmp(const char* s1, const char* s2) {
  2384. return stricmp(s1, s2);
  2385. }
  2386. inline char* StrDup(const char* src) { return strdup(src); }
  2387. # else // !__BORLANDC__
  2388. # if GTEST_OS_WINDOWS_MOBILE
  2389. inline int IsATTY(int /* fd */) { return 0; }
  2390. # else
  2391. inline int IsATTY(int fd) { return _isatty(fd); }
  2392. # endif // GTEST_OS_WINDOWS_MOBILE
  2393. inline int StrCaseCmp(const char* s1, const char* s2) {
  2394. return _stricmp(s1, s2);
  2395. }
  2396. inline char* StrDup(const char* src) { return _strdup(src); }
  2397. # endif // __BORLANDC__
  2398. # if GTEST_OS_WINDOWS_MOBILE
  2399. inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
  2400. // Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
  2401. // time and thus not defined there.
  2402. # else
  2403. inline int FileNo(FILE* file) { return _fileno(file); }
  2404. inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
  2405. inline int RmDir(const char* dir) { return _rmdir(dir); }
  2406. inline bool IsDir(const StatStruct& st) {
  2407. return (_S_IFDIR & st.st_mode) != 0;
  2408. }
  2409. # endif // GTEST_OS_WINDOWS_MOBILE
  2410. #else
  2411. typedef struct stat StatStruct;
  2412. inline int FileNo(FILE* file) { return fileno(file); }
  2413. inline int IsATTY(int fd) { return isatty(fd); }
  2414. inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
  2415. inline int StrCaseCmp(const char* s1, const char* s2) {
  2416. return strcasecmp(s1, s2);
  2417. }
  2418. inline char* StrDup(const char* src) { return strdup(src); }
  2419. inline int RmDir(const char* dir) { return rmdir(dir); }
  2420. inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
  2421. #endif // GTEST_OS_WINDOWS
  2422. // Functions deprecated by MSVC 8.0.
  2423. #ifdef _MSC_VER
  2424. // Temporarily disable warning 4996 (deprecated function).
  2425. # pragma warning(push)
  2426. # pragma warning(disable:4996)
  2427. #endif
  2428. inline const char* StrNCpy(char* dest, const char* src, size_t n) {
  2429. return strncpy(dest, src, n);
  2430. }
  2431. // ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
  2432. // StrError() aren't needed on Windows CE at this time and thus not
  2433. // defined there.
  2434. #if !GTEST_OS_WINDOWS_MOBILE
  2435. inline int ChDir(const char* dir) { return chdir(dir); }
  2436. #endif
  2437. inline FILE* FOpen(const char* path, const char* mode) {
  2438. return fopen(path, mode);
  2439. }
  2440. #if !GTEST_OS_WINDOWS_MOBILE
  2441. inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
  2442. return freopen(path, mode, stream);
  2443. }
  2444. inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
  2445. #endif
  2446. inline int FClose(FILE* fp) { return fclose(fp); }
  2447. #if !GTEST_OS_WINDOWS_MOBILE
  2448. inline int Read(int fd, void* buf, unsigned int count) {
  2449. return static_cast<int>(read(fd, buf, count));
  2450. }
  2451. inline int Write(int fd, const void* buf, unsigned int count) {
  2452. return static_cast<int>(write(fd, buf, count));
  2453. }
  2454. inline int Close(int fd) { return close(fd); }
  2455. inline const char* StrError(int errnum) { return strerror(errnum); }
  2456. #endif
  2457. inline const char* GetEnv(const char* name) {
  2458. #if GTEST_OS_WINDOWS_MOBILE
  2459. // We are on Windows CE, which has no environment variables.
  2460. return NULL;
  2461. #elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
  2462. // Environment variables which we programmatically clear will be set to the
  2463. // empty string rather than unset (NULL). Handle that case.
  2464. const char* const env = getenv(name);
  2465. return (env != NULL && env[0] != '\0') ? env : NULL;
  2466. #else
  2467. return getenv(name);
  2468. #endif
  2469. }
  2470. #ifdef _MSC_VER
  2471. # pragma warning(pop) // Restores the warning state.
  2472. #endif
  2473. #if GTEST_OS_WINDOWS_MOBILE
  2474. // Windows CE has no C library. The abort() function is used in
  2475. // several places in Google Test. This implementation provides a reasonable
  2476. // imitation of standard behaviour.
  2477. void Abort();
  2478. #else
  2479. inline void Abort() { abort(); }
  2480. #endif // GTEST_OS_WINDOWS_MOBILE
  2481. } // namespace posix
  2482. // MSVC "deprecates" snprintf and issues warnings wherever it is used. In
  2483. // order to avoid these warnings, we need to use _snprintf or _snprintf_s on
  2484. // MSVC-based platforms. We map the GTEST_SNPRINTF_ macro to the appropriate
  2485. // function in order to achieve that. We use macro definition here because
  2486. // snprintf is a variadic function.
  2487. #if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
  2488. // MSVC 2005 and above support variadic macros.
  2489. # define GTEST_SNPRINTF_(buffer, size, format, ...) \
  2490. _snprintf_s(buffer, size, size, format, __VA_ARGS__)
  2491. #elif defined(_MSC_VER)
  2492. // Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't
  2493. // complain about _snprintf.
  2494. # define GTEST_SNPRINTF_ _snprintf
  2495. #else
  2496. # define GTEST_SNPRINTF_ snprintf
  2497. #endif
  2498. // The maximum number a BiggestInt can represent. This definition
  2499. // works no matter BiggestInt is represented in one's complement or
  2500. // two's complement.
  2501. //
  2502. // We cannot rely on numeric_limits in STL, as __int64 and long long
  2503. // are not part of standard C++ and numeric_limits doesn't need to be
  2504. // defined for them.
  2505. const BiggestInt kMaxBiggestInt =
  2506. ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
  2507. // This template class serves as a compile-time function from size to
  2508. // type. It maps a size in bytes to a primitive type with that
  2509. // size. e.g.
  2510. //
  2511. // TypeWithSize<4>::UInt
  2512. //
  2513. // is typedef-ed to be unsigned int (unsigned integer made up of 4
  2514. // bytes).
  2515. //
  2516. // Such functionality should belong to STL, but I cannot find it
  2517. // there.
  2518. //
  2519. // Google Test uses this class in the implementation of floating-point
  2520. // comparison.
  2521. //
  2522. // For now it only handles UInt (unsigned int) as that's all Google Test
  2523. // needs. Other types can be easily added in the future if need
  2524. // arises.
  2525. template <size_t size>
  2526. class TypeWithSize {
  2527. public:
  2528. // This prevents the user from using TypeWithSize<N> with incorrect
  2529. // values of N.
  2530. typedef void UInt;
  2531. };
  2532. // The specialization for size 4.
  2533. template <>
  2534. class TypeWithSize<4> {
  2535. public:
  2536. // unsigned int has size 4 in both gcc and MSVC.
  2537. //
  2538. // As base/basictypes.h doesn't compile on Windows, we cannot use
  2539. // uint32, uint64, and etc here.
  2540. typedef int Int;
  2541. typedef unsigned int UInt;
  2542. };
  2543. // The specialization for size 8.
  2544. template <>
  2545. class TypeWithSize<8> {
  2546. public:
  2547. #if GTEST_OS_WINDOWS
  2548. typedef __int64 Int;
  2549. typedef unsigned __int64 UInt;
  2550. #else
  2551. typedef long long Int; // NOLINT
  2552. typedef unsigned long long UInt; // NOLINT
  2553. #endif // GTEST_OS_WINDOWS
  2554. };
  2555. // Integer types of known sizes.
  2556. typedef TypeWithSize<4>::Int Int32;
  2557. typedef TypeWithSize<4>::UInt UInt32;
  2558. typedef TypeWithSize<8>::Int Int64;
  2559. typedef TypeWithSize<8>::UInt UInt64;
  2560. typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds.
  2561. // Utilities for command line flags and environment variables.
  2562. // Macro for referencing flags.
  2563. #define GTEST_FLAG(name) FLAGS_gtest_##name
  2564. // Macros for declaring flags.
  2565. #define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
  2566. #define GTEST_DECLARE_int32_(name) \
  2567. GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
  2568. #define GTEST_DECLARE_string_(name) \
  2569. GTEST_API_ extern ::std::string GTEST_FLAG(name)
  2570. // Macros for defining flags.
  2571. #define GTEST_DEFINE_bool_(name, default_val, doc) \
  2572. GTEST_API_ bool GTEST_FLAG(name) = (default_val)
  2573. #define GTEST_DEFINE_int32_(name, default_val, doc) \
  2574. GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
  2575. #define GTEST_DEFINE_string_(name, default_val, doc) \
  2576. GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)
  2577. // Thread annotations
  2578. #define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
  2579. #define GTEST_LOCK_EXCLUDED_(locks)
  2580. // Parses 'str' for a 32-bit signed integer. If successful, writes the result
  2581. // to *value and returns true; otherwise leaves *value unchanged and returns
  2582. // false.
  2583. // TODO(chandlerc): Find a better way to refactor flag and environment parsing
  2584. // out of both gtest-port.cc and gtest.cc to avoid exporting this utility
  2585. // function.
  2586. bool ParseInt32(const Message& src_text, const char* str, Int32* value);
  2587. // Parses a bool/Int32/string from the environment variable
  2588. // corresponding to the given Google Test flag.
  2589. bool BoolFromGTestEnv(const char* flag, bool default_val);
  2590. GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
  2591. const char* StringFromGTestEnv(const char* flag, const char* default_val);
  2592. } // namespace internal
  2593. } // namespace testing
  2594. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
  2595. #if GTEST_OS_LINUX
  2596. # include <stdlib.h>
  2597. # include <sys/types.h>
  2598. # include <sys/wait.h>
  2599. # include <unistd.h>
  2600. #endif // GTEST_OS_LINUX
  2601. #if GTEST_HAS_EXCEPTIONS
  2602. # include <stdexcept>
  2603. #endif
  2604. #include <ctype.h>
  2605. #include <float.h>
  2606. #include <string.h>
  2607. #include <iomanip>
  2608. #include <limits>
  2609. #include <set>
  2610. // Copyright 2005, Google Inc.
  2611. // All rights reserved.
  2612. //
  2613. // Redistribution and use in source and binary forms, with or without
  2614. // modification, are permitted provided that the following conditions are
  2615. // met:
  2616. //
  2617. // * Redistributions of source code must retain the above copyright
  2618. // notice, this list of conditions and the following disclaimer.
  2619. // * Redistributions in binary form must reproduce the above
  2620. // copyright notice, this list of conditions and the following disclaimer
  2621. // in the documentation and/or other materials provided with the
  2622. // distribution.
  2623. // * Neither the name of Google Inc. nor the names of its
  2624. // contributors may be used to endorse or promote products derived from
  2625. // this software without specific prior written permission.
  2626. //
  2627. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  2628. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  2629. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  2630. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  2631. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  2632. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  2633. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  2634. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  2635. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  2636. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  2637. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2638. //
  2639. // Author: wan@google.com (Zhanyong Wan)
  2640. //
  2641. // The Google C++ Testing Framework (Google Test)
  2642. //
  2643. // This header file defines the Message class.
  2644. //
  2645. // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
  2646. // leave some internal implementation details in this header file.
  2647. // They are clearly marked by comments like this:
  2648. //
  2649. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  2650. //
  2651. // Such code is NOT meant to be used by a user directly, and is subject
  2652. // to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
  2653. // program!
  2654. #ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
  2655. #define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
  2656. #include <limits>
  2657. // Ensures that there is at least one operator<< in the global namespace.
  2658. // See Message& operator<<(...) below for why.
  2659. void operator<<(const testing::internal::Secret&, int);
  2660. namespace testing {
  2661. // The Message class works like an ostream repeater.
  2662. //
  2663. // Typical usage:
  2664. //
  2665. // 1. You stream a bunch of values to a Message object.
  2666. // It will remember the text in a stringstream.
  2667. // 2. Then you stream the Message object to an ostream.
  2668. // This causes the text in the Message to be streamed
  2669. // to the ostream.
  2670. //
  2671. // For example;
  2672. //
  2673. // testing::Message foo;
  2674. // foo << 1 << " != " << 2;
  2675. // std::cout << foo;
  2676. //
  2677. // will print "1 != 2".
  2678. //
  2679. // Message is not intended to be inherited from. In particular, its
  2680. // destructor is not virtual.
  2681. //
  2682. // Note that stringstream behaves differently in gcc and in MSVC. You
  2683. // can stream a NULL char pointer to it in the former, but not in the
  2684. // latter (it causes an access violation if you do). The Message
  2685. // class hides this difference by treating a NULL char pointer as
  2686. // "(null)".
  2687. class GTEST_API_ Message {
  2688. private:
  2689. // The type of basic IO manipulators (endl, ends, and flush) for
  2690. // narrow streams.
  2691. typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
  2692. public:
  2693. // Constructs an empty Message.
  2694. Message();
  2695. // Copy constructor.
  2696. Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT
  2697. *ss_ << msg.GetString();
  2698. }
  2699. // Constructs a Message from a C-string.
  2700. explicit Message(const char* str) : ss_(new ::std::stringstream) {
  2701. *ss_ << str;
  2702. }
  2703. #if GTEST_OS_SYMBIAN
  2704. // Streams a value (either a pointer or not) to this object.
  2705. template <typename T>
  2706. inline Message& operator <<(const T& value) {
  2707. StreamHelper(typename internal::is_pointer<T>::type(), value);
  2708. return *this;
  2709. }
  2710. #else
  2711. // Streams a non-pointer value to this object.
  2712. template <typename T>
  2713. inline Message& operator <<(const T& val) {
  2714. // Some libraries overload << for STL containers. These
  2715. // overloads are defined in the global namespace instead of ::std.
  2716. //
  2717. // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
  2718. // overloads are visible in either the std namespace or the global
  2719. // namespace, but not other namespaces, including the testing
  2720. // namespace which Google Test's Message class is in.
  2721. //
  2722. // To allow STL containers (and other types that has a << operator
  2723. // defined in the global namespace) to be used in Google Test
  2724. // assertions, testing::Message must access the custom << operator
  2725. // from the global namespace. With this using declaration,
  2726. // overloads of << defined in the global namespace and those
  2727. // visible via Koenig lookup are both exposed in this function.
  2728. using ::operator <<;
  2729. *ss_ << val;
  2730. return *this;
  2731. }
  2732. // Streams a pointer value to this object.
  2733. //
  2734. // This function is an overload of the previous one. When you
  2735. // stream a pointer to a Message, this definition will be used as it
  2736. // is more specialized. (The C++ Standard, section
  2737. // [temp.func.order].) If you stream a non-pointer, then the
  2738. // previous definition will be used.
  2739. //
  2740. // The reason for this overload is that streaming a NULL pointer to
  2741. // ostream is undefined behavior. Depending on the compiler, you
  2742. // may get "0", "(nil)", "(null)", or an access violation. To
  2743. // ensure consistent result across compilers, we always treat NULL
  2744. // as "(null)".
  2745. template <typename T>
  2746. inline Message& operator <<(T* const& pointer) { // NOLINT
  2747. if (pointer == NULL) {
  2748. *ss_ << "(null)";
  2749. } else {
  2750. *ss_ << pointer;
  2751. }
  2752. return *this;
  2753. }
  2754. #endif // GTEST_OS_SYMBIAN
  2755. // Since the basic IO manipulators are overloaded for both narrow
  2756. // and wide streams, we have to provide this specialized definition
  2757. // of operator <<, even though its body is the same as the
  2758. // templatized version above. Without this definition, streaming
  2759. // endl or other basic IO manipulators to Message will confuse the
  2760. // compiler.
  2761. Message& operator <<(BasicNarrowIoManip val) {
  2762. *ss_ << val;
  2763. return *this;
  2764. }
  2765. // Instead of 1/0, we want to see true/false for bool values.
  2766. Message& operator <<(bool b) {
  2767. return *this << (b ? "true" : "false");
  2768. }
  2769. // These two overloads allow streaming a wide C string to a Message
  2770. // using the UTF-8 encoding.
  2771. Message& operator <<(const wchar_t* wide_c_str);
  2772. Message& operator <<(wchar_t* wide_c_str);
  2773. #if GTEST_HAS_STD_WSTRING
  2774. // Converts the given wide string to a narrow string using the UTF-8
  2775. // encoding, and streams the result to this Message object.
  2776. Message& operator <<(const ::std::wstring& wstr);
  2777. #endif // GTEST_HAS_STD_WSTRING
  2778. #if GTEST_HAS_GLOBAL_WSTRING
  2779. // Converts the given wide string to a narrow string using the UTF-8
  2780. // encoding, and streams the result to this Message object.
  2781. Message& operator <<(const ::wstring& wstr);
  2782. #endif // GTEST_HAS_GLOBAL_WSTRING
  2783. // Gets the text streamed to this object so far as an std::string.
  2784. // Each '\0' character in the buffer is replaced with "\\0".
  2785. //
  2786. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  2787. std::string GetString() const;
  2788. private:
  2789. #if GTEST_OS_SYMBIAN
  2790. // These are needed as the Nokia Symbian Compiler cannot decide between
  2791. // const T& and const T* in a function template. The Nokia compiler _can_
  2792. // decide between class template specializations for T and T*, so a
  2793. // tr1::type_traits-like is_pointer works, and we can overload on that.
  2794. template <typename T>
  2795. inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) {
  2796. if (pointer == NULL) {
  2797. *ss_ << "(null)";
  2798. } else {
  2799. *ss_ << pointer;
  2800. }
  2801. }
  2802. template <typename T>
  2803. inline void StreamHelper(internal::false_type /*is_pointer*/,
  2804. const T& value) {
  2805. // See the comments in Message& operator <<(const T&) above for why
  2806. // we need this using statement.
  2807. using ::operator <<;
  2808. *ss_ << value;
  2809. }
  2810. #endif // GTEST_OS_SYMBIAN
  2811. // We'll hold the text streamed to this object here.
  2812. const internal::scoped_ptr< ::std::stringstream> ss_;
  2813. // We declare (but don't implement) this to prevent the compiler
  2814. // from implementing the assignment operator.
  2815. void operator=(const Message&);
  2816. };
  2817. // Streams a Message to an ostream.
  2818. inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
  2819. return os << sb.GetString();
  2820. }
  2821. namespace internal {
  2822. // Converts a streamable value to an std::string. A NULL pointer is
  2823. // converted to "(null)". When the input value is a ::string,
  2824. // ::std::string, ::wstring, or ::std::wstring object, each NUL
  2825. // character in it is replaced with "\\0".
  2826. template <typename T>
  2827. std::string StreamableToString(const T& streamable) {
  2828. return (Message() << streamable).GetString();
  2829. }
  2830. } // namespace internal
  2831. } // namespace testing
  2832. #endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
  2833. // Copyright 2005, Google Inc.
  2834. // All rights reserved.
  2835. //
  2836. // Redistribution and use in source and binary forms, with or without
  2837. // modification, are permitted provided that the following conditions are
  2838. // met:
  2839. //
  2840. // * Redistributions of source code must retain the above copyright
  2841. // notice, this list of conditions and the following disclaimer.
  2842. // * Redistributions in binary form must reproduce the above
  2843. // copyright notice, this list of conditions and the following disclaimer
  2844. // in the documentation and/or other materials provided with the
  2845. // distribution.
  2846. // * Neither the name of Google Inc. nor the names of its
  2847. // contributors may be used to endorse or promote products derived from
  2848. // this software without specific prior written permission.
  2849. //
  2850. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  2851. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  2852. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  2853. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  2854. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  2855. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  2856. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  2857. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  2858. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  2859. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  2860. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2861. //
  2862. // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
  2863. //
  2864. // The Google C++ Testing Framework (Google Test)
  2865. //
  2866. // This header file declares the String class and functions used internally by
  2867. // Google Test. They are subject to change without notice. They should not used
  2868. // by code external to Google Test.
  2869. //
  2870. // This header file is #included by <gtest/internal/gtest-internal.h>.
  2871. // It should not be #included by other files.
  2872. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
  2873. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
  2874. #ifdef __BORLANDC__
  2875. // string.h is not guaranteed to provide strcpy on C++ Builder.
  2876. # include <mem.h>
  2877. #endif
  2878. #include <string.h>
  2879. #include <string>
  2880. namespace testing {
  2881. namespace internal {
  2882. // String - an abstract class holding static string utilities.
  2883. class GTEST_API_ String {
  2884. public:
  2885. // Static utility methods
  2886. // Clones a 0-terminated C string, allocating memory using new. The
  2887. // caller is responsible for deleting the return value using
  2888. // delete[]. Returns the cloned string, or NULL if the input is
  2889. // NULL.
  2890. //
  2891. // This is different from strdup() in string.h, which allocates
  2892. // memory using malloc().
  2893. static const char* CloneCString(const char* c_str);
  2894. #if GTEST_OS_WINDOWS_MOBILE
  2895. // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
  2896. // able to pass strings to Win32 APIs on CE we need to convert them
  2897. // to 'Unicode', UTF-16.
  2898. // Creates a UTF-16 wide string from the given ANSI string, allocating
  2899. // memory using new. The caller is responsible for deleting the return
  2900. // value using delete[]. Returns the wide string, or NULL if the
  2901. // input is NULL.
  2902. //
  2903. // The wide string is created using the ANSI codepage (CP_ACP) to
  2904. // match the behaviour of the ANSI versions of Win32 calls and the
  2905. // C runtime.
  2906. static LPCWSTR AnsiToUtf16(const char* c_str);
  2907. // Creates an ANSI string from the given wide string, allocating
  2908. // memory using new. The caller is responsible for deleting the return
  2909. // value using delete[]. Returns the ANSI string, or NULL if the
  2910. // input is NULL.
  2911. //
  2912. // The returned string is created using the ANSI codepage (CP_ACP) to
  2913. // match the behaviour of the ANSI versions of Win32 calls and the
  2914. // C runtime.
  2915. static const char* Utf16ToAnsi(LPCWSTR utf16_str);
  2916. #endif
  2917. // Compares two C strings. Returns true iff they have the same content.
  2918. //
  2919. // Unlike strcmp(), this function can handle NULL argument(s). A
  2920. // NULL C string is considered different to any non-NULL C string,
  2921. // including the empty string.
  2922. static bool CStringEquals(const char* lhs, const char* rhs);
  2923. // Converts a wide C string to a String using the UTF-8 encoding.
  2924. // NULL will be converted to "(null)". If an error occurred during
  2925. // the conversion, "(failed to convert from wide string)" is
  2926. // returned.
  2927. static std::string ShowWideCString(const wchar_t* wide_c_str);
  2928. // Compares two wide C strings. Returns true iff they have the same
  2929. // content.
  2930. //
  2931. // Unlike wcscmp(), this function can handle NULL argument(s). A
  2932. // NULL C string is considered different to any non-NULL C string,
  2933. // including the empty string.
  2934. static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
  2935. // Compares two C strings, ignoring case. Returns true iff they
  2936. // have the same content.
  2937. //
  2938. // Unlike strcasecmp(), this function can handle NULL argument(s).
  2939. // A NULL C string is considered different to any non-NULL C string,
  2940. // including the empty string.
  2941. static bool CaseInsensitiveCStringEquals(const char* lhs,
  2942. const char* rhs);
  2943. // Compares two wide C strings, ignoring case. Returns true iff they
  2944. // have the same content.
  2945. //
  2946. // Unlike wcscasecmp(), this function can handle NULL argument(s).
  2947. // A NULL C string is considered different to any non-NULL wide C string,
  2948. // including the empty string.
  2949. // NB: The implementations on different platforms slightly differ.
  2950. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
  2951. // environment variable. On GNU platform this method uses wcscasecmp
  2952. // which compares according to LC_CTYPE category of the current locale.
  2953. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
  2954. // current locale.
  2955. static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
  2956. const wchar_t* rhs);
  2957. // Returns true iff the given string ends with the given suffix, ignoring
  2958. // case. Any string is considered to end with an empty suffix.
  2959. static bool EndsWithCaseInsensitive(
  2960. const std::string& str, const std::string& suffix);
  2961. // Formats an int value as "%02d".
  2962. static std::string FormatIntWidth2(int value); // "%02d" for width == 2
  2963. // Formats an int value as "%X".
  2964. static std::string FormatHexInt(int value);
  2965. // Formats a byte as "%02X".
  2966. static std::string FormatByte(unsigned char value);
  2967. private:
  2968. String(); // Not meant to be instantiated.
  2969. }; // class String
  2970. // Gets the content of the stringstream's buffer as an std::string. Each '\0'
  2971. // character in the buffer is replaced with "\\0".
  2972. GTEST_API_ std::string StringStreamToString(::std::stringstream* stream);
  2973. } // namespace internal
  2974. } // namespace testing
  2975. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
  2976. // Copyright 2008, Google Inc.
  2977. // All rights reserved.
  2978. //
  2979. // Redistribution and use in source and binary forms, with or without
  2980. // modification, are permitted provided that the following conditions are
  2981. // met:
  2982. //
  2983. // * Redistributions of source code must retain the above copyright
  2984. // notice, this list of conditions and the following disclaimer.
  2985. // * Redistributions in binary form must reproduce the above
  2986. // copyright notice, this list of conditions and the following disclaimer
  2987. // in the documentation and/or other materials provided with the
  2988. // distribution.
  2989. // * Neither the name of Google Inc. nor the names of its
  2990. // contributors may be used to endorse or promote products derived from
  2991. // this software without specific prior written permission.
  2992. //
  2993. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  2994. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  2995. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  2996. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  2997. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  2998. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  2999. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  3000. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  3001. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3002. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  3003. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3004. //
  3005. // Author: keith.ray@gmail.com (Keith Ray)
  3006. //
  3007. // Google Test filepath utilities
  3008. //
  3009. // This header file declares classes and functions used internally by
  3010. // Google Test. They are subject to change without notice.
  3011. //
  3012. // This file is #included in <gtest/internal/gtest-internal.h>.
  3013. // Do not include this header file separately!
  3014. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
  3015. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
  3016. namespace testing {
  3017. namespace internal {
  3018. // FilePath - a class for file and directory pathname manipulation which
  3019. // handles platform-specific conventions (like the pathname separator).
  3020. // Used for helper functions for naming files in a directory for xml output.
  3021. // Except for Set methods, all methods are const or static, which provides an
  3022. // "immutable value object" -- useful for peace of mind.
  3023. // A FilePath with a value ending in a path separator ("like/this/") represents
  3024. // a directory, otherwise it is assumed to represent a file. In either case,
  3025. // it may or may not represent an actual file or directory in the file system.
  3026. // Names are NOT checked for syntax correctness -- no checking for illegal
  3027. // characters, malformed paths, etc.
  3028. class GTEST_API_ FilePath {
  3029. public:
  3030. FilePath() : pathname_("") { }
  3031. FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
  3032. explicit FilePath(const std::string& pathname) : pathname_(pathname) {
  3033. Normalize();
  3034. }
  3035. FilePath& operator=(const FilePath& rhs) {
  3036. Set(rhs);
  3037. return *this;
  3038. }
  3039. void Set(const FilePath& rhs) {
  3040. pathname_ = rhs.pathname_;
  3041. }
  3042. const std::string& string() const { return pathname_; }
  3043. const char* c_str() const { return pathname_.c_str(); }
  3044. // Returns the current working directory, or "" if unsuccessful.
  3045. static FilePath GetCurrentDir();
  3046. // Given directory = "dir", base_name = "test", number = 0,
  3047. // extension = "xml", returns "dir/test.xml". If number is greater
  3048. // than zero (e.g., 12), returns "dir/test_12.xml".
  3049. // On Windows platform, uses \ as the separator rather than /.
  3050. static FilePath MakeFileName(const FilePath& directory,
  3051. const FilePath& base_name,
  3052. int number,
  3053. const char* extension);
  3054. // Given directory = "dir", relative_path = "test.xml",
  3055. // returns "dir/test.xml".
  3056. // On Windows, uses \ as the separator rather than /.
  3057. static FilePath ConcatPaths(const FilePath& directory,
  3058. const FilePath& relative_path);
  3059. // Returns a pathname for a file that does not currently exist. The pathname
  3060. // will be directory/base_name.extension or
  3061. // directory/base_name_<number>.extension if directory/base_name.extension
  3062. // already exists. The number will be incremented until a pathname is found
  3063. // that does not already exist.
  3064. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
  3065. // There could be a race condition if two or more processes are calling this
  3066. // function at the same time -- they could both pick the same filename.
  3067. static FilePath GenerateUniqueFileName(const FilePath& directory,
  3068. const FilePath& base_name,
  3069. const char* extension);
  3070. // Returns true iff the path is "".
  3071. bool IsEmpty() const { return pathname_.empty(); }
  3072. // If input name has a trailing separator character, removes it and returns
  3073. // the name, otherwise return the name string unmodified.
  3074. // On Windows platform, uses \ as the separator, other platforms use /.
  3075. FilePath RemoveTrailingPathSeparator() const;
  3076. // Returns a copy of the FilePath with the directory part removed.
  3077. // Example: FilePath("path/to/file").RemoveDirectoryName() returns
  3078. // FilePath("file"). If there is no directory part ("just_a_file"), it returns
  3079. // the FilePath unmodified. If there is no file part ("just_a_dir/") it
  3080. // returns an empty FilePath ("").
  3081. // On Windows platform, '\' is the path separator, otherwise it is '/'.
  3082. FilePath RemoveDirectoryName() const;
  3083. // RemoveFileName returns the directory path with the filename removed.
  3084. // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
  3085. // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
  3086. // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
  3087. // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
  3088. // On Windows platform, '\' is the path separator, otherwise it is '/'.
  3089. FilePath RemoveFileName() const;
  3090. // Returns a copy of the FilePath with the case-insensitive extension removed.
  3091. // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
  3092. // FilePath("dir/file"). If a case-insensitive extension is not
  3093. // found, returns a copy of the original FilePath.
  3094. FilePath RemoveExtension(const char* extension) const;
  3095. // Creates directories so that path exists. Returns true if successful or if
  3096. // the directories already exist; returns false if unable to create
  3097. // directories for any reason. Will also return false if the FilePath does
  3098. // not represent a directory (that is, it doesn't end with a path separator).
  3099. bool CreateDirectoriesRecursively() const;
  3100. // Create the directory so that path exists. Returns true if successful or
  3101. // if the directory already exists; returns false if unable to create the
  3102. // directory for any reason, including if the parent directory does not
  3103. // exist. Not named "CreateDirectory" because that's a macro on Windows.
  3104. bool CreateFolder() const;
  3105. // Returns true if FilePath describes something in the file-system,
  3106. // either a file, directory, or whatever, and that something exists.
  3107. bool FileOrDirectoryExists() const;
  3108. // Returns true if pathname describes a directory in the file-system
  3109. // that exists.
  3110. bool DirectoryExists() const;
  3111. // Returns true if FilePath ends with a path separator, which indicates that
  3112. // it is intended to represent a directory. Returns false otherwise.
  3113. // This does NOT check that a directory (or file) actually exists.
  3114. bool IsDirectory() const;
  3115. // Returns true if pathname describes a root directory. (Windows has one
  3116. // root directory per disk drive.)
  3117. bool IsRootDirectory() const;
  3118. // Returns true if pathname describes an absolute path.
  3119. bool IsAbsolutePath() const;
  3120. private:
  3121. // Replaces multiple consecutive separators with a single separator.
  3122. // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
  3123. // redundancies that might be in a pathname involving "." or "..".
  3124. //
  3125. // A pathname with multiple consecutive separators may occur either through
  3126. // user error or as a result of some scripts or APIs that generate a pathname
  3127. // with a trailing separator. On other platforms the same API or script
  3128. // may NOT generate a pathname with a trailing "/". Then elsewhere that
  3129. // pathname may have another "/" and pathname components added to it,
  3130. // without checking for the separator already being there.
  3131. // The script language and operating system may allow paths like "foo//bar"
  3132. // but some of the functions in FilePath will not handle that correctly. In
  3133. // particular, RemoveTrailingPathSeparator() only removes one separator, and
  3134. // it is called in CreateDirectoriesRecursively() assuming that it will change
  3135. // a pathname from directory syntax (trailing separator) to filename syntax.
  3136. //
  3137. // On Windows this method also replaces the alternate path separator '/' with
  3138. // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
  3139. // "bar\\foo".
  3140. void Normalize();
  3141. // Returns a pointer to the last occurence of a valid path separator in
  3142. // the FilePath. On Windows, for example, both '/' and '\' are valid path
  3143. // separators. Returns NULL if no path separator was found.
  3144. const char* FindLastPathSeparator() const;
  3145. std::string pathname_;
  3146. }; // class FilePath
  3147. } // namespace internal
  3148. } // namespace testing
  3149. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
  3150. // This file was GENERATED by command:
  3151. // pump.py gtest-type-util.h.pump
  3152. // DO NOT EDIT BY HAND!!!
  3153. // Copyright 2008 Google Inc.
  3154. // All Rights Reserved.
  3155. //
  3156. // Redistribution and use in source and binary forms, with or without
  3157. // modification, are permitted provided that the following conditions are
  3158. // met:
  3159. //
  3160. // * Redistributions of source code must retain the above copyright
  3161. // notice, this list of conditions and the following disclaimer.
  3162. // * Redistributions in binary form must reproduce the above
  3163. // copyright notice, this list of conditions and the following disclaimer
  3164. // in the documentation and/or other materials provided with the
  3165. // distribution.
  3166. // * Neither the name of Google Inc. nor the names of its
  3167. // contributors may be used to endorse or promote products derived from
  3168. // this software without specific prior written permission.
  3169. //
  3170. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  3171. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  3172. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  3173. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  3174. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  3175. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  3176. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  3177. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  3178. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3179. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  3180. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3181. //
  3182. // Author: wan@google.com (Zhanyong Wan)
  3183. // Type utilities needed for implementing typed and type-parameterized
  3184. // tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
  3185. //
  3186. // Currently we support at most 50 types in a list, and at most 50
  3187. // type-parameterized tests in one type-parameterized test case.
  3188. // Please contact googletestframework@googlegroups.com if you need
  3189. // more.
  3190. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
  3191. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
  3192. // #ifdef __GNUC__ is too general here. It is possible to use gcc without using
  3193. // libstdc++ (which is where cxxabi.h comes from).
  3194. # if GTEST_HAS_CXXABI_H_
  3195. # include <cxxabi.h>
  3196. # elif defined(__HP_aCC)
  3197. # include <acxx_demangle.h>
  3198. # endif // GTEST_HASH_CXXABI_H_
  3199. namespace testing {
  3200. namespace internal {
  3201. // GetTypeName<T>() returns a human-readable name of type T.
  3202. // NB: This function is also used in Google Mock, so don't move it inside of
  3203. // the typed-test-only section below.
  3204. template <typename T>
  3205. std::string GetTypeName() {
  3206. # if GTEST_HAS_RTTI
  3207. const char* const name = typeid(T).name();
  3208. # if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
  3209. int status = 0;
  3210. // gcc's implementation of typeid(T).name() mangles the type name,
  3211. // so we have to demangle it.
  3212. # if GTEST_HAS_CXXABI_H_
  3213. using abi::__cxa_demangle;
  3214. # endif // GTEST_HAS_CXXABI_H_
  3215. char* const readable_name = __cxa_demangle(name, 0, 0, &status);
  3216. const std::string name_str(status == 0 ? readable_name : name);
  3217. free(readable_name);
  3218. return name_str;
  3219. # else
  3220. return name;
  3221. # endif // GTEST_HAS_CXXABI_H_ || __HP_aCC
  3222. # else
  3223. return "<type>";
  3224. # endif // GTEST_HAS_RTTI
  3225. }
  3226. #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  3227. // AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
  3228. // type. This can be used as a compile-time assertion to ensure that
  3229. // two types are equal.
  3230. template <typename T1, typename T2>
  3231. struct AssertTypeEq;
  3232. template <typename T>
  3233. struct AssertTypeEq<T, T> {
  3234. typedef bool type;
  3235. };
  3236. // A unique type used as the default value for the arguments of class
  3237. // template Types. This allows us to simulate variadic templates
  3238. // (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
  3239. // support directly.
  3240. struct None {};
  3241. // The following family of struct and struct templates are used to
  3242. // represent type lists. In particular, TypesN<T1, T2, ..., TN>
  3243. // represents a type list with N types (T1, T2, ..., and TN) in it.
  3244. // Except for Types0, every struct in the family has two member types:
  3245. // Head for the first type in the list, and Tail for the rest of the
  3246. // list.
  3247. // The empty type list.
  3248. struct Types0 {};
  3249. // Type lists of length 1, 2, 3, and so on.
  3250. template <typename T1>
  3251. struct Types1 {
  3252. typedef T1 Head;
  3253. typedef Types0 Tail;
  3254. };
  3255. template <typename T1, typename T2>
  3256. struct Types2 {
  3257. typedef T1 Head;
  3258. typedef Types1<T2> Tail;
  3259. };
  3260. template <typename T1, typename T2, typename T3>
  3261. struct Types3 {
  3262. typedef T1 Head;
  3263. typedef Types2<T2, T3> Tail;
  3264. };
  3265. template <typename T1, typename T2, typename T3, typename T4>
  3266. struct Types4 {
  3267. typedef T1 Head;
  3268. typedef Types3<T2, T3, T4> Tail;
  3269. };
  3270. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  3271. struct Types5 {
  3272. typedef T1 Head;
  3273. typedef Types4<T2, T3, T4, T5> Tail;
  3274. };
  3275. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3276. typename T6>
  3277. struct Types6 {
  3278. typedef T1 Head;
  3279. typedef Types5<T2, T3, T4, T5, T6> Tail;
  3280. };
  3281. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3282. typename T6, typename T7>
  3283. struct Types7 {
  3284. typedef T1 Head;
  3285. typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
  3286. };
  3287. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3288. typename T6, typename T7, typename T8>
  3289. struct Types8 {
  3290. typedef T1 Head;
  3291. typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
  3292. };
  3293. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3294. typename T6, typename T7, typename T8, typename T9>
  3295. struct Types9 {
  3296. typedef T1 Head;
  3297. typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
  3298. };
  3299. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3300. typename T6, typename T7, typename T8, typename T9, typename T10>
  3301. struct Types10 {
  3302. typedef T1 Head;
  3303. typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
  3304. };
  3305. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3306. typename T6, typename T7, typename T8, typename T9, typename T10,
  3307. typename T11>
  3308. struct Types11 {
  3309. typedef T1 Head;
  3310. typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
  3311. };
  3312. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3313. typename T6, typename T7, typename T8, typename T9, typename T10,
  3314. typename T11, typename T12>
  3315. struct Types12 {
  3316. typedef T1 Head;
  3317. typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
  3318. };
  3319. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3320. typename T6, typename T7, typename T8, typename T9, typename T10,
  3321. typename T11, typename T12, typename T13>
  3322. struct Types13 {
  3323. typedef T1 Head;
  3324. typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
  3325. };
  3326. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3327. typename T6, typename T7, typename T8, typename T9, typename T10,
  3328. typename T11, typename T12, typename T13, typename T14>
  3329. struct Types14 {
  3330. typedef T1 Head;
  3331. typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
  3332. };
  3333. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3334. typename T6, typename T7, typename T8, typename T9, typename T10,
  3335. typename T11, typename T12, typename T13, typename T14, typename T15>
  3336. struct Types15 {
  3337. typedef T1 Head;
  3338. typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  3339. T15> Tail;
  3340. };
  3341. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3342. typename T6, typename T7, typename T8, typename T9, typename T10,
  3343. typename T11, typename T12, typename T13, typename T14, typename T15,
  3344. typename T16>
  3345. struct Types16 {
  3346. typedef T1 Head;
  3347. typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3348. T16> Tail;
  3349. };
  3350. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3351. typename T6, typename T7, typename T8, typename T9, typename T10,
  3352. typename T11, typename T12, typename T13, typename T14, typename T15,
  3353. typename T16, typename T17>
  3354. struct Types17 {
  3355. typedef T1 Head;
  3356. typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3357. T16, T17> Tail;
  3358. };
  3359. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3360. typename T6, typename T7, typename T8, typename T9, typename T10,
  3361. typename T11, typename T12, typename T13, typename T14, typename T15,
  3362. typename T16, typename T17, typename T18>
  3363. struct Types18 {
  3364. typedef T1 Head;
  3365. typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3366. T16, T17, T18> Tail;
  3367. };
  3368. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3369. typename T6, typename T7, typename T8, typename T9, typename T10,
  3370. typename T11, typename T12, typename T13, typename T14, typename T15,
  3371. typename T16, typename T17, typename T18, typename T19>
  3372. struct Types19 {
  3373. typedef T1 Head;
  3374. typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3375. T16, T17, T18, T19> Tail;
  3376. };
  3377. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3378. typename T6, typename T7, typename T8, typename T9, typename T10,
  3379. typename T11, typename T12, typename T13, typename T14, typename T15,
  3380. typename T16, typename T17, typename T18, typename T19, typename T20>
  3381. struct Types20 {
  3382. typedef T1 Head;
  3383. typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3384. T16, T17, T18, T19, T20> Tail;
  3385. };
  3386. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3387. typename T6, typename T7, typename T8, typename T9, typename T10,
  3388. typename T11, typename T12, typename T13, typename T14, typename T15,
  3389. typename T16, typename T17, typename T18, typename T19, typename T20,
  3390. typename T21>
  3391. struct Types21 {
  3392. typedef T1 Head;
  3393. typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3394. T16, T17, T18, T19, T20, T21> Tail;
  3395. };
  3396. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3397. typename T6, typename T7, typename T8, typename T9, typename T10,
  3398. typename T11, typename T12, typename T13, typename T14, typename T15,
  3399. typename T16, typename T17, typename T18, typename T19, typename T20,
  3400. typename T21, typename T22>
  3401. struct Types22 {
  3402. typedef T1 Head;
  3403. typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3404. T16, T17, T18, T19, T20, T21, T22> Tail;
  3405. };
  3406. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3407. typename T6, typename T7, typename T8, typename T9, typename T10,
  3408. typename T11, typename T12, typename T13, typename T14, typename T15,
  3409. typename T16, typename T17, typename T18, typename T19, typename T20,
  3410. typename T21, typename T22, typename T23>
  3411. struct Types23 {
  3412. typedef T1 Head;
  3413. typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3414. T16, T17, T18, T19, T20, T21, T22, T23> Tail;
  3415. };
  3416. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3417. typename T6, typename T7, typename T8, typename T9, typename T10,
  3418. typename T11, typename T12, typename T13, typename T14, typename T15,
  3419. typename T16, typename T17, typename T18, typename T19, typename T20,
  3420. typename T21, typename T22, typename T23, typename T24>
  3421. struct Types24 {
  3422. typedef T1 Head;
  3423. typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3424. T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
  3425. };
  3426. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3427. typename T6, typename T7, typename T8, typename T9, typename T10,
  3428. typename T11, typename T12, typename T13, typename T14, typename T15,
  3429. typename T16, typename T17, typename T18, typename T19, typename T20,
  3430. typename T21, typename T22, typename T23, typename T24, typename T25>
  3431. struct Types25 {
  3432. typedef T1 Head;
  3433. typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3434. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
  3435. };
  3436. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3437. typename T6, typename T7, typename T8, typename T9, typename T10,
  3438. typename T11, typename T12, typename T13, typename T14, typename T15,
  3439. typename T16, typename T17, typename T18, typename T19, typename T20,
  3440. typename T21, typename T22, typename T23, typename T24, typename T25,
  3441. typename T26>
  3442. struct Types26 {
  3443. typedef T1 Head;
  3444. typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3445. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
  3446. };
  3447. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3448. typename T6, typename T7, typename T8, typename T9, typename T10,
  3449. typename T11, typename T12, typename T13, typename T14, typename T15,
  3450. typename T16, typename T17, typename T18, typename T19, typename T20,
  3451. typename T21, typename T22, typename T23, typename T24, typename T25,
  3452. typename T26, typename T27>
  3453. struct Types27 {
  3454. typedef T1 Head;
  3455. typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3456. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
  3457. };
  3458. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3459. typename T6, typename T7, typename T8, typename T9, typename T10,
  3460. typename T11, typename T12, typename T13, typename T14, typename T15,
  3461. typename T16, typename T17, typename T18, typename T19, typename T20,
  3462. typename T21, typename T22, typename T23, typename T24, typename T25,
  3463. typename T26, typename T27, typename T28>
  3464. struct Types28 {
  3465. typedef T1 Head;
  3466. typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3467. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
  3468. };
  3469. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3470. typename T6, typename T7, typename T8, typename T9, typename T10,
  3471. typename T11, typename T12, typename T13, typename T14, typename T15,
  3472. typename T16, typename T17, typename T18, typename T19, typename T20,
  3473. typename T21, typename T22, typename T23, typename T24, typename T25,
  3474. typename T26, typename T27, typename T28, typename T29>
  3475. struct Types29 {
  3476. typedef T1 Head;
  3477. typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3478. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  3479. T29> Tail;
  3480. };
  3481. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3482. typename T6, typename T7, typename T8, typename T9, typename T10,
  3483. typename T11, typename T12, typename T13, typename T14, typename T15,
  3484. typename T16, typename T17, typename T18, typename T19, typename T20,
  3485. typename T21, typename T22, typename T23, typename T24, typename T25,
  3486. typename T26, typename T27, typename T28, typename T29, typename T30>
  3487. struct Types30 {
  3488. typedef T1 Head;
  3489. typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3490. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3491. T30> Tail;
  3492. };
  3493. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3494. typename T6, typename T7, typename T8, typename T9, typename T10,
  3495. typename T11, typename T12, typename T13, typename T14, typename T15,
  3496. typename T16, typename T17, typename T18, typename T19, typename T20,
  3497. typename T21, typename T22, typename T23, typename T24, typename T25,
  3498. typename T26, typename T27, typename T28, typename T29, typename T30,
  3499. typename T31>
  3500. struct Types31 {
  3501. typedef T1 Head;
  3502. typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3503. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3504. T30, T31> Tail;
  3505. };
  3506. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3507. typename T6, typename T7, typename T8, typename T9, typename T10,
  3508. typename T11, typename T12, typename T13, typename T14, typename T15,
  3509. typename T16, typename T17, typename T18, typename T19, typename T20,
  3510. typename T21, typename T22, typename T23, typename T24, typename T25,
  3511. typename T26, typename T27, typename T28, typename T29, typename T30,
  3512. typename T31, typename T32>
  3513. struct Types32 {
  3514. typedef T1 Head;
  3515. typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3516. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3517. T30, T31, T32> Tail;
  3518. };
  3519. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3520. typename T6, typename T7, typename T8, typename T9, typename T10,
  3521. typename T11, typename T12, typename T13, typename T14, typename T15,
  3522. typename T16, typename T17, typename T18, typename T19, typename T20,
  3523. typename T21, typename T22, typename T23, typename T24, typename T25,
  3524. typename T26, typename T27, typename T28, typename T29, typename T30,
  3525. typename T31, typename T32, typename T33>
  3526. struct Types33 {
  3527. typedef T1 Head;
  3528. typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3529. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3530. T30, T31, T32, T33> Tail;
  3531. };
  3532. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3533. typename T6, typename T7, typename T8, typename T9, typename T10,
  3534. typename T11, typename T12, typename T13, typename T14, typename T15,
  3535. typename T16, typename T17, typename T18, typename T19, typename T20,
  3536. typename T21, typename T22, typename T23, typename T24, typename T25,
  3537. typename T26, typename T27, typename T28, typename T29, typename T30,
  3538. typename T31, typename T32, typename T33, typename T34>
  3539. struct Types34 {
  3540. typedef T1 Head;
  3541. typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3542. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3543. T30, T31, T32, T33, T34> Tail;
  3544. };
  3545. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3546. typename T6, typename T7, typename T8, typename T9, typename T10,
  3547. typename T11, typename T12, typename T13, typename T14, typename T15,
  3548. typename T16, typename T17, typename T18, typename T19, typename T20,
  3549. typename T21, typename T22, typename T23, typename T24, typename T25,
  3550. typename T26, typename T27, typename T28, typename T29, typename T30,
  3551. typename T31, typename T32, typename T33, typename T34, typename T35>
  3552. struct Types35 {
  3553. typedef T1 Head;
  3554. typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3555. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3556. T30, T31, T32, T33, T34, T35> Tail;
  3557. };
  3558. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3559. typename T6, typename T7, typename T8, typename T9, typename T10,
  3560. typename T11, typename T12, typename T13, typename T14, typename T15,
  3561. typename T16, typename T17, typename T18, typename T19, typename T20,
  3562. typename T21, typename T22, typename T23, typename T24, typename T25,
  3563. typename T26, typename T27, typename T28, typename T29, typename T30,
  3564. typename T31, typename T32, typename T33, typename T34, typename T35,
  3565. typename T36>
  3566. struct Types36 {
  3567. typedef T1 Head;
  3568. typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3569. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3570. T30, T31, T32, T33, T34, T35, T36> Tail;
  3571. };
  3572. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3573. typename T6, typename T7, typename T8, typename T9, typename T10,
  3574. typename T11, typename T12, typename T13, typename T14, typename T15,
  3575. typename T16, typename T17, typename T18, typename T19, typename T20,
  3576. typename T21, typename T22, typename T23, typename T24, typename T25,
  3577. typename T26, typename T27, typename T28, typename T29, typename T30,
  3578. typename T31, typename T32, typename T33, typename T34, typename T35,
  3579. typename T36, typename T37>
  3580. struct Types37 {
  3581. typedef T1 Head;
  3582. typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3583. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3584. T30, T31, T32, T33, T34, T35, T36, T37> Tail;
  3585. };
  3586. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3587. typename T6, typename T7, typename T8, typename T9, typename T10,
  3588. typename T11, typename T12, typename T13, typename T14, typename T15,
  3589. typename T16, typename T17, typename T18, typename T19, typename T20,
  3590. typename T21, typename T22, typename T23, typename T24, typename T25,
  3591. typename T26, typename T27, typename T28, typename T29, typename T30,
  3592. typename T31, typename T32, typename T33, typename T34, typename T35,
  3593. typename T36, typename T37, typename T38>
  3594. struct Types38 {
  3595. typedef T1 Head;
  3596. typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3597. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3598. T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
  3599. };
  3600. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3601. typename T6, typename T7, typename T8, typename T9, typename T10,
  3602. typename T11, typename T12, typename T13, typename T14, typename T15,
  3603. typename T16, typename T17, typename T18, typename T19, typename T20,
  3604. typename T21, typename T22, typename T23, typename T24, typename T25,
  3605. typename T26, typename T27, typename T28, typename T29, typename T30,
  3606. typename T31, typename T32, typename T33, typename T34, typename T35,
  3607. typename T36, typename T37, typename T38, typename T39>
  3608. struct Types39 {
  3609. typedef T1 Head;
  3610. typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3611. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3612. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
  3613. };
  3614. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3615. typename T6, typename T7, typename T8, typename T9, typename T10,
  3616. typename T11, typename T12, typename T13, typename T14, typename T15,
  3617. typename T16, typename T17, typename T18, typename T19, typename T20,
  3618. typename T21, typename T22, typename T23, typename T24, typename T25,
  3619. typename T26, typename T27, typename T28, typename T29, typename T30,
  3620. typename T31, typename T32, typename T33, typename T34, typename T35,
  3621. typename T36, typename T37, typename T38, typename T39, typename T40>
  3622. struct Types40 {
  3623. typedef T1 Head;
  3624. typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3625. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3626. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
  3627. };
  3628. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3629. typename T6, typename T7, typename T8, typename T9, typename T10,
  3630. typename T11, typename T12, typename T13, typename T14, typename T15,
  3631. typename T16, typename T17, typename T18, typename T19, typename T20,
  3632. typename T21, typename T22, typename T23, typename T24, typename T25,
  3633. typename T26, typename T27, typename T28, typename T29, typename T30,
  3634. typename T31, typename T32, typename T33, typename T34, typename T35,
  3635. typename T36, typename T37, typename T38, typename T39, typename T40,
  3636. typename T41>
  3637. struct Types41 {
  3638. typedef T1 Head;
  3639. typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3640. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3641. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
  3642. };
  3643. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3644. typename T6, typename T7, typename T8, typename T9, typename T10,
  3645. typename T11, typename T12, typename T13, typename T14, typename T15,
  3646. typename T16, typename T17, typename T18, typename T19, typename T20,
  3647. typename T21, typename T22, typename T23, typename T24, typename T25,
  3648. typename T26, typename T27, typename T28, typename T29, typename T30,
  3649. typename T31, typename T32, typename T33, typename T34, typename T35,
  3650. typename T36, typename T37, typename T38, typename T39, typename T40,
  3651. typename T41, typename T42>
  3652. struct Types42 {
  3653. typedef T1 Head;
  3654. typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3655. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3656. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
  3657. };
  3658. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3659. typename T6, typename T7, typename T8, typename T9, typename T10,
  3660. typename T11, typename T12, typename T13, typename T14, typename T15,
  3661. typename T16, typename T17, typename T18, typename T19, typename T20,
  3662. typename T21, typename T22, typename T23, typename T24, typename T25,
  3663. typename T26, typename T27, typename T28, typename T29, typename T30,
  3664. typename T31, typename T32, typename T33, typename T34, typename T35,
  3665. typename T36, typename T37, typename T38, typename T39, typename T40,
  3666. typename T41, typename T42, typename T43>
  3667. struct Types43 {
  3668. typedef T1 Head;
  3669. typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3670. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3671. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  3672. T43> Tail;
  3673. };
  3674. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3675. typename T6, typename T7, typename T8, typename T9, typename T10,
  3676. typename T11, typename T12, typename T13, typename T14, typename T15,
  3677. typename T16, typename T17, typename T18, typename T19, typename T20,
  3678. typename T21, typename T22, typename T23, typename T24, typename T25,
  3679. typename T26, typename T27, typename T28, typename T29, typename T30,
  3680. typename T31, typename T32, typename T33, typename T34, typename T35,
  3681. typename T36, typename T37, typename T38, typename T39, typename T40,
  3682. typename T41, typename T42, typename T43, typename T44>
  3683. struct Types44 {
  3684. typedef T1 Head;
  3685. typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3686. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3687. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3688. T44> Tail;
  3689. };
  3690. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3691. typename T6, typename T7, typename T8, typename T9, typename T10,
  3692. typename T11, typename T12, typename T13, typename T14, typename T15,
  3693. typename T16, typename T17, typename T18, typename T19, typename T20,
  3694. typename T21, typename T22, typename T23, typename T24, typename T25,
  3695. typename T26, typename T27, typename T28, typename T29, typename T30,
  3696. typename T31, typename T32, typename T33, typename T34, typename T35,
  3697. typename T36, typename T37, typename T38, typename T39, typename T40,
  3698. typename T41, typename T42, typename T43, typename T44, typename T45>
  3699. struct Types45 {
  3700. typedef T1 Head;
  3701. typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3702. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3703. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3704. T44, T45> Tail;
  3705. };
  3706. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3707. typename T6, typename T7, typename T8, typename T9, typename T10,
  3708. typename T11, typename T12, typename T13, typename T14, typename T15,
  3709. typename T16, typename T17, typename T18, typename T19, typename T20,
  3710. typename T21, typename T22, typename T23, typename T24, typename T25,
  3711. typename T26, typename T27, typename T28, typename T29, typename T30,
  3712. typename T31, typename T32, typename T33, typename T34, typename T35,
  3713. typename T36, typename T37, typename T38, typename T39, typename T40,
  3714. typename T41, typename T42, typename T43, typename T44, typename T45,
  3715. typename T46>
  3716. struct Types46 {
  3717. typedef T1 Head;
  3718. typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3719. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3720. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3721. T44, T45, T46> Tail;
  3722. };
  3723. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3724. typename T6, typename T7, typename T8, typename T9, typename T10,
  3725. typename T11, typename T12, typename T13, typename T14, typename T15,
  3726. typename T16, typename T17, typename T18, typename T19, typename T20,
  3727. typename T21, typename T22, typename T23, typename T24, typename T25,
  3728. typename T26, typename T27, typename T28, typename T29, typename T30,
  3729. typename T31, typename T32, typename T33, typename T34, typename T35,
  3730. typename T36, typename T37, typename T38, typename T39, typename T40,
  3731. typename T41, typename T42, typename T43, typename T44, typename T45,
  3732. typename T46, typename T47>
  3733. struct Types47 {
  3734. typedef T1 Head;
  3735. typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3736. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3737. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3738. T44, T45, T46, T47> Tail;
  3739. };
  3740. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3741. typename T6, typename T7, typename T8, typename T9, typename T10,
  3742. typename T11, typename T12, typename T13, typename T14, typename T15,
  3743. typename T16, typename T17, typename T18, typename T19, typename T20,
  3744. typename T21, typename T22, typename T23, typename T24, typename T25,
  3745. typename T26, typename T27, typename T28, typename T29, typename T30,
  3746. typename T31, typename T32, typename T33, typename T34, typename T35,
  3747. typename T36, typename T37, typename T38, typename T39, typename T40,
  3748. typename T41, typename T42, typename T43, typename T44, typename T45,
  3749. typename T46, typename T47, typename T48>
  3750. struct Types48 {
  3751. typedef T1 Head;
  3752. typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3753. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3754. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3755. T44, T45, T46, T47, T48> Tail;
  3756. };
  3757. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3758. typename T6, typename T7, typename T8, typename T9, typename T10,
  3759. typename T11, typename T12, typename T13, typename T14, typename T15,
  3760. typename T16, typename T17, typename T18, typename T19, typename T20,
  3761. typename T21, typename T22, typename T23, typename T24, typename T25,
  3762. typename T26, typename T27, typename T28, typename T29, typename T30,
  3763. typename T31, typename T32, typename T33, typename T34, typename T35,
  3764. typename T36, typename T37, typename T38, typename T39, typename T40,
  3765. typename T41, typename T42, typename T43, typename T44, typename T45,
  3766. typename T46, typename T47, typename T48, typename T49>
  3767. struct Types49 {
  3768. typedef T1 Head;
  3769. typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3770. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3771. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3772. T44, T45, T46, T47, T48, T49> Tail;
  3773. };
  3774. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3775. typename T6, typename T7, typename T8, typename T9, typename T10,
  3776. typename T11, typename T12, typename T13, typename T14, typename T15,
  3777. typename T16, typename T17, typename T18, typename T19, typename T20,
  3778. typename T21, typename T22, typename T23, typename T24, typename T25,
  3779. typename T26, typename T27, typename T28, typename T29, typename T30,
  3780. typename T31, typename T32, typename T33, typename T34, typename T35,
  3781. typename T36, typename T37, typename T38, typename T39, typename T40,
  3782. typename T41, typename T42, typename T43, typename T44, typename T45,
  3783. typename T46, typename T47, typename T48, typename T49, typename T50>
  3784. struct Types50 {
  3785. typedef T1 Head;
  3786. typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3787. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3788. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3789. T44, T45, T46, T47, T48, T49, T50> Tail;
  3790. };
  3791. } // namespace internal
  3792. // We don't want to require the users to write TypesN<...> directly,
  3793. // as that would require them to count the length. Types<...> is much
  3794. // easier to write, but generates horrible messages when there is a
  3795. // compiler error, as gcc insists on printing out each template
  3796. // argument, even if it has the default value (this means Types<int>
  3797. // will appear as Types<int, None, None, ..., None> in the compiler
  3798. // errors).
  3799. //
  3800. // Our solution is to combine the best part of the two approaches: a
  3801. // user would write Types<T1, ..., TN>, and Google Test will translate
  3802. // that to TypesN<T1, ..., TN> internally to make error messages
  3803. // readable. The translation is done by the 'type' member of the
  3804. // Types template.
  3805. template <typename T1 = internal::None, typename T2 = internal::None,
  3806. typename T3 = internal::None, typename T4 = internal::None,
  3807. typename T5 = internal::None, typename T6 = internal::None,
  3808. typename T7 = internal::None, typename T8 = internal::None,
  3809. typename T9 = internal::None, typename T10 = internal::None,
  3810. typename T11 = internal::None, typename T12 = internal::None,
  3811. typename T13 = internal::None, typename T14 = internal::None,
  3812. typename T15 = internal::None, typename T16 = internal::None,
  3813. typename T17 = internal::None, typename T18 = internal::None,
  3814. typename T19 = internal::None, typename T20 = internal::None,
  3815. typename T21 = internal::None, typename T22 = internal::None,
  3816. typename T23 = internal::None, typename T24 = internal::None,
  3817. typename T25 = internal::None, typename T26 = internal::None,
  3818. typename T27 = internal::None, typename T28 = internal::None,
  3819. typename T29 = internal::None, typename T30 = internal::None,
  3820. typename T31 = internal::None, typename T32 = internal::None,
  3821. typename T33 = internal::None, typename T34 = internal::None,
  3822. typename T35 = internal::None, typename T36 = internal::None,
  3823. typename T37 = internal::None, typename T38 = internal::None,
  3824. typename T39 = internal::None, typename T40 = internal::None,
  3825. typename T41 = internal::None, typename T42 = internal::None,
  3826. typename T43 = internal::None, typename T44 = internal::None,
  3827. typename T45 = internal::None, typename T46 = internal::None,
  3828. typename T47 = internal::None, typename T48 = internal::None,
  3829. typename T49 = internal::None, typename T50 = internal::None>
  3830. struct Types {
  3831. typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3832. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  3833. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  3834. T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
  3835. };
  3836. template <>
  3837. struct Types<internal::None, internal::None, internal::None, internal::None,
  3838. internal::None, internal::None, internal::None, internal::None,
  3839. internal::None, internal::None, internal::None, internal::None,
  3840. internal::None, internal::None, internal::None, internal::None,
  3841. internal::None, internal::None, internal::None, internal::None,
  3842. internal::None, internal::None, internal::None, internal::None,
  3843. internal::None, internal::None, internal::None, internal::None,
  3844. internal::None, internal::None, internal::None, internal::None,
  3845. internal::None, internal::None, internal::None, internal::None,
  3846. internal::None, internal::None, internal::None, internal::None,
  3847. internal::None, internal::None, internal::None, internal::None,
  3848. internal::None, internal::None, internal::None, internal::None,
  3849. internal::None, internal::None> {
  3850. typedef internal::Types0 type;
  3851. };
  3852. template <typename T1>
  3853. struct Types<T1, internal::None, internal::None, internal::None,
  3854. internal::None, internal::None, internal::None, internal::None,
  3855. internal::None, internal::None, internal::None, internal::None,
  3856. internal::None, internal::None, internal::None, internal::None,
  3857. internal::None, internal::None, internal::None, internal::None,
  3858. internal::None, internal::None, internal::None, internal::None,
  3859. internal::None, internal::None, internal::None, internal::None,
  3860. internal::None, internal::None, internal::None, internal::None,
  3861. internal::None, internal::None, internal::None, internal::None,
  3862. internal::None, internal::None, internal::None, internal::None,
  3863. internal::None, internal::None, internal::None, internal::None,
  3864. internal::None, internal::None, internal::None, internal::None,
  3865. internal::None, internal::None> {
  3866. typedef internal::Types1<T1> type;
  3867. };
  3868. template <typename T1, typename T2>
  3869. struct Types<T1, T2, internal::None, internal::None, internal::None,
  3870. internal::None, internal::None, internal::None, internal::None,
  3871. internal::None, internal::None, internal::None, internal::None,
  3872. internal::None, internal::None, internal::None, internal::None,
  3873. internal::None, internal::None, internal::None, internal::None,
  3874. internal::None, internal::None, internal::None, internal::None,
  3875. internal::None, internal::None, internal::None, internal::None,
  3876. internal::None, internal::None, internal::None, internal::None,
  3877. internal::None, internal::None, internal::None, internal::None,
  3878. internal::None, internal::None, internal::None, internal::None,
  3879. internal::None, internal::None, internal::None, internal::None,
  3880. internal::None, internal::None, internal::None, internal::None,
  3881. internal::None> {
  3882. typedef internal::Types2<T1, T2> type;
  3883. };
  3884. template <typename T1, typename T2, typename T3>
  3885. struct Types<T1, T2, T3, internal::None, internal::None, internal::None,
  3886. internal::None, internal::None, internal::None, internal::None,
  3887. internal::None, internal::None, internal::None, internal::None,
  3888. internal::None, internal::None, internal::None, internal::None,
  3889. internal::None, internal::None, internal::None, internal::None,
  3890. internal::None, internal::None, internal::None, internal::None,
  3891. internal::None, internal::None, internal::None, internal::None,
  3892. internal::None, internal::None, internal::None, internal::None,
  3893. internal::None, internal::None, internal::None, internal::None,
  3894. internal::None, internal::None, internal::None, internal::None,
  3895. internal::None, internal::None, internal::None, internal::None,
  3896. internal::None, internal::None, internal::None, internal::None> {
  3897. typedef internal::Types3<T1, T2, T3> type;
  3898. };
  3899. template <typename T1, typename T2, typename T3, typename T4>
  3900. struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,
  3901. internal::None, internal::None, internal::None, internal::None,
  3902. internal::None, internal::None, internal::None, internal::None,
  3903. internal::None, internal::None, internal::None, internal::None,
  3904. internal::None, internal::None, internal::None, internal::None,
  3905. internal::None, internal::None, internal::None, internal::None,
  3906. internal::None, internal::None, internal::None, internal::None,
  3907. internal::None, internal::None, internal::None, internal::None,
  3908. internal::None, internal::None, internal::None, internal::None,
  3909. internal::None, internal::None, internal::None, internal::None,
  3910. internal::None, internal::None, internal::None, internal::None,
  3911. internal::None, internal::None, internal::None> {
  3912. typedef internal::Types4<T1, T2, T3, T4> type;
  3913. };
  3914. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  3915. struct Types<T1, T2, T3, T4, T5, internal::None, internal::None,
  3916. internal::None, internal::None, internal::None, internal::None,
  3917. internal::None, internal::None, internal::None, internal::None,
  3918. internal::None, internal::None, internal::None, internal::None,
  3919. internal::None, internal::None, internal::None, internal::None,
  3920. internal::None, internal::None, internal::None, internal::None,
  3921. internal::None, internal::None, internal::None, internal::None,
  3922. internal::None, internal::None, internal::None, internal::None,
  3923. internal::None, internal::None, internal::None, internal::None,
  3924. internal::None, internal::None, internal::None, internal::None,
  3925. internal::None, internal::None, internal::None, internal::None,
  3926. internal::None, internal::None, internal::None> {
  3927. typedef internal::Types5<T1, T2, T3, T4, T5> type;
  3928. };
  3929. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3930. typename T6>
  3931. struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,
  3932. internal::None, internal::None, internal::None, internal::None,
  3933. internal::None, internal::None, internal::None, internal::None,
  3934. internal::None, internal::None, internal::None, internal::None,
  3935. internal::None, internal::None, internal::None, internal::None,
  3936. internal::None, internal::None, internal::None, internal::None,
  3937. internal::None, internal::None, internal::None, internal::None,
  3938. internal::None, internal::None, internal::None, internal::None,
  3939. internal::None, internal::None, internal::None, internal::None,
  3940. internal::None, internal::None, internal::None, internal::None,
  3941. internal::None, internal::None, internal::None, internal::None,
  3942. internal::None, internal::None> {
  3943. typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
  3944. };
  3945. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3946. typename T6, typename T7>
  3947. struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,
  3948. internal::None, internal::None, internal::None, internal::None,
  3949. internal::None, internal::None, internal::None, internal::None,
  3950. internal::None, internal::None, internal::None, internal::None,
  3951. internal::None, internal::None, internal::None, internal::None,
  3952. internal::None, internal::None, internal::None, internal::None,
  3953. internal::None, internal::None, internal::None, internal::None,
  3954. internal::None, internal::None, internal::None, internal::None,
  3955. internal::None, internal::None, internal::None, internal::None,
  3956. internal::None, internal::None, internal::None, internal::None,
  3957. internal::None, internal::None, internal::None, internal::None,
  3958. internal::None> {
  3959. typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
  3960. };
  3961. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3962. typename T6, typename T7, typename T8>
  3963. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,
  3964. internal::None, internal::None, internal::None, internal::None,
  3965. internal::None, internal::None, internal::None, internal::None,
  3966. internal::None, internal::None, internal::None, internal::None,
  3967. internal::None, internal::None, internal::None, internal::None,
  3968. internal::None, internal::None, internal::None, internal::None,
  3969. internal::None, internal::None, internal::None, internal::None,
  3970. internal::None, internal::None, internal::None, internal::None,
  3971. internal::None, internal::None, internal::None, internal::None,
  3972. internal::None, internal::None, internal::None, internal::None,
  3973. internal::None, internal::None, internal::None, internal::None> {
  3974. typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
  3975. };
  3976. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3977. typename T6, typename T7, typename T8, typename T9>
  3978. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,
  3979. internal::None, internal::None, internal::None, internal::None,
  3980. internal::None, internal::None, internal::None, internal::None,
  3981. internal::None, internal::None, internal::None, internal::None,
  3982. internal::None, internal::None, internal::None, internal::None,
  3983. internal::None, internal::None, internal::None, internal::None,
  3984. internal::None, internal::None, internal::None, internal::None,
  3985. internal::None, internal::None, internal::None, internal::None,
  3986. internal::None, internal::None, internal::None, internal::None,
  3987. internal::None, internal::None, internal::None, internal::None,
  3988. internal::None, internal::None, internal::None, internal::None> {
  3989. typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
  3990. };
  3991. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3992. typename T6, typename T7, typename T8, typename T9, typename T10>
  3993. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,
  3994. internal::None, internal::None, internal::None, internal::None,
  3995. internal::None, internal::None, internal::None, internal::None,
  3996. internal::None, internal::None, internal::None, internal::None,
  3997. internal::None, internal::None, internal::None, internal::None,
  3998. internal::None, internal::None, internal::None, internal::None,
  3999. internal::None, internal::None, internal::None, internal::None,
  4000. internal::None, internal::None, internal::None, internal::None,
  4001. internal::None, internal::None, internal::None, internal::None,
  4002. internal::None, internal::None, internal::None, internal::None,
  4003. internal::None, internal::None, internal::None> {
  4004. typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
  4005. };
  4006. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4007. typename T6, typename T7, typename T8, typename T9, typename T10,
  4008. typename T11>
  4009. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,
  4010. internal::None, internal::None, internal::None, internal::None,
  4011. internal::None, internal::None, internal::None, internal::None,
  4012. internal::None, internal::None, internal::None, internal::None,
  4013. internal::None, internal::None, internal::None, internal::None,
  4014. internal::None, internal::None, internal::None, internal::None,
  4015. internal::None, internal::None, internal::None, internal::None,
  4016. internal::None, internal::None, internal::None, internal::None,
  4017. internal::None, internal::None, internal::None, internal::None,
  4018. internal::None, internal::None, internal::None, internal::None,
  4019. internal::None, internal::None> {
  4020. typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
  4021. };
  4022. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4023. typename T6, typename T7, typename T8, typename T9, typename T10,
  4024. typename T11, typename T12>
  4025. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,
  4026. internal::None, internal::None, internal::None, internal::None,
  4027. internal::None, internal::None, internal::None, internal::None,
  4028. internal::None, internal::None, internal::None, internal::None,
  4029. internal::None, internal::None, internal::None, internal::None,
  4030. internal::None, internal::None, internal::None, internal::None,
  4031. internal::None, internal::None, internal::None, internal::None,
  4032. internal::None, internal::None, internal::None, internal::None,
  4033. internal::None, internal::None, internal::None, internal::None,
  4034. internal::None, internal::None, internal::None, internal::None,
  4035. internal::None> {
  4036. typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  4037. T12> type;
  4038. };
  4039. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4040. typename T6, typename T7, typename T8, typename T9, typename T10,
  4041. typename T11, typename T12, typename T13>
  4042. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  4043. internal::None, internal::None, internal::None, internal::None,
  4044. internal::None, internal::None, internal::None, internal::None,
  4045. internal::None, internal::None, internal::None, internal::None,
  4046. internal::None, internal::None, internal::None, internal::None,
  4047. internal::None, internal::None, internal::None, internal::None,
  4048. internal::None, internal::None, internal::None, internal::None,
  4049. internal::None, internal::None, internal::None, internal::None,
  4050. internal::None, internal::None, internal::None, internal::None,
  4051. internal::None, internal::None, internal::None, internal::None,
  4052. internal::None> {
  4053. typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4054. T13> type;
  4055. };
  4056. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4057. typename T6, typename T7, typename T8, typename T9, typename T10,
  4058. typename T11, typename T12, typename T13, typename T14>
  4059. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4060. internal::None, internal::None, internal::None, internal::None,
  4061. internal::None, internal::None, internal::None, internal::None,
  4062. internal::None, internal::None, internal::None, internal::None,
  4063. internal::None, internal::None, internal::None, internal::None,
  4064. internal::None, internal::None, internal::None, internal::None,
  4065. internal::None, internal::None, internal::None, internal::None,
  4066. internal::None, internal::None, internal::None, internal::None,
  4067. internal::None, internal::None, internal::None, internal::None,
  4068. internal::None, internal::None, internal::None, internal::None> {
  4069. typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4070. T13, T14> type;
  4071. };
  4072. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4073. typename T6, typename T7, typename T8, typename T9, typename T10,
  4074. typename T11, typename T12, typename T13, typename T14, typename T15>
  4075. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4076. internal::None, internal::None, internal::None, internal::None,
  4077. internal::None, internal::None, internal::None, internal::None,
  4078. internal::None, internal::None, internal::None, internal::None,
  4079. internal::None, internal::None, internal::None, internal::None,
  4080. internal::None, internal::None, internal::None, internal::None,
  4081. internal::None, internal::None, internal::None, internal::None,
  4082. internal::None, internal::None, internal::None, internal::None,
  4083. internal::None, internal::None, internal::None, internal::None,
  4084. internal::None, internal::None, internal::None> {
  4085. typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4086. T13, T14, T15> type;
  4087. };
  4088. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4089. typename T6, typename T7, typename T8, typename T9, typename T10,
  4090. typename T11, typename T12, typename T13, typename T14, typename T15,
  4091. typename T16>
  4092. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4093. T16, internal::None, internal::None, internal::None, internal::None,
  4094. internal::None, internal::None, internal::None, internal::None,
  4095. internal::None, internal::None, internal::None, internal::None,
  4096. internal::None, internal::None, internal::None, internal::None,
  4097. internal::None, internal::None, internal::None, internal::None,
  4098. internal::None, internal::None, internal::None, internal::None,
  4099. internal::None, internal::None, internal::None, internal::None,
  4100. internal::None, internal::None, internal::None, internal::None,
  4101. internal::None, internal::None> {
  4102. typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4103. T13, T14, T15, T16> type;
  4104. };
  4105. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4106. typename T6, typename T7, typename T8, typename T9, typename T10,
  4107. typename T11, typename T12, typename T13, typename T14, typename T15,
  4108. typename T16, typename T17>
  4109. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4110. T16, T17, internal::None, internal::None, internal::None, internal::None,
  4111. internal::None, internal::None, internal::None, internal::None,
  4112. internal::None, internal::None, internal::None, internal::None,
  4113. internal::None, internal::None, internal::None, internal::None,
  4114. internal::None, internal::None, internal::None, internal::None,
  4115. internal::None, internal::None, internal::None, internal::None,
  4116. internal::None, internal::None, internal::None, internal::None,
  4117. internal::None, internal::None, internal::None, internal::None,
  4118. internal::None> {
  4119. typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4120. T13, T14, T15, T16, T17> type;
  4121. };
  4122. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4123. typename T6, typename T7, typename T8, typename T9, typename T10,
  4124. typename T11, typename T12, typename T13, typename T14, typename T15,
  4125. typename T16, typename T17, typename T18>
  4126. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4127. T16, T17, T18, internal::None, internal::None, internal::None,
  4128. internal::None, internal::None, internal::None, internal::None,
  4129. internal::None, internal::None, internal::None, internal::None,
  4130. internal::None, internal::None, internal::None, internal::None,
  4131. internal::None, internal::None, internal::None, internal::None,
  4132. internal::None, internal::None, internal::None, internal::None,
  4133. internal::None, internal::None, internal::None, internal::None,
  4134. internal::None, internal::None, internal::None, internal::None,
  4135. internal::None> {
  4136. typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4137. T13, T14, T15, T16, T17, T18> type;
  4138. };
  4139. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4140. typename T6, typename T7, typename T8, typename T9, typename T10,
  4141. typename T11, typename T12, typename T13, typename T14, typename T15,
  4142. typename T16, typename T17, typename T18, typename T19>
  4143. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4144. T16, T17, T18, T19, internal::None, internal::None, internal::None,
  4145. internal::None, internal::None, internal::None, internal::None,
  4146. internal::None, internal::None, internal::None, internal::None,
  4147. internal::None, internal::None, internal::None, internal::None,
  4148. internal::None, internal::None, internal::None, internal::None,
  4149. internal::None, internal::None, internal::None, internal::None,
  4150. internal::None, internal::None, internal::None, internal::None,
  4151. internal::None, internal::None, internal::None, internal::None> {
  4152. typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4153. T13, T14, T15, T16, T17, T18, T19> type;
  4154. };
  4155. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4156. typename T6, typename T7, typename T8, typename T9, typename T10,
  4157. typename T11, typename T12, typename T13, typename T14, typename T15,
  4158. typename T16, typename T17, typename T18, typename T19, typename T20>
  4159. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4160. T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,
  4161. internal::None, internal::None, internal::None, internal::None,
  4162. internal::None, internal::None, internal::None, internal::None,
  4163. internal::None, internal::None, internal::None, internal::None,
  4164. internal::None, internal::None, internal::None, internal::None,
  4165. internal::None, internal::None, internal::None, internal::None,
  4166. internal::None, internal::None, internal::None, internal::None,
  4167. internal::None, internal::None, internal::None> {
  4168. typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4169. T13, T14, T15, T16, T17, T18, T19, T20> type;
  4170. };
  4171. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4172. typename T6, typename T7, typename T8, typename T9, typename T10,
  4173. typename T11, typename T12, typename T13, typename T14, typename T15,
  4174. typename T16, typename T17, typename T18, typename T19, typename T20,
  4175. typename T21>
  4176. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4177. T16, T17, T18, T19, T20, T21, internal::None, internal::None,
  4178. internal::None, internal::None, internal::None, internal::None,
  4179. internal::None, internal::None, internal::None, internal::None,
  4180. internal::None, internal::None, internal::None, internal::None,
  4181. internal::None, internal::None, internal::None, internal::None,
  4182. internal::None, internal::None, internal::None, internal::None,
  4183. internal::None, internal::None, internal::None, internal::None,
  4184. internal::None, internal::None, internal::None> {
  4185. typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4186. T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
  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, typename T22>
  4193. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4194. T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None,
  4195. internal::None, internal::None, internal::None, internal::None,
  4196. internal::None, internal::None, internal::None, internal::None,
  4197. internal::None, internal::None, internal::None, internal::None,
  4198. internal::None, internal::None, internal::None, internal::None,
  4199. internal::None, internal::None, internal::None, internal::None,
  4200. internal::None, internal::None, internal::None, internal::None,
  4201. internal::None, internal::None> {
  4202. typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4203. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
  4204. };
  4205. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4206. typename T6, typename T7, typename T8, typename T9, typename T10,
  4207. typename T11, typename T12, typename T13, typename T14, typename T15,
  4208. typename T16, typename T17, typename T18, typename T19, typename T20,
  4209. typename T21, typename T22, typename T23>
  4210. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4211. T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None,
  4212. internal::None, internal::None, internal::None, internal::None,
  4213. internal::None, internal::None, internal::None, internal::None,
  4214. internal::None, internal::None, internal::None, internal::None,
  4215. internal::None, internal::None, internal::None, internal::None,
  4216. internal::None, internal::None, internal::None, internal::None,
  4217. internal::None, internal::None, internal::None, internal::None,
  4218. internal::None> {
  4219. typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4220. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
  4221. };
  4222. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4223. typename T6, typename T7, typename T8, typename T9, typename T10,
  4224. typename T11, typename T12, typename T13, typename T14, typename T15,
  4225. typename T16, typename T17, typename T18, typename T19, typename T20,
  4226. typename T21, typename T22, typename T23, typename T24>
  4227. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4228. T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,
  4229. internal::None, internal::None, internal::None, internal::None,
  4230. internal::None, internal::None, internal::None, internal::None,
  4231. internal::None, internal::None, internal::None, internal::None,
  4232. internal::None, internal::None, internal::None, internal::None,
  4233. internal::None, internal::None, internal::None, internal::None,
  4234. internal::None, internal::None, internal::None, internal::None,
  4235. internal::None> {
  4236. typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4237. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
  4238. };
  4239. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4240. typename T6, typename T7, typename T8, typename T9, typename T10,
  4241. typename T11, typename T12, typename T13, typename T14, typename T15,
  4242. typename T16, typename T17, typename T18, typename T19, typename T20,
  4243. typename T21, typename T22, typename T23, typename T24, typename T25>
  4244. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4245. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,
  4246. internal::None, internal::None, internal::None, internal::None,
  4247. internal::None, internal::None, internal::None, internal::None,
  4248. internal::None, internal::None, internal::None, internal::None,
  4249. internal::None, internal::None, internal::None, internal::None,
  4250. internal::None, internal::None, internal::None, internal::None,
  4251. internal::None, internal::None, internal::None, internal::None> {
  4252. typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4253. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
  4254. };
  4255. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4256. typename T6, typename T7, typename T8, typename T9, typename T10,
  4257. typename T11, typename T12, typename T13, typename T14, typename T15,
  4258. typename T16, typename T17, typename T18, typename T19, typename T20,
  4259. typename T21, typename T22, typename T23, typename T24, typename T25,
  4260. typename T26>
  4261. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4262. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,
  4263. internal::None, internal::None, internal::None, internal::None,
  4264. internal::None, internal::None, internal::None, internal::None,
  4265. internal::None, internal::None, internal::None, internal::None,
  4266. internal::None, internal::None, internal::None, internal::None,
  4267. internal::None, internal::None, internal::None, internal::None,
  4268. internal::None, internal::None, internal::None> {
  4269. typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4270. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  4271. T26> type;
  4272. };
  4273. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4274. typename T6, typename T7, typename T8, typename T9, typename T10,
  4275. typename T11, typename T12, typename T13, typename T14, typename T15,
  4276. typename T16, typename T17, typename T18, typename T19, typename T20,
  4277. typename T21, typename T22, typename T23, typename T24, typename T25,
  4278. typename T26, typename T27>
  4279. struct Types<T1, 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, internal::None,
  4281. internal::None, internal::None, internal::None, internal::None,
  4282. internal::None, internal::None, internal::None, internal::None,
  4283. internal::None, internal::None, internal::None, internal::None,
  4284. internal::None, internal::None, internal::None, internal::None,
  4285. internal::None, internal::None, internal::None, internal::None,
  4286. internal::None, internal::None> {
  4287. typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4288. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4289. T27> type;
  4290. };
  4291. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4292. typename T6, typename T7, typename T8, typename T9, typename T10,
  4293. typename T11, typename T12, typename T13, typename T14, typename T15,
  4294. typename T16, typename T17, typename T18, typename T19, typename T20,
  4295. typename T21, typename T22, typename T23, typename T24, typename T25,
  4296. typename T26, typename T27, typename T28>
  4297. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4298. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4299. internal::None, internal::None, internal::None, internal::None,
  4300. internal::None, internal::None, internal::None, internal::None,
  4301. internal::None, internal::None, internal::None, internal::None,
  4302. internal::None, internal::None, internal::None, internal::None,
  4303. internal::None, internal::None, internal::None, internal::None,
  4304. internal::None, internal::None> {
  4305. typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4306. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4307. T27, T28> type;
  4308. };
  4309. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4310. typename T6, typename T7, typename T8, typename T9, typename T10,
  4311. typename T11, typename T12, typename T13, typename T14, typename T15,
  4312. typename T16, typename T17, typename T18, typename T19, typename T20,
  4313. typename T21, typename T22, typename T23, typename T24, typename T25,
  4314. typename T26, typename T27, typename T28, typename T29>
  4315. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4316. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4317. internal::None, internal::None, internal::None, internal::None,
  4318. internal::None, internal::None, internal::None, internal::None,
  4319. internal::None, internal::None, internal::None, internal::None,
  4320. internal::None, internal::None, internal::None, internal::None,
  4321. internal::None, internal::None, internal::None, internal::None,
  4322. internal::None> {
  4323. typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4324. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4325. T27, T28, T29> type;
  4326. };
  4327. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4328. typename T6, typename T7, typename T8, typename T9, typename T10,
  4329. typename T11, typename T12, typename T13, typename T14, typename T15,
  4330. typename T16, typename T17, typename T18, typename T19, typename T20,
  4331. typename T21, typename T22, typename T23, typename T24, typename T25,
  4332. typename T26, typename T27, typename T28, typename T29, typename T30>
  4333. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4334. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4335. internal::None, internal::None, internal::None, internal::None,
  4336. internal::None, internal::None, internal::None, internal::None,
  4337. internal::None, internal::None, internal::None, internal::None,
  4338. internal::None, internal::None, internal::None, internal::None,
  4339. internal::None, internal::None, internal::None, internal::None> {
  4340. typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4341. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4342. T27, T28, T29, T30> type;
  4343. };
  4344. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4345. typename T6, typename T7, typename T8, typename T9, typename T10,
  4346. typename T11, typename T12, typename T13, typename T14, typename T15,
  4347. typename T16, typename T17, typename T18, typename T19, typename T20,
  4348. typename T21, typename T22, typename T23, typename T24, typename T25,
  4349. typename T26, typename T27, typename T28, typename T29, typename T30,
  4350. typename T31>
  4351. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4352. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4353. T31, internal::None, internal::None, internal::None, internal::None,
  4354. internal::None, internal::None, internal::None, internal::None,
  4355. internal::None, internal::None, internal::None, internal::None,
  4356. internal::None, internal::None, internal::None, internal::None,
  4357. internal::None, internal::None, internal::None> {
  4358. typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4359. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4360. T27, T28, T29, T30, T31> type;
  4361. };
  4362. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4363. typename T6, typename T7, typename T8, typename T9, typename T10,
  4364. typename T11, typename T12, typename T13, typename T14, typename T15,
  4365. typename T16, typename T17, typename T18, typename T19, typename T20,
  4366. typename T21, typename T22, typename T23, typename T24, typename T25,
  4367. typename T26, typename T27, typename T28, typename T29, typename T30,
  4368. typename T31, typename T32>
  4369. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4370. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4371. T31, T32, internal::None, internal::None, internal::None, internal::None,
  4372. internal::None, internal::None, internal::None, internal::None,
  4373. internal::None, internal::None, internal::None, internal::None,
  4374. internal::None, internal::None, internal::None, internal::None,
  4375. internal::None, internal::None> {
  4376. typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4377. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4378. T27, T28, T29, T30, T31, T32> type;
  4379. };
  4380. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4381. typename T6, typename T7, typename T8, typename T9, typename T10,
  4382. typename T11, typename T12, typename T13, typename T14, typename T15,
  4383. typename T16, typename T17, typename T18, typename T19, typename T20,
  4384. typename T21, typename T22, typename T23, typename T24, typename T25,
  4385. typename T26, typename T27, typename T28, typename T29, typename T30,
  4386. typename T31, typename T32, typename T33>
  4387. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4388. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4389. T31, T32, T33, internal::None, internal::None, internal::None,
  4390. internal::None, internal::None, internal::None, internal::None,
  4391. internal::None, internal::None, internal::None, internal::None,
  4392. internal::None, internal::None, internal::None, internal::None,
  4393. internal::None, internal::None> {
  4394. typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4395. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4396. T27, T28, T29, T30, T31, T32, T33> type;
  4397. };
  4398. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4399. typename T6, typename T7, typename T8, typename T9, typename T10,
  4400. typename T11, typename T12, typename T13, typename T14, typename T15,
  4401. typename T16, typename T17, typename T18, typename T19, typename T20,
  4402. typename T21, typename T22, typename T23, typename T24, typename T25,
  4403. typename T26, typename T27, typename T28, typename T29, typename T30,
  4404. typename T31, typename T32, typename T33, typename T34>
  4405. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4406. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4407. T31, T32, T33, T34, internal::None, internal::None, internal::None,
  4408. internal::None, internal::None, internal::None, internal::None,
  4409. internal::None, internal::None, internal::None, internal::None,
  4410. internal::None, internal::None, internal::None, internal::None,
  4411. internal::None> {
  4412. typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4413. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4414. T27, T28, T29, T30, T31, T32, T33, T34> type;
  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. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4424. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4425. T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
  4426. internal::None, internal::None, internal::None, internal::None,
  4427. internal::None, internal::None, internal::None, internal::None,
  4428. internal::None, internal::None, internal::None, internal::None> {
  4429. typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4430. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4431. T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
  4432. };
  4433. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4434. typename T6, typename T7, typename T8, typename T9, typename T10,
  4435. typename T11, typename T12, typename T13, typename T14, typename T15,
  4436. typename T16, typename T17, typename T18, typename T19, typename T20,
  4437. typename T21, typename T22, typename T23, typename T24, typename T25,
  4438. typename T26, typename T27, typename T28, typename T29, typename T30,
  4439. typename T31, typename T32, typename T33, typename T34, typename T35,
  4440. typename T36>
  4441. struct Types<T1, 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, T30,
  4443. T31, T32, T33, T34, T35, T36, internal::None, internal::None,
  4444. internal::None, internal::None, internal::None, internal::None,
  4445. internal::None, internal::None, internal::None, internal::None,
  4446. internal::None, internal::None, internal::None, internal::None> {
  4447. typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4448. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4449. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
  4450. };
  4451. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4452. typename T6, typename T7, typename T8, typename T9, typename T10,
  4453. typename T11, typename T12, typename T13, typename T14, typename T15,
  4454. typename T16, typename T17, typename T18, typename T19, typename T20,
  4455. typename T21, typename T22, typename T23, typename T24, typename T25,
  4456. typename T26, typename T27, typename T28, typename T29, typename T30,
  4457. typename T31, typename T32, typename T33, typename T34, typename T35,
  4458. typename T36, typename T37>
  4459. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4460. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4461. T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
  4462. internal::None, internal::None, internal::None, internal::None,
  4463. internal::None, internal::None, internal::None, internal::None,
  4464. internal::None, internal::None, internal::None> {
  4465. typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4466. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4467. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
  4468. };
  4469. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4470. typename T6, typename T7, typename T8, typename T9, typename T10,
  4471. typename T11, typename T12, typename T13, typename T14, typename T15,
  4472. typename T16, typename T17, typename T18, typename T19, typename T20,
  4473. typename T21, typename T22, typename T23, typename T24, typename T25,
  4474. typename T26, typename T27, typename T28, typename T29, typename T30,
  4475. typename T31, typename T32, typename T33, typename T34, typename T35,
  4476. typename T36, typename T37, typename T38>
  4477. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4478. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4479. T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
  4480. internal::None, internal::None, internal::None, internal::None,
  4481. internal::None, internal::None, internal::None, internal::None,
  4482. internal::None, internal::None> {
  4483. typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4484. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4485. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
  4486. };
  4487. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4488. typename T6, typename T7, typename T8, typename T9, typename T10,
  4489. typename T11, typename T12, typename T13, typename T14, typename T15,
  4490. typename T16, typename T17, typename T18, typename T19, typename T20,
  4491. typename T21, typename T22, typename T23, typename T24, typename T25,
  4492. typename T26, typename T27, typename T28, typename T29, typename T30,
  4493. typename T31, typename T32, typename T33, typename T34, typename T35,
  4494. typename T36, typename T37, typename T38, typename T39>
  4495. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4496. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4497. T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
  4498. internal::None, internal::None, internal::None, internal::None,
  4499. internal::None, internal::None, internal::None, internal::None,
  4500. internal::None, internal::None> {
  4501. typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4502. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4503. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
  4504. };
  4505. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4506. typename T6, typename T7, typename T8, typename T9, typename T10,
  4507. typename T11, typename T12, typename T13, typename T14, typename T15,
  4508. typename T16, typename T17, typename T18, typename T19, typename T20,
  4509. typename T21, typename T22, typename T23, typename T24, typename T25,
  4510. typename T26, typename T27, typename T28, typename T29, typename T30,
  4511. typename T31, typename T32, typename T33, typename T34, typename T35,
  4512. typename T36, typename T37, typename T38, typename T39, typename T40>
  4513. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4514. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4515. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
  4516. internal::None, internal::None, internal::None, internal::None,
  4517. internal::None, internal::None, internal::None, internal::None,
  4518. internal::None> {
  4519. typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4520. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4521. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  4522. T40> type;
  4523. };
  4524. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4525. typename T6, typename T7, typename T8, typename T9, typename T10,
  4526. typename T11, typename T12, typename T13, typename T14, typename T15,
  4527. typename T16, typename T17, typename T18, typename T19, typename T20,
  4528. typename T21, typename T22, typename T23, typename T24, typename T25,
  4529. typename T26, typename T27, typename T28, typename T29, typename T30,
  4530. typename T31, typename T32, typename T33, typename T34, typename T35,
  4531. typename T36, typename T37, typename T38, typename T39, typename T40,
  4532. typename T41>
  4533. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4534. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4535. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
  4536. internal::None, internal::None, internal::None, internal::None,
  4537. internal::None, internal::None, internal::None, internal::None> {
  4538. typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4539. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4540. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4541. T41> type;
  4542. };
  4543. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4544. typename T6, typename T7, typename T8, typename T9, typename T10,
  4545. typename T11, typename T12, typename T13, typename T14, typename T15,
  4546. typename T16, typename T17, typename T18, typename T19, typename T20,
  4547. typename T21, typename T22, typename T23, typename T24, typename T25,
  4548. typename T26, typename T27, typename T28, typename T29, typename T30,
  4549. typename T31, typename T32, typename T33, typename T34, typename T35,
  4550. typename T36, typename T37, typename T38, typename T39, typename T40,
  4551. typename T41, typename T42>
  4552. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4553. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4554. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
  4555. internal::None, internal::None, internal::None, internal::None,
  4556. internal::None, internal::None, internal::None> {
  4557. typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4558. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4559. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4560. T41, T42> type;
  4561. };
  4562. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4563. typename T6, typename T7, typename T8, typename T9, typename T10,
  4564. typename T11, typename T12, typename T13, typename T14, typename T15,
  4565. typename T16, typename T17, typename T18, typename T19, typename T20,
  4566. typename T21, typename T22, typename T23, typename T24, typename T25,
  4567. typename T26, typename T27, typename T28, typename T29, typename T30,
  4568. typename T31, typename T32, typename T33, typename T34, typename T35,
  4569. typename T36, typename T37, typename T38, typename T39, typename T40,
  4570. typename T41, typename T42, typename T43>
  4571. struct Types<T1, 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, T30,
  4573. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  4574. internal::None, internal::None, internal::None, internal::None,
  4575. internal::None, internal::None, internal::None> {
  4576. typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4577. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4578. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4579. T41, T42, T43> type;
  4580. };
  4581. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4582. typename T6, typename T7, typename T8, typename T9, typename T10,
  4583. typename T11, typename T12, typename T13, typename T14, typename T15,
  4584. typename T16, typename T17, typename T18, typename T19, typename T20,
  4585. typename T21, typename T22, typename T23, typename T24, typename T25,
  4586. typename T26, typename T27, typename T28, typename T29, typename T30,
  4587. typename T31, typename T32, typename T33, typename T34, typename T35,
  4588. typename T36, typename T37, typename T38, typename T39, typename T40,
  4589. typename T41, typename T42, typename T43, typename T44>
  4590. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4591. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4592. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  4593. internal::None, internal::None, internal::None, internal::None,
  4594. internal::None, internal::None> {
  4595. typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4596. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4597. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4598. T41, T42, T43, T44> type;
  4599. };
  4600. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4601. typename T6, typename T7, typename T8, typename T9, typename T10,
  4602. typename T11, typename T12, typename T13, typename T14, typename T15,
  4603. typename T16, typename T17, typename T18, typename T19, typename T20,
  4604. typename T21, typename T22, typename T23, typename T24, typename T25,
  4605. typename T26, typename T27, typename T28, typename T29, typename T30,
  4606. typename T31, typename T32, typename T33, typename T34, typename T35,
  4607. typename T36, typename T37, typename T38, typename T39, typename T40,
  4608. typename T41, typename T42, typename T43, typename T44, typename T45>
  4609. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4610. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4611. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  4612. internal::None, internal::None, internal::None, internal::None,
  4613. internal::None> {
  4614. typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4615. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4616. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4617. T41, T42, T43, T44, T45> type;
  4618. };
  4619. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4620. typename T6, typename T7, typename T8, typename T9, typename T10,
  4621. typename T11, typename T12, typename T13, typename T14, typename T15,
  4622. typename T16, typename T17, typename T18, typename T19, typename T20,
  4623. typename T21, typename T22, typename T23, typename T24, typename T25,
  4624. typename T26, typename T27, typename T28, typename T29, typename T30,
  4625. typename T31, typename T32, typename T33, typename T34, typename T35,
  4626. typename T36, typename T37, typename T38, typename T39, typename T40,
  4627. typename T41, typename T42, typename T43, typename T44, typename T45,
  4628. typename T46>
  4629. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4630. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4631. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  4632. T46, internal::None, internal::None, internal::None, internal::None> {
  4633. typedef internal::Types46<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> type;
  4637. };
  4638. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4639. typename T6, typename T7, typename T8, typename T9, typename T10,
  4640. typename T11, typename T12, typename T13, typename T14, typename T15,
  4641. typename T16, typename T17, typename T18, typename T19, typename T20,
  4642. typename T21, typename T22, typename T23, typename T24, typename T25,
  4643. typename T26, typename T27, typename T28, typename T29, typename T30,
  4644. typename T31, typename T32, typename T33, typename T34, typename T35,
  4645. typename T36, typename T37, typename T38, typename T39, typename T40,
  4646. typename T41, typename T42, typename T43, typename T44, typename T45,
  4647. typename T46, typename T47>
  4648. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4649. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4650. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  4651. T46, T47, internal::None, internal::None, internal::None> {
  4652. typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4653. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4654. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4655. T41, T42, T43, T44, T45, T46, T47> type;
  4656. };
  4657. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4658. typename T6, typename T7, typename T8, typename T9, typename T10,
  4659. typename T11, typename T12, typename T13, typename T14, typename T15,
  4660. typename T16, typename T17, typename T18, typename T19, typename T20,
  4661. typename T21, typename T22, typename T23, typename T24, typename T25,
  4662. typename T26, typename T27, typename T28, typename T29, typename T30,
  4663. typename T31, typename T32, typename T33, typename T34, typename T35,
  4664. typename T36, typename T37, typename T38, typename T39, typename T40,
  4665. typename T41, typename T42, typename T43, typename T44, typename T45,
  4666. typename T46, typename T47, typename T48>
  4667. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4668. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4669. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  4670. T46, T47, T48, internal::None, internal::None> {
  4671. typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4672. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4673. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4674. T41, T42, T43, T44, T45, T46, T47, T48> type;
  4675. };
  4676. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4677. typename T6, typename T7, typename T8, typename T9, typename T10,
  4678. typename T11, typename T12, typename T13, typename T14, typename T15,
  4679. typename T16, typename T17, typename T18, typename T19, typename T20,
  4680. typename T21, typename T22, typename T23, typename T24, typename T25,
  4681. typename T26, typename T27, typename T28, typename T29, typename T30,
  4682. typename T31, typename T32, typename T33, typename T34, typename T35,
  4683. typename T36, typename T37, typename T38, typename T39, typename T40,
  4684. typename T41, typename T42, typename T43, typename T44, typename T45,
  4685. typename T46, typename T47, typename T48, typename T49>
  4686. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4687. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4688. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  4689. T46, T47, T48, T49, internal::None> {
  4690. typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4691. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4692. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4693. T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
  4694. };
  4695. namespace internal {
  4696. # define GTEST_TEMPLATE_ template <typename T> class
  4697. // The template "selector" struct TemplateSel<Tmpl> is used to
  4698. // represent Tmpl, which must be a class template with one type
  4699. // parameter, as a type. TemplateSel<Tmpl>::Bind<T>::type is defined
  4700. // as the type Tmpl<T>. This allows us to actually instantiate the
  4701. // template "selected" by TemplateSel<Tmpl>.
  4702. //
  4703. // This trick is necessary for simulating typedef for class templates,
  4704. // which C++ doesn't support directly.
  4705. template <GTEST_TEMPLATE_ Tmpl>
  4706. struct TemplateSel {
  4707. template <typename T>
  4708. struct Bind {
  4709. typedef Tmpl<T> type;
  4710. };
  4711. };
  4712. # define GTEST_BIND_(TmplSel, T) \
  4713. TmplSel::template Bind<T>::type
  4714. // A unique struct template used as the default value for the
  4715. // arguments of class template Templates. This allows us to simulate
  4716. // variadic templates (e.g. Templates<int>, Templates<int, double>,
  4717. // and etc), which C++ doesn't support directly.
  4718. template <typename T>
  4719. struct NoneT {};
  4720. // The following family of struct and struct templates are used to
  4721. // represent template lists. In particular, TemplatesN<T1, T2, ...,
  4722. // TN> represents a list of N templates (T1, T2, ..., and TN). Except
  4723. // for Templates0, every struct in the family has two member types:
  4724. // Head for the selector of the first template in the list, and Tail
  4725. // for the rest of the list.
  4726. // The empty template list.
  4727. struct Templates0 {};
  4728. // Template lists of length 1, 2, 3, and so on.
  4729. template <GTEST_TEMPLATE_ T1>
  4730. struct Templates1 {
  4731. typedef TemplateSel<T1> Head;
  4732. typedef Templates0 Tail;
  4733. };
  4734. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
  4735. struct Templates2 {
  4736. typedef TemplateSel<T1> Head;
  4737. typedef Templates1<T2> Tail;
  4738. };
  4739. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
  4740. struct Templates3 {
  4741. typedef TemplateSel<T1> Head;
  4742. typedef Templates2<T2, T3> Tail;
  4743. };
  4744. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4745. GTEST_TEMPLATE_ T4>
  4746. struct Templates4 {
  4747. typedef TemplateSel<T1> Head;
  4748. typedef Templates3<T2, T3, T4> Tail;
  4749. };
  4750. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4751. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
  4752. struct Templates5 {
  4753. typedef TemplateSel<T1> Head;
  4754. typedef Templates4<T2, T3, T4, T5> Tail;
  4755. };
  4756. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4757. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
  4758. struct Templates6 {
  4759. typedef TemplateSel<T1> Head;
  4760. typedef Templates5<T2, T3, T4, T5, T6> Tail;
  4761. };
  4762. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4763. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4764. GTEST_TEMPLATE_ T7>
  4765. struct Templates7 {
  4766. typedef TemplateSel<T1> Head;
  4767. typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
  4768. };
  4769. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4770. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4771. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
  4772. struct Templates8 {
  4773. typedef TemplateSel<T1> Head;
  4774. typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
  4775. };
  4776. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4777. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4778. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
  4779. struct Templates9 {
  4780. typedef TemplateSel<T1> Head;
  4781. typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
  4782. };
  4783. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4784. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4785. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4786. GTEST_TEMPLATE_ T10>
  4787. struct Templates10 {
  4788. typedef TemplateSel<T1> Head;
  4789. typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
  4790. };
  4791. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4792. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4793. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4794. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
  4795. struct Templates11 {
  4796. typedef TemplateSel<T1> Head;
  4797. typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
  4798. };
  4799. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4800. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4801. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4802. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
  4803. struct Templates12 {
  4804. typedef TemplateSel<T1> Head;
  4805. typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
  4806. };
  4807. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4808. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4809. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4810. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4811. GTEST_TEMPLATE_ T13>
  4812. struct Templates13 {
  4813. typedef TemplateSel<T1> Head;
  4814. typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
  4815. };
  4816. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4817. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4818. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4819. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4820. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
  4821. struct Templates14 {
  4822. typedef TemplateSel<T1> Head;
  4823. typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  4824. T14> Tail;
  4825. };
  4826. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4827. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4828. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4829. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4830. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
  4831. struct Templates15 {
  4832. typedef TemplateSel<T1> Head;
  4833. typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4834. T15> Tail;
  4835. };
  4836. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4837. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4838. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4839. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4840. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4841. GTEST_TEMPLATE_ T16>
  4842. struct Templates16 {
  4843. typedef TemplateSel<T1> Head;
  4844. typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4845. T15, T16> Tail;
  4846. };
  4847. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4848. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4849. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4850. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4851. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4852. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
  4853. struct Templates17 {
  4854. typedef TemplateSel<T1> Head;
  4855. typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4856. T15, T16, T17> Tail;
  4857. };
  4858. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4859. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4860. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4861. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4862. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4863. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
  4864. struct Templates18 {
  4865. typedef TemplateSel<T1> Head;
  4866. typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4867. T15, T16, T17, T18> Tail;
  4868. };
  4869. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4870. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4871. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4872. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4873. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4874. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4875. GTEST_TEMPLATE_ T19>
  4876. struct Templates19 {
  4877. typedef TemplateSel<T1> Head;
  4878. typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4879. T15, T16, T17, T18, T19> Tail;
  4880. };
  4881. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4882. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4883. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4884. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4885. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4886. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4887. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
  4888. struct Templates20 {
  4889. typedef TemplateSel<T1> Head;
  4890. typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4891. T15, T16, T17, T18, T19, T20> Tail;
  4892. };
  4893. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4894. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4895. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4896. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4897. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4898. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4899. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
  4900. struct Templates21 {
  4901. typedef TemplateSel<T1> Head;
  4902. typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4903. T15, T16, T17, T18, T19, T20, T21> Tail;
  4904. };
  4905. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4906. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4907. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4908. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4909. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4910. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4911. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4912. GTEST_TEMPLATE_ T22>
  4913. struct Templates22 {
  4914. typedef TemplateSel<T1> Head;
  4915. typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4916. T15, T16, T17, T18, T19, T20, T21, T22> Tail;
  4917. };
  4918. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4919. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4920. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4921. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4922. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4923. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4924. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4925. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
  4926. struct Templates23 {
  4927. typedef TemplateSel<T1> Head;
  4928. typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4929. T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
  4930. };
  4931. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4932. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4933. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4934. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4935. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4936. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4937. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4938. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
  4939. struct Templates24 {
  4940. typedef TemplateSel<T1> Head;
  4941. typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4942. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
  4943. };
  4944. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4945. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4946. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4947. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4948. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4949. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4950. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4951. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4952. GTEST_TEMPLATE_ T25>
  4953. struct Templates25 {
  4954. typedef TemplateSel<T1> Head;
  4955. typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4956. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
  4957. };
  4958. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4959. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4960. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4961. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4962. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4963. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4964. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4965. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4966. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
  4967. struct Templates26 {
  4968. typedef TemplateSel<T1> Head;
  4969. typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4970. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
  4971. };
  4972. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4973. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4974. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4975. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4976. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4977. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4978. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4979. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4980. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
  4981. struct Templates27 {
  4982. typedef TemplateSel<T1> Head;
  4983. typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4984. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
  4985. };
  4986. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4987. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4988. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4989. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4990. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4991. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4992. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4993. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4994. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4995. GTEST_TEMPLATE_ T28>
  4996. struct Templates28 {
  4997. typedef TemplateSel<T1> Head;
  4998. typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4999. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5000. T28> Tail;
  5001. };
  5002. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5003. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5004. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5005. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5006. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5007. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5008. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5009. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5010. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5011. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
  5012. struct Templates29 {
  5013. typedef TemplateSel<T1> Head;
  5014. typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5015. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5016. T29> Tail;
  5017. };
  5018. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5019. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5020. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5021. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5022. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5023. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5024. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5025. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5026. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5027. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
  5028. struct Templates30 {
  5029. typedef TemplateSel<T1> Head;
  5030. typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5031. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5032. T29, T30> Tail;
  5033. };
  5034. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5035. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5036. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5037. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5038. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5039. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5040. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5041. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5042. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5043. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5044. GTEST_TEMPLATE_ T31>
  5045. struct Templates31 {
  5046. typedef TemplateSel<T1> Head;
  5047. typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5048. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5049. T29, T30, T31> Tail;
  5050. };
  5051. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5052. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5053. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5054. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5055. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5056. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5057. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5058. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5059. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5060. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5061. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
  5062. struct Templates32 {
  5063. typedef TemplateSel<T1> Head;
  5064. typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5065. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5066. T29, T30, T31, T32> Tail;
  5067. };
  5068. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5069. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5070. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5071. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5072. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5073. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5074. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5075. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5076. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5077. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5078. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
  5079. struct Templates33 {
  5080. typedef TemplateSel<T1> Head;
  5081. typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5082. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5083. T29, T30, T31, T32, T33> Tail;
  5084. };
  5085. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5086. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5087. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5088. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5089. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5090. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5091. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5092. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5093. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5094. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5095. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5096. GTEST_TEMPLATE_ T34>
  5097. struct Templates34 {
  5098. typedef TemplateSel<T1> Head;
  5099. typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5100. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5101. T29, T30, T31, T32, T33, T34> Tail;
  5102. };
  5103. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5104. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5105. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5106. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5107. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5108. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5109. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5110. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5111. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5112. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5113. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5114. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
  5115. struct Templates35 {
  5116. typedef TemplateSel<T1> Head;
  5117. typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5118. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5119. T29, T30, T31, T32, T33, T34, T35> Tail;
  5120. };
  5121. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5122. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5123. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5124. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5125. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5126. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5127. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5128. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5129. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5130. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5131. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5132. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
  5133. struct Templates36 {
  5134. typedef TemplateSel<T1> Head;
  5135. typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5136. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5137. T29, T30, T31, T32, T33, T34, T35, T36> Tail;
  5138. };
  5139. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5140. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5141. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5142. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5143. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5144. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5145. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5146. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5147. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5148. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5149. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5150. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5151. GTEST_TEMPLATE_ T37>
  5152. struct Templates37 {
  5153. typedef TemplateSel<T1> Head;
  5154. typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5155. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5156. T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
  5157. };
  5158. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5159. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5160. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5161. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5162. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5163. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5164. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5165. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5166. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5167. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5168. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5169. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5170. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
  5171. struct Templates38 {
  5172. typedef TemplateSel<T1> Head;
  5173. typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5174. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5175. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
  5176. };
  5177. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5178. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5179. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5180. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5181. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5182. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5183. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5184. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5185. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5186. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5187. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5188. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5189. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
  5190. struct Templates39 {
  5191. typedef TemplateSel<T1> Head;
  5192. typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5193. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5194. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
  5195. };
  5196. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5197. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5198. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5199. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5200. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5201. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5202. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5203. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5204. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5205. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5206. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5207. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5208. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5209. GTEST_TEMPLATE_ T40>
  5210. struct Templates40 {
  5211. typedef TemplateSel<T1> Head;
  5212. typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5213. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5214. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
  5215. };
  5216. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5217. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5218. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5219. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5220. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5221. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5222. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5223. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5224. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5225. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5226. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5227. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5228. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5229. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
  5230. struct Templates41 {
  5231. typedef TemplateSel<T1> Head;
  5232. typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5233. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5234. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
  5235. };
  5236. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5237. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5238. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5239. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5240. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5241. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5242. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5243. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5244. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5245. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5246. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5247. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5248. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5249. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
  5250. struct Templates42 {
  5251. typedef TemplateSel<T1> Head;
  5252. typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5253. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5254. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5255. T42> Tail;
  5256. };
  5257. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5258. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5259. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5260. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5261. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5262. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5263. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5264. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5265. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5266. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5267. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5268. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5269. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5270. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5271. GTEST_TEMPLATE_ T43>
  5272. struct Templates43 {
  5273. typedef TemplateSel<T1> Head;
  5274. typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5275. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5276. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5277. T43> Tail;
  5278. };
  5279. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5280. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5281. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5282. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5283. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5284. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5285. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5286. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5287. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5288. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5289. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5290. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5291. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5292. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5293. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
  5294. struct Templates44 {
  5295. typedef TemplateSel<T1> Head;
  5296. typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5297. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5298. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5299. T43, T44> Tail;
  5300. };
  5301. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5302. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5303. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5304. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5305. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5306. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5307. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5308. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5309. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5310. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5311. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5312. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5313. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5314. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5315. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
  5316. struct Templates45 {
  5317. typedef TemplateSel<T1> Head;
  5318. typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5319. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5320. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5321. T43, T44, T45> Tail;
  5322. };
  5323. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5324. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5325. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5326. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5327. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5328. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5329. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5330. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5331. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5332. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5333. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5334. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5335. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5336. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5337. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5338. GTEST_TEMPLATE_ T46>
  5339. struct Templates46 {
  5340. typedef TemplateSel<T1> Head;
  5341. typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5342. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5343. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5344. T43, T44, T45, T46> Tail;
  5345. };
  5346. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5347. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5348. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5349. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5350. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5351. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5352. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5353. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5354. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5355. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5356. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5357. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5358. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5359. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5360. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5361. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
  5362. struct Templates47 {
  5363. typedef TemplateSel<T1> Head;
  5364. typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5365. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5366. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5367. T43, T44, T45, T46, T47> Tail;
  5368. };
  5369. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5370. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5371. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5372. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5373. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5374. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5375. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5376. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5377. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5378. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5379. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5380. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5381. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5382. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5383. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5384. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
  5385. struct Templates48 {
  5386. typedef TemplateSel<T1> Head;
  5387. typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5388. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5389. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5390. T43, T44, T45, T46, T47, T48> Tail;
  5391. };
  5392. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5393. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5394. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5395. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5396. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5397. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5398. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5399. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5400. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5401. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5402. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5403. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5404. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5405. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5406. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5407. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
  5408. GTEST_TEMPLATE_ T49>
  5409. struct Templates49 {
  5410. typedef TemplateSel<T1> Head;
  5411. typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5412. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5413. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5414. T43, T44, T45, T46, T47, T48, T49> Tail;
  5415. };
  5416. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5417. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5418. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5419. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5420. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5421. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5422. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5423. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5424. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5425. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5426. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5427. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5428. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5429. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5430. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5431. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
  5432. GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
  5433. struct Templates50 {
  5434. typedef TemplateSel<T1> Head;
  5435. typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5436. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5437. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5438. T43, T44, T45, T46, T47, T48, T49, T50> Tail;
  5439. };
  5440. // We don't want to require the users to write TemplatesN<...> directly,
  5441. // as that would require them to count the length. Templates<...> is much
  5442. // easier to write, but generates horrible messages when there is a
  5443. // compiler error, as gcc insists on printing out each template
  5444. // argument, even if it has the default value (this means Templates<list>
  5445. // will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
  5446. // errors).
  5447. //
  5448. // Our solution is to combine the best part of the two approaches: a
  5449. // user would write Templates<T1, ..., TN>, and Google Test will translate
  5450. // that to TemplatesN<T1, ..., TN> internally to make error messages
  5451. // readable. The translation is done by the 'type' member of the
  5452. // Templates template.
  5453. template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
  5454. GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
  5455. GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
  5456. GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
  5457. GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
  5458. GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
  5459. GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
  5460. GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
  5461. GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
  5462. GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
  5463. GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
  5464. GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
  5465. GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
  5466. GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
  5467. GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
  5468. GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
  5469. GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
  5470. GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
  5471. GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
  5472. GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
  5473. GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
  5474. GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
  5475. GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
  5476. GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
  5477. GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
  5478. struct Templates {
  5479. typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5480. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5481. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5482. T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
  5483. };
  5484. template <>
  5485. struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5486. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5487. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5488. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5489. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5490. NoneT> {
  5491. typedef Templates0 type;
  5492. };
  5493. template <GTEST_TEMPLATE_ T1>
  5494. struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5495. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5496. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5497. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5498. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5499. NoneT> {
  5500. typedef Templates1<T1> type;
  5501. };
  5502. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
  5503. struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5504. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5505. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5506. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5507. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5508. NoneT> {
  5509. typedef Templates2<T1, T2> type;
  5510. };
  5511. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
  5512. struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5513. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5514. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5515. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5516. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5517. typedef Templates3<T1, T2, T3> type;
  5518. };
  5519. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5520. GTEST_TEMPLATE_ T4>
  5521. struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5522. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5523. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5524. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5525. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5526. typedef Templates4<T1, T2, T3, T4> type;
  5527. };
  5528. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5529. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
  5530. struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5531. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5532. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5533. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5534. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5535. typedef Templates5<T1, T2, T3, T4, T5> type;
  5536. };
  5537. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5538. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
  5539. struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
  5540. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5541. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5542. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5543. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5544. typedef Templates6<T1, T2, T3, T4, T5, T6> type;
  5545. };
  5546. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5547. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5548. GTEST_TEMPLATE_ T7>
  5549. struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
  5550. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5551. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5552. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5553. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5554. typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
  5555. };
  5556. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5557. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5558. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
  5559. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
  5560. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5561. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5562. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5563. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5564. typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
  5565. };
  5566. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5567. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5568. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
  5569. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
  5570. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5571. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5572. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5573. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5574. typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
  5575. };
  5576. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5577. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5578. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5579. GTEST_TEMPLATE_ T10>
  5580. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
  5581. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5582. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5583. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5584. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5585. typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
  5586. };
  5587. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5588. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5589. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5590. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
  5591. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
  5592. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5593. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5594. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5595. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5596. typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
  5597. };
  5598. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5599. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5600. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5601. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
  5602. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
  5603. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5604. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5605. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5606. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5607. typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
  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 Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
  5615. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5616. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5617. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5618. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5619. typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5620. T13> type;
  5621. };
  5622. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5623. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5624. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5625. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5626. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
  5627. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5628. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5629. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5630. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5631. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5632. typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5633. T14> type;
  5634. };
  5635. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5636. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5637. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5638. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5639. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
  5640. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5641. T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5642. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5643. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5644. NoneT, NoneT, NoneT, NoneT, NoneT> {
  5645. typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5646. T14, T15> type;
  5647. };
  5648. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5649. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5650. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5651. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5652. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5653. GTEST_TEMPLATE_ T16>
  5654. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5655. T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5656. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5657. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5658. NoneT, NoneT, NoneT, NoneT, NoneT> {
  5659. typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5660. T14, T15, T16> type;
  5661. };
  5662. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5663. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5664. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5665. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5666. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5667. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
  5668. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5669. T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5670. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5671. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5672. NoneT, NoneT, NoneT, NoneT, NoneT> {
  5673. typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5674. T14, T15, T16, T17> type;
  5675. };
  5676. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5677. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5678. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5679. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5680. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5681. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
  5682. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5683. T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5684. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5685. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5686. NoneT, NoneT, NoneT, NoneT> {
  5687. typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5688. T14, T15, T16, T17, T18> type;
  5689. };
  5690. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5691. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5692. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5693. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5694. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5695. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5696. GTEST_TEMPLATE_ T19>
  5697. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5698. T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5699. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5700. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5701. NoneT, NoneT, NoneT, NoneT> {
  5702. typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5703. T14, T15, T16, T17, T18, T19> type;
  5704. };
  5705. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5706. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5707. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5708. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5709. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5710. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5711. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
  5712. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5713. T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5714. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5715. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5716. NoneT, NoneT, NoneT, NoneT> {
  5717. typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5718. T14, T15, T16, T17, T18, T19, T20> type;
  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. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5728. T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
  5729. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5730. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5731. NoneT, NoneT, NoneT, NoneT> {
  5732. typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5733. T14, T15, T16, T17, T18, T19, T20, T21> type;
  5734. };
  5735. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5736. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5737. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5738. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5739. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5740. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5741. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5742. GTEST_TEMPLATE_ T22>
  5743. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5744. T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
  5745. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5746. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5747. NoneT, NoneT, NoneT> {
  5748. typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5749. T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
  5750. };
  5751. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5752. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5753. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5754. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5755. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5756. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5757. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5758. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
  5759. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5760. T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
  5761. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5762. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5763. NoneT, NoneT, NoneT> {
  5764. typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5765. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
  5766. };
  5767. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5768. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5769. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5770. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5771. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5772. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5773. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5774. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
  5775. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5776. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
  5777. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5778. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5779. NoneT, NoneT, NoneT> {
  5780. typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5781. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
  5782. };
  5783. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5784. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5785. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5786. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5787. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5788. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5789. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5790. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5791. GTEST_TEMPLATE_ T25>
  5792. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5793. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
  5794. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5795. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5796. NoneT, NoneT> {
  5797. typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5798. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
  5799. };
  5800. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5801. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5802. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5803. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5804. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5805. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5806. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5807. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5808. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
  5809. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5810. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
  5811. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5812. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5813. NoneT, NoneT> {
  5814. typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5815. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
  5816. };
  5817. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5818. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5819. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5820. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5821. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5822. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5823. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5824. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5825. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
  5826. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5827. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
  5828. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5829. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5830. NoneT, NoneT> {
  5831. typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5832. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5833. T27> type;
  5834. };
  5835. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5836. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5837. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5838. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5839. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5840. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5841. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5842. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5843. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5844. GTEST_TEMPLATE_ T28>
  5845. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5846. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5847. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5848. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5849. NoneT, NoneT> {
  5850. typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5851. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5852. T28> type;
  5853. };
  5854. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5855. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5856. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5857. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5858. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5859. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5860. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5861. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5862. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5863. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
  5864. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5865. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5866. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5867. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5868. NoneT> {
  5869. typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5870. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5871. T28, T29> type;
  5872. };
  5873. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5874. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5875. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5876. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5877. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5878. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5879. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5880. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5881. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5882. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
  5883. struct Templates<T1, 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, T29,
  5885. T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5886. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5887. typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5888. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5889. T28, T29, T30> type;
  5890. };
  5891. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5892. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5893. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5894. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5895. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5896. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5897. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5898. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5899. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5900. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5901. GTEST_TEMPLATE_ T31>
  5902. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5903. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5904. T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5905. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5906. typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5907. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5908. T28, T29, T30, T31> type;
  5909. };
  5910. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5911. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5912. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5913. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5914. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5915. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5916. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5917. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5918. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5919. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5920. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
  5921. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5922. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5923. T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5924. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5925. typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5926. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5927. T28, T29, T30, T31, T32> type;
  5928. };
  5929. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5930. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5931. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5932. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5933. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5934. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5935. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5936. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5937. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5938. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5939. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
  5940. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5941. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5942. T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5943. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5944. typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5945. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5946. T28, T29, T30, T31, T32, T33> type;
  5947. };
  5948. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5949. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5950. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5951. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5952. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5953. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5954. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5955. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5956. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5957. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5958. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5959. GTEST_TEMPLATE_ T34>
  5960. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5961. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5962. T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5963. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5964. typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5965. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5966. T28, T29, T30, T31, T32, T33, T34> type;
  5967. };
  5968. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5969. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5970. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5971. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5972. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5973. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5974. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5975. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5976. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5977. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5978. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5979. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
  5980. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5981. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5982. T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5983. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5984. typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5985. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5986. T28, T29, T30, T31, T32, T33, T34, T35> type;
  5987. };
  5988. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5989. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5990. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5991. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5992. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5993. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5994. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5995. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5996. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5997. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5998. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5999. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
  6000. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6001. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6002. T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
  6003. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6004. typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6005. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6006. T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
  6007. };
  6008. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6009. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6010. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6011. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6012. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6013. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6014. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6015. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6016. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6017. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6018. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6019. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6020. GTEST_TEMPLATE_ T37>
  6021. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6022. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6023. T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
  6024. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6025. typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6026. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6027. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
  6028. };
  6029. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6030. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6031. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6032. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6033. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6034. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6035. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6036. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6037. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6038. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6039. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6040. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6041. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
  6042. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6043. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6044. T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
  6045. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6046. typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6047. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6048. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
  6049. };
  6050. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6051. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6052. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6053. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6054. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6055. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6056. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6057. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6058. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6059. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6060. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6061. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6062. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
  6063. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6064. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6065. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
  6066. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6067. typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6068. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6069. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
  6070. };
  6071. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6072. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6073. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6074. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6075. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6076. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6077. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6078. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6079. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6080. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6081. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6082. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6083. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6084. GTEST_TEMPLATE_ T40>
  6085. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6086. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6087. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
  6088. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6089. typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6090. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6091. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
  6092. };
  6093. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6094. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6095. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6096. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6097. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6098. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6099. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6100. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6101. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6102. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6103. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6104. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6105. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6106. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
  6107. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6108. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6109. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
  6110. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6111. typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6112. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6113. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  6114. T41> type;
  6115. };
  6116. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6117. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6118. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6119. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6120. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6121. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6122. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6123. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6124. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6125. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6126. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6127. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6128. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6129. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
  6130. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6131. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6132. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
  6133. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6134. typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6135. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6136. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6137. T42> type;
  6138. };
  6139. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6140. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6141. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6142. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6143. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6144. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6145. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6146. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6147. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6148. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6149. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6150. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6151. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6152. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6153. GTEST_TEMPLATE_ T43>
  6154. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6155. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6156. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  6157. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6158. typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6159. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6160. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6161. T42, T43> type;
  6162. };
  6163. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6164. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6165. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6166. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6167. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6168. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6169. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6170. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6171. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6172. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6173. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6174. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6175. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6176. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6177. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
  6178. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6179. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6180. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  6181. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6182. typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6183. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6184. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6185. T42, T43, T44> type;
  6186. };
  6187. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6188. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6189. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6190. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6191. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6192. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6193. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6194. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6195. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6196. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6197. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6198. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6199. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6200. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6201. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
  6202. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6203. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6204. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  6205. T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6206. typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6207. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6208. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6209. T42, T43, T44, T45> type;
  6210. };
  6211. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6212. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6213. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6214. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6215. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6216. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6217. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6218. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6219. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6220. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6221. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6222. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6223. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6224. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6225. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6226. GTEST_TEMPLATE_ T46>
  6227. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6228. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6229. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  6230. T45, T46, NoneT, NoneT, NoneT, NoneT> {
  6231. typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6232. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6233. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6234. T42, T43, T44, T45, T46> type;
  6235. };
  6236. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6237. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6238. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6239. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6240. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6241. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6242. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6243. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6244. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6245. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6246. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6247. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6248. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6249. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6250. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6251. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
  6252. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6253. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6254. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  6255. T45, T46, T47, NoneT, NoneT, NoneT> {
  6256. typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6257. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6258. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6259. T42, T43, T44, T45, T46, T47> type;
  6260. };
  6261. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6262. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6263. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6264. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6265. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6266. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6267. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6268. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6269. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6270. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6271. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6272. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6273. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6274. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6275. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6276. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
  6277. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6278. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6279. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  6280. T45, T46, T47, T48, NoneT, NoneT> {
  6281. typedef Templates48<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> type;
  6285. };
  6286. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6287. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6288. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6289. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6290. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6291. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6292. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6293. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6294. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6295. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6296. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6297. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6298. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6299. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6300. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6301. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
  6302. GTEST_TEMPLATE_ T49>
  6303. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6304. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6305. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  6306. T45, T46, T47, T48, T49, NoneT> {
  6307. typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6308. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6309. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6310. T42, T43, T44, T45, T46, T47, T48, T49> type;
  6311. };
  6312. // The TypeList template makes it possible to use either a single type
  6313. // or a Types<...> list in TYPED_TEST_CASE() and
  6314. // INSTANTIATE_TYPED_TEST_CASE_P().
  6315. template <typename T>
  6316. struct TypeList {
  6317. typedef Types1<T> type;
  6318. };
  6319. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  6320. typename T6, typename T7, typename T8, typename T9, typename T10,
  6321. typename T11, typename T12, typename T13, typename T14, typename T15,
  6322. typename T16, typename T17, typename T18, typename T19, typename T20,
  6323. typename T21, typename T22, typename T23, typename T24, typename T25,
  6324. typename T26, typename T27, typename T28, typename T29, typename T30,
  6325. typename T31, typename T32, typename T33, typename T34, typename T35,
  6326. typename T36, typename T37, typename T38, typename T39, typename T40,
  6327. typename T41, typename T42, typename T43, typename T44, typename T45,
  6328. typename T46, typename T47, typename T48, typename T49, typename T50>
  6329. struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6330. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6331. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  6332. T44, T45, T46, T47, T48, T49, T50> > {
  6333. typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  6334. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  6335. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  6336. T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
  6337. };
  6338. #endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  6339. } // namespace internal
  6340. } // namespace testing
  6341. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
  6342. // Due to C++ preprocessor weirdness, we need double indirection to
  6343. // concatenate two tokens when one of them is __LINE__. Writing
  6344. //
  6345. // foo ## __LINE__
  6346. //
  6347. // will result in the token foo__LINE__, instead of foo followed by
  6348. // the current line number. For more details, see
  6349. // http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
  6350. #define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
  6351. #define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
  6352. class ProtocolMessage;
  6353. namespace proto2 { class Message; }
  6354. namespace testing {
  6355. // Forward declarations.
  6356. class AssertionResult; // Result of an assertion.
  6357. class Message; // Represents a failure message.
  6358. class Test; // Represents a test.
  6359. class TestInfo; // Information about a test.
  6360. class TestPartResult; // Result of a test part.
  6361. class UnitTest; // A collection of test cases.
  6362. template <typename T>
  6363. ::std::string PrintToString(const T& value);
  6364. namespace internal {
  6365. struct TraceInfo; // Information about a trace point.
  6366. class ScopedTrace; // Implements scoped trace.
  6367. class TestInfoImpl; // Opaque implementation of TestInfo
  6368. class UnitTestImpl; // Opaque implementation of UnitTest
  6369. // How many times InitGoogleTest() has been called.
  6370. GTEST_API_ extern int g_init_gtest_count;
  6371. // The text used in failure messages to indicate the start of the
  6372. // stack trace.
  6373. GTEST_API_ extern const char kStackTraceMarker[];
  6374. // Two overloaded helpers for checking at compile time whether an
  6375. // expression is a null pointer literal (i.e. NULL or any 0-valued
  6376. // compile-time integral constant). Their return values have
  6377. // different sizes, so we can use sizeof() to test which version is
  6378. // picked by the compiler. These helpers have no implementations, as
  6379. // we only need their signatures.
  6380. //
  6381. // Given IsNullLiteralHelper(x), the compiler will pick the first
  6382. // version if x can be implicitly converted to Secret*, and pick the
  6383. // second version otherwise. Since Secret is a secret and incomplete
  6384. // type, the only expression a user can write that has type Secret* is
  6385. // a null pointer literal. Therefore, we know that x is a null
  6386. // pointer literal if and only if the first version is picked by the
  6387. // compiler.
  6388. char IsNullLiteralHelper(Secret* p);
  6389. char (&IsNullLiteralHelper(...))[2]; // NOLINT
  6390. // A compile-time bool constant that is true if and only if x is a
  6391. // null pointer literal (i.e. NULL or any 0-valued compile-time
  6392. // integral constant).
  6393. #ifdef GTEST_ELLIPSIS_NEEDS_POD_
  6394. // We lose support for NULL detection where the compiler doesn't like
  6395. // passing non-POD classes through ellipsis (...).
  6396. # define GTEST_IS_NULL_LITERAL_(x) false
  6397. #else
  6398. # define GTEST_IS_NULL_LITERAL_(x) \
  6399. (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
  6400. #endif // GTEST_ELLIPSIS_NEEDS_POD_
  6401. // Appends the user-supplied message to the Google-Test-generated message.
  6402. GTEST_API_ std::string AppendUserMessage(
  6403. const std::string& gtest_msg, const Message& user_msg);
  6404. #if GTEST_HAS_EXCEPTIONS
  6405. // This exception is thrown by (and only by) a failed Google Test
  6406. // assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions
  6407. // are enabled). We derive it from std::runtime_error, which is for
  6408. // errors presumably detectable only at run time. Since
  6409. // std::runtime_error inherits from std::exception, many testing
  6410. // frameworks know how to extract and print the message inside it.
  6411. class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {
  6412. public:
  6413. explicit GoogleTestFailureException(const TestPartResult& failure);
  6414. };
  6415. #endif // GTEST_HAS_EXCEPTIONS
  6416. // A helper class for creating scoped traces in user programs.
  6417. class GTEST_API_ ScopedTrace {
  6418. public:
  6419. // The c'tor pushes the given source file location and message onto
  6420. // a trace stack maintained by Google Test.
  6421. ScopedTrace(const char* file, int line, const Message& message);
  6422. // The d'tor pops the info pushed by the c'tor.
  6423. //
  6424. // Note that the d'tor is not virtual in order to be efficient.
  6425. // Don't inherit from ScopedTrace!
  6426. ~ScopedTrace();
  6427. private:
  6428. GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
  6429. } GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its
  6430. // c'tor and d'tor. Therefore it doesn't
  6431. // need to be used otherwise.
  6432. // Constructs and returns the message for an equality assertion
  6433. // (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
  6434. //
  6435. // The first four parameters are the expressions used in the assertion
  6436. // and their values, as strings. For example, for ASSERT_EQ(foo, bar)
  6437. // where foo is 5 and bar is 6, we have:
  6438. //
  6439. // expected_expression: "foo"
  6440. // actual_expression: "bar"
  6441. // expected_value: "5"
  6442. // actual_value: "6"
  6443. //
  6444. // The ignoring_case parameter is true iff the assertion is a
  6445. // *_STRCASEEQ*. When it's true, the string " (ignoring case)" will
  6446. // be inserted into the message.
  6447. GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
  6448. const char* actual_expression,
  6449. const std::string& expected_value,
  6450. const std::string& actual_value,
  6451. bool ignoring_case);
  6452. // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
  6453. GTEST_API_ std::string GetBoolAssertionFailureMessage(
  6454. const AssertionResult& assertion_result,
  6455. const char* expression_text,
  6456. const char* actual_predicate_value,
  6457. const char* expected_predicate_value);
  6458. // This template class represents an IEEE floating-point number
  6459. // (either single-precision or double-precision, depending on the
  6460. // template parameters).
  6461. //
  6462. // The purpose of this class is to do more sophisticated number
  6463. // comparison. (Due to round-off error, etc, it's very unlikely that
  6464. // two floating-points will be equal exactly. Hence a naive
  6465. // comparison by the == operation often doesn't work.)
  6466. //
  6467. // Format of IEEE floating-point:
  6468. //
  6469. // The most-significant bit being the leftmost, an IEEE
  6470. // floating-point looks like
  6471. //
  6472. // sign_bit exponent_bits fraction_bits
  6473. //
  6474. // Here, sign_bit is a single bit that designates the sign of the
  6475. // number.
  6476. //
  6477. // For float, there are 8 exponent bits and 23 fraction bits.
  6478. //
  6479. // For double, there are 11 exponent bits and 52 fraction bits.
  6480. //
  6481. // More details can be found at
  6482. // http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
  6483. //
  6484. // Template parameter:
  6485. //
  6486. // RawType: the raw floating-point type (either float or double)
  6487. template <typename RawType>
  6488. class FloatingPoint {
  6489. public:
  6490. // Defines the unsigned integer type that has the same size as the
  6491. // floating point number.
  6492. typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
  6493. // Constants.
  6494. // # of bits in a number.
  6495. static const size_t kBitCount = 8*sizeof(RawType);
  6496. // # of fraction bits in a number.
  6497. static const size_t kFractionBitCount =
  6498. std::numeric_limits<RawType>::digits - 1;
  6499. // # of exponent bits in a number.
  6500. static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
  6501. // The mask for the sign bit.
  6502. static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
  6503. // The mask for the fraction bits.
  6504. static const Bits kFractionBitMask =
  6505. ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
  6506. // The mask for the exponent bits.
  6507. static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
  6508. // How many ULP's (Units in the Last Place) we want to tolerate when
  6509. // comparing two numbers. The larger the value, the more error we
  6510. // allow. A 0 value means that two numbers must be exactly the same
  6511. // to be considered equal.
  6512. //
  6513. // The maximum error of a single floating-point operation is 0.5
  6514. // units in the last place. On Intel CPU's, all floating-point
  6515. // calculations are done with 80-bit precision, while double has 64
  6516. // bits. Therefore, 4 should be enough for ordinary use.
  6517. //
  6518. // See the following article for more details on ULP:
  6519. // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
  6520. static const size_t kMaxUlps = 4;
  6521. // Constructs a FloatingPoint from a raw floating-point number.
  6522. //
  6523. // On an Intel CPU, passing a non-normalized NAN (Not a Number)
  6524. // around may change its bits, although the new value is guaranteed
  6525. // to be also a NAN. Therefore, don't expect this constructor to
  6526. // preserve the bits in x when x is a NAN.
  6527. explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
  6528. // Static methods
  6529. // Reinterprets a bit pattern as a floating-point number.
  6530. //
  6531. // This function is needed to test the AlmostEquals() method.
  6532. static RawType ReinterpretBits(const Bits bits) {
  6533. FloatingPoint fp(0);
  6534. fp.u_.bits_ = bits;
  6535. return fp.u_.value_;
  6536. }
  6537. // Returns the floating-point number that represent positive infinity.
  6538. static RawType Infinity() {
  6539. return ReinterpretBits(kExponentBitMask);
  6540. }
  6541. // Returns the maximum representable finite floating-point number.
  6542. static RawType Max();
  6543. // Non-static methods
  6544. // Returns the bits that represents this number.
  6545. const Bits &bits() const { return u_.bits_; }
  6546. // Returns the exponent bits of this number.
  6547. Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
  6548. // Returns the fraction bits of this number.
  6549. Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
  6550. // Returns the sign bit of this number.
  6551. Bits sign_bit() const { return kSignBitMask & u_.bits_; }
  6552. // Returns true iff this is NAN (not a number).
  6553. bool is_nan() const {
  6554. // It's a NAN if the exponent bits are all ones and the fraction
  6555. // bits are not entirely zeros.
  6556. return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
  6557. }
  6558. // Returns true iff this number is at most kMaxUlps ULP's away from
  6559. // rhs. In particular, this function:
  6560. //
  6561. // - returns false if either number is (or both are) NAN.
  6562. // - treats really large numbers as almost equal to infinity.
  6563. // - thinks +0.0 and -0.0 are 0 DLP's apart.
  6564. bool AlmostEquals(const FloatingPoint& rhs) const {
  6565. // The IEEE standard says that any comparison operation involving
  6566. // a NAN must return false.
  6567. if (is_nan() || rhs.is_nan()) return false;
  6568. return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
  6569. <= kMaxUlps;
  6570. }
  6571. private:
  6572. // The data type used to store the actual floating-point number.
  6573. union FloatingPointUnion {
  6574. RawType value_; // The raw floating-point number.
  6575. Bits bits_; // The bits that represent the number.
  6576. };
  6577. // Converts an integer from the sign-and-magnitude representation to
  6578. // the biased representation. More precisely, let N be 2 to the
  6579. // power of (kBitCount - 1), an integer x is represented by the
  6580. // unsigned number x + N.
  6581. //
  6582. // For instance,
  6583. //
  6584. // -N + 1 (the most negative number representable using
  6585. // sign-and-magnitude) is represented by 1;
  6586. // 0 is represented by N; and
  6587. // N - 1 (the biggest number representable using
  6588. // sign-and-magnitude) is represented by 2N - 1.
  6589. //
  6590. // Read http://en.wikipedia.org/wiki/Signed_number_representations
  6591. // for more details on signed number representations.
  6592. static Bits SignAndMagnitudeToBiased(const Bits &sam) {
  6593. if (kSignBitMask & sam) {
  6594. // sam represents a negative number.
  6595. return ~sam + 1;
  6596. } else {
  6597. // sam represents a positive number.
  6598. return kSignBitMask | sam;
  6599. }
  6600. }
  6601. // Given two numbers in the sign-and-magnitude representation,
  6602. // returns the distance between them as an unsigned number.
  6603. static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
  6604. const Bits &sam2) {
  6605. const Bits biased1 = SignAndMagnitudeToBiased(sam1);
  6606. const Bits biased2 = SignAndMagnitudeToBiased(sam2);
  6607. return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
  6608. }
  6609. FloatingPointUnion u_;
  6610. };
  6611. // We cannot use std::numeric_limits<T>::max() as it clashes with the max()
  6612. // macro defined by <windows.h>.
  6613. template <>
  6614. inline float FloatingPoint<float>::Max() { return FLT_MAX; }
  6615. template <>
  6616. inline double FloatingPoint<double>::Max() { return DBL_MAX; }
  6617. // Typedefs the instances of the FloatingPoint template class that we
  6618. // care to use.
  6619. typedef FloatingPoint<float> Float;
  6620. typedef FloatingPoint<double> Double;
  6621. // In order to catch the mistake of putting tests that use different
  6622. // test fixture classes in the same test case, we need to assign
  6623. // unique IDs to fixture classes and compare them. The TypeId type is
  6624. // used to hold such IDs. The user should treat TypeId as an opaque
  6625. // type: the only operation allowed on TypeId values is to compare
  6626. // them for equality using the == operator.
  6627. typedef const void* TypeId;
  6628. template <typename T>
  6629. class TypeIdHelper {
  6630. public:
  6631. // dummy_ must not have a const type. Otherwise an overly eager
  6632. // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
  6633. // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
  6634. static bool dummy_;
  6635. };
  6636. template <typename T>
  6637. bool TypeIdHelper<T>::dummy_ = false;
  6638. // GetTypeId<T>() returns the ID of type T. Different values will be
  6639. // returned for different types. Calling the function twice with the
  6640. // same type argument is guaranteed to return the same ID.
  6641. template <typename T>
  6642. TypeId GetTypeId() {
  6643. // The compiler is required to allocate a different
  6644. // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
  6645. // the template. Therefore, the address of dummy_ is guaranteed to
  6646. // be unique.
  6647. return &(TypeIdHelper<T>::dummy_);
  6648. }
  6649. // Returns the type ID of ::testing::Test. Always call this instead
  6650. // of GetTypeId< ::testing::Test>() to get the type ID of
  6651. // ::testing::Test, as the latter may give the wrong result due to a
  6652. // suspected linker bug when compiling Google Test as a Mac OS X
  6653. // framework.
  6654. GTEST_API_ TypeId GetTestTypeId();
  6655. // Defines the abstract factory interface that creates instances
  6656. // of a Test object.
  6657. class TestFactoryBase {
  6658. public:
  6659. virtual ~TestFactoryBase() {}
  6660. // Creates a test instance to run. The instance is both created and destroyed
  6661. // within TestInfoImpl::Run()
  6662. virtual Test* CreateTest() = 0;
  6663. protected:
  6664. TestFactoryBase() {}
  6665. private:
  6666. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
  6667. };
  6668. // This class provides implementation of TeastFactoryBase interface.
  6669. // It is used in TEST and TEST_F macros.
  6670. template <class TestClass>
  6671. class TestFactoryImpl : public TestFactoryBase {
  6672. public:
  6673. virtual Test* CreateTest() { return new TestClass; }
  6674. };
  6675. #if GTEST_OS_WINDOWS
  6676. // Predicate-formatters for implementing the HRESULT checking macros
  6677. // {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
  6678. // We pass a long instead of HRESULT to avoid causing an
  6679. // include dependency for the HRESULT type.
  6680. GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
  6681. long hr); // NOLINT
  6682. GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
  6683. long hr); // NOLINT
  6684. #endif // GTEST_OS_WINDOWS
  6685. // Types of SetUpTestCase() and TearDownTestCase() functions.
  6686. typedef void (*SetUpTestCaseFunc)();
  6687. typedef void (*TearDownTestCaseFunc)();
  6688. // Creates a new TestInfo object and registers it with Google Test;
  6689. // returns the created object.
  6690. //
  6691. // Arguments:
  6692. //
  6693. // test_case_name: name of the test case
  6694. // name: name of the test
  6695. // type_param the name of the test's type parameter, or NULL if
  6696. // this is not a typed or a type-parameterized test.
  6697. // value_param text representation of the test's value parameter,
  6698. // or NULL if this is not a type-parameterized test.
  6699. // fixture_class_id: ID of the test fixture class
  6700. // set_up_tc: pointer to the function that sets up the test case
  6701. // tear_down_tc: pointer to the function that tears down the test case
  6702. // factory: pointer to the factory that creates a test object.
  6703. // The newly created TestInfo instance will assume
  6704. // ownership of the factory object.
  6705. GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
  6706. const char* test_case_name,
  6707. const char* name,
  6708. const char* type_param,
  6709. const char* value_param,
  6710. TypeId fixture_class_id,
  6711. SetUpTestCaseFunc set_up_tc,
  6712. TearDownTestCaseFunc tear_down_tc,
  6713. TestFactoryBase* factory);
  6714. // If *pstr starts with the given prefix, modifies *pstr to be right
  6715. // past the prefix and returns true; otherwise leaves *pstr unchanged
  6716. // and returns false. None of pstr, *pstr, and prefix can be NULL.
  6717. GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
  6718. #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  6719. // State of the definition of a type-parameterized test case.
  6720. class GTEST_API_ TypedTestCasePState {
  6721. public:
  6722. TypedTestCasePState() : registered_(false) {}
  6723. // Adds the given test name to defined_test_names_ and return true
  6724. // if the test case hasn't been registered; otherwise aborts the
  6725. // program.
  6726. bool AddTestName(const char* file, int line, const char* case_name,
  6727. const char* test_name) {
  6728. if (registered_) {
  6729. fprintf(stderr, "%s Test %s must be defined before "
  6730. "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
  6731. FormatFileLocation(file, line).c_str(), test_name, case_name);
  6732. fflush(stderr);
  6733. posix::Abort();
  6734. }
  6735. defined_test_names_.insert(test_name);
  6736. return true;
  6737. }
  6738. // Verifies that registered_tests match the test names in
  6739. // defined_test_names_; returns registered_tests if successful, or
  6740. // aborts the program otherwise.
  6741. const char* VerifyRegisteredTestNames(
  6742. const char* file, int line, const char* registered_tests);
  6743. private:
  6744. bool registered_;
  6745. ::std::set<const char*> defined_test_names_;
  6746. };
  6747. // Skips to the first non-space char after the first comma in 'str';
  6748. // returns NULL if no comma is found in 'str'.
  6749. inline const char* SkipComma(const char* str) {
  6750. const char* comma = strchr(str, ',');
  6751. if (comma == NULL) {
  6752. return NULL;
  6753. }
  6754. while (IsSpace(*(++comma))) {}
  6755. return comma;
  6756. }
  6757. // Returns the prefix of 'str' before the first comma in it; returns
  6758. // the entire string if it contains no comma.
  6759. inline std::string GetPrefixUntilComma(const char* str) {
  6760. const char* comma = strchr(str, ',');
  6761. return comma == NULL ? str : std::string(str, comma);
  6762. }
  6763. // TypeParameterizedTest<Fixture, TestSel, Types>::Register()
  6764. // registers a list of type-parameterized tests with Google Test. The
  6765. // return value is insignificant - we just need to return something
  6766. // such that we can call this function in a namespace scope.
  6767. //
  6768. // Implementation note: The GTEST_TEMPLATE_ macro declares a template
  6769. // template parameter. It's defined in gtest-type-util.h.
  6770. template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
  6771. class TypeParameterizedTest {
  6772. public:
  6773. // 'index' is the index of the test in the type list 'Types'
  6774. // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
  6775. // Types). Valid values for 'index' are [0, N - 1] where N is the
  6776. // length of Types.
  6777. static bool Register(const char* prefix, const char* case_name,
  6778. const char* test_names, int index) {
  6779. typedef typename Types::Head Type;
  6780. typedef Fixture<Type> FixtureClass;
  6781. typedef typename GTEST_BIND_(TestSel, Type) TestClass;
  6782. // First, registers the first type-parameterized test in the type
  6783. // list.
  6784. MakeAndRegisterTestInfo(
  6785. (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/"
  6786. + StreamableToString(index)).c_str(),
  6787. GetPrefixUntilComma(test_names).c_str(),
  6788. GetTypeName<Type>().c_str(),
  6789. NULL, // No value parameter.
  6790. GetTypeId<FixtureClass>(),
  6791. TestClass::SetUpTestCase,
  6792. TestClass::TearDownTestCase,
  6793. new TestFactoryImpl<TestClass>);
  6794. // Next, recurses (at compile time) with the tail of the type list.
  6795. return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
  6796. ::Register(prefix, case_name, test_names, index + 1);
  6797. }
  6798. };
  6799. // The base case for the compile time recursion.
  6800. template <GTEST_TEMPLATE_ Fixture, class TestSel>
  6801. class TypeParameterizedTest<Fixture, TestSel, Types0> {
  6802. public:
  6803. static bool Register(const char* /*prefix*/, const char* /*case_name*/,
  6804. const char* /*test_names*/, int /*index*/) {
  6805. return true;
  6806. }
  6807. };
  6808. // TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
  6809. // registers *all combinations* of 'Tests' and 'Types' with Google
  6810. // Test. The return value is insignificant - we just need to return
  6811. // something such that we can call this function in a namespace scope.
  6812. template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
  6813. class TypeParameterizedTestCase {
  6814. public:
  6815. static bool Register(const char* prefix, const char* case_name,
  6816. const char* test_names) {
  6817. typedef typename Tests::Head Head;
  6818. // First, register the first test in 'Test' for each type in 'Types'.
  6819. TypeParameterizedTest<Fixture, Head, Types>::Register(
  6820. prefix, case_name, test_names, 0);
  6821. // Next, recurses (at compile time) with the tail of the test list.
  6822. return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
  6823. ::Register(prefix, case_name, SkipComma(test_names));
  6824. }
  6825. };
  6826. // The base case for the compile time recursion.
  6827. template <GTEST_TEMPLATE_ Fixture, typename Types>
  6828. class TypeParameterizedTestCase<Fixture, Templates0, Types> {
  6829. public:
  6830. static bool Register(const char* /*prefix*/, const char* /*case_name*/,
  6831. const char* /*test_names*/) {
  6832. return true;
  6833. }
  6834. };
  6835. #endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  6836. // Returns the current OS stack trace as an std::string.
  6837. //
  6838. // The maximum number of stack frames to be included is specified by
  6839. // the gtest_stack_trace_depth flag. The skip_count parameter
  6840. // specifies the number of top frames to be skipped, which doesn't
  6841. // count against the number of frames to be included.
  6842. //
  6843. // For example, if Foo() calls Bar(), which in turn calls
  6844. // GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
  6845. // the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
  6846. GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(
  6847. UnitTest* unit_test, int skip_count);
  6848. // Helpers for suppressing warnings on unreachable code or constant
  6849. // condition.
  6850. // Always returns true.
  6851. GTEST_API_ bool AlwaysTrue();
  6852. // Always returns false.
  6853. inline bool AlwaysFalse() { return !AlwaysTrue(); }
  6854. // Helper for suppressing false warning from Clang on a const char*
  6855. // variable declared in a conditional expression always being NULL in
  6856. // the else branch.
  6857. struct GTEST_API_ ConstCharPtr {
  6858. ConstCharPtr(const char* str) : value(str) {}
  6859. operator bool() const { return true; }
  6860. const char* value;
  6861. };
  6862. // A simple Linear Congruential Generator for generating random
  6863. // numbers with a uniform distribution. Unlike rand() and srand(), it
  6864. // doesn't use global state (and therefore can't interfere with user
  6865. // code). Unlike rand_r(), it's portable. An LCG isn't very random,
  6866. // but it's good enough for our purposes.
  6867. class GTEST_API_ Random {
  6868. public:
  6869. static const UInt32 kMaxRange = 1u << 31;
  6870. explicit Random(UInt32 seed) : state_(seed) {}
  6871. void Reseed(UInt32 seed) { state_ = seed; }
  6872. // Generates a random number from [0, range). Crashes if 'range' is
  6873. // 0 or greater than kMaxRange.
  6874. UInt32 Generate(UInt32 range);
  6875. private:
  6876. UInt32 state_;
  6877. GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
  6878. };
  6879. // Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
  6880. // compiler error iff T1 and T2 are different types.
  6881. template <typename T1, typename T2>
  6882. struct CompileAssertTypesEqual;
  6883. template <typename T>
  6884. struct CompileAssertTypesEqual<T, T> {
  6885. };
  6886. // Removes the reference from a type if it is a reference type,
  6887. // otherwise leaves it unchanged. This is the same as
  6888. // tr1::remove_reference, which is not widely available yet.
  6889. template <typename T>
  6890. struct RemoveReference { typedef T type; }; // NOLINT
  6891. template <typename T>
  6892. struct RemoveReference<T&> { typedef T type; }; // NOLINT
  6893. // A handy wrapper around RemoveReference that works when the argument
  6894. // T depends on template parameters.
  6895. #define GTEST_REMOVE_REFERENCE_(T) \
  6896. typename ::testing::internal::RemoveReference<T>::type
  6897. // Removes const from a type if it is a const type, otherwise leaves
  6898. // it unchanged. This is the same as tr1::remove_const, which is not
  6899. // widely available yet.
  6900. template <typename T>
  6901. struct RemoveConst { typedef T type; }; // NOLINT
  6902. template <typename T>
  6903. struct RemoveConst<const T> { typedef T type; }; // NOLINT
  6904. // MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
  6905. // definition to fail to remove the const in 'const int[3]' and 'const
  6906. // char[3][4]'. The following specialization works around the bug.
  6907. template <typename T, size_t N>
  6908. struct RemoveConst<const T[N]> {
  6909. typedef typename RemoveConst<T>::type type[N];
  6910. };
  6911. #if defined(_MSC_VER) && _MSC_VER < 1400
  6912. // This is the only specialization that allows VC++ 7.1 to remove const in
  6913. // 'const int[3] and 'const int[3][4]'. However, it causes trouble with GCC
  6914. // and thus needs to be conditionally compiled.
  6915. template <typename T, size_t N>
  6916. struct RemoveConst<T[N]> {
  6917. typedef typename RemoveConst<T>::type type[N];
  6918. };
  6919. #endif
  6920. // A handy wrapper around RemoveConst that works when the argument
  6921. // T depends on template parameters.
  6922. #define GTEST_REMOVE_CONST_(T) \
  6923. typename ::testing::internal::RemoveConst<T>::type
  6924. // Turns const U&, U&, const U, and U all into U.
  6925. #define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
  6926. GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
  6927. // Adds reference to a type if it is not a reference type,
  6928. // otherwise leaves it unchanged. This is the same as
  6929. // tr1::add_reference, which is not widely available yet.
  6930. template <typename T>
  6931. struct AddReference { typedef T& type; }; // NOLINT
  6932. template <typename T>
  6933. struct AddReference<T&> { typedef T& type; }; // NOLINT
  6934. // A handy wrapper around AddReference that works when the argument T
  6935. // depends on template parameters.
  6936. #define GTEST_ADD_REFERENCE_(T) \
  6937. typename ::testing::internal::AddReference<T>::type
  6938. // Adds a reference to const on top of T as necessary. For example,
  6939. // it transforms
  6940. //
  6941. // char ==> const char&
  6942. // const char ==> const char&
  6943. // char& ==> const char&
  6944. // const char& ==> const char&
  6945. //
  6946. // The argument T must depend on some template parameters.
  6947. #define GTEST_REFERENCE_TO_CONST_(T) \
  6948. GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T))
  6949. // ImplicitlyConvertible<From, To>::value is a compile-time bool
  6950. // constant that's true iff type From can be implicitly converted to
  6951. // type To.
  6952. template <typename From, typename To>
  6953. class ImplicitlyConvertible {
  6954. private:
  6955. // We need the following helper functions only for their types.
  6956. // They have no implementations.
  6957. // MakeFrom() is an expression whose type is From. We cannot simply
  6958. // use From(), as the type From may not have a public default
  6959. // constructor.
  6960. static From MakeFrom();
  6961. // These two functions are overloaded. Given an expression
  6962. // Helper(x), the compiler will pick the first version if x can be
  6963. // implicitly converted to type To; otherwise it will pick the
  6964. // second version.
  6965. //
  6966. // The first version returns a value of size 1, and the second
  6967. // version returns a value of size 2. Therefore, by checking the
  6968. // size of Helper(x), which can be done at compile time, we can tell
  6969. // which version of Helper() is used, and hence whether x can be
  6970. // implicitly converted to type To.
  6971. static char Helper(To);
  6972. static char (&Helper(...))[2]; // NOLINT
  6973. // We have to put the 'public' section after the 'private' section,
  6974. // or MSVC refuses to compile the code.
  6975. public:
  6976. // MSVC warns about implicitly converting from double to int for
  6977. // possible loss of data, so we need to temporarily disable the
  6978. // warning.
  6979. #ifdef _MSC_VER
  6980. # pragma warning(push) // Saves the current warning state.
  6981. # pragma warning(disable:4244) // Temporarily disables warning 4244.
  6982. static const bool value =
  6983. sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
  6984. # pragma warning(pop) // Restores the warning state.
  6985. #elif defined(__BORLANDC__)
  6986. // C++Builder cannot use member overload resolution during template
  6987. // instantiation. The simplest workaround is to use its C++0x type traits
  6988. // functions (C++Builder 2009 and above only).
  6989. static const bool value = __is_convertible(From, To);
  6990. #else
  6991. static const bool value =
  6992. sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
  6993. #endif // _MSV_VER
  6994. };
  6995. template <typename From, typename To>
  6996. const bool ImplicitlyConvertible<From, To>::value;
  6997. // IsAProtocolMessage<T>::value is a compile-time bool constant that's
  6998. // true iff T is type ProtocolMessage, proto2::Message, or a subclass
  6999. // of those.
  7000. template <typename T>
  7001. struct IsAProtocolMessage
  7002. : public bool_constant<
  7003. ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
  7004. ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
  7005. };
  7006. // When the compiler sees expression IsContainerTest<C>(0), if C is an
  7007. // STL-style container class, the first overload of IsContainerTest
  7008. // will be viable (since both C::iterator* and C::const_iterator* are
  7009. // valid types and NULL can be implicitly converted to them). It will
  7010. // be picked over the second overload as 'int' is a perfect match for
  7011. // the type of argument 0. If C::iterator or C::const_iterator is not
  7012. // a valid type, the first overload is not viable, and the second
  7013. // overload will be picked. Therefore, we can determine whether C is
  7014. // a container class by checking the type of IsContainerTest<C>(0).
  7015. // The value of the expression is insignificant.
  7016. //
  7017. // Note that we look for both C::iterator and C::const_iterator. The
  7018. // reason is that C++ injects the name of a class as a member of the
  7019. // class itself (e.g. you can refer to class iterator as either
  7020. // 'iterator' or 'iterator::iterator'). If we look for C::iterator
  7021. // only, for example, we would mistakenly think that a class named
  7022. // iterator is an STL container.
  7023. //
  7024. // Also note that the simpler approach of overloading
  7025. // IsContainerTest(typename C::const_iterator*) and
  7026. // IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
  7027. typedef int IsContainer;
  7028. template <class C>
  7029. IsContainer IsContainerTest(int /* dummy */,
  7030. typename C::iterator* /* it */ = NULL,
  7031. typename C::const_iterator* /* const_it */ = NULL) {
  7032. return 0;
  7033. }
  7034. typedef char IsNotContainer;
  7035. template <class C>
  7036. IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
  7037. // EnableIf<condition>::type is void when 'Cond' is true, and
  7038. // undefined when 'Cond' is false. To use SFINAE to make a function
  7039. // overload only apply when a particular expression is true, add
  7040. // "typename EnableIf<expression>::type* = 0" as the last parameter.
  7041. template<bool> struct EnableIf;
  7042. template<> struct EnableIf<true> { typedef void type; }; // NOLINT
  7043. // Utilities for native arrays.
  7044. // ArrayEq() compares two k-dimensional native arrays using the
  7045. // elements' operator==, where k can be any integer >= 0. When k is
  7046. // 0, ArrayEq() degenerates into comparing a single pair of values.
  7047. template <typename T, typename U>
  7048. bool ArrayEq(const T* lhs, size_t size, const U* rhs);
  7049. // This generic version is used when k is 0.
  7050. template <typename T, typename U>
  7051. inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
  7052. // This overload is used when k >= 1.
  7053. template <typename T, typename U, size_t N>
  7054. inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
  7055. return internal::ArrayEq(lhs, N, rhs);
  7056. }
  7057. // This helper reduces code bloat. If we instead put its logic inside
  7058. // the previous ArrayEq() function, arrays with different sizes would
  7059. // lead to different copies of the template code.
  7060. template <typename T, typename U>
  7061. bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
  7062. for (size_t i = 0; i != size; i++) {
  7063. if (!internal::ArrayEq(lhs[i], rhs[i]))
  7064. return false;
  7065. }
  7066. return true;
  7067. }
  7068. // Finds the first element in the iterator range [begin, end) that
  7069. // equals elem. Element may be a native array type itself.
  7070. template <typename Iter, typename Element>
  7071. Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
  7072. for (Iter it = begin; it != end; ++it) {
  7073. if (internal::ArrayEq(*it, elem))
  7074. return it;
  7075. }
  7076. return end;
  7077. }
  7078. // CopyArray() copies a k-dimensional native array using the elements'
  7079. // operator=, where k can be any integer >= 0. When k is 0,
  7080. // CopyArray() degenerates into copying a single value.
  7081. template <typename T, typename U>
  7082. void CopyArray(const T* from, size_t size, U* to);
  7083. // This generic version is used when k is 0.
  7084. template <typename T, typename U>
  7085. inline void CopyArray(const T& from, U* to) { *to = from; }
  7086. // This overload is used when k >= 1.
  7087. template <typename T, typename U, size_t N>
  7088. inline void CopyArray(const T(&from)[N], U(*to)[N]) {
  7089. internal::CopyArray(from, N, *to);
  7090. }
  7091. // This helper reduces code bloat. If we instead put its logic inside
  7092. // the previous CopyArray() function, arrays with different sizes
  7093. // would lead to different copies of the template code.
  7094. template <typename T, typename U>
  7095. void CopyArray(const T* from, size_t size, U* to) {
  7096. for (size_t i = 0; i != size; i++) {
  7097. internal::CopyArray(from[i], to + i);
  7098. }
  7099. }
  7100. // The relation between an NativeArray object (see below) and the
  7101. // native array it represents.
  7102. enum RelationToSource {
  7103. kReference, // The NativeArray references the native array.
  7104. kCopy // The NativeArray makes a copy of the native array and
  7105. // owns the copy.
  7106. };
  7107. // Adapts a native array to a read-only STL-style container. Instead
  7108. // of the complete STL container concept, this adaptor only implements
  7109. // members useful for Google Mock's container matchers. New members
  7110. // should be added as needed. To simplify the implementation, we only
  7111. // support Element being a raw type (i.e. having no top-level const or
  7112. // reference modifier). It's the client's responsibility to satisfy
  7113. // this requirement. Element can be an array type itself (hence
  7114. // multi-dimensional arrays are supported).
  7115. template <typename Element>
  7116. class NativeArray {
  7117. public:
  7118. // STL-style container typedefs.
  7119. typedef Element value_type;
  7120. typedef Element* iterator;
  7121. typedef const Element* const_iterator;
  7122. // Constructs from a native array.
  7123. NativeArray(const Element* array, size_t count, RelationToSource relation) {
  7124. Init(array, count, relation);
  7125. }
  7126. // Copy constructor.
  7127. NativeArray(const NativeArray& rhs) {
  7128. Init(rhs.array_, rhs.size_, rhs.relation_to_source_);
  7129. }
  7130. ~NativeArray() {
  7131. // Ensures that the user doesn't instantiate NativeArray with a
  7132. // const or reference type.
  7133. static_cast<void>(StaticAssertTypeEqHelper<Element,
  7134. GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>());
  7135. if (relation_to_source_ == kCopy)
  7136. delete[] array_;
  7137. }
  7138. // STL-style container methods.
  7139. size_t size() const { return size_; }
  7140. const_iterator begin() const { return array_; }
  7141. const_iterator end() const { return array_ + size_; }
  7142. bool operator==(const NativeArray& rhs) const {
  7143. return size() == rhs.size() &&
  7144. ArrayEq(begin(), size(), rhs.begin());
  7145. }
  7146. private:
  7147. // Initializes this object; makes a copy of the input array if
  7148. // 'relation' is kCopy.
  7149. void Init(const Element* array, size_t a_size, RelationToSource relation) {
  7150. if (relation == kReference) {
  7151. array_ = array;
  7152. } else {
  7153. Element* const copy = new Element[a_size];
  7154. CopyArray(array, a_size, copy);
  7155. array_ = copy;
  7156. }
  7157. size_ = a_size;
  7158. relation_to_source_ = relation;
  7159. }
  7160. const Element* array_;
  7161. size_t size_;
  7162. RelationToSource relation_to_source_;
  7163. GTEST_DISALLOW_ASSIGN_(NativeArray);
  7164. };
  7165. } // namespace internal
  7166. } // namespace testing
  7167. #define GTEST_MESSAGE_AT_(file, line, message, result_type) \
  7168. ::testing::internal::AssertHelper(result_type, file, line, message) \
  7169. = ::testing::Message()
  7170. #define GTEST_MESSAGE_(message, result_type) \
  7171. GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
  7172. #define GTEST_FATAL_FAILURE_(message) \
  7173. return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
  7174. #define GTEST_NONFATAL_FAILURE_(message) \
  7175. GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
  7176. #define GTEST_SUCCESS_(message) \
  7177. GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
  7178. // Suppresses MSVC warnings 4072 (unreachable code) for the code following
  7179. // statement if it returns or throws (or doesn't return or throw in some
  7180. // situations).
  7181. #define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
  7182. if (::testing::internal::AlwaysTrue()) { statement; }
  7183. #define GTEST_TEST_THROW_(statement, expected_exception, fail) \
  7184. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7185. if (::testing::internal::ConstCharPtr gtest_msg = "") { \
  7186. bool gtest_caught_expected = false; \
  7187. try { \
  7188. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7189. } \
  7190. catch (expected_exception const&) { \
  7191. gtest_caught_expected = true; \
  7192. } \
  7193. catch (...) { \
  7194. gtest_msg.value = \
  7195. "Expected: " #statement " throws an exception of type " \
  7196. #expected_exception ".\n Actual: it throws a different type."; \
  7197. goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
  7198. } \
  7199. if (!gtest_caught_expected) { \
  7200. gtest_msg.value = \
  7201. "Expected: " #statement " throws an exception of type " \
  7202. #expected_exception ".\n Actual: it throws nothing."; \
  7203. goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
  7204. } \
  7205. } else \
  7206. GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
  7207. fail(gtest_msg.value)
  7208. #define GTEST_TEST_NO_THROW_(statement, fail) \
  7209. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7210. if (::testing::internal::AlwaysTrue()) { \
  7211. try { \
  7212. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7213. } \
  7214. catch (...) { \
  7215. goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
  7216. } \
  7217. } else \
  7218. GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
  7219. fail("Expected: " #statement " doesn't throw an exception.\n" \
  7220. " Actual: it throws.")
  7221. #define GTEST_TEST_ANY_THROW_(statement, fail) \
  7222. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7223. if (::testing::internal::AlwaysTrue()) { \
  7224. bool gtest_caught_any = false; \
  7225. try { \
  7226. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7227. } \
  7228. catch (...) { \
  7229. gtest_caught_any = true; \
  7230. } \
  7231. if (!gtest_caught_any) { \
  7232. goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
  7233. } \
  7234. } else \
  7235. GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
  7236. fail("Expected: " #statement " throws an exception.\n" \
  7237. " Actual: it doesn't.")
  7238. // Implements Boolean test assertions such as EXPECT_TRUE. expression can be
  7239. // either a boolean expression or an AssertionResult. text is a textual
  7240. // represenation of expression as it was passed into the EXPECT_TRUE.
  7241. #define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
  7242. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7243. if (const ::testing::AssertionResult gtest_ar_ = \
  7244. ::testing::AssertionResult(expression)) \
  7245. ; \
  7246. else \
  7247. fail(::testing::internal::GetBoolAssertionFailureMessage(\
  7248. gtest_ar_, text, #actual, #expected).c_str())
  7249. #define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
  7250. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7251. if (::testing::internal::AlwaysTrue()) { \
  7252. ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
  7253. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7254. if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
  7255. goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
  7256. } \
  7257. } else \
  7258. GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
  7259. fail("Expected: " #statement " doesn't generate new fatal " \
  7260. "failures in the current thread.\n" \
  7261. " Actual: it does.")
  7262. // Expands to the name of the class that implements the given test.
  7263. #define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
  7264. test_case_name##_##test_name##_Test
  7265. // Helper macro for defining tests.
  7266. #define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
  7267. class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
  7268. public:\
  7269. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
  7270. private:\
  7271. virtual void TestBody();\
  7272. static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
  7273. GTEST_DISALLOW_COPY_AND_ASSIGN_(\
  7274. GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
  7275. };\
  7276. \
  7277. ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
  7278. ::test_info_ =\
  7279. ::testing::internal::MakeAndRegisterTestInfo(\
  7280. #test_case_name, #test_name, NULL, NULL, \
  7281. (parent_id), \
  7282. parent_class::SetUpTestCase, \
  7283. parent_class::TearDownTestCase, \
  7284. new ::testing::internal::TestFactoryImpl<\
  7285. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
  7286. void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
  7287. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
  7288. // Copyright 2005, Google Inc.
  7289. // All rights reserved.
  7290. //
  7291. // Redistribution and use in source and binary forms, with or without
  7292. // modification, are permitted provided that the following conditions are
  7293. // met:
  7294. //
  7295. // * Redistributions of source code must retain the above copyright
  7296. // notice, this list of conditions and the following disclaimer.
  7297. // * Redistributions in binary form must reproduce the above
  7298. // copyright notice, this list of conditions and the following disclaimer
  7299. // in the documentation and/or other materials provided with the
  7300. // distribution.
  7301. // * Neither the name of Google Inc. nor the names of its
  7302. // contributors may be used to endorse or promote products derived from
  7303. // this software without specific prior written permission.
  7304. //
  7305. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  7306. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  7307. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  7308. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7309. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  7310. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  7311. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  7312. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  7313. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  7314. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  7315. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  7316. //
  7317. // Author: wan@google.com (Zhanyong Wan)
  7318. //
  7319. // The Google C++ Testing Framework (Google Test)
  7320. //
  7321. // This header file defines the public API for death tests. It is
  7322. // #included by gtest.h so a user doesn't need to include this
  7323. // directly.
  7324. #ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
  7325. #define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
  7326. // Copyright 2005, Google Inc.
  7327. // All rights reserved.
  7328. //
  7329. // Redistribution and use in source and binary forms, with or without
  7330. // modification, are permitted provided that the following conditions are
  7331. // met:
  7332. //
  7333. // * Redistributions of source code must retain the above copyright
  7334. // notice, this list of conditions and the following disclaimer.
  7335. // * Redistributions in binary form must reproduce the above
  7336. // copyright notice, this list of conditions and the following disclaimer
  7337. // in the documentation and/or other materials provided with the
  7338. // distribution.
  7339. // * Neither the name of Google Inc. nor the names of its
  7340. // contributors may be used to endorse or promote products derived from
  7341. // this software without specific prior written permission.
  7342. //
  7343. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  7344. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  7345. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  7346. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7347. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  7348. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  7349. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  7350. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  7351. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  7352. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  7353. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  7354. //
  7355. // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
  7356. //
  7357. // The Google C++ Testing Framework (Google Test)
  7358. //
  7359. // This header file defines internal utilities needed for implementing
  7360. // death tests. They are subject to change without notice.
  7361. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
  7362. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
  7363. #include <stdio.h>
  7364. namespace testing {
  7365. namespace internal {
  7366. GTEST_DECLARE_string_(internal_run_death_test);
  7367. // Names of the flags (needed for parsing Google Test flags).
  7368. const char kDeathTestStyleFlag[] = "death_test_style";
  7369. const char kDeathTestUseFork[] = "death_test_use_fork";
  7370. const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
  7371. #if GTEST_HAS_DEATH_TEST
  7372. // DeathTest is a class that hides much of the complexity of the
  7373. // GTEST_DEATH_TEST_ macro. It is abstract; its static Create method
  7374. // returns a concrete class that depends on the prevailing death test
  7375. // style, as defined by the --gtest_death_test_style and/or
  7376. // --gtest_internal_run_death_test flags.
  7377. // In describing the results of death tests, these terms are used with
  7378. // the corresponding definitions:
  7379. //
  7380. // exit status: The integer exit information in the format specified
  7381. // by wait(2)
  7382. // exit code: The integer code passed to exit(3), _exit(2), or
  7383. // returned from main()
  7384. class GTEST_API_ DeathTest {
  7385. public:
  7386. // Create returns false if there was an error determining the
  7387. // appropriate action to take for the current death test; for example,
  7388. // if the gtest_death_test_style flag is set to an invalid value.
  7389. // The LastMessage method will return a more detailed message in that
  7390. // case. Otherwise, the DeathTest pointer pointed to by the "test"
  7391. // argument is set. If the death test should be skipped, the pointer
  7392. // is set to NULL; otherwise, it is set to the address of a new concrete
  7393. // DeathTest object that controls the execution of the current test.
  7394. static bool Create(const char* statement, const RE* regex,
  7395. const char* file, int line, DeathTest** test);
  7396. DeathTest();
  7397. virtual ~DeathTest() { }
  7398. // A helper class that aborts a death test when it's deleted.
  7399. class ReturnSentinel {
  7400. public:
  7401. explicit ReturnSentinel(DeathTest* test) : test_(test) { }
  7402. ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
  7403. private:
  7404. DeathTest* const test_;
  7405. GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
  7406. } GTEST_ATTRIBUTE_UNUSED_;
  7407. // An enumeration of possible roles that may be taken when a death
  7408. // test is encountered. EXECUTE means that the death test logic should
  7409. // be executed immediately. OVERSEE means that the program should prepare
  7410. // the appropriate environment for a child process to execute the death
  7411. // test, then wait for it to complete.
  7412. enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
  7413. // An enumeration of the three reasons that a test might be aborted.
  7414. enum AbortReason {
  7415. TEST_ENCOUNTERED_RETURN_STATEMENT,
  7416. TEST_THREW_EXCEPTION,
  7417. TEST_DID_NOT_DIE
  7418. };
  7419. // Assumes one of the above roles.
  7420. virtual TestRole AssumeRole() = 0;
  7421. // Waits for the death test to finish and returns its status.
  7422. virtual int Wait() = 0;
  7423. // Returns true if the death test passed; that is, the test process
  7424. // exited during the test, its exit status matches a user-supplied
  7425. // predicate, and its stderr output matches a user-supplied regular
  7426. // expression.
  7427. // The user-supplied predicate may be a macro expression rather
  7428. // than a function pointer or functor, or else Wait and Passed could
  7429. // be combined.
  7430. virtual bool Passed(bool exit_status_ok) = 0;
  7431. // Signals that the death test did not die as expected.
  7432. virtual void Abort(AbortReason reason) = 0;
  7433. // Returns a human-readable outcome message regarding the outcome of
  7434. // the last death test.
  7435. static const char* LastMessage();
  7436. static void set_last_death_test_message(const std::string& message);
  7437. private:
  7438. // A string containing a description of the outcome of the last death test.
  7439. static std::string last_death_test_message_;
  7440. GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
  7441. };
  7442. // Factory interface for death tests. May be mocked out for testing.
  7443. class DeathTestFactory {
  7444. public:
  7445. virtual ~DeathTestFactory() { }
  7446. virtual bool Create(const char* statement, const RE* regex,
  7447. const char* file, int line, DeathTest** test) = 0;
  7448. };
  7449. // A concrete DeathTestFactory implementation for normal use.
  7450. class DefaultDeathTestFactory : public DeathTestFactory {
  7451. public:
  7452. virtual bool Create(const char* statement, const RE* regex,
  7453. const char* file, int line, DeathTest** test);
  7454. };
  7455. // Returns true if exit_status describes a process that was terminated
  7456. // by a signal, or exited normally with a nonzero exit code.
  7457. GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
  7458. // Traps C++ exceptions escaping statement and reports them as test
  7459. // failures. Note that trapping SEH exceptions is not implemented here.
  7460. # if GTEST_HAS_EXCEPTIONS
  7461. # define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
  7462. try { \
  7463. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7464. } catch (const ::std::exception& gtest_exception) { \
  7465. fprintf(\
  7466. stderr, \
  7467. "\n%s: Caught std::exception-derived exception escaping the " \
  7468. "death test statement. Exception message: %s\n", \
  7469. ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
  7470. gtest_exception.what()); \
  7471. fflush(stderr); \
  7472. death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
  7473. } catch (...) { \
  7474. death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
  7475. }
  7476. # else
  7477. # define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
  7478. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
  7479. # endif
  7480. // This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
  7481. // ASSERT_EXIT*, and EXPECT_EXIT*.
  7482. # define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
  7483. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7484. if (::testing::internal::AlwaysTrue()) { \
  7485. const ::testing::internal::RE& gtest_regex = (regex); \
  7486. ::testing::internal::DeathTest* gtest_dt; \
  7487. if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \
  7488. __FILE__, __LINE__, &gtest_dt)) { \
  7489. goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
  7490. } \
  7491. if (gtest_dt != NULL) { \
  7492. ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
  7493. gtest_dt_ptr(gtest_dt); \
  7494. switch (gtest_dt->AssumeRole()) { \
  7495. case ::testing::internal::DeathTest::OVERSEE_TEST: \
  7496. if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
  7497. goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
  7498. } \
  7499. break; \
  7500. case ::testing::internal::DeathTest::EXECUTE_TEST: { \
  7501. ::testing::internal::DeathTest::ReturnSentinel \
  7502. gtest_sentinel(gtest_dt); \
  7503. GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
  7504. gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
  7505. break; \
  7506. } \
  7507. default: \
  7508. break; \
  7509. } \
  7510. } \
  7511. } else \
  7512. GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
  7513. fail(::testing::internal::DeathTest::LastMessage())
  7514. // The symbol "fail" here expands to something into which a message
  7515. // can be streamed.
  7516. // This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in
  7517. // NDEBUG mode. In this case we need the statements to be executed, the regex is
  7518. // ignored, and the macro must accept a streamed message even though the message
  7519. // is never printed.
  7520. # define GTEST_EXECUTE_STATEMENT_(statement, regex) \
  7521. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7522. if (::testing::internal::AlwaysTrue()) { \
  7523. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7524. } else \
  7525. ::testing::Message()
  7526. // A class representing the parsed contents of the
  7527. // --gtest_internal_run_death_test flag, as it existed when
  7528. // RUN_ALL_TESTS was called.
  7529. class InternalRunDeathTestFlag {
  7530. public:
  7531. InternalRunDeathTestFlag(const std::string& a_file,
  7532. int a_line,
  7533. int an_index,
  7534. int a_write_fd)
  7535. : file_(a_file), line_(a_line), index_(an_index),
  7536. write_fd_(a_write_fd) {}
  7537. ~InternalRunDeathTestFlag() {
  7538. if (write_fd_ >= 0)
  7539. posix::Close(write_fd_);
  7540. }
  7541. const std::string& file() const { return file_; }
  7542. int line() const { return line_; }
  7543. int index() const { return index_; }
  7544. int write_fd() const { return write_fd_; }
  7545. private:
  7546. std::string file_;
  7547. int line_;
  7548. int index_;
  7549. int write_fd_;
  7550. GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
  7551. };
  7552. // Returns a newly created InternalRunDeathTestFlag object with fields
  7553. // initialized from the GTEST_FLAG(internal_run_death_test) flag if
  7554. // the flag is specified; otherwise returns NULL.
  7555. InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
  7556. #else // GTEST_HAS_DEATH_TEST
  7557. // This macro is used for implementing macros such as
  7558. // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
  7559. // death tests are not supported. Those macros must compile on such systems
  7560. // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
  7561. // systems that support death tests. This allows one to write such a macro
  7562. // on a system that does not support death tests and be sure that it will
  7563. // compile on a death-test supporting system.
  7564. //
  7565. // Parameters:
  7566. // statement - A statement that a macro such as EXPECT_DEATH would test
  7567. // for program termination. This macro has to make sure this
  7568. // statement is compiled but not executed, to ensure that
  7569. // EXPECT_DEATH_IF_SUPPORTED compiles with a certain
  7570. // parameter iff EXPECT_DEATH compiles with it.
  7571. // regex - A regex that a macro such as EXPECT_DEATH would use to test
  7572. // the output of statement. This parameter has to be
  7573. // compiled but not evaluated by this macro, to ensure that
  7574. // this macro only accepts expressions that a macro such as
  7575. // EXPECT_DEATH would accept.
  7576. // terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
  7577. // and a return statement for ASSERT_DEATH_IF_SUPPORTED.
  7578. // This ensures that ASSERT_DEATH_IF_SUPPORTED will not
  7579. // compile inside functions where ASSERT_DEATH doesn't
  7580. // compile.
  7581. //
  7582. // The branch that has an always false condition is used to ensure that
  7583. // statement and regex are compiled (and thus syntactically correct) but
  7584. // never executed. The unreachable code macro protects the terminator
  7585. // statement from generating an 'unreachable code' warning in case
  7586. // statement unconditionally returns or throws. The Message constructor at
  7587. // the end allows the syntax of streaming additional messages into the
  7588. // macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
  7589. # define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \
  7590. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7591. if (::testing::internal::AlwaysTrue()) { \
  7592. GTEST_LOG_(WARNING) \
  7593. << "Death tests are not supported on this platform.\n" \
  7594. << "Statement '" #statement "' cannot be verified."; \
  7595. } else if (::testing::internal::AlwaysFalse()) { \
  7596. ::testing::internal::RE::PartialMatch(".*", (regex)); \
  7597. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7598. terminator; \
  7599. } else \
  7600. ::testing::Message()
  7601. #endif // GTEST_HAS_DEATH_TEST
  7602. } // namespace internal
  7603. } // namespace testing
  7604. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
  7605. namespace testing {
  7606. // This flag controls the style of death tests. Valid values are "threadsafe",
  7607. // meaning that the death test child process will re-execute the test binary
  7608. // from the start, running only a single death test, or "fast",
  7609. // meaning that the child process will execute the test logic immediately
  7610. // after forking.
  7611. GTEST_DECLARE_string_(death_test_style);
  7612. #if GTEST_HAS_DEATH_TEST
  7613. namespace internal {
  7614. // Returns a Boolean value indicating whether the caller is currently
  7615. // executing in the context of the death test child process. Tools such as
  7616. // Valgrind heap checkers may need this to modify their behavior in death
  7617. // tests. IMPORTANT: This is an internal utility. Using it may break the
  7618. // implementation of death tests. User code MUST NOT use it.
  7619. GTEST_API_ bool InDeathTestChild();
  7620. } // namespace internal
  7621. // The following macros are useful for writing death tests.
  7622. // Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
  7623. // executed:
  7624. //
  7625. // 1. It generates a warning if there is more than one active
  7626. // thread. This is because it's safe to fork() or clone() only
  7627. // when there is a single thread.
  7628. //
  7629. // 2. The parent process clone()s a sub-process and runs the death
  7630. // test in it; the sub-process exits with code 0 at the end of the
  7631. // death test, if it hasn't exited already.
  7632. //
  7633. // 3. The parent process waits for the sub-process to terminate.
  7634. //
  7635. // 4. The parent process checks the exit code and error message of
  7636. // the sub-process.
  7637. //
  7638. // Examples:
  7639. //
  7640. // ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
  7641. // for (int i = 0; i < 5; i++) {
  7642. // EXPECT_DEATH(server.ProcessRequest(i),
  7643. // "Invalid request .* in ProcessRequest()")
  7644. // << "Failed to die on request " << i;
  7645. // }
  7646. //
  7647. // ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
  7648. //
  7649. // bool KilledBySIGHUP(int exit_code) {
  7650. // return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
  7651. // }
  7652. //
  7653. // ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
  7654. //
  7655. // On the regular expressions used in death tests:
  7656. //
  7657. // On POSIX-compliant systems (*nix), we use the <regex.h> library,
  7658. // which uses the POSIX extended regex syntax.
  7659. //
  7660. // On other platforms (e.g. Windows), we only support a simple regex
  7661. // syntax implemented as part of Google Test. This limited
  7662. // implementation should be enough most of the time when writing
  7663. // death tests; though it lacks many features you can find in PCRE
  7664. // or POSIX extended regex syntax. For example, we don't support
  7665. // union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
  7666. // repetition count ("x{5,7}"), among others.
  7667. //
  7668. // Below is the syntax that we do support. We chose it to be a
  7669. // subset of both PCRE and POSIX extended regex, so it's easy to
  7670. // learn wherever you come from. In the following: 'A' denotes a
  7671. // literal character, period (.), or a single \\ escape sequence;
  7672. // 'x' and 'y' denote regular expressions; 'm' and 'n' are for
  7673. // natural numbers.
  7674. //
  7675. // c matches any literal character c
  7676. // \\d matches any decimal digit
  7677. // \\D matches any character that's not a decimal digit
  7678. // \\f matches \f
  7679. // \\n matches \n
  7680. // \\r matches \r
  7681. // \\s matches any ASCII whitespace, including \n
  7682. // \\S matches any character that's not a whitespace
  7683. // \\t matches \t
  7684. // \\v matches \v
  7685. // \\w matches any letter, _, or decimal digit
  7686. // \\W matches any character that \\w doesn't match
  7687. // \\c matches any literal character c, which must be a punctuation
  7688. // . matches any single character except \n
  7689. // A? matches 0 or 1 occurrences of A
  7690. // A* matches 0 or many occurrences of A
  7691. // A+ matches 1 or many occurrences of A
  7692. // ^ matches the beginning of a string (not that of each line)
  7693. // $ matches the end of a string (not that of each line)
  7694. // xy matches x followed by y
  7695. //
  7696. // If you accidentally use PCRE or POSIX extended regex features
  7697. // not implemented by us, you will get a run-time failure. In that
  7698. // case, please try to rewrite your regular expression within the
  7699. // above syntax.
  7700. //
  7701. // This implementation is *not* meant to be as highly tuned or robust
  7702. // as a compiled regex library, but should perform well enough for a
  7703. // death test, which already incurs significant overhead by launching
  7704. // a child process.
  7705. //
  7706. // Known caveats:
  7707. //
  7708. // A "threadsafe" style death test obtains the path to the test
  7709. // program from argv[0] and re-executes it in the sub-process. For
  7710. // simplicity, the current implementation doesn't search the PATH
  7711. // when launching the sub-process. This means that the user must
  7712. // invoke the test program via a path that contains at least one
  7713. // path separator (e.g. path/to/foo_test and
  7714. // /absolute/path/to/bar_test are fine, but foo_test is not). This
  7715. // is rarely a problem as people usually don't put the test binary
  7716. // directory in PATH.
  7717. //
  7718. // TODO(wan@google.com): make thread-safe death tests search the PATH.
  7719. // Asserts that a given statement causes the program to exit, with an
  7720. // integer exit status that satisfies predicate, and emitting error output
  7721. // that matches regex.
  7722. # define ASSERT_EXIT(statement, predicate, regex) \
  7723. GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
  7724. // Like ASSERT_EXIT, but continues on to successive tests in the
  7725. // test case, if any:
  7726. # define EXPECT_EXIT(statement, predicate, regex) \
  7727. GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
  7728. // Asserts that a given statement causes the program to exit, either by
  7729. // explicitly exiting with a nonzero exit code or being killed by a
  7730. // signal, and emitting error output that matches regex.
  7731. # define ASSERT_DEATH(statement, regex) \
  7732. ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
  7733. // Like ASSERT_DEATH, but continues on to successive tests in the
  7734. // test case, if any:
  7735. # define EXPECT_DEATH(statement, regex) \
  7736. EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
  7737. // Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
  7738. // Tests that an exit code describes a normal exit with a given exit code.
  7739. class GTEST_API_ ExitedWithCode {
  7740. public:
  7741. explicit ExitedWithCode(int exit_code);
  7742. bool operator()(int exit_status) const;
  7743. private:
  7744. // No implementation - assignment is unsupported.
  7745. void operator=(const ExitedWithCode& other);
  7746. const int exit_code_;
  7747. };
  7748. # if !GTEST_OS_WINDOWS
  7749. // Tests that an exit code describes an exit due to termination by a
  7750. // given signal.
  7751. class GTEST_API_ KilledBySignal {
  7752. public:
  7753. explicit KilledBySignal(int signum);
  7754. bool operator()(int exit_status) const;
  7755. private:
  7756. const int signum_;
  7757. };
  7758. # endif // !GTEST_OS_WINDOWS
  7759. // EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
  7760. // The death testing framework causes this to have interesting semantics,
  7761. // since the sideeffects of the call are only visible in opt mode, and not
  7762. // in debug mode.
  7763. //
  7764. // In practice, this can be used to test functions that utilize the
  7765. // LOG(DFATAL) macro using the following style:
  7766. //
  7767. // int DieInDebugOr12(int* sideeffect) {
  7768. // if (sideeffect) {
  7769. // *sideeffect = 12;
  7770. // }
  7771. // LOG(DFATAL) << "death";
  7772. // return 12;
  7773. // }
  7774. //
  7775. // TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
  7776. // int sideeffect = 0;
  7777. // // Only asserts in dbg.
  7778. // EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
  7779. //
  7780. // #ifdef NDEBUG
  7781. // // opt-mode has sideeffect visible.
  7782. // EXPECT_EQ(12, sideeffect);
  7783. // #else
  7784. // // dbg-mode no visible sideeffect.
  7785. // EXPECT_EQ(0, sideeffect);
  7786. // #endif
  7787. // }
  7788. //
  7789. // This will assert that DieInDebugReturn12InOpt() crashes in debug
  7790. // mode, usually due to a DCHECK or LOG(DFATAL), but returns the
  7791. // appropriate fallback value (12 in this case) in opt mode. If you
  7792. // need to test that a function has appropriate side-effects in opt
  7793. // mode, include assertions against the side-effects. A general
  7794. // pattern for this is:
  7795. //
  7796. // EXPECT_DEBUG_DEATH({
  7797. // // Side-effects here will have an effect after this statement in
  7798. // // opt mode, but none in debug mode.
  7799. // EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
  7800. // }, "death");
  7801. //
  7802. # ifdef NDEBUG
  7803. # define EXPECT_DEBUG_DEATH(statement, regex) \
  7804. GTEST_EXECUTE_STATEMENT_(statement, regex)
  7805. # define ASSERT_DEBUG_DEATH(statement, regex) \
  7806. GTEST_EXECUTE_STATEMENT_(statement, regex)
  7807. # else
  7808. # define EXPECT_DEBUG_DEATH(statement, regex) \
  7809. EXPECT_DEATH(statement, regex)
  7810. # define ASSERT_DEBUG_DEATH(statement, regex) \
  7811. ASSERT_DEATH(statement, regex)
  7812. # endif // NDEBUG for EXPECT_DEBUG_DEATH
  7813. #endif // GTEST_HAS_DEATH_TEST
  7814. // EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
  7815. // ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
  7816. // death tests are supported; otherwise they just issue a warning. This is
  7817. // useful when you are combining death test assertions with normal test
  7818. // assertions in one test.
  7819. #if GTEST_HAS_DEATH_TEST
  7820. # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
  7821. EXPECT_DEATH(statement, regex)
  7822. # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
  7823. ASSERT_DEATH(statement, regex)
  7824. #else
  7825. # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
  7826. GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
  7827. # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
  7828. GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)
  7829. #endif
  7830. } // namespace testing
  7831. #endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
  7832. // This file was GENERATED by command:
  7833. // pump.py gtest-param-test.h.pump
  7834. // DO NOT EDIT BY HAND!!!
  7835. // Copyright 2008, Google Inc.
  7836. // All rights reserved.
  7837. //
  7838. // Redistribution and use in source and binary forms, with or without
  7839. // modification, are permitted provided that the following conditions are
  7840. // met:
  7841. //
  7842. // * Redistributions of source code must retain the above copyright
  7843. // notice, this list of conditions and the following disclaimer.
  7844. // * Redistributions in binary form must reproduce the above
  7845. // copyright notice, this list of conditions and the following disclaimer
  7846. // in the documentation and/or other materials provided with the
  7847. // distribution.
  7848. // * Neither the name of Google Inc. nor the names of its
  7849. // contributors may be used to endorse or promote products derived from
  7850. // this software without specific prior written permission.
  7851. //
  7852. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  7853. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  7854. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  7855. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7856. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  7857. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  7858. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  7859. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  7860. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  7861. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  7862. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  7863. //
  7864. // Authors: vladl@google.com (Vlad Losev)
  7865. //
  7866. // Macros and functions for implementing parameterized tests
  7867. // in Google C++ Testing Framework (Google Test)
  7868. //
  7869. // This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
  7870. //
  7871. #ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
  7872. #define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
  7873. // Value-parameterized tests allow you to test your code with different
  7874. // parameters without writing multiple copies of the same test.
  7875. //
  7876. // Here is how you use value-parameterized tests:
  7877. #if 0
  7878. // To write value-parameterized tests, first you should define a fixture
  7879. // class. It is usually derived from testing::TestWithParam<T> (see below for
  7880. // another inheritance scheme that's sometimes useful in more complicated
  7881. // class hierarchies), where the type of your parameter values.
  7882. // TestWithParam<T> is itself derived from testing::Test. T can be any
  7883. // copyable type. If it's a raw pointer, you are responsible for managing the
  7884. // lifespan of the pointed values.
  7885. class FooTest : public ::testing::TestWithParam<const char*> {
  7886. // You can implement all the usual class fixture members here.
  7887. };
  7888. // Then, use the TEST_P macro to define as many parameterized tests
  7889. // for this fixture as you want. The _P suffix is for "parameterized"
  7890. // or "pattern", whichever you prefer to think.
  7891. TEST_P(FooTest, DoesBlah) {
  7892. // Inside a test, access the test parameter with the GetParam() method
  7893. // of the TestWithParam<T> class:
  7894. EXPECT_TRUE(foo.Blah(GetParam()));
  7895. ...
  7896. }
  7897. TEST_P(FooTest, HasBlahBlah) {
  7898. ...
  7899. }
  7900. // Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
  7901. // case with any set of parameters you want. Google Test defines a number
  7902. // of functions for generating test parameters. They return what we call
  7903. // (surprise!) parameter generators. Here is a summary of them, which
  7904. // are all in the testing namespace:
  7905. //
  7906. //
  7907. // Range(begin, end [, step]) - Yields values {begin, begin+step,
  7908. // begin+step+step, ...}. The values do not
  7909. // include end. step defaults to 1.
  7910. // Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}.
  7911. // ValuesIn(container) - Yields values from a C-style array, an STL
  7912. // ValuesIn(begin,end) container, or an iterator range [begin, end).
  7913. // Bool() - Yields sequence {false, true}.
  7914. // Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product
  7915. // for the math savvy) of the values generated
  7916. // by the N generators.
  7917. //
  7918. // For more details, see comments at the definitions of these functions below
  7919. // in this file.
  7920. //
  7921. // The following statement will instantiate tests from the FooTest test case
  7922. // each with parameter values "meeny", "miny", and "moe".
  7923. INSTANTIATE_TEST_CASE_P(InstantiationName,
  7924. FooTest,
  7925. Values("meeny", "miny", "moe"));
  7926. // To distinguish different instances of the pattern, (yes, you
  7927. // can instantiate it more then once) the first argument to the
  7928. // INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
  7929. // actual test case name. Remember to pick unique prefixes for different
  7930. // instantiations. The tests from the instantiation above will have
  7931. // these names:
  7932. //
  7933. // * InstantiationName/FooTest.DoesBlah/0 for "meeny"
  7934. // * InstantiationName/FooTest.DoesBlah/1 for "miny"
  7935. // * InstantiationName/FooTest.DoesBlah/2 for "moe"
  7936. // * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
  7937. // * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
  7938. // * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
  7939. //
  7940. // You can use these names in --gtest_filter.
  7941. //
  7942. // This statement will instantiate all tests from FooTest again, each
  7943. // with parameter values "cat" and "dog":
  7944. const char* pets[] = {"cat", "dog"};
  7945. INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
  7946. // The tests from the instantiation above will have these names:
  7947. //
  7948. // * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
  7949. // * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
  7950. // * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
  7951. // * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
  7952. //
  7953. // Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
  7954. // in the given test case, whether their definitions come before or
  7955. // AFTER the INSTANTIATE_TEST_CASE_P statement.
  7956. //
  7957. // Please also note that generator expressions (including parameters to the
  7958. // generators) are evaluated in InitGoogleTest(), after main() has started.
  7959. // This allows the user on one hand, to adjust generator parameters in order
  7960. // to dynamically determine a set of tests to run and on the other hand,
  7961. // give the user a chance to inspect the generated tests with Google Test
  7962. // reflection API before RUN_ALL_TESTS() is executed.
  7963. //
  7964. // You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
  7965. // for more examples.
  7966. //
  7967. // In the future, we plan to publish the API for defining new parameter
  7968. // generators. But for now this interface remains part of the internal
  7969. // implementation and is subject to change.
  7970. //
  7971. //
  7972. // A parameterized test fixture must be derived from testing::Test and from
  7973. // testing::WithParamInterface<T>, where T is the type of the parameter
  7974. // values. Inheriting from TestWithParam<T> satisfies that requirement because
  7975. // TestWithParam<T> inherits from both Test and WithParamInterface. In more
  7976. // complicated hierarchies, however, it is occasionally useful to inherit
  7977. // separately from Test and WithParamInterface. For example:
  7978. class BaseTest : public ::testing::Test {
  7979. // You can inherit all the usual members for a non-parameterized test
  7980. // fixture here.
  7981. };
  7982. class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
  7983. // The usual test fixture members go here too.
  7984. };
  7985. TEST_F(BaseTest, HasFoo) {
  7986. // This is an ordinary non-parameterized test.
  7987. }
  7988. TEST_P(DerivedTest, DoesBlah) {
  7989. // GetParam works just the same here as if you inherit from TestWithParam.
  7990. EXPECT_TRUE(foo.Blah(GetParam()));
  7991. }
  7992. #endif // 0
  7993. #if !GTEST_OS_SYMBIAN
  7994. # include <utility>
  7995. #endif
  7996. // scripts/fuse_gtest.py depends on gtest's own header being #included
  7997. // *unconditionally*. Therefore these #includes cannot be moved
  7998. // inside #if GTEST_HAS_PARAM_TEST.
  7999. // Copyright 2008 Google Inc.
  8000. // All Rights Reserved.
  8001. //
  8002. // Redistribution and use in source and binary forms, with or without
  8003. // modification, are permitted provided that the following conditions are
  8004. // met:
  8005. //
  8006. // * Redistributions of source code must retain the above copyright
  8007. // notice, this list of conditions and the following disclaimer.
  8008. // * Redistributions in binary form must reproduce the above
  8009. // copyright notice, this list of conditions and the following disclaimer
  8010. // in the documentation and/or other materials provided with the
  8011. // distribution.
  8012. // * Neither the name of Google Inc. nor the names of its
  8013. // contributors may be used to endorse or promote products derived from
  8014. // this software without specific prior written permission.
  8015. //
  8016. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8017. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  8018. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8019. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  8020. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8021. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  8022. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  8023. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  8024. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  8025. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  8026. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8027. //
  8028. // Author: vladl@google.com (Vlad Losev)
  8029. // Type and function utilities for implementing parameterized tests.
  8030. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
  8031. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
  8032. #include <iterator>
  8033. #include <utility>
  8034. #include <vector>
  8035. // scripts/fuse_gtest.py depends on gtest's own header being #included
  8036. // *unconditionally*. Therefore these #includes cannot be moved
  8037. // inside #if GTEST_HAS_PARAM_TEST.
  8038. // Copyright 2003 Google Inc.
  8039. // All rights reserved.
  8040. //
  8041. // Redistribution and use in source and binary forms, with or without
  8042. // modification, are permitted provided that the following conditions are
  8043. // met:
  8044. //
  8045. // * Redistributions of source code must retain the above copyright
  8046. // notice, this list of conditions and the following disclaimer.
  8047. // * Redistributions in binary form must reproduce the above
  8048. // copyright notice, this list of conditions and the following disclaimer
  8049. // in the documentation and/or other materials provided with the
  8050. // distribution.
  8051. // * Neither the name of Google Inc. nor the names of its
  8052. // contributors may be used to endorse or promote products derived from
  8053. // this software without specific prior written permission.
  8054. //
  8055. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8056. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  8057. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8058. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  8059. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8060. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  8061. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  8062. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  8063. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  8064. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  8065. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8066. //
  8067. // Authors: Dan Egnor (egnor@google.com)
  8068. //
  8069. // A "smart" pointer type with reference tracking. Every pointer to a
  8070. // particular object is kept on a circular linked list. When the last pointer
  8071. // to an object is destroyed or reassigned, the object is deleted.
  8072. //
  8073. // Used properly, this deletes the object when the last reference goes away.
  8074. // There are several caveats:
  8075. // - Like all reference counting schemes, cycles lead to leaks.
  8076. // - Each smart pointer is actually two pointers (8 bytes instead of 4).
  8077. // - Every time a pointer is assigned, the entire list of pointers to that
  8078. // object is traversed. This class is therefore NOT SUITABLE when there
  8079. // will often be more than two or three pointers to a particular object.
  8080. // - References are only tracked as long as linked_ptr<> objects are copied.
  8081. // If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
  8082. // will happen (double deletion).
  8083. //
  8084. // A good use of this class is storing object references in STL containers.
  8085. // You can safely put linked_ptr<> in a vector<>.
  8086. // Other uses may not be as good.
  8087. //
  8088. // Note: If you use an incomplete type with linked_ptr<>, the class
  8089. // *containing* linked_ptr<> must have a constructor and destructor (even
  8090. // if they do nothing!).
  8091. //
  8092. // Bill Gibbons suggested we use something like this.
  8093. //
  8094. // Thread Safety:
  8095. // Unlike other linked_ptr implementations, in this implementation
  8096. // a linked_ptr object is thread-safe in the sense that:
  8097. // - it's safe to copy linked_ptr objects concurrently,
  8098. // - it's safe to copy *from* a linked_ptr and read its underlying
  8099. // raw pointer (e.g. via get()) concurrently, and
  8100. // - it's safe to write to two linked_ptrs that point to the same
  8101. // shared object concurrently.
  8102. // TODO(wan@google.com): rename this to safe_linked_ptr to avoid
  8103. // confusion with normal linked_ptr.
  8104. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
  8105. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
  8106. #include <stdlib.h>
  8107. #include <assert.h>
  8108. namespace testing {
  8109. namespace internal {
  8110. // Protects copying of all linked_ptr objects.
  8111. GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
  8112. // This is used internally by all instances of linked_ptr<>. It needs to be
  8113. // a non-template class because different types of linked_ptr<> can refer to
  8114. // the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
  8115. // So, it needs to be possible for different types of linked_ptr to participate
  8116. // in the same circular linked list, so we need a single class type here.
  8117. //
  8118. // DO NOT USE THIS CLASS DIRECTLY YOURSELF. Use linked_ptr<T>.
  8119. class linked_ptr_internal {
  8120. public:
  8121. // Create a new circle that includes only this instance.
  8122. void join_new() {
  8123. next_ = this;
  8124. }
  8125. // Many linked_ptr operations may change p.link_ for some linked_ptr
  8126. // variable p in the same circle as this object. Therefore we need
  8127. // to prevent two such operations from occurring concurrently.
  8128. //
  8129. // Note that different types of linked_ptr objects can coexist in a
  8130. // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
  8131. // linked_ptr<Derived2>). Therefore we must use a single mutex to
  8132. // protect all linked_ptr objects. This can create serious
  8133. // contention in production code, but is acceptable in a testing
  8134. // framework.
  8135. // Join an existing circle.
  8136. void join(linked_ptr_internal const* ptr)
  8137. GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
  8138. MutexLock lock(&g_linked_ptr_mutex);
  8139. linked_ptr_internal const* p = ptr;
  8140. while (p->next_ != ptr) p = p->next_;
  8141. p->next_ = this;
  8142. next_ = ptr;
  8143. }
  8144. // Leave whatever circle we're part of. Returns true if we were the
  8145. // last member of the circle. Once this is done, you can join() another.
  8146. bool depart()
  8147. GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
  8148. MutexLock lock(&g_linked_ptr_mutex);
  8149. if (next_ == this) return true;
  8150. linked_ptr_internal const* p = next_;
  8151. while (p->next_ != this) p = p->next_;
  8152. p->next_ = next_;
  8153. return false;
  8154. }
  8155. private:
  8156. mutable linked_ptr_internal const* next_;
  8157. };
  8158. template <typename T>
  8159. class linked_ptr {
  8160. public:
  8161. typedef T element_type;
  8162. // Take over ownership of a raw pointer. This should happen as soon as
  8163. // possible after the object is created.
  8164. explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
  8165. ~linked_ptr() { depart(); }
  8166. // Copy an existing linked_ptr<>, adding ourselves to the list of references.
  8167. template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
  8168. linked_ptr(linked_ptr const& ptr) { // NOLINT
  8169. assert(&ptr != this);
  8170. copy(&ptr);
  8171. }
  8172. // Assignment releases the old value and acquires the new.
  8173. template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
  8174. depart();
  8175. copy(&ptr);
  8176. return *this;
  8177. }
  8178. linked_ptr& operator=(linked_ptr const& ptr) {
  8179. if (&ptr != this) {
  8180. depart();
  8181. copy(&ptr);
  8182. }
  8183. return *this;
  8184. }
  8185. // Smart pointer members.
  8186. void reset(T* ptr = NULL) {
  8187. depart();
  8188. capture(ptr);
  8189. }
  8190. T* get() const { return value_; }
  8191. T* operator->() const { return value_; }
  8192. T& operator*() const { return *value_; }
  8193. bool operator==(T* p) const { return value_ == p; }
  8194. bool operator!=(T* p) const { return value_ != p; }
  8195. template <typename U>
  8196. bool operator==(linked_ptr<U> const& ptr) const {
  8197. return value_ == ptr.get();
  8198. }
  8199. template <typename U>
  8200. bool operator!=(linked_ptr<U> const& ptr) const {
  8201. return value_ != ptr.get();
  8202. }
  8203. private:
  8204. template <typename U>
  8205. friend class linked_ptr;
  8206. T* value_;
  8207. linked_ptr_internal link_;
  8208. void depart() {
  8209. if (link_.depart()) delete value_;
  8210. }
  8211. void capture(T* ptr) {
  8212. value_ = ptr;
  8213. link_.join_new();
  8214. }
  8215. template <typename U> void copy(linked_ptr<U> const* ptr) {
  8216. value_ = ptr->get();
  8217. if (value_)
  8218. link_.join(&ptr->link_);
  8219. else
  8220. link_.join_new();
  8221. }
  8222. };
  8223. template<typename T> inline
  8224. bool operator==(T* ptr, const linked_ptr<T>& x) {
  8225. return ptr == x.get();
  8226. }
  8227. template<typename T> inline
  8228. bool operator!=(T* ptr, const linked_ptr<T>& x) {
  8229. return ptr != x.get();
  8230. }
  8231. // A function to convert T* into linked_ptr<T>
  8232. // Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
  8233. // for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
  8234. template <typename T>
  8235. linked_ptr<T> make_linked_ptr(T* ptr) {
  8236. return linked_ptr<T>(ptr);
  8237. }
  8238. } // namespace internal
  8239. } // namespace testing
  8240. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
  8241. // Copyright 2007, Google Inc.
  8242. // All rights reserved.
  8243. //
  8244. // Redistribution and use in source and binary forms, with or without
  8245. // modification, are permitted provided that the following conditions are
  8246. // met:
  8247. //
  8248. // * Redistributions of source code must retain the above copyright
  8249. // notice, this list of conditions and the following disclaimer.
  8250. // * Redistributions in binary form must reproduce the above
  8251. // copyright notice, this list of conditions and the following disclaimer
  8252. // in the documentation and/or other materials provided with the
  8253. // distribution.
  8254. // * Neither the name of Google Inc. nor the names of its
  8255. // contributors may be used to endorse or promote products derived from
  8256. // this software without specific prior written permission.
  8257. //
  8258. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8259. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  8260. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8261. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  8262. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8263. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  8264. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  8265. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  8266. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  8267. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  8268. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8269. //
  8270. // Author: wan@google.com (Zhanyong Wan)
  8271. // Google Test - The Google C++ Testing Framework
  8272. //
  8273. // This file implements a universal value printer that can print a
  8274. // value of any type T:
  8275. //
  8276. // void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
  8277. //
  8278. // A user can teach this function how to print a class type T by
  8279. // defining either operator<<() or PrintTo() in the namespace that
  8280. // defines T. More specifically, the FIRST defined function in the
  8281. // following list will be used (assuming T is defined in namespace
  8282. // foo):
  8283. //
  8284. // 1. foo::PrintTo(const T&, ostream*)
  8285. // 2. operator<<(ostream&, const T&) defined in either foo or the
  8286. // global namespace.
  8287. //
  8288. // If none of the above is defined, it will print the debug string of
  8289. // the value if it is a protocol buffer, or print the raw bytes in the
  8290. // value otherwise.
  8291. //
  8292. // To aid debugging: when T is a reference type, the address of the
  8293. // value is also printed; when T is a (const) char pointer, both the
  8294. // pointer value and the NUL-terminated string it points to are
  8295. // printed.
  8296. //
  8297. // We also provide some convenient wrappers:
  8298. //
  8299. // // Prints a value to a string. For a (const or not) char
  8300. // // pointer, the NUL-terminated string (but not the pointer) is
  8301. // // printed.
  8302. // std::string ::testing::PrintToString(const T& value);
  8303. //
  8304. // // Prints a value tersely: for a reference type, the referenced
  8305. // // value (but not the address) is printed; for a (const or not) char
  8306. // // pointer, the NUL-terminated string (but not the pointer) is
  8307. // // printed.
  8308. // void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
  8309. //
  8310. // // Prints value using the type inferred by the compiler. The difference
  8311. // // from UniversalTersePrint() is that this function prints both the
  8312. // // pointer and the NUL-terminated string for a (const or not) char pointer.
  8313. // void ::testing::internal::UniversalPrint(const T& value, ostream*);
  8314. //
  8315. // // Prints the fields of a tuple tersely to a string vector, one
  8316. // // element for each field. Tuple support must be enabled in
  8317. // // gtest-port.h.
  8318. // std::vector<string> UniversalTersePrintTupleFieldsToStrings(
  8319. // const Tuple& value);
  8320. //
  8321. // Known limitation:
  8322. //
  8323. // The print primitives print the elements of an STL-style container
  8324. // using the compiler-inferred type of *iter where iter is a
  8325. // const_iterator of the container. When const_iterator is an input
  8326. // iterator but not a forward iterator, this inferred type may not
  8327. // match value_type, and the print output may be incorrect. In
  8328. // practice, this is rarely a problem as for most containers
  8329. // const_iterator is a forward iterator. We'll fix this if there's an
  8330. // actual need for it. Note that this fix cannot rely on value_type
  8331. // being defined as many user-defined container types don't have
  8332. // value_type.
  8333. #ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
  8334. #define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
  8335. #include <ostream> // NOLINT
  8336. #include <sstream>
  8337. #include <string>
  8338. #include <utility>
  8339. #include <vector>
  8340. namespace testing {
  8341. // Definitions in the 'internal' and 'internal2' name spaces are
  8342. // subject to change without notice. DO NOT USE THEM IN USER CODE!
  8343. namespace internal2 {
  8344. // Prints the given number of bytes in the given object to the given
  8345. // ostream.
  8346. GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
  8347. size_t count,
  8348. ::std::ostream* os);
  8349. // For selecting which printer to use when a given type has neither <<
  8350. // nor PrintTo().
  8351. enum TypeKind {
  8352. kProtobuf, // a protobuf type
  8353. kConvertibleToInteger, // a type implicitly convertible to BiggestInt
  8354. // (e.g. a named or unnamed enum type)
  8355. kOtherType // anything else
  8356. };
  8357. // TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
  8358. // by the universal printer to print a value of type T when neither
  8359. // operator<< nor PrintTo() is defined for T, where kTypeKind is the
  8360. // "kind" of T as defined by enum TypeKind.
  8361. template <typename T, TypeKind kTypeKind>
  8362. class TypeWithoutFormatter {
  8363. public:
  8364. // This default version is called when kTypeKind is kOtherType.
  8365. static void PrintValue(const T& value, ::std::ostream* os) {
  8366. PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value),
  8367. sizeof(value), os);
  8368. }
  8369. };
  8370. // We print a protobuf using its ShortDebugString() when the string
  8371. // doesn't exceed this many characters; otherwise we print it using
  8372. // DebugString() for better readability.
  8373. const size_t kProtobufOneLinerMaxLength = 50;
  8374. template <typename T>
  8375. class TypeWithoutFormatter<T, kProtobuf> {
  8376. public:
  8377. static void PrintValue(const T& value, ::std::ostream* os) {
  8378. const ::testing::internal::string short_str = value.ShortDebugString();
  8379. const ::testing::internal::string pretty_str =
  8380. short_str.length() <= kProtobufOneLinerMaxLength ?
  8381. short_str : ("\n" + value.DebugString());
  8382. *os << ("<" + pretty_str + ">");
  8383. }
  8384. };
  8385. template <typename T>
  8386. class TypeWithoutFormatter<T, kConvertibleToInteger> {
  8387. public:
  8388. // Since T has no << operator or PrintTo() but can be implicitly
  8389. // converted to BiggestInt, we print it as a BiggestInt.
  8390. //
  8391. // Most likely T is an enum type (either named or unnamed), in which
  8392. // case printing it as an integer is the desired behavior. In case
  8393. // T is not an enum, printing it as an integer is the best we can do
  8394. // given that it has no user-defined printer.
  8395. static void PrintValue(const T& value, ::std::ostream* os) {
  8396. const internal::BiggestInt kBigInt = value;
  8397. *os << kBigInt;
  8398. }
  8399. };
  8400. // Prints the given value to the given ostream. If the value is a
  8401. // protocol message, its debug string is printed; if it's an enum or
  8402. // of a type implicitly convertible to BiggestInt, it's printed as an
  8403. // integer; otherwise the bytes in the value are printed. This is
  8404. // what UniversalPrinter<T>::Print() does when it knows nothing about
  8405. // type T and T has neither << operator nor PrintTo().
  8406. //
  8407. // A user can override this behavior for a class type Foo by defining
  8408. // a << operator in the namespace where Foo is defined.
  8409. //
  8410. // We put this operator in namespace 'internal2' instead of 'internal'
  8411. // to simplify the implementation, as much code in 'internal' needs to
  8412. // use << in STL, which would conflict with our own << were it defined
  8413. // in 'internal'.
  8414. //
  8415. // Note that this operator<< takes a generic std::basic_ostream<Char,
  8416. // CharTraits> type instead of the more restricted std::ostream. If
  8417. // we define it to take an std::ostream instead, we'll get an
  8418. // "ambiguous overloads" compiler error when trying to print a type
  8419. // Foo that supports streaming to std::basic_ostream<Char,
  8420. // CharTraits>, as the compiler cannot tell whether
  8421. // operator<<(std::ostream&, const T&) or
  8422. // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
  8423. // specific.
  8424. template <typename Char, typename CharTraits, typename T>
  8425. ::std::basic_ostream<Char, CharTraits>& operator<<(
  8426. ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
  8427. TypeWithoutFormatter<T,
  8428. (internal::IsAProtocolMessage<T>::value ? kProtobuf :
  8429. internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ?
  8430. kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
  8431. return os;
  8432. }
  8433. } // namespace internal2
  8434. } // namespace testing
  8435. // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
  8436. // magic needed for implementing UniversalPrinter won't work.
  8437. namespace testing_internal {
  8438. // Used to print a value that is not an STL-style container when the
  8439. // user doesn't define PrintTo() for it.
  8440. template <typename T>
  8441. void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
  8442. // With the following statement, during unqualified name lookup,
  8443. // testing::internal2::operator<< appears as if it was declared in
  8444. // the nearest enclosing namespace that contains both
  8445. // ::testing_internal and ::testing::internal2, i.e. the global
  8446. // namespace. For more details, refer to the C++ Standard section
  8447. // 7.3.4-1 [namespace.udir]. This allows us to fall back onto
  8448. // testing::internal2::operator<< in case T doesn't come with a <<
  8449. // operator.
  8450. //
  8451. // We cannot write 'using ::testing::internal2::operator<<;', which
  8452. // gcc 3.3 fails to compile due to a compiler bug.
  8453. using namespace ::testing::internal2; // NOLINT
  8454. // Assuming T is defined in namespace foo, in the next statement,
  8455. // the compiler will consider all of:
  8456. //
  8457. // 1. foo::operator<< (thanks to Koenig look-up),
  8458. // 2. ::operator<< (as the current namespace is enclosed in ::),
  8459. // 3. testing::internal2::operator<< (thanks to the using statement above).
  8460. //
  8461. // The operator<< whose type matches T best will be picked.
  8462. //
  8463. // We deliberately allow #2 to be a candidate, as sometimes it's
  8464. // impossible to define #1 (e.g. when foo is ::std, defining
  8465. // anything in it is undefined behavior unless you are a compiler
  8466. // vendor.).
  8467. *os << value;
  8468. }
  8469. } // namespace testing_internal
  8470. namespace testing {
  8471. namespace internal {
  8472. // UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
  8473. // value to the given ostream. The caller must ensure that
  8474. // 'ostream_ptr' is not NULL, or the behavior is undefined.
  8475. //
  8476. // We define UniversalPrinter as a class template (as opposed to a
  8477. // function template), as we need to partially specialize it for
  8478. // reference types, which cannot be done with function templates.
  8479. template <typename T>
  8480. class UniversalPrinter;
  8481. template <typename T>
  8482. void UniversalPrint(const T& value, ::std::ostream* os);
  8483. // Used to print an STL-style container when the user doesn't define
  8484. // a PrintTo() for it.
  8485. template <typename C>
  8486. void DefaultPrintTo(IsContainer /* dummy */,
  8487. false_type /* is not a pointer */,
  8488. const C& container, ::std::ostream* os) {
  8489. const size_t kMaxCount = 32; // The maximum number of elements to print.
  8490. *os << '{';
  8491. size_t count = 0;
  8492. for (typename C::const_iterator it = container.begin();
  8493. it != container.end(); ++it, ++count) {
  8494. if (count > 0) {
  8495. *os << ',';
  8496. if (count == kMaxCount) { // Enough has been printed.
  8497. *os << " ...";
  8498. break;
  8499. }
  8500. }
  8501. *os << ' ';
  8502. // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
  8503. // handle *it being a native array.
  8504. internal::UniversalPrint(*it, os);
  8505. }
  8506. if (count > 0) {
  8507. *os << ' ';
  8508. }
  8509. *os << '}';
  8510. }
  8511. // Used to print a pointer that is neither a char pointer nor a member
  8512. // pointer, when the user doesn't define PrintTo() for it. (A member
  8513. // variable pointer or member function pointer doesn't really point to
  8514. // a location in the address space. Their representation is
  8515. // implementation-defined. Therefore they will be printed as raw
  8516. // bytes.)
  8517. template <typename T>
  8518. void DefaultPrintTo(IsNotContainer /* dummy */,
  8519. true_type /* is a pointer */,
  8520. T* p, ::std::ostream* os) {
  8521. if (p == NULL) {
  8522. *os << "NULL";
  8523. } else {
  8524. // C++ doesn't allow casting from a function pointer to any object
  8525. // pointer.
  8526. //
  8527. // IsTrue() silences warnings: "Condition is always true",
  8528. // "unreachable code".
  8529. if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {
  8530. // T is not a function type. We just call << to print p,
  8531. // relying on ADL to pick up user-defined << for their pointer
  8532. // types, if any.
  8533. *os << p;
  8534. } else {
  8535. // T is a function type, so '*os << p' doesn't do what we want
  8536. // (it just prints p as bool). We want to print p as a const
  8537. // void*. However, we cannot cast it to const void* directly,
  8538. // even using reinterpret_cast, as earlier versions of gcc
  8539. // (e.g. 3.4.5) cannot compile the cast when p is a function
  8540. // pointer. Casting to UInt64 first solves the problem.
  8541. *os << reinterpret_cast<const void*>(
  8542. /*reinterpret_cast<internal::UInt64>*/(p));
  8543. }
  8544. }
  8545. }
  8546. // Used to print a non-container, non-pointer value when the user
  8547. // doesn't define PrintTo() for it.
  8548. template <typename T>
  8549. void DefaultPrintTo(IsNotContainer /* dummy */,
  8550. false_type /* is not a pointer */,
  8551. const T& value, ::std::ostream* os) {
  8552. ::testing_internal::DefaultPrintNonContainerTo(value, os);
  8553. }
  8554. // Prints the given value using the << operator if it has one;
  8555. // otherwise prints the bytes in it. This is what
  8556. // UniversalPrinter<T>::Print() does when PrintTo() is not specialized
  8557. // or overloaded for type T.
  8558. //
  8559. // A user can override this behavior for a class type Foo by defining
  8560. // an overload of PrintTo() in the namespace where Foo is defined. We
  8561. // give the user this option as sometimes defining a << operator for
  8562. // Foo is not desirable (e.g. the coding style may prevent doing it,
  8563. // or there is already a << operator but it doesn't do what the user
  8564. // wants).
  8565. template <typename T>
  8566. void PrintTo(const T& value, ::std::ostream* os) {
  8567. // DefaultPrintTo() is overloaded. The type of its first two
  8568. // arguments determine which version will be picked. If T is an
  8569. // STL-style container, the version for container will be called; if
  8570. // T is a pointer, the pointer version will be called; otherwise the
  8571. // generic version will be called.
  8572. //
  8573. // Note that we check for container types here, prior to we check
  8574. // for protocol message types in our operator<<. The rationale is:
  8575. //
  8576. // For protocol messages, we want to give people a chance to
  8577. // override Google Mock's format by defining a PrintTo() or
  8578. // operator<<. For STL containers, other formats can be
  8579. // incompatible with Google Mock's format for the container
  8580. // elements; therefore we check for container types here to ensure
  8581. // that our format is used.
  8582. //
  8583. // The second argument of DefaultPrintTo() is needed to bypass a bug
  8584. // in Symbian's C++ compiler that prevents it from picking the right
  8585. // overload between:
  8586. //
  8587. // PrintTo(const T& x, ...);
  8588. // PrintTo(T* x, ...);
  8589. DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);
  8590. }
  8591. // The following list of PrintTo() overloads tells
  8592. // UniversalPrinter<T>::Print() how to print standard types (built-in
  8593. // types, strings, plain arrays, and pointers).
  8594. // Overloads for various char types.
  8595. GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
  8596. GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
  8597. inline void PrintTo(char c, ::std::ostream* os) {
  8598. // When printing a plain char, we always treat it as unsigned. This
  8599. // way, the output won't be affected by whether the compiler thinks
  8600. // char is signed or not.
  8601. PrintTo(static_cast<unsigned char>(c), os);
  8602. }
  8603. // Overloads for other simple built-in types.
  8604. inline void PrintTo(bool x, ::std::ostream* os) {
  8605. *os << (x ? "true" : "false");
  8606. }
  8607. // Overload for wchar_t type.
  8608. // Prints a wchar_t as a symbol if it is printable or as its internal
  8609. // code otherwise and also as its decimal code (except for L'\0').
  8610. // The L'\0' char is printed as "L'\\0'". The decimal code is printed
  8611. // as signed integer when wchar_t is implemented by the compiler
  8612. // as a signed type and is printed as an unsigned integer when wchar_t
  8613. // is implemented as an unsigned type.
  8614. GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
  8615. // Overloads for C strings.
  8616. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
  8617. inline void PrintTo(char* s, ::std::ostream* os) {
  8618. PrintTo(ImplicitCast_<const char*>(s), os);
  8619. }
  8620. // signed/unsigned char is often used for representing binary data, so
  8621. // we print pointers to it as void* to be safe.
  8622. inline void PrintTo(const signed char* s, ::std::ostream* os) {
  8623. PrintTo(ImplicitCast_<const void*>(s), os);
  8624. }
  8625. inline void PrintTo(signed char* s, ::std::ostream* os) {
  8626. PrintTo(ImplicitCast_<const void*>(s), os);
  8627. }
  8628. inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
  8629. PrintTo(ImplicitCast_<const void*>(s), os);
  8630. }
  8631. inline void PrintTo(unsigned char* s, ::std::ostream* os) {
  8632. PrintTo(ImplicitCast_<const void*>(s), os);
  8633. }
  8634. // MSVC can be configured to define wchar_t as a typedef of unsigned
  8635. // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
  8636. // type. When wchar_t is a typedef, defining an overload for const
  8637. // wchar_t* would cause unsigned short* be printed as a wide string,
  8638. // possibly causing invalid memory accesses.
  8639. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
  8640. // Overloads for wide C strings
  8641. GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
  8642. inline void PrintTo(wchar_t* s, ::std::ostream* os) {
  8643. PrintTo(ImplicitCast_<const wchar_t*>(s), os);
  8644. }
  8645. #endif
  8646. // Overload for C arrays. Multi-dimensional arrays are printed
  8647. // properly.
  8648. // Prints the given number of elements in an array, without printing
  8649. // the curly braces.
  8650. template <typename T>
  8651. void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
  8652. UniversalPrint(a[0], os);
  8653. for (size_t i = 1; i != count; i++) {
  8654. *os << ", ";
  8655. UniversalPrint(a[i], os);
  8656. }
  8657. }
  8658. // Overloads for ::string and ::std::string.
  8659. #if GTEST_HAS_GLOBAL_STRING
  8660. GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
  8661. inline void PrintTo(const ::string& s, ::std::ostream* os) {
  8662. PrintStringTo(s, os);
  8663. }
  8664. #endif // GTEST_HAS_GLOBAL_STRING
  8665. GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
  8666. inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
  8667. PrintStringTo(s, os);
  8668. }
  8669. // Overloads for ::wstring and ::std::wstring.
  8670. #if GTEST_HAS_GLOBAL_WSTRING
  8671. GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
  8672. inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
  8673. PrintWideStringTo(s, os);
  8674. }
  8675. #endif // GTEST_HAS_GLOBAL_WSTRING
  8676. #if GTEST_HAS_STD_WSTRING
  8677. GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
  8678. inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
  8679. PrintWideStringTo(s, os);
  8680. }
  8681. #endif // GTEST_HAS_STD_WSTRING
  8682. #if GTEST_HAS_TR1_TUPLE
  8683. // Overload for ::std::tr1::tuple. Needed for printing function arguments,
  8684. // which are packed as tuples.
  8685. // Helper function for printing a tuple. T must be instantiated with
  8686. // a tuple type.
  8687. template <typename T>
  8688. void PrintTupleTo(const T& t, ::std::ostream* os);
  8689. // Overloaded PrintTo() for tuples of various arities. We support
  8690. // tuples of up-to 10 fields. The following implementation works
  8691. // regardless of whether tr1::tuple is implemented using the
  8692. // non-standard variadic template feature or not.
  8693. inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
  8694. PrintTupleTo(t, os);
  8695. }
  8696. template <typename T1>
  8697. void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
  8698. PrintTupleTo(t, os);
  8699. }
  8700. template <typename T1, typename T2>
  8701. void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
  8702. PrintTupleTo(t, os);
  8703. }
  8704. template <typename T1, typename T2, typename T3>
  8705. void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
  8706. PrintTupleTo(t, os);
  8707. }
  8708. template <typename T1, typename T2, typename T3, typename T4>
  8709. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
  8710. PrintTupleTo(t, os);
  8711. }
  8712. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  8713. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
  8714. ::std::ostream* os) {
  8715. PrintTupleTo(t, os);
  8716. }
  8717. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  8718. typename T6>
  8719. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
  8720. ::std::ostream* os) {
  8721. PrintTupleTo(t, os);
  8722. }
  8723. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  8724. typename T6, typename T7>
  8725. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
  8726. ::std::ostream* os) {
  8727. PrintTupleTo(t, os);
  8728. }
  8729. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  8730. typename T6, typename T7, typename T8>
  8731. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
  8732. ::std::ostream* os) {
  8733. PrintTupleTo(t, os);
  8734. }
  8735. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  8736. typename T6, typename T7, typename T8, typename T9>
  8737. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
  8738. ::std::ostream* os) {
  8739. PrintTupleTo(t, os);
  8740. }
  8741. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  8742. typename T6, typename T7, typename T8, typename T9, typename T10>
  8743. void PrintTo(
  8744. const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
  8745. ::std::ostream* os) {
  8746. PrintTupleTo(t, os);
  8747. }
  8748. #endif // GTEST_HAS_TR1_TUPLE
  8749. // Overload for std::pair.
  8750. template <typename T1, typename T2>
  8751. void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
  8752. *os << '(';
  8753. // We cannot use UniversalPrint(value.first, os) here, as T1 may be
  8754. // a reference type. The same for printing value.second.
  8755. UniversalPrinter<T1>::Print(value.first, os);
  8756. *os << ", ";
  8757. UniversalPrinter<T2>::Print(value.second, os);
  8758. *os << ')';
  8759. }
  8760. // Implements printing a non-reference type T by letting the compiler
  8761. // pick the right overload of PrintTo() for T.
  8762. template <typename T>
  8763. class UniversalPrinter {
  8764. public:
  8765. // MSVC warns about adding const to a function type, so we want to
  8766. // disable the warning.
  8767. #ifdef _MSC_VER
  8768. # pragma warning(push) // Saves the current warning state.
  8769. # pragma warning(disable:4180) // Temporarily disables warning 4180.
  8770. #endif // _MSC_VER
  8771. // Note: we deliberately don't call this PrintTo(), as that name
  8772. // conflicts with ::testing::internal::PrintTo in the body of the
  8773. // function.
  8774. static void Print(const T& value, ::std::ostream* os) {
  8775. // By default, ::testing::internal::PrintTo() is used for printing
  8776. // the value.
  8777. //
  8778. // Thanks to Koenig look-up, if T is a class and has its own
  8779. // PrintTo() function defined in its namespace, that function will
  8780. // be visible here. Since it is more specific than the generic ones
  8781. // in ::testing::internal, it will be picked by the compiler in the
  8782. // following statement - exactly what we want.
  8783. PrintTo(value, os);
  8784. }
  8785. #ifdef _MSC_VER
  8786. # pragma warning(pop) // Restores the warning state.
  8787. #endif // _MSC_VER
  8788. };
  8789. // UniversalPrintArray(begin, len, os) prints an array of 'len'
  8790. // elements, starting at address 'begin'.
  8791. template <typename T>
  8792. void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
  8793. if (len == 0) {
  8794. *os << "{}";
  8795. } else {
  8796. *os << "{ ";
  8797. const size_t kThreshold = 18;
  8798. const size_t kChunkSize = 8;
  8799. // If the array has more than kThreshold elements, we'll have to
  8800. // omit some details by printing only the first and the last
  8801. // kChunkSize elements.
  8802. // TODO(wan@google.com): let the user control the threshold using a flag.
  8803. if (len <= kThreshold) {
  8804. PrintRawArrayTo(begin, len, os);
  8805. } else {
  8806. PrintRawArrayTo(begin, kChunkSize, os);
  8807. *os << ", ..., ";
  8808. PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
  8809. }
  8810. *os << " }";
  8811. }
  8812. }
  8813. // This overload prints a (const) char array compactly.
  8814. GTEST_API_ void UniversalPrintArray(
  8815. const char* begin, size_t len, ::std::ostream* os);
  8816. // This overload prints a (const) wchar_t array compactly.
  8817. GTEST_API_ void UniversalPrintArray(
  8818. const wchar_t* begin, size_t len, ::std::ostream* os);
  8819. // Implements printing an array type T[N].
  8820. template <typename T, size_t N>
  8821. class UniversalPrinter<T[N]> {
  8822. public:
  8823. // Prints the given array, omitting some elements when there are too
  8824. // many.
  8825. static void Print(const T (&a)[N], ::std::ostream* os) {
  8826. UniversalPrintArray(a, N, os);
  8827. }
  8828. };
  8829. // Implements printing a reference type T&.
  8830. template <typename T>
  8831. class UniversalPrinter<T&> {
  8832. public:
  8833. // MSVC warns about adding const to a function type, so we want to
  8834. // disable the warning.
  8835. #ifdef _MSC_VER
  8836. # pragma warning(push) // Saves the current warning state.
  8837. # pragma warning(disable:4180) // Temporarily disables warning 4180.
  8838. #endif // _MSC_VER
  8839. static void Print(const T& value, ::std::ostream* os) {
  8840. // Prints the address of the value. We use reinterpret_cast here
  8841. // as static_cast doesn't compile when T is a function type.
  8842. *os << "@" << reinterpret_cast<const void*>(&value) << " ";
  8843. // Then prints the value itself.
  8844. UniversalPrint(value, os);
  8845. }
  8846. #ifdef _MSC_VER
  8847. # pragma warning(pop) // Restores the warning state.
  8848. #endif // _MSC_VER
  8849. };
  8850. // Prints a value tersely: for a reference type, the referenced value
  8851. // (but not the address) is printed; for a (const) char pointer, the
  8852. // NUL-terminated string (but not the pointer) is printed.
  8853. template <typename T>
  8854. class UniversalTersePrinter {
  8855. public:
  8856. static void Print(const T& value, ::std::ostream* os) {
  8857. UniversalPrint(value, os);
  8858. }
  8859. };
  8860. template <typename T>
  8861. class UniversalTersePrinter<T&> {
  8862. public:
  8863. static void Print(const T& value, ::std::ostream* os) {
  8864. UniversalPrint(value, os);
  8865. }
  8866. };
  8867. template <typename T, size_t N>
  8868. class UniversalTersePrinter<T[N]> {
  8869. public:
  8870. static void Print(const T (&value)[N], ::std::ostream* os) {
  8871. UniversalPrinter<T[N]>::Print(value, os);
  8872. }
  8873. };
  8874. template <>
  8875. class UniversalTersePrinter<const char*> {
  8876. public:
  8877. static void Print(const char* str, ::std::ostream* os) {
  8878. if (str == NULL) {
  8879. *os << "NULL";
  8880. } else {
  8881. UniversalPrint(string(str), os);
  8882. }
  8883. }
  8884. };
  8885. template <>
  8886. class UniversalTersePrinter<char*> {
  8887. public:
  8888. static void Print(char* str, ::std::ostream* os) {
  8889. UniversalTersePrinter<const char*>::Print(str, os);
  8890. }
  8891. };
  8892. #if GTEST_HAS_STD_WSTRING
  8893. template <>
  8894. class UniversalTersePrinter<const wchar_t*> {
  8895. public:
  8896. static void Print(const wchar_t* str, ::std::ostream* os) {
  8897. if (str == NULL) {
  8898. *os << "NULL";
  8899. } else {
  8900. UniversalPrint(::std::wstring(str), os);
  8901. }
  8902. }
  8903. };
  8904. #endif
  8905. template <>
  8906. class UniversalTersePrinter<wchar_t*> {
  8907. public:
  8908. static void Print(wchar_t* str, ::std::ostream* os) {
  8909. UniversalTersePrinter<const wchar_t*>::Print(str, os);
  8910. }
  8911. };
  8912. template <typename T>
  8913. void UniversalTersePrint(const T& value, ::std::ostream* os) {
  8914. UniversalTersePrinter<T>::Print(value, os);
  8915. }
  8916. // Prints a value using the type inferred by the compiler. The
  8917. // difference between this and UniversalTersePrint() is that for a
  8918. // (const) char pointer, this prints both the pointer and the
  8919. // NUL-terminated string.
  8920. template <typename T>
  8921. void UniversalPrint(const T& value, ::std::ostream* os) {
  8922. // A workarond for the bug in VC++ 7.1 that prevents us from instantiating
  8923. // UniversalPrinter with T directly.
  8924. typedef T T1;
  8925. UniversalPrinter<T1>::Print(value, os);
  8926. }
  8927. #if GTEST_HAS_TR1_TUPLE
  8928. typedef ::std::vector<string> Strings;
  8929. // This helper template allows PrintTo() for tuples and
  8930. // UniversalTersePrintTupleFieldsToStrings() to be defined by
  8931. // induction on the number of tuple fields. The idea is that
  8932. // TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
  8933. // fields in tuple t, and can be defined in terms of
  8934. // TuplePrefixPrinter<N - 1>.
  8935. // The inductive case.
  8936. template <size_t N>
  8937. struct TuplePrefixPrinter {
  8938. // Prints the first N fields of a tuple.
  8939. template <typename Tuple>
  8940. static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
  8941. TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
  8942. *os << ", ";
  8943. UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>
  8944. ::Print(::std::tr1::get<N - 1>(t), os);
  8945. }
  8946. // Tersely prints the first N fields of a tuple to a string vector,
  8947. // one element for each field.
  8948. template <typename Tuple>
  8949. static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
  8950. TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
  8951. ::std::stringstream ss;
  8952. UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);
  8953. strings->push_back(ss.str());
  8954. }
  8955. };
  8956. // Base cases.
  8957. template <>
  8958. struct TuplePrefixPrinter<0> {
  8959. template <typename Tuple>
  8960. static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
  8961. template <typename Tuple>
  8962. static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
  8963. };
  8964. // We have to specialize the entire TuplePrefixPrinter<> class
  8965. // template here, even though the definition of
  8966. // TersePrintPrefixToStrings() is the same as the generic version, as
  8967. // Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't
  8968. // support specializing a method template of a class template.
  8969. template <>
  8970. struct TuplePrefixPrinter<1> {
  8971. template <typename Tuple>
  8972. static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
  8973. UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::
  8974. Print(::std::tr1::get<0>(t), os);
  8975. }
  8976. template <typename Tuple>
  8977. static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
  8978. ::std::stringstream ss;
  8979. UniversalTersePrint(::std::tr1::get<0>(t), &ss);
  8980. strings->push_back(ss.str());
  8981. }
  8982. };
  8983. // Helper function for printing a tuple. T must be instantiated with
  8984. // a tuple type.
  8985. template <typename T>
  8986. void PrintTupleTo(const T& t, ::std::ostream* os) {
  8987. *os << "(";
  8988. TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::
  8989. PrintPrefixTo(t, os);
  8990. *os << ")";
  8991. }
  8992. // Prints the fields of a tuple tersely to a string vector, one
  8993. // element for each field. See the comment before
  8994. // UniversalTersePrint() for how we define "tersely".
  8995. template <typename Tuple>
  8996. Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
  8997. Strings result;
  8998. TuplePrefixPrinter< ::std::tr1::tuple_size<Tuple>::value>::
  8999. TersePrintPrefixToStrings(value, &result);
  9000. return result;
  9001. }
  9002. #endif // GTEST_HAS_TR1_TUPLE
  9003. } // namespace internal
  9004. template <typename T>
  9005. ::std::string PrintToString(const T& value) {
  9006. ::std::stringstream ss;
  9007. internal::UniversalTersePrinter<T>::Print(value, &ss);
  9008. return ss.str();
  9009. }
  9010. } // namespace testing
  9011. #endif // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
  9012. #if GTEST_HAS_PARAM_TEST
  9013. namespace testing {
  9014. namespace internal {
  9015. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9016. //
  9017. // Outputs a message explaining invalid registration of different
  9018. // fixture class for the same test case. This may happen when
  9019. // TEST_P macro is used to define two tests with the same name
  9020. // but in different namespaces.
  9021. GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
  9022. const char* file, int line);
  9023. template <typename> class ParamGeneratorInterface;
  9024. template <typename> class ParamGenerator;
  9025. // Interface for iterating over elements provided by an implementation
  9026. // of ParamGeneratorInterface<T>.
  9027. template <typename T>
  9028. class ParamIteratorInterface {
  9029. public:
  9030. virtual ~ParamIteratorInterface() {}
  9031. // A pointer to the base generator instance.
  9032. // Used only for the purposes of iterator comparison
  9033. // to make sure that two iterators belong to the same generator.
  9034. virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
  9035. // Advances iterator to point to the next element
  9036. // provided by the generator. The caller is responsible
  9037. // for not calling Advance() on an iterator equal to
  9038. // BaseGenerator()->End().
  9039. virtual void Advance() = 0;
  9040. // Clones the iterator object. Used for implementing copy semantics
  9041. // of ParamIterator<T>.
  9042. virtual ParamIteratorInterface* Clone() const = 0;
  9043. // Dereferences the current iterator and provides (read-only) access
  9044. // to the pointed value. It is the caller's responsibility not to call
  9045. // Current() on an iterator equal to BaseGenerator()->End().
  9046. // Used for implementing ParamGenerator<T>::operator*().
  9047. virtual const T* Current() const = 0;
  9048. // Determines whether the given iterator and other point to the same
  9049. // element in the sequence generated by the generator.
  9050. // Used for implementing ParamGenerator<T>::operator==().
  9051. virtual bool Equals(const ParamIteratorInterface& other) const = 0;
  9052. };
  9053. // Class iterating over elements provided by an implementation of
  9054. // ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
  9055. // and implements the const forward iterator concept.
  9056. template <typename T>
  9057. class ParamIterator {
  9058. public:
  9059. typedef T value_type;
  9060. typedef const T& reference;
  9061. typedef ptrdiff_t difference_type;
  9062. // ParamIterator assumes ownership of the impl_ pointer.
  9063. ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
  9064. ParamIterator& operator=(const ParamIterator& other) {
  9065. if (this != &other)
  9066. impl_.reset(other.impl_->Clone());
  9067. return *this;
  9068. }
  9069. const T& operator*() const { return *impl_->Current(); }
  9070. const T* operator->() const { return impl_->Current(); }
  9071. // Prefix version of operator++.
  9072. ParamIterator& operator++() {
  9073. impl_->Advance();
  9074. return *this;
  9075. }
  9076. // Postfix version of operator++.
  9077. ParamIterator operator++(int /*unused*/) {
  9078. ParamIteratorInterface<T>* clone = impl_->Clone();
  9079. impl_->Advance();
  9080. return ParamIterator(clone);
  9081. }
  9082. bool operator==(const ParamIterator& other) const {
  9083. return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
  9084. }
  9085. bool operator!=(const ParamIterator& other) const {
  9086. return !(*this == other);
  9087. }
  9088. private:
  9089. friend class ParamGenerator<T>;
  9090. explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
  9091. scoped_ptr<ParamIteratorInterface<T> > impl_;
  9092. };
  9093. // ParamGeneratorInterface<T> is the binary interface to access generators
  9094. // defined in other translation units.
  9095. template <typename T>
  9096. class ParamGeneratorInterface {
  9097. public:
  9098. typedef T ParamType;
  9099. virtual ~ParamGeneratorInterface() {}
  9100. // Generator interface definition
  9101. virtual ParamIteratorInterface<T>* Begin() const = 0;
  9102. virtual ParamIteratorInterface<T>* End() const = 0;
  9103. };
  9104. // Wraps ParamGeneratorInterface<T> and provides general generator syntax
  9105. // compatible with the STL Container concept.
  9106. // This class implements copy initialization semantics and the contained
  9107. // ParamGeneratorInterface<T> instance is shared among all copies
  9108. // of the original object. This is possible because that instance is immutable.
  9109. template<typename T>
  9110. class ParamGenerator {
  9111. public:
  9112. typedef ParamIterator<T> iterator;
  9113. explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
  9114. ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
  9115. ParamGenerator& operator=(const ParamGenerator& other) {
  9116. impl_ = other.impl_;
  9117. return *this;
  9118. }
  9119. iterator begin() const { return iterator(impl_->Begin()); }
  9120. iterator end() const { return iterator(impl_->End()); }
  9121. private:
  9122. linked_ptr<const ParamGeneratorInterface<T> > impl_;
  9123. };
  9124. // Generates values from a range of two comparable values. Can be used to
  9125. // generate sequences of user-defined types that implement operator+() and
  9126. // operator<().
  9127. // This class is used in the Range() function.
  9128. template <typename T, typename IncrementT>
  9129. class RangeGenerator : public ParamGeneratorInterface<T> {
  9130. public:
  9131. RangeGenerator(T begin, T end, IncrementT step)
  9132. : begin_(begin), end_(end),
  9133. step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
  9134. virtual ~RangeGenerator() {}
  9135. virtual ParamIteratorInterface<T>* Begin() const {
  9136. return new Iterator(this, begin_, 0, step_);
  9137. }
  9138. virtual ParamIteratorInterface<T>* End() const {
  9139. return new Iterator(this, end_, end_index_, step_);
  9140. }
  9141. private:
  9142. class Iterator : public ParamIteratorInterface<T> {
  9143. public:
  9144. Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
  9145. IncrementT step)
  9146. : base_(base), value_(value), index_(index), step_(step) {}
  9147. virtual ~Iterator() {}
  9148. virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
  9149. return base_;
  9150. }
  9151. virtual void Advance() {
  9152. value_ = value_ + step_;
  9153. index_++;
  9154. }
  9155. virtual ParamIteratorInterface<T>* Clone() const {
  9156. return new Iterator(*this);
  9157. }
  9158. virtual const T* Current() const { return &value_; }
  9159. virtual bool Equals(const ParamIteratorInterface<T>& other) const {
  9160. // Having the same base generator guarantees that the other
  9161. // iterator is of the same type and we can downcast.
  9162. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  9163. << "The program attempted to compare iterators "
  9164. << "from different generators." << std::endl;
  9165. const int other_index =
  9166. CheckedDowncastToActualType<const Iterator>(&other)->index_;
  9167. return index_ == other_index;
  9168. }
  9169. private:
  9170. Iterator(const Iterator& other)
  9171. : ParamIteratorInterface<T>(),
  9172. base_(other.base_), value_(other.value_), index_(other.index_),
  9173. step_(other.step_) {}
  9174. // No implementation - assignment is unsupported.
  9175. void operator=(const Iterator& other);
  9176. const ParamGeneratorInterface<T>* const base_;
  9177. T value_;
  9178. int index_;
  9179. const IncrementT step_;
  9180. }; // class RangeGenerator::Iterator
  9181. static int CalculateEndIndex(const T& begin,
  9182. const T& end,
  9183. const IncrementT& step) {
  9184. int end_index = 0;
  9185. for (T i = begin; i < end; i = i + step)
  9186. end_index++;
  9187. return end_index;
  9188. }
  9189. // No implementation - assignment is unsupported.
  9190. void operator=(const RangeGenerator& other);
  9191. const T begin_;
  9192. const T end_;
  9193. const IncrementT step_;
  9194. // The index for the end() iterator. All the elements in the generated
  9195. // sequence are indexed (0-based) to aid iterator comparison.
  9196. const int end_index_;
  9197. }; // class RangeGenerator
  9198. // Generates values from a pair of STL-style iterators. Used in the
  9199. // ValuesIn() function. The elements are copied from the source range
  9200. // since the source can be located on the stack, and the generator
  9201. // is likely to persist beyond that stack frame.
  9202. template <typename T>
  9203. class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
  9204. public:
  9205. template <typename ForwardIterator>
  9206. ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
  9207. : container_(begin, end) {}
  9208. virtual ~ValuesInIteratorRangeGenerator() {}
  9209. virtual ParamIteratorInterface<T>* Begin() const {
  9210. return new Iterator(this, container_.begin());
  9211. }
  9212. virtual ParamIteratorInterface<T>* End() const {
  9213. return new Iterator(this, container_.end());
  9214. }
  9215. private:
  9216. typedef typename ::std::vector<T> ContainerType;
  9217. class Iterator : public ParamIteratorInterface<T> {
  9218. public:
  9219. Iterator(const ParamGeneratorInterface<T>* base,
  9220. typename ContainerType::const_iterator iterator)
  9221. : base_(base), iterator_(iterator) {}
  9222. virtual ~Iterator() {}
  9223. virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
  9224. return base_;
  9225. }
  9226. virtual void Advance() {
  9227. ++iterator_;
  9228. value_.reset();
  9229. }
  9230. virtual ParamIteratorInterface<T>* Clone() const {
  9231. return new Iterator(*this);
  9232. }
  9233. // We need to use cached value referenced by iterator_ because *iterator_
  9234. // can return a temporary object (and of type other then T), so just
  9235. // having "return &*iterator_;" doesn't work.
  9236. // value_ is updated here and not in Advance() because Advance()
  9237. // can advance iterator_ beyond the end of the range, and we cannot
  9238. // detect that fact. The client code, on the other hand, is
  9239. // responsible for not calling Current() on an out-of-range iterator.
  9240. virtual const T* Current() const {
  9241. if (value_.get() == NULL)
  9242. value_.reset(new T(*iterator_));
  9243. return value_.get();
  9244. }
  9245. virtual bool Equals(const ParamIteratorInterface<T>& other) const {
  9246. // Having the same base generator guarantees that the other
  9247. // iterator is of the same type and we can downcast.
  9248. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  9249. << "The program attempted to compare iterators "
  9250. << "from different generators." << std::endl;
  9251. return iterator_ ==
  9252. CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
  9253. }
  9254. private:
  9255. Iterator(const Iterator& other)
  9256. // The explicit constructor call suppresses a false warning
  9257. // emitted by gcc when supplied with the -Wextra option.
  9258. : ParamIteratorInterface<T>(),
  9259. base_(other.base_),
  9260. iterator_(other.iterator_) {}
  9261. const ParamGeneratorInterface<T>* const base_;
  9262. typename ContainerType::const_iterator iterator_;
  9263. // A cached value of *iterator_. We keep it here to allow access by
  9264. // pointer in the wrapping iterator's operator->().
  9265. // value_ needs to be mutable to be accessed in Current().
  9266. // Use of scoped_ptr helps manage cached value's lifetime,
  9267. // which is bound by the lifespan of the iterator itself.
  9268. mutable scoped_ptr<const T> value_;
  9269. }; // class ValuesInIteratorRangeGenerator::Iterator
  9270. // No implementation - assignment is unsupported.
  9271. void operator=(const ValuesInIteratorRangeGenerator& other);
  9272. const ContainerType container_;
  9273. }; // class ValuesInIteratorRangeGenerator
  9274. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9275. //
  9276. // Stores a parameter value and later creates tests parameterized with that
  9277. // value.
  9278. template <class TestClass>
  9279. class ParameterizedTestFactory : public TestFactoryBase {
  9280. public:
  9281. typedef typename TestClass::ParamType ParamType;
  9282. explicit ParameterizedTestFactory(ParamType parameter) :
  9283. parameter_(parameter) {}
  9284. virtual Test* CreateTest() {
  9285. TestClass::SetParam(&parameter_);
  9286. return new TestClass();
  9287. }
  9288. private:
  9289. const ParamType parameter_;
  9290. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
  9291. };
  9292. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9293. //
  9294. // TestMetaFactoryBase is a base class for meta-factories that create
  9295. // test factories for passing into MakeAndRegisterTestInfo function.
  9296. template <class ParamType>
  9297. class TestMetaFactoryBase {
  9298. public:
  9299. virtual ~TestMetaFactoryBase() {}
  9300. virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
  9301. };
  9302. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9303. //
  9304. // TestMetaFactory creates test factories for passing into
  9305. // MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
  9306. // ownership of test factory pointer, same factory object cannot be passed
  9307. // into that method twice. But ParameterizedTestCaseInfo is going to call
  9308. // it for each Test/Parameter value combination. Thus it needs meta factory
  9309. // creator class.
  9310. template <class TestCase>
  9311. class TestMetaFactory
  9312. : public TestMetaFactoryBase<typename TestCase::ParamType> {
  9313. public:
  9314. typedef typename TestCase::ParamType ParamType;
  9315. TestMetaFactory() {}
  9316. virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
  9317. return new ParameterizedTestFactory<TestCase>(parameter);
  9318. }
  9319. private:
  9320. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
  9321. };
  9322. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9323. //
  9324. // ParameterizedTestCaseInfoBase is a generic interface
  9325. // to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
  9326. // accumulates test information provided by TEST_P macro invocations
  9327. // and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
  9328. // and uses that information to register all resulting test instances
  9329. // in RegisterTests method. The ParameterizeTestCaseRegistry class holds
  9330. // a collection of pointers to the ParameterizedTestCaseInfo objects
  9331. // and calls RegisterTests() on each of them when asked.
  9332. class ParameterizedTestCaseInfoBase {
  9333. public:
  9334. virtual ~ParameterizedTestCaseInfoBase() {}
  9335. // Base part of test case name for display purposes.
  9336. virtual const string& GetTestCaseName() const = 0;
  9337. // Test case id to verify identity.
  9338. virtual TypeId GetTestCaseTypeId() const = 0;
  9339. // UnitTest class invokes this method to register tests in this
  9340. // test case right before running them in RUN_ALL_TESTS macro.
  9341. // This method should not be called more then once on any single
  9342. // instance of a ParameterizedTestCaseInfoBase derived class.
  9343. virtual void RegisterTests() = 0;
  9344. protected:
  9345. ParameterizedTestCaseInfoBase() {}
  9346. private:
  9347. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
  9348. };
  9349. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9350. //
  9351. // ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
  9352. // macro invocations for a particular test case and generators
  9353. // obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
  9354. // test case. It registers tests with all values generated by all
  9355. // generators when asked.
  9356. template <class TestCase>
  9357. class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
  9358. public:
  9359. // ParamType and GeneratorCreationFunc are private types but are required
  9360. // for declarations of public methods AddTestPattern() and
  9361. // AddTestCaseInstantiation().
  9362. typedef typename TestCase::ParamType ParamType;
  9363. // A function that returns an instance of appropriate generator type.
  9364. typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
  9365. explicit ParameterizedTestCaseInfo(const char* name)
  9366. : test_case_name_(name) {}
  9367. // Test case base name for display purposes.
  9368. virtual const string& GetTestCaseName() const { return test_case_name_; }
  9369. // Test case id to verify identity.
  9370. virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
  9371. // TEST_P macro uses AddTestPattern() to record information
  9372. // about a single test in a LocalTestInfo structure.
  9373. // test_case_name is the base name of the test case (without invocation
  9374. // prefix). test_base_name is the name of an individual test without
  9375. // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
  9376. // test case base name and DoBar is test base name.
  9377. void AddTestPattern(const char* test_case_name,
  9378. const char* test_base_name,
  9379. TestMetaFactoryBase<ParamType>* meta_factory) {
  9380. tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
  9381. test_base_name,
  9382. meta_factory)));
  9383. }
  9384. // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
  9385. // about a generator.
  9386. int AddTestCaseInstantiation(const string& instantiation_name,
  9387. GeneratorCreationFunc* func,
  9388. const char* /* file */,
  9389. int /* line */) {
  9390. instantiations_.push_back(::std::make_pair(instantiation_name, func));
  9391. return 0; // Return value used only to run this method in namespace scope.
  9392. }
  9393. // UnitTest class invokes this method to register tests in this test case
  9394. // test cases right before running tests in RUN_ALL_TESTS macro.
  9395. // This method should not be called more then once on any single
  9396. // instance of a ParameterizedTestCaseInfoBase derived class.
  9397. // UnitTest has a guard to prevent from calling this method more then once.
  9398. virtual void RegisterTests() {
  9399. for (typename TestInfoContainer::iterator test_it = tests_.begin();
  9400. test_it != tests_.end(); ++test_it) {
  9401. linked_ptr<TestInfo> test_info = *test_it;
  9402. for (typename InstantiationContainer::iterator gen_it =
  9403. instantiations_.begin(); gen_it != instantiations_.end();
  9404. ++gen_it) {
  9405. const string& instantiation_name = gen_it->first;
  9406. ParamGenerator<ParamType> generator((*gen_it->second)());
  9407. string test_case_name;
  9408. if ( !instantiation_name.empty() )
  9409. test_case_name = instantiation_name + "/";
  9410. test_case_name += test_info->test_case_base_name;
  9411. int i = 0;
  9412. for (typename ParamGenerator<ParamType>::iterator param_it =
  9413. generator.begin();
  9414. param_it != generator.end(); ++param_it, ++i) {
  9415. Message test_name_stream;
  9416. test_name_stream << test_info->test_base_name << "/" << i;
  9417. MakeAndRegisterTestInfo(
  9418. test_case_name.c_str(),
  9419. test_name_stream.GetString().c_str(),
  9420. NULL, // No type parameter.
  9421. PrintToString(*param_it).c_str(),
  9422. GetTestCaseTypeId(),
  9423. TestCase::SetUpTestCase,
  9424. TestCase::TearDownTestCase,
  9425. test_info->test_meta_factory->CreateTestFactory(*param_it));
  9426. } // for param_it
  9427. } // for gen_it
  9428. } // for test_it
  9429. } // RegisterTests
  9430. private:
  9431. // LocalTestInfo structure keeps information about a single test registered
  9432. // with TEST_P macro.
  9433. struct TestInfo {
  9434. TestInfo(const char* a_test_case_base_name,
  9435. const char* a_test_base_name,
  9436. TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
  9437. test_case_base_name(a_test_case_base_name),
  9438. test_base_name(a_test_base_name),
  9439. test_meta_factory(a_test_meta_factory) {}
  9440. const string test_case_base_name;
  9441. const string test_base_name;
  9442. const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
  9443. };
  9444. typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
  9445. // Keeps pairs of <Instantiation name, Sequence generator creation function>
  9446. // received from INSTANTIATE_TEST_CASE_P macros.
  9447. typedef ::std::vector<std::pair<string, GeneratorCreationFunc*> >
  9448. InstantiationContainer;
  9449. const string test_case_name_;
  9450. TestInfoContainer tests_;
  9451. InstantiationContainer instantiations_;
  9452. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
  9453. }; // class ParameterizedTestCaseInfo
  9454. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9455. //
  9456. // ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
  9457. // classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
  9458. // macros use it to locate their corresponding ParameterizedTestCaseInfo
  9459. // descriptors.
  9460. class ParameterizedTestCaseRegistry {
  9461. public:
  9462. ParameterizedTestCaseRegistry() {}
  9463. ~ParameterizedTestCaseRegistry() {
  9464. for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
  9465. it != test_case_infos_.end(); ++it) {
  9466. delete *it;
  9467. }
  9468. }
  9469. // Looks up or creates and returns a structure containing information about
  9470. // tests and instantiations of a particular test case.
  9471. template <class TestCase>
  9472. ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
  9473. const char* test_case_name,
  9474. const char* file,
  9475. int line) {
  9476. ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
  9477. for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
  9478. it != test_case_infos_.end(); ++it) {
  9479. if ((*it)->GetTestCaseName() == test_case_name) {
  9480. if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
  9481. // Complain about incorrect usage of Google Test facilities
  9482. // and terminate the program since we cannot guaranty correct
  9483. // test case setup and tear-down in this case.
  9484. ReportInvalidTestCaseType(test_case_name, file, line);
  9485. posix::Abort();
  9486. } else {
  9487. // At this point we are sure that the object we found is of the same
  9488. // type we are looking for, so we downcast it to that type
  9489. // without further checks.
  9490. typed_test_info = CheckedDowncastToActualType<
  9491. ParameterizedTestCaseInfo<TestCase> >(*it);
  9492. }
  9493. break;
  9494. }
  9495. }
  9496. if (typed_test_info == NULL) {
  9497. typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name);
  9498. test_case_infos_.push_back(typed_test_info);
  9499. }
  9500. return typed_test_info;
  9501. }
  9502. void RegisterTests() {
  9503. for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
  9504. it != test_case_infos_.end(); ++it) {
  9505. (*it)->RegisterTests();
  9506. }
  9507. }
  9508. private:
  9509. typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
  9510. TestCaseInfoContainer test_case_infos_;
  9511. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
  9512. };
  9513. } // namespace internal
  9514. } // namespace testing
  9515. #endif // GTEST_HAS_PARAM_TEST
  9516. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
  9517. // This file was GENERATED by command:
  9518. // pump.py gtest-param-util-generated.h.pump
  9519. // DO NOT EDIT BY HAND!!!
  9520. // Copyright 2008 Google Inc.
  9521. // All Rights Reserved.
  9522. //
  9523. // Redistribution and use in source and binary forms, with or without
  9524. // modification, are permitted provided that the following conditions are
  9525. // met:
  9526. //
  9527. // * Redistributions of source code must retain the above copyright
  9528. // notice, this list of conditions and the following disclaimer.
  9529. // * Redistributions in binary form must reproduce the above
  9530. // copyright notice, this list of conditions and the following disclaimer
  9531. // in the documentation and/or other materials provided with the
  9532. // distribution.
  9533. // * Neither the name of Google Inc. nor the names of its
  9534. // contributors may be used to endorse or promote products derived from
  9535. // this software without specific prior written permission.
  9536. //
  9537. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  9538. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  9539. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  9540. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  9541. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  9542. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  9543. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  9544. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  9545. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  9546. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  9547. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  9548. //
  9549. // Author: vladl@google.com (Vlad Losev)
  9550. // Type and function utilities for implementing parameterized tests.
  9551. // This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
  9552. //
  9553. // Currently Google Test supports at most 50 arguments in Values,
  9554. // and at most 10 arguments in Combine. Please contact
  9555. // googletestframework@googlegroups.com if you need more.
  9556. // Please note that the number of arguments to Combine is limited
  9557. // by the maximum arity of the implementation of tr1::tuple which is
  9558. // currently set at 10.
  9559. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
  9560. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
  9561. // scripts/fuse_gtest.py depends on gtest's own header being #included
  9562. // *unconditionally*. Therefore these #includes cannot be moved
  9563. // inside #if GTEST_HAS_PARAM_TEST.
  9564. #if GTEST_HAS_PARAM_TEST
  9565. namespace testing {
  9566. // Forward declarations of ValuesIn(), which is implemented in
  9567. // include/gtest/gtest-param-test.h.
  9568. template <typename ForwardIterator>
  9569. internal::ParamGenerator<
  9570. typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
  9571. ValuesIn(ForwardIterator begin, ForwardIterator end);
  9572. template <typename T, size_t N>
  9573. internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
  9574. template <class Container>
  9575. internal::ParamGenerator<typename Container::value_type> ValuesIn(
  9576. const Container& container);
  9577. namespace internal {
  9578. // Used in the Values() function to provide polymorphic capabilities.
  9579. template <typename T1>
  9580. class ValueArray1 {
  9581. public:
  9582. explicit ValueArray1(T1 v1) : v1_(v1) {}
  9583. template <typename T>
  9584. operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }
  9585. private:
  9586. // No implementation - assignment is unsupported.
  9587. void operator=(const ValueArray1& other);
  9588. const T1 v1_;
  9589. };
  9590. template <typename T1, typename T2>
  9591. class ValueArray2 {
  9592. public:
  9593. ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
  9594. template <typename T>
  9595. operator ParamGenerator<T>() const {
  9596. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_)};
  9597. return ValuesIn(array);
  9598. }
  9599. private:
  9600. // No implementation - assignment is unsupported.
  9601. void operator=(const ValueArray2& other);
  9602. const T1 v1_;
  9603. const T2 v2_;
  9604. };
  9605. template <typename T1, typename T2, typename T3>
  9606. class ValueArray3 {
  9607. public:
  9608. ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
  9609. template <typename T>
  9610. operator ParamGenerator<T>() const {
  9611. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  9612. static_cast<T>(v3_)};
  9613. return ValuesIn(array);
  9614. }
  9615. private:
  9616. // No implementation - assignment is unsupported.
  9617. void operator=(const ValueArray3& other);
  9618. const T1 v1_;
  9619. const T2 v2_;
  9620. const T3 v3_;
  9621. };
  9622. template <typename T1, typename T2, typename T3, typename T4>
  9623. class ValueArray4 {
  9624. public:
  9625. ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
  9626. v4_(v4) {}
  9627. template <typename T>
  9628. operator ParamGenerator<T>() const {
  9629. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  9630. static_cast<T>(v3_), static_cast<T>(v4_)};
  9631. return ValuesIn(array);
  9632. }
  9633. private:
  9634. // No implementation - assignment is unsupported.
  9635. void operator=(const ValueArray4& other);
  9636. const T1 v1_;
  9637. const T2 v2_;
  9638. const T3 v3_;
  9639. const T4 v4_;
  9640. };
  9641. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  9642. class ValueArray5 {
  9643. public:
  9644. ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
  9645. v4_(v4), v5_(v5) {}
  9646. template <typename T>
  9647. operator ParamGenerator<T>() const {
  9648. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  9649. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_)};
  9650. return ValuesIn(array);
  9651. }
  9652. private:
  9653. // No implementation - assignment is unsupported.
  9654. void operator=(const ValueArray5& other);
  9655. const T1 v1_;
  9656. const T2 v2_;
  9657. const T3 v3_;
  9658. const T4 v4_;
  9659. const T5 v5_;
  9660. };
  9661. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9662. typename T6>
  9663. class ValueArray6 {
  9664. public:
  9665. ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
  9666. v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
  9667. template <typename T>
  9668. operator ParamGenerator<T>() const {
  9669. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  9670. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  9671. static_cast<T>(v6_)};
  9672. return ValuesIn(array);
  9673. }
  9674. private:
  9675. // No implementation - assignment is unsupported.
  9676. void operator=(const ValueArray6& other);
  9677. const T1 v1_;
  9678. const T2 v2_;
  9679. const T3 v3_;
  9680. const T4 v4_;
  9681. const T5 v5_;
  9682. const T6 v6_;
  9683. };
  9684. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9685. typename T6, typename T7>
  9686. class ValueArray7 {
  9687. public:
  9688. ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
  9689. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
  9690. template <typename T>
  9691. operator ParamGenerator<T>() const {
  9692. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  9693. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  9694. static_cast<T>(v6_), static_cast<T>(v7_)};
  9695. return ValuesIn(array);
  9696. }
  9697. private:
  9698. // No implementation - assignment is unsupported.
  9699. void operator=(const ValueArray7& other);
  9700. const T1 v1_;
  9701. const T2 v2_;
  9702. const T3 v3_;
  9703. const T4 v4_;
  9704. const T5 v5_;
  9705. const T6 v6_;
  9706. const T7 v7_;
  9707. };
  9708. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9709. typename T6, typename T7, typename T8>
  9710. class ValueArray8 {
  9711. public:
  9712. ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  9713. T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  9714. v8_(v8) {}
  9715. template <typename T>
  9716. operator ParamGenerator<T>() const {
  9717. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  9718. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  9719. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_)};
  9720. return ValuesIn(array);
  9721. }
  9722. private:
  9723. // No implementation - assignment is unsupported.
  9724. void operator=(const ValueArray8& other);
  9725. const T1 v1_;
  9726. const T2 v2_;
  9727. const T3 v3_;
  9728. const T4 v4_;
  9729. const T5 v5_;
  9730. const T6 v6_;
  9731. const T7 v7_;
  9732. const T8 v8_;
  9733. };
  9734. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9735. typename T6, typename T7, typename T8, typename T9>
  9736. class ValueArray9 {
  9737. public:
  9738. ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  9739. T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  9740. v8_(v8), v9_(v9) {}
  9741. template <typename T>
  9742. operator ParamGenerator<T>() const {
  9743. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  9744. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  9745. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  9746. static_cast<T>(v9_)};
  9747. return ValuesIn(array);
  9748. }
  9749. private:
  9750. // No implementation - assignment is unsupported.
  9751. void operator=(const ValueArray9& other);
  9752. const T1 v1_;
  9753. const T2 v2_;
  9754. const T3 v3_;
  9755. const T4 v4_;
  9756. const T5 v5_;
  9757. const T6 v6_;
  9758. const T7 v7_;
  9759. const T8 v8_;
  9760. const T9 v9_;
  9761. };
  9762. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9763. typename T6, typename T7, typename T8, typename T9, typename T10>
  9764. class ValueArray10 {
  9765. public:
  9766. ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9767. T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  9768. v8_(v8), v9_(v9), v10_(v10) {}
  9769. template <typename T>
  9770. operator ParamGenerator<T>() const {
  9771. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  9772. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  9773. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  9774. static_cast<T>(v9_), static_cast<T>(v10_)};
  9775. return ValuesIn(array);
  9776. }
  9777. private:
  9778. // No implementation - assignment is unsupported.
  9779. void operator=(const ValueArray10& other);
  9780. const T1 v1_;
  9781. const T2 v2_;
  9782. const T3 v3_;
  9783. const T4 v4_;
  9784. const T5 v5_;
  9785. const T6 v6_;
  9786. const T7 v7_;
  9787. const T8 v8_;
  9788. const T9 v9_;
  9789. const T10 v10_;
  9790. };
  9791. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9792. typename T6, typename T7, typename T8, typename T9, typename T10,
  9793. typename T11>
  9794. class ValueArray11 {
  9795. public:
  9796. ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9797. T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  9798. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
  9799. template <typename T>
  9800. operator ParamGenerator<T>() const {
  9801. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  9802. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  9803. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  9804. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_)};
  9805. return ValuesIn(array);
  9806. }
  9807. private:
  9808. // No implementation - assignment is unsupported.
  9809. void operator=(const ValueArray11& other);
  9810. const T1 v1_;
  9811. const T2 v2_;
  9812. const T3 v3_;
  9813. const T4 v4_;
  9814. const T5 v5_;
  9815. const T6 v6_;
  9816. const T7 v7_;
  9817. const T8 v8_;
  9818. const T9 v9_;
  9819. const T10 v10_;
  9820. const T11 v11_;
  9821. };
  9822. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9823. typename T6, typename T7, typename T8, typename T9, typename T10,
  9824. typename T11, typename T12>
  9825. class ValueArray12 {
  9826. public:
  9827. ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9828. T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  9829. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
  9830. template <typename T>
  9831. operator ParamGenerator<T>() const {
  9832. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  9833. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  9834. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  9835. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  9836. static_cast<T>(v12_)};
  9837. return ValuesIn(array);
  9838. }
  9839. private:
  9840. // No implementation - assignment is unsupported.
  9841. void operator=(const ValueArray12& other);
  9842. const T1 v1_;
  9843. const T2 v2_;
  9844. const T3 v3_;
  9845. const T4 v4_;
  9846. const T5 v5_;
  9847. const T6 v6_;
  9848. const T7 v7_;
  9849. const T8 v8_;
  9850. const T9 v9_;
  9851. const T10 v10_;
  9852. const T11 v11_;
  9853. const T12 v12_;
  9854. };
  9855. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9856. typename T6, typename T7, typename T8, typename T9, typename T10,
  9857. typename T11, typename T12, typename T13>
  9858. class ValueArray13 {
  9859. public:
  9860. ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9861. T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  9862. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  9863. v12_(v12), v13_(v13) {}
  9864. template <typename T>
  9865. operator ParamGenerator<T>() const {
  9866. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  9867. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  9868. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  9869. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  9870. static_cast<T>(v12_), static_cast<T>(v13_)};
  9871. return ValuesIn(array);
  9872. }
  9873. private:
  9874. // No implementation - assignment is unsupported.
  9875. void operator=(const ValueArray13& other);
  9876. const T1 v1_;
  9877. const T2 v2_;
  9878. const T3 v3_;
  9879. const T4 v4_;
  9880. const T5 v5_;
  9881. const T6 v6_;
  9882. const T7 v7_;
  9883. const T8 v8_;
  9884. const T9 v9_;
  9885. const T10 v10_;
  9886. const T11 v11_;
  9887. const T12 v12_;
  9888. const T13 v13_;
  9889. };
  9890. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9891. typename T6, typename T7, typename T8, typename T9, typename T10,
  9892. typename T11, typename T12, typename T13, typename T14>
  9893. class ValueArray14 {
  9894. public:
  9895. ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9896. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
  9897. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  9898. v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
  9899. template <typename T>
  9900. operator ParamGenerator<T>() const {
  9901. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  9902. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  9903. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  9904. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  9905. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_)};
  9906. return ValuesIn(array);
  9907. }
  9908. private:
  9909. // No implementation - assignment is unsupported.
  9910. void operator=(const ValueArray14& other);
  9911. const T1 v1_;
  9912. const T2 v2_;
  9913. const T3 v3_;
  9914. const T4 v4_;
  9915. const T5 v5_;
  9916. const T6 v6_;
  9917. const T7 v7_;
  9918. const T8 v8_;
  9919. const T9 v9_;
  9920. const T10 v10_;
  9921. const T11 v11_;
  9922. const T12 v12_;
  9923. const T13 v13_;
  9924. const T14 v14_;
  9925. };
  9926. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9927. typename T6, typename T7, typename T8, typename T9, typename T10,
  9928. typename T11, typename T12, typename T13, typename T14, typename T15>
  9929. class ValueArray15 {
  9930. public:
  9931. ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9932. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
  9933. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  9934. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
  9935. template <typename T>
  9936. operator ParamGenerator<T>() const {
  9937. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  9938. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  9939. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  9940. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  9941. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  9942. static_cast<T>(v15_)};
  9943. return ValuesIn(array);
  9944. }
  9945. private:
  9946. // No implementation - assignment is unsupported.
  9947. void operator=(const ValueArray15& other);
  9948. const T1 v1_;
  9949. const T2 v2_;
  9950. const T3 v3_;
  9951. const T4 v4_;
  9952. const T5 v5_;
  9953. const T6 v6_;
  9954. const T7 v7_;
  9955. const T8 v8_;
  9956. const T9 v9_;
  9957. const T10 v10_;
  9958. const T11 v11_;
  9959. const T12 v12_;
  9960. const T13 v13_;
  9961. const T14 v14_;
  9962. const T15 v15_;
  9963. };
  9964. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9965. typename T6, typename T7, typename T8, typename T9, typename T10,
  9966. typename T11, typename T12, typename T13, typename T14, typename T15,
  9967. typename T16>
  9968. class ValueArray16 {
  9969. public:
  9970. ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9971. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
  9972. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  9973. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  9974. v16_(v16) {}
  9975. template <typename T>
  9976. operator ParamGenerator<T>() const {
  9977. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  9978. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  9979. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  9980. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  9981. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  9982. static_cast<T>(v15_), static_cast<T>(v16_)};
  9983. return ValuesIn(array);
  9984. }
  9985. private:
  9986. // No implementation - assignment is unsupported.
  9987. void operator=(const ValueArray16& other);
  9988. const T1 v1_;
  9989. const T2 v2_;
  9990. const T3 v3_;
  9991. const T4 v4_;
  9992. const T5 v5_;
  9993. const T6 v6_;
  9994. const T7 v7_;
  9995. const T8 v8_;
  9996. const T9 v9_;
  9997. const T10 v10_;
  9998. const T11 v11_;
  9999. const T12 v12_;
  10000. const T13 v13_;
  10001. const T14 v14_;
  10002. const T15 v15_;
  10003. const T16 v16_;
  10004. };
  10005. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10006. typename T6, typename T7, typename T8, typename T9, typename T10,
  10007. typename T11, typename T12, typename T13, typename T14, typename T15,
  10008. typename T16, typename T17>
  10009. class ValueArray17 {
  10010. public:
  10011. ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10012. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
  10013. T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  10014. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  10015. v15_(v15), v16_(v16), v17_(v17) {}
  10016. template <typename T>
  10017. operator ParamGenerator<T>() const {
  10018. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10019. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10020. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10021. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10022. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  10023. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_)};
  10024. return ValuesIn(array);
  10025. }
  10026. private:
  10027. // No implementation - assignment is unsupported.
  10028. void operator=(const ValueArray17& other);
  10029. const T1 v1_;
  10030. const T2 v2_;
  10031. const T3 v3_;
  10032. const T4 v4_;
  10033. const T5 v5_;
  10034. const T6 v6_;
  10035. const T7 v7_;
  10036. const T8 v8_;
  10037. const T9 v9_;
  10038. const T10 v10_;
  10039. const T11 v11_;
  10040. const T12 v12_;
  10041. const T13 v13_;
  10042. const T14 v14_;
  10043. const T15 v15_;
  10044. const T16 v16_;
  10045. const T17 v17_;
  10046. };
  10047. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10048. typename T6, typename T7, typename T8, typename T9, typename T10,
  10049. typename T11, typename T12, typename T13, typename T14, typename T15,
  10050. typename T16, typename T17, typename T18>
  10051. class ValueArray18 {
  10052. public:
  10053. ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10054. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10055. T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  10056. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  10057. v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
  10058. template <typename T>
  10059. operator ParamGenerator<T>() const {
  10060. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10061. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10062. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10063. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10064. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  10065. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  10066. static_cast<T>(v18_)};
  10067. return ValuesIn(array);
  10068. }
  10069. private:
  10070. // No implementation - assignment is unsupported.
  10071. void operator=(const ValueArray18& other);
  10072. const T1 v1_;
  10073. const T2 v2_;
  10074. const T3 v3_;
  10075. const T4 v4_;
  10076. const T5 v5_;
  10077. const T6 v6_;
  10078. const T7 v7_;
  10079. const T8 v8_;
  10080. const T9 v9_;
  10081. const T10 v10_;
  10082. const T11 v11_;
  10083. const T12 v12_;
  10084. const T13 v13_;
  10085. const T14 v14_;
  10086. const T15 v15_;
  10087. const T16 v16_;
  10088. const T17 v17_;
  10089. const T18 v18_;
  10090. };
  10091. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10092. typename T6, typename T7, typename T8, typename T9, typename T10,
  10093. typename T11, typename T12, typename T13, typename T14, typename T15,
  10094. typename T16, typename T17, typename T18, typename T19>
  10095. class ValueArray19 {
  10096. public:
  10097. ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10098. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10099. T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  10100. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  10101. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
  10102. template <typename T>
  10103. operator ParamGenerator<T>() const {
  10104. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10105. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10106. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10107. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10108. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  10109. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  10110. static_cast<T>(v18_), static_cast<T>(v19_)};
  10111. return ValuesIn(array);
  10112. }
  10113. private:
  10114. // No implementation - assignment is unsupported.
  10115. void operator=(const ValueArray19& other);
  10116. const T1 v1_;
  10117. const T2 v2_;
  10118. const T3 v3_;
  10119. const T4 v4_;
  10120. const T5 v5_;
  10121. const T6 v6_;
  10122. const T7 v7_;
  10123. const T8 v8_;
  10124. const T9 v9_;
  10125. const T10 v10_;
  10126. const T11 v11_;
  10127. const T12 v12_;
  10128. const T13 v13_;
  10129. const T14 v14_;
  10130. const T15 v15_;
  10131. const T16 v16_;
  10132. const T17 v17_;
  10133. const T18 v18_;
  10134. const T19 v19_;
  10135. };
  10136. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10137. typename T6, typename T7, typename T8, typename T9, typename T10,
  10138. typename T11, typename T12, typename T13, typename T14, typename T15,
  10139. typename T16, typename T17, typename T18, typename T19, typename T20>
  10140. class ValueArray20 {
  10141. public:
  10142. ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10143. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10144. T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  10145. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  10146. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  10147. v19_(v19), v20_(v20) {}
  10148. template <typename T>
  10149. operator ParamGenerator<T>() const {
  10150. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10151. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10152. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10153. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10154. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  10155. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  10156. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_)};
  10157. return ValuesIn(array);
  10158. }
  10159. private:
  10160. // No implementation - assignment is unsupported.
  10161. void operator=(const ValueArray20& other);
  10162. const T1 v1_;
  10163. const T2 v2_;
  10164. const T3 v3_;
  10165. const T4 v4_;
  10166. const T5 v5_;
  10167. const T6 v6_;
  10168. const T7 v7_;
  10169. const T8 v8_;
  10170. const T9 v9_;
  10171. const T10 v10_;
  10172. const T11 v11_;
  10173. const T12 v12_;
  10174. const T13 v13_;
  10175. const T14 v14_;
  10176. const T15 v15_;
  10177. const T16 v16_;
  10178. const T17 v17_;
  10179. const T18 v18_;
  10180. const T19 v19_;
  10181. const T20 v20_;
  10182. };
  10183. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10184. typename T6, typename T7, typename T8, typename T9, typename T10,
  10185. typename T11, typename T12, typename T13, typename T14, typename T15,
  10186. typename T16, typename T17, typename T18, typename T19, typename T20,
  10187. typename T21>
  10188. class ValueArray21 {
  10189. public:
  10190. ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10191. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10192. T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  10193. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  10194. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  10195. v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
  10196. template <typename T>
  10197. operator ParamGenerator<T>() const {
  10198. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10199. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10200. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10201. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10202. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  10203. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  10204. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  10205. static_cast<T>(v21_)};
  10206. return ValuesIn(array);
  10207. }
  10208. private:
  10209. // No implementation - assignment is unsupported.
  10210. void operator=(const ValueArray21& other);
  10211. const T1 v1_;
  10212. const T2 v2_;
  10213. const T3 v3_;
  10214. const T4 v4_;
  10215. const T5 v5_;
  10216. const T6 v6_;
  10217. const T7 v7_;
  10218. const T8 v8_;
  10219. const T9 v9_;
  10220. const T10 v10_;
  10221. const T11 v11_;
  10222. const T12 v12_;
  10223. const T13 v13_;
  10224. const T14 v14_;
  10225. const T15 v15_;
  10226. const T16 v16_;
  10227. const T17 v17_;
  10228. const T18 v18_;
  10229. const T19 v19_;
  10230. const T20 v20_;
  10231. const T21 v21_;
  10232. };
  10233. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10234. typename T6, typename T7, typename T8, typename T9, typename T10,
  10235. typename T11, typename T12, typename T13, typename T14, typename T15,
  10236. typename T16, typename T17, typename T18, typename T19, typename T20,
  10237. typename T21, typename T22>
  10238. class ValueArray22 {
  10239. public:
  10240. ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10241. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10242. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
  10243. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  10244. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  10245. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
  10246. template <typename T>
  10247. operator ParamGenerator<T>() const {
  10248. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10249. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10250. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10251. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10252. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  10253. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  10254. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  10255. static_cast<T>(v21_), static_cast<T>(v22_)};
  10256. return ValuesIn(array);
  10257. }
  10258. private:
  10259. // No implementation - assignment is unsupported.
  10260. void operator=(const ValueArray22& other);
  10261. const T1 v1_;
  10262. const T2 v2_;
  10263. const T3 v3_;
  10264. const T4 v4_;
  10265. const T5 v5_;
  10266. const T6 v6_;
  10267. const T7 v7_;
  10268. const T8 v8_;
  10269. const T9 v9_;
  10270. const T10 v10_;
  10271. const T11 v11_;
  10272. const T12 v12_;
  10273. const T13 v13_;
  10274. const T14 v14_;
  10275. const T15 v15_;
  10276. const T16 v16_;
  10277. const T17 v17_;
  10278. const T18 v18_;
  10279. const T19 v19_;
  10280. const T20 v20_;
  10281. const T21 v21_;
  10282. const T22 v22_;
  10283. };
  10284. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10285. typename T6, typename T7, typename T8, typename T9, typename T10,
  10286. typename T11, typename T12, typename T13, typename T14, typename T15,
  10287. typename T16, typename T17, typename T18, typename T19, typename T20,
  10288. typename T21, typename T22, typename T23>
  10289. class ValueArray23 {
  10290. public:
  10291. ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10292. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10293. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
  10294. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  10295. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  10296. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  10297. v23_(v23) {}
  10298. template <typename T>
  10299. operator ParamGenerator<T>() const {
  10300. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10301. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10302. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10303. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10304. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  10305. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  10306. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  10307. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_)};
  10308. return ValuesIn(array);
  10309. }
  10310. private:
  10311. // No implementation - assignment is unsupported.
  10312. void operator=(const ValueArray23& other);
  10313. const T1 v1_;
  10314. const T2 v2_;
  10315. const T3 v3_;
  10316. const T4 v4_;
  10317. const T5 v5_;
  10318. const T6 v6_;
  10319. const T7 v7_;
  10320. const T8 v8_;
  10321. const T9 v9_;
  10322. const T10 v10_;
  10323. const T11 v11_;
  10324. const T12 v12_;
  10325. const T13 v13_;
  10326. const T14 v14_;
  10327. const T15 v15_;
  10328. const T16 v16_;
  10329. const T17 v17_;
  10330. const T18 v18_;
  10331. const T19 v19_;
  10332. const T20 v20_;
  10333. const T21 v21_;
  10334. const T22 v22_;
  10335. const T23 v23_;
  10336. };
  10337. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10338. typename T6, typename T7, typename T8, typename T9, typename T10,
  10339. typename T11, typename T12, typename T13, typename T14, typename T15,
  10340. typename T16, typename T17, typename T18, typename T19, typename T20,
  10341. typename T21, typename T22, typename T23, typename T24>
  10342. class ValueArray24 {
  10343. public:
  10344. ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10345. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10346. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
  10347. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  10348. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  10349. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  10350. v22_(v22), v23_(v23), v24_(v24) {}
  10351. template <typename T>
  10352. operator ParamGenerator<T>() const {
  10353. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10354. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10355. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10356. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10357. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  10358. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  10359. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  10360. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  10361. static_cast<T>(v24_)};
  10362. return ValuesIn(array);
  10363. }
  10364. private:
  10365. // No implementation - assignment is unsupported.
  10366. void operator=(const ValueArray24& other);
  10367. const T1 v1_;
  10368. const T2 v2_;
  10369. const T3 v3_;
  10370. const T4 v4_;
  10371. const T5 v5_;
  10372. const T6 v6_;
  10373. const T7 v7_;
  10374. const T8 v8_;
  10375. const T9 v9_;
  10376. const T10 v10_;
  10377. const T11 v11_;
  10378. const T12 v12_;
  10379. const T13 v13_;
  10380. const T14 v14_;
  10381. const T15 v15_;
  10382. const T16 v16_;
  10383. const T17 v17_;
  10384. const T18 v18_;
  10385. const T19 v19_;
  10386. const T20 v20_;
  10387. const T21 v21_;
  10388. const T22 v22_;
  10389. const T23 v23_;
  10390. const T24 v24_;
  10391. };
  10392. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10393. typename T6, typename T7, typename T8, typename T9, typename T10,
  10394. typename T11, typename T12, typename T13, typename T14, typename T15,
  10395. typename T16, typename T17, typename T18, typename T19, typename T20,
  10396. typename T21, typename T22, typename T23, typename T24, typename T25>
  10397. class ValueArray25 {
  10398. public:
  10399. ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10400. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10401. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
  10402. T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  10403. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  10404. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  10405. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
  10406. template <typename T>
  10407. operator ParamGenerator<T>() const {
  10408. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10409. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10410. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10411. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10412. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  10413. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  10414. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  10415. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  10416. static_cast<T>(v24_), static_cast<T>(v25_)};
  10417. return ValuesIn(array);
  10418. }
  10419. private:
  10420. // No implementation - assignment is unsupported.
  10421. void operator=(const ValueArray25& other);
  10422. const T1 v1_;
  10423. const T2 v2_;
  10424. const T3 v3_;
  10425. const T4 v4_;
  10426. const T5 v5_;
  10427. const T6 v6_;
  10428. const T7 v7_;
  10429. const T8 v8_;
  10430. const T9 v9_;
  10431. const T10 v10_;
  10432. const T11 v11_;
  10433. const T12 v12_;
  10434. const T13 v13_;
  10435. const T14 v14_;
  10436. const T15 v15_;
  10437. const T16 v16_;
  10438. const T17 v17_;
  10439. const T18 v18_;
  10440. const T19 v19_;
  10441. const T20 v20_;
  10442. const T21 v21_;
  10443. const T22 v22_;
  10444. const T23 v23_;
  10445. const T24 v24_;
  10446. const T25 v25_;
  10447. };
  10448. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10449. typename T6, typename T7, typename T8, typename T9, typename T10,
  10450. typename T11, typename T12, typename T13, typename T14, typename T15,
  10451. typename T16, typename T17, typename T18, typename T19, typename T20,
  10452. typename T21, typename T22, typename T23, typename T24, typename T25,
  10453. typename T26>
  10454. class ValueArray26 {
  10455. public:
  10456. ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10457. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10458. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10459. T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  10460. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  10461. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  10462. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
  10463. template <typename T>
  10464. operator ParamGenerator<T>() const {
  10465. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10466. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10467. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10468. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10469. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  10470. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  10471. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  10472. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  10473. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_)};
  10474. return ValuesIn(array);
  10475. }
  10476. private:
  10477. // No implementation - assignment is unsupported.
  10478. void operator=(const ValueArray26& other);
  10479. const T1 v1_;
  10480. const T2 v2_;
  10481. const T3 v3_;
  10482. const T4 v4_;
  10483. const T5 v5_;
  10484. const T6 v6_;
  10485. const T7 v7_;
  10486. const T8 v8_;
  10487. const T9 v9_;
  10488. const T10 v10_;
  10489. const T11 v11_;
  10490. const T12 v12_;
  10491. const T13 v13_;
  10492. const T14 v14_;
  10493. const T15 v15_;
  10494. const T16 v16_;
  10495. const T17 v17_;
  10496. const T18 v18_;
  10497. const T19 v19_;
  10498. const T20 v20_;
  10499. const T21 v21_;
  10500. const T22 v22_;
  10501. const T23 v23_;
  10502. const T24 v24_;
  10503. const T25 v25_;
  10504. const T26 v26_;
  10505. };
  10506. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10507. typename T6, typename T7, typename T8, typename T9, typename T10,
  10508. typename T11, typename T12, typename T13, typename T14, typename T15,
  10509. typename T16, typename T17, typename T18, typename T19, typename T20,
  10510. typename T21, typename T22, typename T23, typename T24, typename T25,
  10511. typename T26, typename T27>
  10512. class ValueArray27 {
  10513. public:
  10514. ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10515. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10516. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10517. T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  10518. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  10519. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
  10520. v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
  10521. v26_(v26), v27_(v27) {}
  10522. template <typename T>
  10523. operator ParamGenerator<T>() const {
  10524. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10525. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10526. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10527. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10528. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  10529. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  10530. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  10531. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  10532. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  10533. static_cast<T>(v27_)};
  10534. return ValuesIn(array);
  10535. }
  10536. private:
  10537. // No implementation - assignment is unsupported.
  10538. void operator=(const ValueArray27& other);
  10539. const T1 v1_;
  10540. const T2 v2_;
  10541. const T3 v3_;
  10542. const T4 v4_;
  10543. const T5 v5_;
  10544. const T6 v6_;
  10545. const T7 v7_;
  10546. const T8 v8_;
  10547. const T9 v9_;
  10548. const T10 v10_;
  10549. const T11 v11_;
  10550. const T12 v12_;
  10551. const T13 v13_;
  10552. const T14 v14_;
  10553. const T15 v15_;
  10554. const T16 v16_;
  10555. const T17 v17_;
  10556. const T18 v18_;
  10557. const T19 v19_;
  10558. const T20 v20_;
  10559. const T21 v21_;
  10560. const T22 v22_;
  10561. const T23 v23_;
  10562. const T24 v24_;
  10563. const T25 v25_;
  10564. const T26 v26_;
  10565. const T27 v27_;
  10566. };
  10567. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10568. typename T6, typename T7, typename T8, typename T9, typename T10,
  10569. typename T11, typename T12, typename T13, typename T14, typename T15,
  10570. typename T16, typename T17, typename T18, typename T19, typename T20,
  10571. typename T21, typename T22, typename T23, typename T24, typename T25,
  10572. typename T26, typename T27, typename T28>
  10573. class ValueArray28 {
  10574. public:
  10575. ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10576. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10577. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10578. T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  10579. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  10580. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  10581. v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
  10582. v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
  10583. template <typename T>
  10584. operator ParamGenerator<T>() const {
  10585. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10586. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10587. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10588. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10589. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  10590. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  10591. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  10592. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  10593. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  10594. static_cast<T>(v27_), static_cast<T>(v28_)};
  10595. return ValuesIn(array);
  10596. }
  10597. private:
  10598. // No implementation - assignment is unsupported.
  10599. void operator=(const ValueArray28& other);
  10600. const T1 v1_;
  10601. const T2 v2_;
  10602. const T3 v3_;
  10603. const T4 v4_;
  10604. const T5 v5_;
  10605. const T6 v6_;
  10606. const T7 v7_;
  10607. const T8 v8_;
  10608. const T9 v9_;
  10609. const T10 v10_;
  10610. const T11 v11_;
  10611. const T12 v12_;
  10612. const T13 v13_;
  10613. const T14 v14_;
  10614. const T15 v15_;
  10615. const T16 v16_;
  10616. const T17 v17_;
  10617. const T18 v18_;
  10618. const T19 v19_;
  10619. const T20 v20_;
  10620. const T21 v21_;
  10621. const T22 v22_;
  10622. const T23 v23_;
  10623. const T24 v24_;
  10624. const T25 v25_;
  10625. const T26 v26_;
  10626. const T27 v27_;
  10627. const T28 v28_;
  10628. };
  10629. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10630. typename T6, typename T7, typename T8, typename T9, typename T10,
  10631. typename T11, typename T12, typename T13, typename T14, typename T15,
  10632. typename T16, typename T17, typename T18, typename T19, typename T20,
  10633. typename T21, typename T22, typename T23, typename T24, typename T25,
  10634. typename T26, typename T27, typename T28, typename T29>
  10635. class ValueArray29 {
  10636. public:
  10637. ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10638. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10639. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10640. T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  10641. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  10642. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  10643. v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
  10644. v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
  10645. template <typename T>
  10646. operator ParamGenerator<T>() const {
  10647. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10648. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10649. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10650. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10651. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  10652. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  10653. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  10654. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  10655. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  10656. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_)};
  10657. return ValuesIn(array);
  10658. }
  10659. private:
  10660. // No implementation - assignment is unsupported.
  10661. void operator=(const ValueArray29& other);
  10662. const T1 v1_;
  10663. const T2 v2_;
  10664. const T3 v3_;
  10665. const T4 v4_;
  10666. const T5 v5_;
  10667. const T6 v6_;
  10668. const T7 v7_;
  10669. const T8 v8_;
  10670. const T9 v9_;
  10671. const T10 v10_;
  10672. const T11 v11_;
  10673. const T12 v12_;
  10674. const T13 v13_;
  10675. const T14 v14_;
  10676. const T15 v15_;
  10677. const T16 v16_;
  10678. const T17 v17_;
  10679. const T18 v18_;
  10680. const T19 v19_;
  10681. const T20 v20_;
  10682. const T21 v21_;
  10683. const T22 v22_;
  10684. const T23 v23_;
  10685. const T24 v24_;
  10686. const T25 v25_;
  10687. const T26 v26_;
  10688. const T27 v27_;
  10689. const T28 v28_;
  10690. const T29 v29_;
  10691. };
  10692. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10693. typename T6, typename T7, typename T8, typename T9, typename T10,
  10694. typename T11, typename T12, typename T13, typename T14, typename T15,
  10695. typename T16, typename T17, typename T18, typename T19, typename T20,
  10696. typename T21, typename T22, typename T23, typename T24, typename T25,
  10697. typename T26, typename T27, typename T28, typename T29, typename T30>
  10698. class ValueArray30 {
  10699. public:
  10700. ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10701. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10702. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10703. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
  10704. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  10705. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  10706. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  10707. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  10708. v29_(v29), v30_(v30) {}
  10709. template <typename T>
  10710. operator ParamGenerator<T>() const {
  10711. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10712. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10713. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10714. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10715. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  10716. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  10717. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  10718. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  10719. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  10720. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  10721. static_cast<T>(v30_)};
  10722. return ValuesIn(array);
  10723. }
  10724. private:
  10725. // No implementation - assignment is unsupported.
  10726. void operator=(const ValueArray30& other);
  10727. const T1 v1_;
  10728. const T2 v2_;
  10729. const T3 v3_;
  10730. const T4 v4_;
  10731. const T5 v5_;
  10732. const T6 v6_;
  10733. const T7 v7_;
  10734. const T8 v8_;
  10735. const T9 v9_;
  10736. const T10 v10_;
  10737. const T11 v11_;
  10738. const T12 v12_;
  10739. const T13 v13_;
  10740. const T14 v14_;
  10741. const T15 v15_;
  10742. const T16 v16_;
  10743. const T17 v17_;
  10744. const T18 v18_;
  10745. const T19 v19_;
  10746. const T20 v20_;
  10747. const T21 v21_;
  10748. const T22 v22_;
  10749. const T23 v23_;
  10750. const T24 v24_;
  10751. const T25 v25_;
  10752. const T26 v26_;
  10753. const T27 v27_;
  10754. const T28 v28_;
  10755. const T29 v29_;
  10756. const T30 v30_;
  10757. };
  10758. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10759. typename T6, typename T7, typename T8, typename T9, typename T10,
  10760. typename T11, typename T12, typename T13, typename T14, typename T15,
  10761. typename T16, typename T17, typename T18, typename T19, typename T20,
  10762. typename T21, typename T22, typename T23, typename T24, typename T25,
  10763. typename T26, typename T27, typename T28, typename T29, typename T30,
  10764. typename T31>
  10765. class ValueArray31 {
  10766. public:
  10767. ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10768. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10769. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10770. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
  10771. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  10772. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  10773. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  10774. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  10775. v29_(v29), v30_(v30), v31_(v31) {}
  10776. template <typename T>
  10777. operator ParamGenerator<T>() const {
  10778. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10779. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10780. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10781. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10782. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  10783. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  10784. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  10785. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  10786. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  10787. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  10788. static_cast<T>(v30_), static_cast<T>(v31_)};
  10789. return ValuesIn(array);
  10790. }
  10791. private:
  10792. // No implementation - assignment is unsupported.
  10793. void operator=(const ValueArray31& other);
  10794. const T1 v1_;
  10795. const T2 v2_;
  10796. const T3 v3_;
  10797. const T4 v4_;
  10798. const T5 v5_;
  10799. const T6 v6_;
  10800. const T7 v7_;
  10801. const T8 v8_;
  10802. const T9 v9_;
  10803. const T10 v10_;
  10804. const T11 v11_;
  10805. const T12 v12_;
  10806. const T13 v13_;
  10807. const T14 v14_;
  10808. const T15 v15_;
  10809. const T16 v16_;
  10810. const T17 v17_;
  10811. const T18 v18_;
  10812. const T19 v19_;
  10813. const T20 v20_;
  10814. const T21 v21_;
  10815. const T22 v22_;
  10816. const T23 v23_;
  10817. const T24 v24_;
  10818. const T25 v25_;
  10819. const T26 v26_;
  10820. const T27 v27_;
  10821. const T28 v28_;
  10822. const T29 v29_;
  10823. const T30 v30_;
  10824. const T31 v31_;
  10825. };
  10826. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10827. typename T6, typename T7, typename T8, typename T9, typename T10,
  10828. typename T11, typename T12, typename T13, typename T14, typename T15,
  10829. typename T16, typename T17, typename T18, typename T19, typename T20,
  10830. typename T21, typename T22, typename T23, typename T24, typename T25,
  10831. typename T26, typename T27, typename T28, typename T29, typename T30,
  10832. typename T31, typename T32>
  10833. class ValueArray32 {
  10834. public:
  10835. ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10836. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10837. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10838. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
  10839. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  10840. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  10841. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  10842. v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
  10843. v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
  10844. template <typename T>
  10845. operator ParamGenerator<T>() const {
  10846. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10847. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10848. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10849. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10850. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  10851. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  10852. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  10853. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  10854. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  10855. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  10856. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_)};
  10857. return ValuesIn(array);
  10858. }
  10859. private:
  10860. // No implementation - assignment is unsupported.
  10861. void operator=(const ValueArray32& other);
  10862. const T1 v1_;
  10863. const T2 v2_;
  10864. const T3 v3_;
  10865. const T4 v4_;
  10866. const T5 v5_;
  10867. const T6 v6_;
  10868. const T7 v7_;
  10869. const T8 v8_;
  10870. const T9 v9_;
  10871. const T10 v10_;
  10872. const T11 v11_;
  10873. const T12 v12_;
  10874. const T13 v13_;
  10875. const T14 v14_;
  10876. const T15 v15_;
  10877. const T16 v16_;
  10878. const T17 v17_;
  10879. const T18 v18_;
  10880. const T19 v19_;
  10881. const T20 v20_;
  10882. const T21 v21_;
  10883. const T22 v22_;
  10884. const T23 v23_;
  10885. const T24 v24_;
  10886. const T25 v25_;
  10887. const T26 v26_;
  10888. const T27 v27_;
  10889. const T28 v28_;
  10890. const T29 v29_;
  10891. const T30 v30_;
  10892. const T31 v31_;
  10893. const T32 v32_;
  10894. };
  10895. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10896. typename T6, typename T7, typename T8, typename T9, typename T10,
  10897. typename T11, typename T12, typename T13, typename T14, typename T15,
  10898. typename T16, typename T17, typename T18, typename T19, typename T20,
  10899. typename T21, typename T22, typename T23, typename T24, typename T25,
  10900. typename T26, typename T27, typename T28, typename T29, typename T30,
  10901. typename T31, typename T32, typename T33>
  10902. class ValueArray33 {
  10903. public:
  10904. ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10905. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10906. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10907. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
  10908. T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  10909. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  10910. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  10911. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  10912. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  10913. v33_(v33) {}
  10914. template <typename T>
  10915. operator ParamGenerator<T>() const {
  10916. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10917. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10918. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10919. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10920. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  10921. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  10922. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  10923. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  10924. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  10925. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  10926. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  10927. static_cast<T>(v33_)};
  10928. return ValuesIn(array);
  10929. }
  10930. private:
  10931. // No implementation - assignment is unsupported.
  10932. void operator=(const ValueArray33& other);
  10933. const T1 v1_;
  10934. const T2 v2_;
  10935. const T3 v3_;
  10936. const T4 v4_;
  10937. const T5 v5_;
  10938. const T6 v6_;
  10939. const T7 v7_;
  10940. const T8 v8_;
  10941. const T9 v9_;
  10942. const T10 v10_;
  10943. const T11 v11_;
  10944. const T12 v12_;
  10945. const T13 v13_;
  10946. const T14 v14_;
  10947. const T15 v15_;
  10948. const T16 v16_;
  10949. const T17 v17_;
  10950. const T18 v18_;
  10951. const T19 v19_;
  10952. const T20 v20_;
  10953. const T21 v21_;
  10954. const T22 v22_;
  10955. const T23 v23_;
  10956. const T24 v24_;
  10957. const T25 v25_;
  10958. const T26 v26_;
  10959. const T27 v27_;
  10960. const T28 v28_;
  10961. const T29 v29_;
  10962. const T30 v30_;
  10963. const T31 v31_;
  10964. const T32 v32_;
  10965. const T33 v33_;
  10966. };
  10967. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10968. typename T6, typename T7, typename T8, typename T9, typename T10,
  10969. typename T11, typename T12, typename T13, typename T14, typename T15,
  10970. typename T16, typename T17, typename T18, typename T19, typename T20,
  10971. typename T21, typename T22, typename T23, typename T24, typename T25,
  10972. typename T26, typename T27, typename T28, typename T29, typename T30,
  10973. typename T31, typename T32, typename T33, typename T34>
  10974. class ValueArray34 {
  10975. public:
  10976. ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10977. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10978. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10979. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  10980. T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  10981. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  10982. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  10983. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  10984. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  10985. v33_(v33), v34_(v34) {}
  10986. template <typename T>
  10987. operator ParamGenerator<T>() const {
  10988. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10989. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10990. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10991. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10992. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  10993. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  10994. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  10995. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  10996. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  10997. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  10998. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  10999. static_cast<T>(v33_), static_cast<T>(v34_)};
  11000. return ValuesIn(array);
  11001. }
  11002. private:
  11003. // No implementation - assignment is unsupported.
  11004. void operator=(const ValueArray34& other);
  11005. const T1 v1_;
  11006. const T2 v2_;
  11007. const T3 v3_;
  11008. const T4 v4_;
  11009. const T5 v5_;
  11010. const T6 v6_;
  11011. const T7 v7_;
  11012. const T8 v8_;
  11013. const T9 v9_;
  11014. const T10 v10_;
  11015. const T11 v11_;
  11016. const T12 v12_;
  11017. const T13 v13_;
  11018. const T14 v14_;
  11019. const T15 v15_;
  11020. const T16 v16_;
  11021. const T17 v17_;
  11022. const T18 v18_;
  11023. const T19 v19_;
  11024. const T20 v20_;
  11025. const T21 v21_;
  11026. const T22 v22_;
  11027. const T23 v23_;
  11028. const T24 v24_;
  11029. const T25 v25_;
  11030. const T26 v26_;
  11031. const T27 v27_;
  11032. const T28 v28_;
  11033. const T29 v29_;
  11034. const T30 v30_;
  11035. const T31 v31_;
  11036. const T32 v32_;
  11037. const T33 v33_;
  11038. const T34 v34_;
  11039. };
  11040. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11041. typename T6, typename T7, typename T8, typename T9, typename T10,
  11042. typename T11, typename T12, typename T13, typename T14, typename T15,
  11043. typename T16, typename T17, typename T18, typename T19, typename T20,
  11044. typename T21, typename T22, typename T23, typename T24, typename T25,
  11045. typename T26, typename T27, typename T28, typename T29, typename T30,
  11046. typename T31, typename T32, typename T33, typename T34, typename T35>
  11047. class ValueArray35 {
  11048. public:
  11049. ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11050. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11051. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11052. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11053. T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  11054. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  11055. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
  11056. v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
  11057. v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
  11058. v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
  11059. template <typename T>
  11060. operator ParamGenerator<T>() const {
  11061. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11062. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11063. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11064. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11065. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11066. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11067. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11068. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11069. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  11070. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  11071. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  11072. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_)};
  11073. return ValuesIn(array);
  11074. }
  11075. private:
  11076. // No implementation - assignment is unsupported.
  11077. void operator=(const ValueArray35& other);
  11078. const T1 v1_;
  11079. const T2 v2_;
  11080. const T3 v3_;
  11081. const T4 v4_;
  11082. const T5 v5_;
  11083. const T6 v6_;
  11084. const T7 v7_;
  11085. const T8 v8_;
  11086. const T9 v9_;
  11087. const T10 v10_;
  11088. const T11 v11_;
  11089. const T12 v12_;
  11090. const T13 v13_;
  11091. const T14 v14_;
  11092. const T15 v15_;
  11093. const T16 v16_;
  11094. const T17 v17_;
  11095. const T18 v18_;
  11096. const T19 v19_;
  11097. const T20 v20_;
  11098. const T21 v21_;
  11099. const T22 v22_;
  11100. const T23 v23_;
  11101. const T24 v24_;
  11102. const T25 v25_;
  11103. const T26 v26_;
  11104. const T27 v27_;
  11105. const T28 v28_;
  11106. const T29 v29_;
  11107. const T30 v30_;
  11108. const T31 v31_;
  11109. const T32 v32_;
  11110. const T33 v33_;
  11111. const T34 v34_;
  11112. const T35 v35_;
  11113. };
  11114. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11115. typename T6, typename T7, typename T8, typename T9, typename T10,
  11116. typename T11, typename T12, typename T13, typename T14, typename T15,
  11117. typename T16, typename T17, typename T18, typename T19, typename T20,
  11118. typename T21, typename T22, typename T23, typename T24, typename T25,
  11119. typename T26, typename T27, typename T28, typename T29, typename T30,
  11120. typename T31, typename T32, typename T33, typename T34, typename T35,
  11121. typename T36>
  11122. class ValueArray36 {
  11123. public:
  11124. ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11125. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11126. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11127. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11128. T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  11129. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  11130. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  11131. v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
  11132. v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
  11133. v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
  11134. template <typename T>
  11135. operator ParamGenerator<T>() const {
  11136. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11137. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11138. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11139. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11140. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11141. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11142. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11143. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11144. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  11145. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  11146. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  11147. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  11148. static_cast<T>(v36_)};
  11149. return ValuesIn(array);
  11150. }
  11151. private:
  11152. // No implementation - assignment is unsupported.
  11153. void operator=(const ValueArray36& other);
  11154. const T1 v1_;
  11155. const T2 v2_;
  11156. const T3 v3_;
  11157. const T4 v4_;
  11158. const T5 v5_;
  11159. const T6 v6_;
  11160. const T7 v7_;
  11161. const T8 v8_;
  11162. const T9 v9_;
  11163. const T10 v10_;
  11164. const T11 v11_;
  11165. const T12 v12_;
  11166. const T13 v13_;
  11167. const T14 v14_;
  11168. const T15 v15_;
  11169. const T16 v16_;
  11170. const T17 v17_;
  11171. const T18 v18_;
  11172. const T19 v19_;
  11173. const T20 v20_;
  11174. const T21 v21_;
  11175. const T22 v22_;
  11176. const T23 v23_;
  11177. const T24 v24_;
  11178. const T25 v25_;
  11179. const T26 v26_;
  11180. const T27 v27_;
  11181. const T28 v28_;
  11182. const T29 v29_;
  11183. const T30 v30_;
  11184. const T31 v31_;
  11185. const T32 v32_;
  11186. const T33 v33_;
  11187. const T34 v34_;
  11188. const T35 v35_;
  11189. const T36 v36_;
  11190. };
  11191. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11192. typename T6, typename T7, typename T8, typename T9, typename T10,
  11193. typename T11, typename T12, typename T13, typename T14, typename T15,
  11194. typename T16, typename T17, typename T18, typename T19, typename T20,
  11195. typename T21, typename T22, typename T23, typename T24, typename T25,
  11196. typename T26, typename T27, typename T28, typename T29, typename T30,
  11197. typename T31, typename T32, typename T33, typename T34, typename T35,
  11198. typename T36, typename T37>
  11199. class ValueArray37 {
  11200. public:
  11201. ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11202. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11203. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11204. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11205. T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  11206. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  11207. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  11208. v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
  11209. v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
  11210. v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
  11211. v36_(v36), v37_(v37) {}
  11212. template <typename T>
  11213. operator ParamGenerator<T>() const {
  11214. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11215. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11216. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11217. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11218. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11219. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11220. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11221. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11222. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  11223. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  11224. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  11225. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  11226. static_cast<T>(v36_), static_cast<T>(v37_)};
  11227. return ValuesIn(array);
  11228. }
  11229. private:
  11230. // No implementation - assignment is unsupported.
  11231. void operator=(const ValueArray37& other);
  11232. const T1 v1_;
  11233. const T2 v2_;
  11234. const T3 v3_;
  11235. const T4 v4_;
  11236. const T5 v5_;
  11237. const T6 v6_;
  11238. const T7 v7_;
  11239. const T8 v8_;
  11240. const T9 v9_;
  11241. const T10 v10_;
  11242. const T11 v11_;
  11243. const T12 v12_;
  11244. const T13 v13_;
  11245. const T14 v14_;
  11246. const T15 v15_;
  11247. const T16 v16_;
  11248. const T17 v17_;
  11249. const T18 v18_;
  11250. const T19 v19_;
  11251. const T20 v20_;
  11252. const T21 v21_;
  11253. const T22 v22_;
  11254. const T23 v23_;
  11255. const T24 v24_;
  11256. const T25 v25_;
  11257. const T26 v26_;
  11258. const T27 v27_;
  11259. const T28 v28_;
  11260. const T29 v29_;
  11261. const T30 v30_;
  11262. const T31 v31_;
  11263. const T32 v32_;
  11264. const T33 v33_;
  11265. const T34 v34_;
  11266. const T35 v35_;
  11267. const T36 v36_;
  11268. const T37 v37_;
  11269. };
  11270. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11271. typename T6, typename T7, typename T8, typename T9, typename T10,
  11272. typename T11, typename T12, typename T13, typename T14, typename T15,
  11273. typename T16, typename T17, typename T18, typename T19, typename T20,
  11274. typename T21, typename T22, typename T23, typename T24, typename T25,
  11275. typename T26, typename T27, typename T28, typename T29, typename T30,
  11276. typename T31, typename T32, typename T33, typename T34, typename T35,
  11277. typename T36, typename T37, typename T38>
  11278. class ValueArray38 {
  11279. public:
  11280. ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11281. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11282. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11283. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11284. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
  11285. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11286. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  11287. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  11288. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  11289. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  11290. v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
  11291. template <typename T>
  11292. operator ParamGenerator<T>() const {
  11293. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11294. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11295. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11296. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11297. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11298. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11299. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11300. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11301. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  11302. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  11303. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  11304. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  11305. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_)};
  11306. return ValuesIn(array);
  11307. }
  11308. private:
  11309. // No implementation - assignment is unsupported.
  11310. void operator=(const ValueArray38& other);
  11311. const T1 v1_;
  11312. const T2 v2_;
  11313. const T3 v3_;
  11314. const T4 v4_;
  11315. const T5 v5_;
  11316. const T6 v6_;
  11317. const T7 v7_;
  11318. const T8 v8_;
  11319. const T9 v9_;
  11320. const T10 v10_;
  11321. const T11 v11_;
  11322. const T12 v12_;
  11323. const T13 v13_;
  11324. const T14 v14_;
  11325. const T15 v15_;
  11326. const T16 v16_;
  11327. const T17 v17_;
  11328. const T18 v18_;
  11329. const T19 v19_;
  11330. const T20 v20_;
  11331. const T21 v21_;
  11332. const T22 v22_;
  11333. const T23 v23_;
  11334. const T24 v24_;
  11335. const T25 v25_;
  11336. const T26 v26_;
  11337. const T27 v27_;
  11338. const T28 v28_;
  11339. const T29 v29_;
  11340. const T30 v30_;
  11341. const T31 v31_;
  11342. const T32 v32_;
  11343. const T33 v33_;
  11344. const T34 v34_;
  11345. const T35 v35_;
  11346. const T36 v36_;
  11347. const T37 v37_;
  11348. const T38 v38_;
  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, typename T18, typename T19, typename T20,
  11354. typename T21, typename T22, typename T23, typename T24, typename T25,
  11355. typename T26, typename T27, typename T28, typename T29, typename T30,
  11356. typename T31, typename T32, typename T33, typename T34, typename T35,
  11357. typename T36, typename T37, typename T38, typename T39>
  11358. class ValueArray39 {
  11359. public:
  11360. ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11361. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11362. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11363. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11364. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
  11365. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11366. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  11367. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  11368. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  11369. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  11370. v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
  11371. template <typename T>
  11372. operator ParamGenerator<T>() const {
  11373. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11374. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11375. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11376. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11377. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11378. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11379. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11380. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11381. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  11382. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  11383. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  11384. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  11385. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  11386. static_cast<T>(v39_)};
  11387. return ValuesIn(array);
  11388. }
  11389. private:
  11390. // No implementation - assignment is unsupported.
  11391. void operator=(const ValueArray39& other);
  11392. const T1 v1_;
  11393. const T2 v2_;
  11394. const T3 v3_;
  11395. const T4 v4_;
  11396. const T5 v5_;
  11397. const T6 v6_;
  11398. const T7 v7_;
  11399. const T8 v8_;
  11400. const T9 v9_;
  11401. const T10 v10_;
  11402. const T11 v11_;
  11403. const T12 v12_;
  11404. const T13 v13_;
  11405. const T14 v14_;
  11406. const T15 v15_;
  11407. const T16 v16_;
  11408. const T17 v17_;
  11409. const T18 v18_;
  11410. const T19 v19_;
  11411. const T20 v20_;
  11412. const T21 v21_;
  11413. const T22 v22_;
  11414. const T23 v23_;
  11415. const T24 v24_;
  11416. const T25 v25_;
  11417. const T26 v26_;
  11418. const T27 v27_;
  11419. const T28 v28_;
  11420. const T29 v29_;
  11421. const T30 v30_;
  11422. const T31 v31_;
  11423. const T32 v32_;
  11424. const T33 v33_;
  11425. const T34 v34_;
  11426. const T35 v35_;
  11427. const T36 v36_;
  11428. const T37 v37_;
  11429. const T38 v38_;
  11430. const T39 v39_;
  11431. };
  11432. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11433. typename T6, typename T7, typename T8, typename T9, typename T10,
  11434. typename T11, typename T12, typename T13, typename T14, typename T15,
  11435. typename T16, typename T17, typename T18, typename T19, typename T20,
  11436. typename T21, typename T22, typename T23, typename T24, typename T25,
  11437. typename T26, typename T27, typename T28, typename T29, typename T30,
  11438. typename T31, typename T32, typename T33, typename T34, typename T35,
  11439. typename T36, typename T37, typename T38, typename T39, typename T40>
  11440. class ValueArray40 {
  11441. public:
  11442. ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11443. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11444. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11445. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11446. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
  11447. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  11448. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  11449. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  11450. v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
  11451. v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
  11452. v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
  11453. v40_(v40) {}
  11454. template <typename T>
  11455. operator ParamGenerator<T>() const {
  11456. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11457. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11458. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11459. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11460. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11461. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11462. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11463. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11464. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  11465. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  11466. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  11467. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  11468. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  11469. static_cast<T>(v39_), static_cast<T>(v40_)};
  11470. return ValuesIn(array);
  11471. }
  11472. private:
  11473. // No implementation - assignment is unsupported.
  11474. void operator=(const ValueArray40& other);
  11475. const T1 v1_;
  11476. const T2 v2_;
  11477. const T3 v3_;
  11478. const T4 v4_;
  11479. const T5 v5_;
  11480. const T6 v6_;
  11481. const T7 v7_;
  11482. const T8 v8_;
  11483. const T9 v9_;
  11484. const T10 v10_;
  11485. const T11 v11_;
  11486. const T12 v12_;
  11487. const T13 v13_;
  11488. const T14 v14_;
  11489. const T15 v15_;
  11490. const T16 v16_;
  11491. const T17 v17_;
  11492. const T18 v18_;
  11493. const T19 v19_;
  11494. const T20 v20_;
  11495. const T21 v21_;
  11496. const T22 v22_;
  11497. const T23 v23_;
  11498. const T24 v24_;
  11499. const T25 v25_;
  11500. const T26 v26_;
  11501. const T27 v27_;
  11502. const T28 v28_;
  11503. const T29 v29_;
  11504. const T30 v30_;
  11505. const T31 v31_;
  11506. const T32 v32_;
  11507. const T33 v33_;
  11508. const T34 v34_;
  11509. const T35 v35_;
  11510. const T36 v36_;
  11511. const T37 v37_;
  11512. const T38 v38_;
  11513. const T39 v39_;
  11514. const T40 v40_;
  11515. };
  11516. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11517. typename T6, typename T7, typename T8, typename T9, typename T10,
  11518. typename T11, typename T12, typename T13, typename T14, typename T15,
  11519. typename T16, typename T17, typename T18, typename T19, typename T20,
  11520. typename T21, typename T22, typename T23, typename T24, typename T25,
  11521. typename T26, typename T27, typename T28, typename T29, typename T30,
  11522. typename T31, typename T32, typename T33, typename T34, typename T35,
  11523. typename T36, typename T37, typename T38, typename T39, typename T40,
  11524. typename T41>
  11525. class ValueArray41 {
  11526. public:
  11527. ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11528. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11529. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11530. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11531. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
  11532. T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11533. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11534. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  11535. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  11536. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  11537. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  11538. v39_(v39), v40_(v40), v41_(v41) {}
  11539. template <typename T>
  11540. operator ParamGenerator<T>() const {
  11541. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11542. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11543. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11544. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11545. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11546. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11547. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11548. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11549. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  11550. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  11551. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  11552. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  11553. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  11554. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_)};
  11555. return ValuesIn(array);
  11556. }
  11557. private:
  11558. // No implementation - assignment is unsupported.
  11559. void operator=(const ValueArray41& other);
  11560. const T1 v1_;
  11561. const T2 v2_;
  11562. const T3 v3_;
  11563. const T4 v4_;
  11564. const T5 v5_;
  11565. const T6 v6_;
  11566. const T7 v7_;
  11567. const T8 v8_;
  11568. const T9 v9_;
  11569. const T10 v10_;
  11570. const T11 v11_;
  11571. const T12 v12_;
  11572. const T13 v13_;
  11573. const T14 v14_;
  11574. const T15 v15_;
  11575. const T16 v16_;
  11576. const T17 v17_;
  11577. const T18 v18_;
  11578. const T19 v19_;
  11579. const T20 v20_;
  11580. const T21 v21_;
  11581. const T22 v22_;
  11582. const T23 v23_;
  11583. const T24 v24_;
  11584. const T25 v25_;
  11585. const T26 v26_;
  11586. const T27 v27_;
  11587. const T28 v28_;
  11588. const T29 v29_;
  11589. const T30 v30_;
  11590. const T31 v31_;
  11591. const T32 v32_;
  11592. const T33 v33_;
  11593. const T34 v34_;
  11594. const T35 v35_;
  11595. const T36 v36_;
  11596. const T37 v37_;
  11597. const T38 v38_;
  11598. const T39 v39_;
  11599. const T40 v40_;
  11600. const T41 v41_;
  11601. };
  11602. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11603. typename T6, typename T7, typename T8, typename T9, typename T10,
  11604. typename T11, typename T12, typename T13, typename T14, typename T15,
  11605. typename T16, typename T17, typename T18, typename T19, typename T20,
  11606. typename T21, typename T22, typename T23, typename T24, typename T25,
  11607. typename T26, typename T27, typename T28, typename T29, typename T30,
  11608. typename T31, typename T32, typename T33, typename T34, typename T35,
  11609. typename T36, typename T37, typename T38, typename T39, typename T40,
  11610. typename T41, typename T42>
  11611. class ValueArray42 {
  11612. public:
  11613. ValueArray42(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, T23 v23, T24 v24, T25 v25,
  11616. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11617. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11618. T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11619. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11620. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  11621. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  11622. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  11623. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  11624. v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
  11625. template <typename T>
  11626. operator ParamGenerator<T>() const {
  11627. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11628. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11629. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11630. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11631. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11632. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11633. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11634. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11635. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  11636. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  11637. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  11638. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  11639. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  11640. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  11641. static_cast<T>(v42_)};
  11642. return ValuesIn(array);
  11643. }
  11644. private:
  11645. // No implementation - assignment is unsupported.
  11646. void operator=(const ValueArray42& other);
  11647. const T1 v1_;
  11648. const T2 v2_;
  11649. const T3 v3_;
  11650. const T4 v4_;
  11651. const T5 v5_;
  11652. const T6 v6_;
  11653. const T7 v7_;
  11654. const T8 v8_;
  11655. const T9 v9_;
  11656. const T10 v10_;
  11657. const T11 v11_;
  11658. const T12 v12_;
  11659. const T13 v13_;
  11660. const T14 v14_;
  11661. const T15 v15_;
  11662. const T16 v16_;
  11663. const T17 v17_;
  11664. const T18 v18_;
  11665. const T19 v19_;
  11666. const T20 v20_;
  11667. const T21 v21_;
  11668. const T22 v22_;
  11669. const T23 v23_;
  11670. const T24 v24_;
  11671. const T25 v25_;
  11672. const T26 v26_;
  11673. const T27 v27_;
  11674. const T28 v28_;
  11675. const T29 v29_;
  11676. const T30 v30_;
  11677. const T31 v31_;
  11678. const T32 v32_;
  11679. const T33 v33_;
  11680. const T34 v34_;
  11681. const T35 v35_;
  11682. const T36 v36_;
  11683. const T37 v37_;
  11684. const T38 v38_;
  11685. const T39 v39_;
  11686. const T40 v40_;
  11687. const T41 v41_;
  11688. const T42 v42_;
  11689. };
  11690. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11691. typename T6, typename T7, typename T8, typename T9, typename T10,
  11692. typename T11, typename T12, typename T13, typename T14, typename T15,
  11693. typename T16, typename T17, typename T18, typename T19, typename T20,
  11694. typename T21, typename T22, typename T23, typename T24, typename T25,
  11695. typename T26, typename T27, typename T28, typename T29, typename T30,
  11696. typename T31, typename T32, typename T33, typename T34, typename T35,
  11697. typename T36, typename T37, typename T38, typename T39, typename T40,
  11698. typename T41, typename T42, typename T43>
  11699. class ValueArray43 {
  11700. public:
  11701. ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11702. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11703. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11704. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11705. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11706. T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  11707. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  11708. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
  11709. v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
  11710. v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
  11711. v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
  11712. v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
  11713. template <typename T>
  11714. operator ParamGenerator<T>() const {
  11715. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11716. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11717. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11718. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11719. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11720. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11721. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11722. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11723. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  11724. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  11725. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  11726. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  11727. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  11728. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  11729. static_cast<T>(v42_), static_cast<T>(v43_)};
  11730. return ValuesIn(array);
  11731. }
  11732. private:
  11733. // No implementation - assignment is unsupported.
  11734. void operator=(const ValueArray43& other);
  11735. const T1 v1_;
  11736. const T2 v2_;
  11737. const T3 v3_;
  11738. const T4 v4_;
  11739. const T5 v5_;
  11740. const T6 v6_;
  11741. const T7 v7_;
  11742. const T8 v8_;
  11743. const T9 v9_;
  11744. const T10 v10_;
  11745. const T11 v11_;
  11746. const T12 v12_;
  11747. const T13 v13_;
  11748. const T14 v14_;
  11749. const T15 v15_;
  11750. const T16 v16_;
  11751. const T17 v17_;
  11752. const T18 v18_;
  11753. const T19 v19_;
  11754. const T20 v20_;
  11755. const T21 v21_;
  11756. const T22 v22_;
  11757. const T23 v23_;
  11758. const T24 v24_;
  11759. const T25 v25_;
  11760. const T26 v26_;
  11761. const T27 v27_;
  11762. const T28 v28_;
  11763. const T29 v29_;
  11764. const T30 v30_;
  11765. const T31 v31_;
  11766. const T32 v32_;
  11767. const T33 v33_;
  11768. const T34 v34_;
  11769. const T35 v35_;
  11770. const T36 v36_;
  11771. const T37 v37_;
  11772. const T38 v38_;
  11773. const T39 v39_;
  11774. const T40 v40_;
  11775. const T41 v41_;
  11776. const T42 v42_;
  11777. const T43 v43_;
  11778. };
  11779. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11780. typename T6, typename T7, typename T8, typename T9, typename T10,
  11781. typename T11, typename T12, typename T13, typename T14, typename T15,
  11782. typename T16, typename T17, typename T18, typename T19, typename T20,
  11783. typename T21, typename T22, typename T23, typename T24, typename T25,
  11784. typename T26, typename T27, typename T28, typename T29, typename T30,
  11785. typename T31, typename T32, typename T33, typename T34, typename T35,
  11786. typename T36, typename T37, typename T38, typename T39, typename T40,
  11787. typename T41, typename T42, typename T43, typename T44>
  11788. class ValueArray44 {
  11789. public:
  11790. ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11791. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11792. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11793. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11794. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11795. T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  11796. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  11797. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  11798. v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
  11799. v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
  11800. v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
  11801. v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
  11802. v43_(v43), v44_(v44) {}
  11803. template <typename T>
  11804. operator ParamGenerator<T>() const {
  11805. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11806. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11807. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11808. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11809. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11810. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11811. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11812. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11813. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  11814. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  11815. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  11816. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  11817. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  11818. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  11819. static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_)};
  11820. return ValuesIn(array);
  11821. }
  11822. private:
  11823. // No implementation - assignment is unsupported.
  11824. void operator=(const ValueArray44& other);
  11825. const T1 v1_;
  11826. const T2 v2_;
  11827. const T3 v3_;
  11828. const T4 v4_;
  11829. const T5 v5_;
  11830. const T6 v6_;
  11831. const T7 v7_;
  11832. const T8 v8_;
  11833. const T9 v9_;
  11834. const T10 v10_;
  11835. const T11 v11_;
  11836. const T12 v12_;
  11837. const T13 v13_;
  11838. const T14 v14_;
  11839. const T15 v15_;
  11840. const T16 v16_;
  11841. const T17 v17_;
  11842. const T18 v18_;
  11843. const T19 v19_;
  11844. const T20 v20_;
  11845. const T21 v21_;
  11846. const T22 v22_;
  11847. const T23 v23_;
  11848. const T24 v24_;
  11849. const T25 v25_;
  11850. const T26 v26_;
  11851. const T27 v27_;
  11852. const T28 v28_;
  11853. const T29 v29_;
  11854. const T30 v30_;
  11855. const T31 v31_;
  11856. const T32 v32_;
  11857. const T33 v33_;
  11858. const T34 v34_;
  11859. const T35 v35_;
  11860. const T36 v36_;
  11861. const T37 v37_;
  11862. const T38 v38_;
  11863. const T39 v39_;
  11864. const T40 v40_;
  11865. const T41 v41_;
  11866. const T42 v42_;
  11867. const T43 v43_;
  11868. const T44 v44_;
  11869. };
  11870. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11871. typename T6, typename T7, typename T8, typename T9, typename T10,
  11872. typename T11, typename T12, typename T13, typename T14, typename T15,
  11873. typename T16, typename T17, typename T18, typename T19, typename T20,
  11874. typename T21, typename T22, typename T23, typename T24, typename T25,
  11875. typename T26, typename T27, typename T28, typename T29, typename T30,
  11876. typename T31, typename T32, typename T33, typename T34, typename T35,
  11877. typename T36, typename T37, typename T38, typename T39, typename T40,
  11878. typename T41, typename T42, typename T43, typename T44, typename T45>
  11879. class ValueArray45 {
  11880. public:
  11881. ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11882. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11883. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11884. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11885. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11886. T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  11887. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  11888. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  11889. v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
  11890. v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
  11891. v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
  11892. v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
  11893. v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
  11894. template <typename T>
  11895. operator ParamGenerator<T>() const {
  11896. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11897. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11898. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11899. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11900. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11901. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11902. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11903. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11904. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  11905. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  11906. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  11907. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  11908. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  11909. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  11910. static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
  11911. static_cast<T>(v45_)};
  11912. return ValuesIn(array);
  11913. }
  11914. private:
  11915. // No implementation - assignment is unsupported.
  11916. void operator=(const ValueArray45& other);
  11917. const T1 v1_;
  11918. const T2 v2_;
  11919. const T3 v3_;
  11920. const T4 v4_;
  11921. const T5 v5_;
  11922. const T6 v6_;
  11923. const T7 v7_;
  11924. const T8 v8_;
  11925. const T9 v9_;
  11926. const T10 v10_;
  11927. const T11 v11_;
  11928. const T12 v12_;
  11929. const T13 v13_;
  11930. const T14 v14_;
  11931. const T15 v15_;
  11932. const T16 v16_;
  11933. const T17 v17_;
  11934. const T18 v18_;
  11935. const T19 v19_;
  11936. const T20 v20_;
  11937. const T21 v21_;
  11938. const T22 v22_;
  11939. const T23 v23_;
  11940. const T24 v24_;
  11941. const T25 v25_;
  11942. const T26 v26_;
  11943. const T27 v27_;
  11944. const T28 v28_;
  11945. const T29 v29_;
  11946. const T30 v30_;
  11947. const T31 v31_;
  11948. const T32 v32_;
  11949. const T33 v33_;
  11950. const T34 v34_;
  11951. const T35 v35_;
  11952. const T36 v36_;
  11953. const T37 v37_;
  11954. const T38 v38_;
  11955. const T39 v39_;
  11956. const T40 v40_;
  11957. const T41 v41_;
  11958. const T42 v42_;
  11959. const T43 v43_;
  11960. const T44 v44_;
  11961. const T45 v45_;
  11962. };
  11963. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11964. typename T6, typename T7, typename T8, typename T9, typename T10,
  11965. typename T11, typename T12, typename T13, typename T14, typename T15,
  11966. typename T16, typename T17, typename T18, typename T19, typename T20,
  11967. typename T21, typename T22, typename T23, typename T24, typename T25,
  11968. typename T26, typename T27, typename T28, typename T29, typename T30,
  11969. typename T31, typename T32, typename T33, typename T34, typename T35,
  11970. typename T36, typename T37, typename T38, typename T39, typename T40,
  11971. typename T41, typename T42, typename T43, typename T44, typename T45,
  11972. typename T46>
  11973. class ValueArray46 {
  11974. public:
  11975. ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11976. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11977. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11978. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11979. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11980. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
  11981. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11982. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  11983. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  11984. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  11985. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  11986. v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
  11987. v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
  11988. template <typename T>
  11989. operator ParamGenerator<T>() const {
  11990. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11991. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11992. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11993. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11994. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11995. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11996. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11997. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11998. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  11999. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12000. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12001. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  12002. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  12003. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  12004. static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
  12005. static_cast<T>(v45_), static_cast<T>(v46_)};
  12006. return ValuesIn(array);
  12007. }
  12008. private:
  12009. // No implementation - assignment is unsupported.
  12010. void operator=(const ValueArray46& other);
  12011. const T1 v1_;
  12012. const T2 v2_;
  12013. const T3 v3_;
  12014. const T4 v4_;
  12015. const T5 v5_;
  12016. const T6 v6_;
  12017. const T7 v7_;
  12018. const T8 v8_;
  12019. const T9 v9_;
  12020. const T10 v10_;
  12021. const T11 v11_;
  12022. const T12 v12_;
  12023. const T13 v13_;
  12024. const T14 v14_;
  12025. const T15 v15_;
  12026. const T16 v16_;
  12027. const T17 v17_;
  12028. const T18 v18_;
  12029. const T19 v19_;
  12030. const T20 v20_;
  12031. const T21 v21_;
  12032. const T22 v22_;
  12033. const T23 v23_;
  12034. const T24 v24_;
  12035. const T25 v25_;
  12036. const T26 v26_;
  12037. const T27 v27_;
  12038. const T28 v28_;
  12039. const T29 v29_;
  12040. const T30 v30_;
  12041. const T31 v31_;
  12042. const T32 v32_;
  12043. const T33 v33_;
  12044. const T34 v34_;
  12045. const T35 v35_;
  12046. const T36 v36_;
  12047. const T37 v37_;
  12048. const T38 v38_;
  12049. const T39 v39_;
  12050. const T40 v40_;
  12051. const T41 v41_;
  12052. const T42 v42_;
  12053. const T43 v43_;
  12054. const T44 v44_;
  12055. const T45 v45_;
  12056. const T46 v46_;
  12057. };
  12058. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12059. typename T6, typename T7, typename T8, typename T9, typename T10,
  12060. typename T11, typename T12, typename T13, typename T14, typename T15,
  12061. typename T16, typename T17, typename T18, typename T19, typename T20,
  12062. typename T21, typename T22, typename T23, typename T24, typename T25,
  12063. typename T26, typename T27, typename T28, typename T29, typename T30,
  12064. typename T31, typename T32, typename T33, typename T34, typename T35,
  12065. typename T36, typename T37, typename T38, typename T39, typename T40,
  12066. typename T41, typename T42, typename T43, typename T44, typename T45,
  12067. typename T46, typename T47>
  12068. class ValueArray47 {
  12069. public:
  12070. ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12071. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12072. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12073. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12074. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  12075. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
  12076. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  12077. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  12078. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  12079. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  12080. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  12081. v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
  12082. v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
  12083. v47_(v47) {}
  12084. template <typename T>
  12085. operator ParamGenerator<T>() const {
  12086. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12087. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12088. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12089. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12090. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12091. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12092. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12093. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12094. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12095. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12096. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12097. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  12098. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  12099. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  12100. static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
  12101. static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_)};
  12102. return ValuesIn(array);
  12103. }
  12104. private:
  12105. // No implementation - assignment is unsupported.
  12106. void operator=(const ValueArray47& other);
  12107. const T1 v1_;
  12108. const T2 v2_;
  12109. const T3 v3_;
  12110. const T4 v4_;
  12111. const T5 v5_;
  12112. const T6 v6_;
  12113. const T7 v7_;
  12114. const T8 v8_;
  12115. const T9 v9_;
  12116. const T10 v10_;
  12117. const T11 v11_;
  12118. const T12 v12_;
  12119. const T13 v13_;
  12120. const T14 v14_;
  12121. const T15 v15_;
  12122. const T16 v16_;
  12123. const T17 v17_;
  12124. const T18 v18_;
  12125. const T19 v19_;
  12126. const T20 v20_;
  12127. const T21 v21_;
  12128. const T22 v22_;
  12129. const T23 v23_;
  12130. const T24 v24_;
  12131. const T25 v25_;
  12132. const T26 v26_;
  12133. const T27 v27_;
  12134. const T28 v28_;
  12135. const T29 v29_;
  12136. const T30 v30_;
  12137. const T31 v31_;
  12138. const T32 v32_;
  12139. const T33 v33_;
  12140. const T34 v34_;
  12141. const T35 v35_;
  12142. const T36 v36_;
  12143. const T37 v37_;
  12144. const T38 v38_;
  12145. const T39 v39_;
  12146. const T40 v40_;
  12147. const T41 v41_;
  12148. const T42 v42_;
  12149. const T43 v43_;
  12150. const T44 v44_;
  12151. const T45 v45_;
  12152. const T46 v46_;
  12153. const T47 v47_;
  12154. };
  12155. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12156. typename T6, typename T7, typename T8, typename T9, typename T10,
  12157. typename T11, typename T12, typename T13, typename T14, typename T15,
  12158. typename T16, typename T17, typename T18, typename T19, typename T20,
  12159. typename T21, typename T22, typename T23, typename T24, typename T25,
  12160. typename T26, typename T27, typename T28, typename T29, typename T30,
  12161. typename T31, typename T32, typename T33, typename T34, typename T35,
  12162. typename T36, typename T37, typename T38, typename T39, typename T40,
  12163. typename T41, typename T42, typename T43, typename T44, typename T45,
  12164. typename T46, typename T47, typename T48>
  12165. class ValueArray48 {
  12166. public:
  12167. ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12168. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12169. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12170. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12171. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  12172. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
  12173. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  12174. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  12175. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  12176. v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
  12177. v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
  12178. v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
  12179. v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
  12180. v46_(v46), v47_(v47), v48_(v48) {}
  12181. template <typename T>
  12182. operator ParamGenerator<T>() const {
  12183. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12184. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12185. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12186. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12187. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12188. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12189. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12190. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12191. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12192. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12193. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12194. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  12195. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  12196. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  12197. static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
  12198. static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
  12199. static_cast<T>(v48_)};
  12200. return ValuesIn(array);
  12201. }
  12202. private:
  12203. // No implementation - assignment is unsupported.
  12204. void operator=(const ValueArray48& other);
  12205. const T1 v1_;
  12206. const T2 v2_;
  12207. const T3 v3_;
  12208. const T4 v4_;
  12209. const T5 v5_;
  12210. const T6 v6_;
  12211. const T7 v7_;
  12212. const T8 v8_;
  12213. const T9 v9_;
  12214. const T10 v10_;
  12215. const T11 v11_;
  12216. const T12 v12_;
  12217. const T13 v13_;
  12218. const T14 v14_;
  12219. const T15 v15_;
  12220. const T16 v16_;
  12221. const T17 v17_;
  12222. const T18 v18_;
  12223. const T19 v19_;
  12224. const T20 v20_;
  12225. const T21 v21_;
  12226. const T22 v22_;
  12227. const T23 v23_;
  12228. const T24 v24_;
  12229. const T25 v25_;
  12230. const T26 v26_;
  12231. const T27 v27_;
  12232. const T28 v28_;
  12233. const T29 v29_;
  12234. const T30 v30_;
  12235. const T31 v31_;
  12236. const T32 v32_;
  12237. const T33 v33_;
  12238. const T34 v34_;
  12239. const T35 v35_;
  12240. const T36 v36_;
  12241. const T37 v37_;
  12242. const T38 v38_;
  12243. const T39 v39_;
  12244. const T40 v40_;
  12245. const T41 v41_;
  12246. const T42 v42_;
  12247. const T43 v43_;
  12248. const T44 v44_;
  12249. const T45 v45_;
  12250. const T46 v46_;
  12251. const T47 v47_;
  12252. const T48 v48_;
  12253. };
  12254. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12255. typename T6, typename T7, typename T8, typename T9, typename T10,
  12256. typename T11, typename T12, typename T13, typename T14, typename T15,
  12257. typename T16, typename T17, typename T18, typename T19, typename T20,
  12258. typename T21, typename T22, typename T23, typename T24, typename T25,
  12259. typename T26, typename T27, typename T28, typename T29, typename T30,
  12260. typename T31, typename T32, typename T33, typename T34, typename T35,
  12261. typename T36, typename T37, typename T38, typename T39, typename T40,
  12262. typename T41, typename T42, typename T43, typename T44, typename T45,
  12263. typename T46, typename T47, typename T48, typename T49>
  12264. class ValueArray49 {
  12265. public:
  12266. ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12267. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12268. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12269. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12270. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  12271. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
  12272. T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  12273. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  12274. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  12275. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  12276. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  12277. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  12278. v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
  12279. v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
  12280. template <typename T>
  12281. operator ParamGenerator<T>() const {
  12282. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12283. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12284. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12285. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12286. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12287. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12288. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12289. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12290. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12291. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12292. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12293. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  12294. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  12295. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  12296. static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
  12297. static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
  12298. static_cast<T>(v48_), static_cast<T>(v49_)};
  12299. return ValuesIn(array);
  12300. }
  12301. private:
  12302. // No implementation - assignment is unsupported.
  12303. void operator=(const ValueArray49& other);
  12304. const T1 v1_;
  12305. const T2 v2_;
  12306. const T3 v3_;
  12307. const T4 v4_;
  12308. const T5 v5_;
  12309. const T6 v6_;
  12310. const T7 v7_;
  12311. const T8 v8_;
  12312. const T9 v9_;
  12313. const T10 v10_;
  12314. const T11 v11_;
  12315. const T12 v12_;
  12316. const T13 v13_;
  12317. const T14 v14_;
  12318. const T15 v15_;
  12319. const T16 v16_;
  12320. const T17 v17_;
  12321. const T18 v18_;
  12322. const T19 v19_;
  12323. const T20 v20_;
  12324. const T21 v21_;
  12325. const T22 v22_;
  12326. const T23 v23_;
  12327. const T24 v24_;
  12328. const T25 v25_;
  12329. const T26 v26_;
  12330. const T27 v27_;
  12331. const T28 v28_;
  12332. const T29 v29_;
  12333. const T30 v30_;
  12334. const T31 v31_;
  12335. const T32 v32_;
  12336. const T33 v33_;
  12337. const T34 v34_;
  12338. const T35 v35_;
  12339. const T36 v36_;
  12340. const T37 v37_;
  12341. const T38 v38_;
  12342. const T39 v39_;
  12343. const T40 v40_;
  12344. const T41 v41_;
  12345. const T42 v42_;
  12346. const T43 v43_;
  12347. const T44 v44_;
  12348. const T45 v45_;
  12349. const T46 v46_;
  12350. const T47 v47_;
  12351. const T48 v48_;
  12352. const T49 v49_;
  12353. };
  12354. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12355. typename T6, typename T7, typename T8, typename T9, typename T10,
  12356. typename T11, typename T12, typename T13, typename T14, typename T15,
  12357. typename T16, typename T17, typename T18, typename T19, typename T20,
  12358. typename T21, typename T22, typename T23, typename T24, typename T25,
  12359. typename T26, typename T27, typename T28, typename T29, typename T30,
  12360. typename T31, typename T32, typename T33, typename T34, typename T35,
  12361. typename T36, typename T37, typename T38, typename T39, typename T40,
  12362. typename T41, typename T42, typename T43, typename T44, typename T45,
  12363. typename T46, typename T47, typename T48, typename T49, typename T50>
  12364. class ValueArray50 {
  12365. public:
  12366. ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12367. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12368. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12369. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12370. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  12371. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
  12372. T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  12373. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  12374. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  12375. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  12376. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  12377. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  12378. v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
  12379. v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
  12380. template <typename T>
  12381. operator ParamGenerator<T>() const {
  12382. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12383. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12384. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12385. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12386. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12387. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12388. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12389. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12390. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12391. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12392. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12393. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  12394. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  12395. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  12396. static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
  12397. static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
  12398. static_cast<T>(v48_), static_cast<T>(v49_), static_cast<T>(v50_)};
  12399. return ValuesIn(array);
  12400. }
  12401. private:
  12402. // No implementation - assignment is unsupported.
  12403. void operator=(const ValueArray50& other);
  12404. const T1 v1_;
  12405. const T2 v2_;
  12406. const T3 v3_;
  12407. const T4 v4_;
  12408. const T5 v5_;
  12409. const T6 v6_;
  12410. const T7 v7_;
  12411. const T8 v8_;
  12412. const T9 v9_;
  12413. const T10 v10_;
  12414. const T11 v11_;
  12415. const T12 v12_;
  12416. const T13 v13_;
  12417. const T14 v14_;
  12418. const T15 v15_;
  12419. const T16 v16_;
  12420. const T17 v17_;
  12421. const T18 v18_;
  12422. const T19 v19_;
  12423. const T20 v20_;
  12424. const T21 v21_;
  12425. const T22 v22_;
  12426. const T23 v23_;
  12427. const T24 v24_;
  12428. const T25 v25_;
  12429. const T26 v26_;
  12430. const T27 v27_;
  12431. const T28 v28_;
  12432. const T29 v29_;
  12433. const T30 v30_;
  12434. const T31 v31_;
  12435. const T32 v32_;
  12436. const T33 v33_;
  12437. const T34 v34_;
  12438. const T35 v35_;
  12439. const T36 v36_;
  12440. const T37 v37_;
  12441. const T38 v38_;
  12442. const T39 v39_;
  12443. const T40 v40_;
  12444. const T41 v41_;
  12445. const T42 v42_;
  12446. const T43 v43_;
  12447. const T44 v44_;
  12448. const T45 v45_;
  12449. const T46 v46_;
  12450. const T47 v47_;
  12451. const T48 v48_;
  12452. const T49 v49_;
  12453. const T50 v50_;
  12454. };
  12455. # if GTEST_HAS_COMBINE
  12456. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  12457. //
  12458. // Generates values from the Cartesian product of values produced
  12459. // by the argument generators.
  12460. //
  12461. template <typename T1, typename T2>
  12462. class CartesianProductGenerator2
  12463. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {
  12464. public:
  12465. typedef ::std::tr1::tuple<T1, T2> ParamType;
  12466. CartesianProductGenerator2(const ParamGenerator<T1>& g1,
  12467. const ParamGenerator<T2>& g2)
  12468. : g1_(g1), g2_(g2) {}
  12469. virtual ~CartesianProductGenerator2() {}
  12470. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12471. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
  12472. }
  12473. virtual ParamIteratorInterface<ParamType>* End() const {
  12474. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
  12475. }
  12476. private:
  12477. class Iterator : public ParamIteratorInterface<ParamType> {
  12478. public:
  12479. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12480. const ParamGenerator<T1>& g1,
  12481. const typename ParamGenerator<T1>::iterator& current1,
  12482. const ParamGenerator<T2>& g2,
  12483. const typename ParamGenerator<T2>::iterator& current2)
  12484. : base_(base),
  12485. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12486. begin2_(g2.begin()), end2_(g2.end()), current2_(current2) {
  12487. ComputeCurrentValue();
  12488. }
  12489. virtual ~Iterator() {}
  12490. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12491. return base_;
  12492. }
  12493. // Advance should not be called on beyond-of-range iterators
  12494. // so no component iterators must be beyond end of range, either.
  12495. virtual void Advance() {
  12496. assert(!AtEnd());
  12497. ++current2_;
  12498. if (current2_ == end2_) {
  12499. current2_ = begin2_;
  12500. ++current1_;
  12501. }
  12502. ComputeCurrentValue();
  12503. }
  12504. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12505. return new Iterator(*this);
  12506. }
  12507. virtual const ParamType* Current() const { return &current_value_; }
  12508. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12509. // Having the same base generator guarantees that the other
  12510. // iterator is of the same type and we can downcast.
  12511. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12512. << "The program attempted to compare iterators "
  12513. << "from different generators." << std::endl;
  12514. const Iterator* typed_other =
  12515. CheckedDowncastToActualType<const Iterator>(&other);
  12516. // We must report iterators equal if they both point beyond their
  12517. // respective ranges. That can happen in a variety of fashions,
  12518. // so we have to consult AtEnd().
  12519. return (AtEnd() && typed_other->AtEnd()) ||
  12520. (
  12521. current1_ == typed_other->current1_ &&
  12522. current2_ == typed_other->current2_);
  12523. }
  12524. private:
  12525. Iterator(const Iterator& other)
  12526. : base_(other.base_),
  12527. begin1_(other.begin1_),
  12528. end1_(other.end1_),
  12529. current1_(other.current1_),
  12530. begin2_(other.begin2_),
  12531. end2_(other.end2_),
  12532. current2_(other.current2_) {
  12533. ComputeCurrentValue();
  12534. }
  12535. void ComputeCurrentValue() {
  12536. if (!AtEnd())
  12537. current_value_ = ParamType(*current1_, *current2_);
  12538. }
  12539. bool AtEnd() const {
  12540. // We must report iterator past the end of the range when either of the
  12541. // component iterators has reached the end of its range.
  12542. return
  12543. current1_ == end1_ ||
  12544. current2_ == end2_;
  12545. }
  12546. // No implementation - assignment is unsupported.
  12547. void operator=(const Iterator& other);
  12548. const ParamGeneratorInterface<ParamType>* const base_;
  12549. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12550. // current[i]_ is the actual traversing iterator.
  12551. const typename ParamGenerator<T1>::iterator begin1_;
  12552. const typename ParamGenerator<T1>::iterator end1_;
  12553. typename ParamGenerator<T1>::iterator current1_;
  12554. const typename ParamGenerator<T2>::iterator begin2_;
  12555. const typename ParamGenerator<T2>::iterator end2_;
  12556. typename ParamGenerator<T2>::iterator current2_;
  12557. ParamType current_value_;
  12558. }; // class CartesianProductGenerator2::Iterator
  12559. // No implementation - assignment is unsupported.
  12560. void operator=(const CartesianProductGenerator2& other);
  12561. const ParamGenerator<T1> g1_;
  12562. const ParamGenerator<T2> g2_;
  12563. }; // class CartesianProductGenerator2
  12564. template <typename T1, typename T2, typename T3>
  12565. class CartesianProductGenerator3
  12566. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {
  12567. public:
  12568. typedef ::std::tr1::tuple<T1, T2, T3> ParamType;
  12569. CartesianProductGenerator3(const ParamGenerator<T1>& g1,
  12570. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
  12571. : g1_(g1), g2_(g2), g3_(g3) {}
  12572. virtual ~CartesianProductGenerator3() {}
  12573. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12574. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12575. g3_.begin());
  12576. }
  12577. virtual ParamIteratorInterface<ParamType>* End() const {
  12578. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
  12579. }
  12580. private:
  12581. class Iterator : public ParamIteratorInterface<ParamType> {
  12582. public:
  12583. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12584. const ParamGenerator<T1>& g1,
  12585. const typename ParamGenerator<T1>::iterator& current1,
  12586. const ParamGenerator<T2>& g2,
  12587. const typename ParamGenerator<T2>::iterator& current2,
  12588. const ParamGenerator<T3>& g3,
  12589. const typename ParamGenerator<T3>::iterator& current3)
  12590. : base_(base),
  12591. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12592. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  12593. begin3_(g3.begin()), end3_(g3.end()), current3_(current3) {
  12594. ComputeCurrentValue();
  12595. }
  12596. virtual ~Iterator() {}
  12597. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12598. return base_;
  12599. }
  12600. // Advance should not be called on beyond-of-range iterators
  12601. // so no component iterators must be beyond end of range, either.
  12602. virtual void Advance() {
  12603. assert(!AtEnd());
  12604. ++current3_;
  12605. if (current3_ == end3_) {
  12606. current3_ = begin3_;
  12607. ++current2_;
  12608. }
  12609. if (current2_ == end2_) {
  12610. current2_ = begin2_;
  12611. ++current1_;
  12612. }
  12613. ComputeCurrentValue();
  12614. }
  12615. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12616. return new Iterator(*this);
  12617. }
  12618. virtual const ParamType* Current() const { return &current_value_; }
  12619. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12620. // Having the same base generator guarantees that the other
  12621. // iterator is of the same type and we can downcast.
  12622. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12623. << "The program attempted to compare iterators "
  12624. << "from different generators." << std::endl;
  12625. const Iterator* typed_other =
  12626. CheckedDowncastToActualType<const Iterator>(&other);
  12627. // We must report iterators equal if they both point beyond their
  12628. // respective ranges. That can happen in a variety of fashions,
  12629. // so we have to consult AtEnd().
  12630. return (AtEnd() && typed_other->AtEnd()) ||
  12631. (
  12632. current1_ == typed_other->current1_ &&
  12633. current2_ == typed_other->current2_ &&
  12634. current3_ == typed_other->current3_);
  12635. }
  12636. private:
  12637. Iterator(const Iterator& other)
  12638. : base_(other.base_),
  12639. begin1_(other.begin1_),
  12640. end1_(other.end1_),
  12641. current1_(other.current1_),
  12642. begin2_(other.begin2_),
  12643. end2_(other.end2_),
  12644. current2_(other.current2_),
  12645. begin3_(other.begin3_),
  12646. end3_(other.end3_),
  12647. current3_(other.current3_) {
  12648. ComputeCurrentValue();
  12649. }
  12650. void ComputeCurrentValue() {
  12651. if (!AtEnd())
  12652. current_value_ = ParamType(*current1_, *current2_, *current3_);
  12653. }
  12654. bool AtEnd() const {
  12655. // We must report iterator past the end of the range when either of the
  12656. // component iterators has reached the end of its range.
  12657. return
  12658. current1_ == end1_ ||
  12659. current2_ == end2_ ||
  12660. current3_ == end3_;
  12661. }
  12662. // No implementation - assignment is unsupported.
  12663. void operator=(const Iterator& other);
  12664. const ParamGeneratorInterface<ParamType>* const base_;
  12665. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12666. // current[i]_ is the actual traversing iterator.
  12667. const typename ParamGenerator<T1>::iterator begin1_;
  12668. const typename ParamGenerator<T1>::iterator end1_;
  12669. typename ParamGenerator<T1>::iterator current1_;
  12670. const typename ParamGenerator<T2>::iterator begin2_;
  12671. const typename ParamGenerator<T2>::iterator end2_;
  12672. typename ParamGenerator<T2>::iterator current2_;
  12673. const typename ParamGenerator<T3>::iterator begin3_;
  12674. const typename ParamGenerator<T3>::iterator end3_;
  12675. typename ParamGenerator<T3>::iterator current3_;
  12676. ParamType current_value_;
  12677. }; // class CartesianProductGenerator3::Iterator
  12678. // No implementation - assignment is unsupported.
  12679. void operator=(const CartesianProductGenerator3& other);
  12680. const ParamGenerator<T1> g1_;
  12681. const ParamGenerator<T2> g2_;
  12682. const ParamGenerator<T3> g3_;
  12683. }; // class CartesianProductGenerator3
  12684. template <typename T1, typename T2, typename T3, typename T4>
  12685. class CartesianProductGenerator4
  12686. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {
  12687. public:
  12688. typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;
  12689. CartesianProductGenerator4(const ParamGenerator<T1>& g1,
  12690. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  12691. const ParamGenerator<T4>& g4)
  12692. : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
  12693. virtual ~CartesianProductGenerator4() {}
  12694. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12695. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12696. g3_.begin(), g4_, g4_.begin());
  12697. }
  12698. virtual ParamIteratorInterface<ParamType>* End() const {
  12699. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  12700. g4_, g4_.end());
  12701. }
  12702. private:
  12703. class Iterator : public ParamIteratorInterface<ParamType> {
  12704. public:
  12705. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12706. const ParamGenerator<T1>& g1,
  12707. const typename ParamGenerator<T1>::iterator& current1,
  12708. const ParamGenerator<T2>& g2,
  12709. const typename ParamGenerator<T2>::iterator& current2,
  12710. const ParamGenerator<T3>& g3,
  12711. const typename ParamGenerator<T3>::iterator& current3,
  12712. const ParamGenerator<T4>& g4,
  12713. const typename ParamGenerator<T4>::iterator& current4)
  12714. : base_(base),
  12715. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12716. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  12717. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  12718. begin4_(g4.begin()), end4_(g4.end()), current4_(current4) {
  12719. ComputeCurrentValue();
  12720. }
  12721. virtual ~Iterator() {}
  12722. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12723. return base_;
  12724. }
  12725. // Advance should not be called on beyond-of-range iterators
  12726. // so no component iterators must be beyond end of range, either.
  12727. virtual void Advance() {
  12728. assert(!AtEnd());
  12729. ++current4_;
  12730. if (current4_ == end4_) {
  12731. current4_ = begin4_;
  12732. ++current3_;
  12733. }
  12734. if (current3_ == end3_) {
  12735. current3_ = begin3_;
  12736. ++current2_;
  12737. }
  12738. if (current2_ == end2_) {
  12739. current2_ = begin2_;
  12740. ++current1_;
  12741. }
  12742. ComputeCurrentValue();
  12743. }
  12744. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12745. return new Iterator(*this);
  12746. }
  12747. virtual const ParamType* Current() const { return &current_value_; }
  12748. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12749. // Having the same base generator guarantees that the other
  12750. // iterator is of the same type and we can downcast.
  12751. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12752. << "The program attempted to compare iterators "
  12753. << "from different generators." << std::endl;
  12754. const Iterator* typed_other =
  12755. CheckedDowncastToActualType<const Iterator>(&other);
  12756. // We must report iterators equal if they both point beyond their
  12757. // respective ranges. That can happen in a variety of fashions,
  12758. // so we have to consult AtEnd().
  12759. return (AtEnd() && typed_other->AtEnd()) ||
  12760. (
  12761. current1_ == typed_other->current1_ &&
  12762. current2_ == typed_other->current2_ &&
  12763. current3_ == typed_other->current3_ &&
  12764. current4_ == typed_other->current4_);
  12765. }
  12766. private:
  12767. Iterator(const Iterator& other)
  12768. : base_(other.base_),
  12769. begin1_(other.begin1_),
  12770. end1_(other.end1_),
  12771. current1_(other.current1_),
  12772. begin2_(other.begin2_),
  12773. end2_(other.end2_),
  12774. current2_(other.current2_),
  12775. begin3_(other.begin3_),
  12776. end3_(other.end3_),
  12777. current3_(other.current3_),
  12778. begin4_(other.begin4_),
  12779. end4_(other.end4_),
  12780. current4_(other.current4_) {
  12781. ComputeCurrentValue();
  12782. }
  12783. void ComputeCurrentValue() {
  12784. if (!AtEnd())
  12785. current_value_ = ParamType(*current1_, *current2_, *current3_,
  12786. *current4_);
  12787. }
  12788. bool AtEnd() const {
  12789. // We must report iterator past the end of the range when either of the
  12790. // component iterators has reached the end of its range.
  12791. return
  12792. current1_ == end1_ ||
  12793. current2_ == end2_ ||
  12794. current3_ == end3_ ||
  12795. current4_ == end4_;
  12796. }
  12797. // No implementation - assignment is unsupported.
  12798. void operator=(const Iterator& other);
  12799. const ParamGeneratorInterface<ParamType>* const base_;
  12800. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12801. // current[i]_ is the actual traversing iterator.
  12802. const typename ParamGenerator<T1>::iterator begin1_;
  12803. const typename ParamGenerator<T1>::iterator end1_;
  12804. typename ParamGenerator<T1>::iterator current1_;
  12805. const typename ParamGenerator<T2>::iterator begin2_;
  12806. const typename ParamGenerator<T2>::iterator end2_;
  12807. typename ParamGenerator<T2>::iterator current2_;
  12808. const typename ParamGenerator<T3>::iterator begin3_;
  12809. const typename ParamGenerator<T3>::iterator end3_;
  12810. typename ParamGenerator<T3>::iterator current3_;
  12811. const typename ParamGenerator<T4>::iterator begin4_;
  12812. const typename ParamGenerator<T4>::iterator end4_;
  12813. typename ParamGenerator<T4>::iterator current4_;
  12814. ParamType current_value_;
  12815. }; // class CartesianProductGenerator4::Iterator
  12816. // No implementation - assignment is unsupported.
  12817. void operator=(const CartesianProductGenerator4& other);
  12818. const ParamGenerator<T1> g1_;
  12819. const ParamGenerator<T2> g2_;
  12820. const ParamGenerator<T3> g3_;
  12821. const ParamGenerator<T4> g4_;
  12822. }; // class CartesianProductGenerator4
  12823. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  12824. class CartesianProductGenerator5
  12825. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {
  12826. public:
  12827. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;
  12828. CartesianProductGenerator5(const ParamGenerator<T1>& g1,
  12829. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  12830. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
  12831. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
  12832. virtual ~CartesianProductGenerator5() {}
  12833. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12834. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12835. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
  12836. }
  12837. virtual ParamIteratorInterface<ParamType>* End() const {
  12838. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  12839. g4_, g4_.end(), g5_, g5_.end());
  12840. }
  12841. private:
  12842. class Iterator : public ParamIteratorInterface<ParamType> {
  12843. public:
  12844. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12845. const ParamGenerator<T1>& g1,
  12846. const typename ParamGenerator<T1>::iterator& current1,
  12847. const ParamGenerator<T2>& g2,
  12848. const typename ParamGenerator<T2>::iterator& current2,
  12849. const ParamGenerator<T3>& g3,
  12850. const typename ParamGenerator<T3>::iterator& current3,
  12851. const ParamGenerator<T4>& g4,
  12852. const typename ParamGenerator<T4>::iterator& current4,
  12853. const ParamGenerator<T5>& g5,
  12854. const typename ParamGenerator<T5>::iterator& current5)
  12855. : base_(base),
  12856. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12857. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  12858. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  12859. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  12860. begin5_(g5.begin()), end5_(g5.end()), current5_(current5) {
  12861. ComputeCurrentValue();
  12862. }
  12863. virtual ~Iterator() {}
  12864. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12865. return base_;
  12866. }
  12867. // Advance should not be called on beyond-of-range iterators
  12868. // so no component iterators must be beyond end of range, either.
  12869. virtual void Advance() {
  12870. assert(!AtEnd());
  12871. ++current5_;
  12872. if (current5_ == end5_) {
  12873. current5_ = begin5_;
  12874. ++current4_;
  12875. }
  12876. if (current4_ == end4_) {
  12877. current4_ = begin4_;
  12878. ++current3_;
  12879. }
  12880. if (current3_ == end3_) {
  12881. current3_ = begin3_;
  12882. ++current2_;
  12883. }
  12884. if (current2_ == end2_) {
  12885. current2_ = begin2_;
  12886. ++current1_;
  12887. }
  12888. ComputeCurrentValue();
  12889. }
  12890. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12891. return new Iterator(*this);
  12892. }
  12893. virtual const ParamType* Current() const { return &current_value_; }
  12894. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12895. // Having the same base generator guarantees that the other
  12896. // iterator is of the same type and we can downcast.
  12897. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12898. << "The program attempted to compare iterators "
  12899. << "from different generators." << std::endl;
  12900. const Iterator* typed_other =
  12901. CheckedDowncastToActualType<const Iterator>(&other);
  12902. // We must report iterators equal if they both point beyond their
  12903. // respective ranges. That can happen in a variety of fashions,
  12904. // so we have to consult AtEnd().
  12905. return (AtEnd() && typed_other->AtEnd()) ||
  12906. (
  12907. current1_ == typed_other->current1_ &&
  12908. current2_ == typed_other->current2_ &&
  12909. current3_ == typed_other->current3_ &&
  12910. current4_ == typed_other->current4_ &&
  12911. current5_ == typed_other->current5_);
  12912. }
  12913. private:
  12914. Iterator(const Iterator& other)
  12915. : base_(other.base_),
  12916. begin1_(other.begin1_),
  12917. end1_(other.end1_),
  12918. current1_(other.current1_),
  12919. begin2_(other.begin2_),
  12920. end2_(other.end2_),
  12921. current2_(other.current2_),
  12922. begin3_(other.begin3_),
  12923. end3_(other.end3_),
  12924. current3_(other.current3_),
  12925. begin4_(other.begin4_),
  12926. end4_(other.end4_),
  12927. current4_(other.current4_),
  12928. begin5_(other.begin5_),
  12929. end5_(other.end5_),
  12930. current5_(other.current5_) {
  12931. ComputeCurrentValue();
  12932. }
  12933. void ComputeCurrentValue() {
  12934. if (!AtEnd())
  12935. current_value_ = ParamType(*current1_, *current2_, *current3_,
  12936. *current4_, *current5_);
  12937. }
  12938. bool AtEnd() const {
  12939. // We must report iterator past the end of the range when either of the
  12940. // component iterators has reached the end of its range.
  12941. return
  12942. current1_ == end1_ ||
  12943. current2_ == end2_ ||
  12944. current3_ == end3_ ||
  12945. current4_ == end4_ ||
  12946. current5_ == end5_;
  12947. }
  12948. // No implementation - assignment is unsupported.
  12949. void operator=(const Iterator& other);
  12950. const ParamGeneratorInterface<ParamType>* const base_;
  12951. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12952. // current[i]_ is the actual traversing iterator.
  12953. const typename ParamGenerator<T1>::iterator begin1_;
  12954. const typename ParamGenerator<T1>::iterator end1_;
  12955. typename ParamGenerator<T1>::iterator current1_;
  12956. const typename ParamGenerator<T2>::iterator begin2_;
  12957. const typename ParamGenerator<T2>::iterator end2_;
  12958. typename ParamGenerator<T2>::iterator current2_;
  12959. const typename ParamGenerator<T3>::iterator begin3_;
  12960. const typename ParamGenerator<T3>::iterator end3_;
  12961. typename ParamGenerator<T3>::iterator current3_;
  12962. const typename ParamGenerator<T4>::iterator begin4_;
  12963. const typename ParamGenerator<T4>::iterator end4_;
  12964. typename ParamGenerator<T4>::iterator current4_;
  12965. const typename ParamGenerator<T5>::iterator begin5_;
  12966. const typename ParamGenerator<T5>::iterator end5_;
  12967. typename ParamGenerator<T5>::iterator current5_;
  12968. ParamType current_value_;
  12969. }; // class CartesianProductGenerator5::Iterator
  12970. // No implementation - assignment is unsupported.
  12971. void operator=(const CartesianProductGenerator5& other);
  12972. const ParamGenerator<T1> g1_;
  12973. const ParamGenerator<T2> g2_;
  12974. const ParamGenerator<T3> g3_;
  12975. const ParamGenerator<T4> g4_;
  12976. const ParamGenerator<T5> g5_;
  12977. }; // class CartesianProductGenerator5
  12978. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12979. typename T6>
  12980. class CartesianProductGenerator6
  12981. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,
  12982. T6> > {
  12983. public:
  12984. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;
  12985. CartesianProductGenerator6(const ParamGenerator<T1>& g1,
  12986. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  12987. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  12988. const ParamGenerator<T6>& g6)
  12989. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
  12990. virtual ~CartesianProductGenerator6() {}
  12991. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12992. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12993. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
  12994. }
  12995. virtual ParamIteratorInterface<ParamType>* End() const {
  12996. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  12997. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
  12998. }
  12999. private:
  13000. class Iterator : public ParamIteratorInterface<ParamType> {
  13001. public:
  13002. Iterator(const ParamGeneratorInterface<ParamType>* base,
  13003. const ParamGenerator<T1>& g1,
  13004. const typename ParamGenerator<T1>::iterator& current1,
  13005. const ParamGenerator<T2>& g2,
  13006. const typename ParamGenerator<T2>::iterator& current2,
  13007. const ParamGenerator<T3>& g3,
  13008. const typename ParamGenerator<T3>::iterator& current3,
  13009. const ParamGenerator<T4>& g4,
  13010. const typename ParamGenerator<T4>::iterator& current4,
  13011. const ParamGenerator<T5>& g5,
  13012. const typename ParamGenerator<T5>::iterator& current5,
  13013. const ParamGenerator<T6>& g6,
  13014. const typename ParamGenerator<T6>::iterator& current6)
  13015. : base_(base),
  13016. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  13017. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  13018. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  13019. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  13020. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  13021. begin6_(g6.begin()), end6_(g6.end()), current6_(current6) {
  13022. ComputeCurrentValue();
  13023. }
  13024. virtual ~Iterator() {}
  13025. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  13026. return base_;
  13027. }
  13028. // Advance should not be called on beyond-of-range iterators
  13029. // so no component iterators must be beyond end of range, either.
  13030. virtual void Advance() {
  13031. assert(!AtEnd());
  13032. ++current6_;
  13033. if (current6_ == end6_) {
  13034. current6_ = begin6_;
  13035. ++current5_;
  13036. }
  13037. if (current5_ == end5_) {
  13038. current5_ = begin5_;
  13039. ++current4_;
  13040. }
  13041. if (current4_ == end4_) {
  13042. current4_ = begin4_;
  13043. ++current3_;
  13044. }
  13045. if (current3_ == end3_) {
  13046. current3_ = begin3_;
  13047. ++current2_;
  13048. }
  13049. if (current2_ == end2_) {
  13050. current2_ = begin2_;
  13051. ++current1_;
  13052. }
  13053. ComputeCurrentValue();
  13054. }
  13055. virtual ParamIteratorInterface<ParamType>* Clone() const {
  13056. return new Iterator(*this);
  13057. }
  13058. virtual const ParamType* Current() const { return &current_value_; }
  13059. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  13060. // Having the same base generator guarantees that the other
  13061. // iterator is of the same type and we can downcast.
  13062. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  13063. << "The program attempted to compare iterators "
  13064. << "from different generators." << std::endl;
  13065. const Iterator* typed_other =
  13066. CheckedDowncastToActualType<const Iterator>(&other);
  13067. // We must report iterators equal if they both point beyond their
  13068. // respective ranges. That can happen in a variety of fashions,
  13069. // so we have to consult AtEnd().
  13070. return (AtEnd() && typed_other->AtEnd()) ||
  13071. (
  13072. current1_ == typed_other->current1_ &&
  13073. current2_ == typed_other->current2_ &&
  13074. current3_ == typed_other->current3_ &&
  13075. current4_ == typed_other->current4_ &&
  13076. current5_ == typed_other->current5_ &&
  13077. current6_ == typed_other->current6_);
  13078. }
  13079. private:
  13080. Iterator(const Iterator& other)
  13081. : base_(other.base_),
  13082. begin1_(other.begin1_),
  13083. end1_(other.end1_),
  13084. current1_(other.current1_),
  13085. begin2_(other.begin2_),
  13086. end2_(other.end2_),
  13087. current2_(other.current2_),
  13088. begin3_(other.begin3_),
  13089. end3_(other.end3_),
  13090. current3_(other.current3_),
  13091. begin4_(other.begin4_),
  13092. end4_(other.end4_),
  13093. current4_(other.current4_),
  13094. begin5_(other.begin5_),
  13095. end5_(other.end5_),
  13096. current5_(other.current5_),
  13097. begin6_(other.begin6_),
  13098. end6_(other.end6_),
  13099. current6_(other.current6_) {
  13100. ComputeCurrentValue();
  13101. }
  13102. void ComputeCurrentValue() {
  13103. if (!AtEnd())
  13104. current_value_ = ParamType(*current1_, *current2_, *current3_,
  13105. *current4_, *current5_, *current6_);
  13106. }
  13107. bool AtEnd() const {
  13108. // We must report iterator past the end of the range when either of the
  13109. // component iterators has reached the end of its range.
  13110. return
  13111. current1_ == end1_ ||
  13112. current2_ == end2_ ||
  13113. current3_ == end3_ ||
  13114. current4_ == end4_ ||
  13115. current5_ == end5_ ||
  13116. current6_ == end6_;
  13117. }
  13118. // No implementation - assignment is unsupported.
  13119. void operator=(const Iterator& other);
  13120. const ParamGeneratorInterface<ParamType>* const base_;
  13121. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  13122. // current[i]_ is the actual traversing iterator.
  13123. const typename ParamGenerator<T1>::iterator begin1_;
  13124. const typename ParamGenerator<T1>::iterator end1_;
  13125. typename ParamGenerator<T1>::iterator current1_;
  13126. const typename ParamGenerator<T2>::iterator begin2_;
  13127. const typename ParamGenerator<T2>::iterator end2_;
  13128. typename ParamGenerator<T2>::iterator current2_;
  13129. const typename ParamGenerator<T3>::iterator begin3_;
  13130. const typename ParamGenerator<T3>::iterator end3_;
  13131. typename ParamGenerator<T3>::iterator current3_;
  13132. const typename ParamGenerator<T4>::iterator begin4_;
  13133. const typename ParamGenerator<T4>::iterator end4_;
  13134. typename ParamGenerator<T4>::iterator current4_;
  13135. const typename ParamGenerator<T5>::iterator begin5_;
  13136. const typename ParamGenerator<T5>::iterator end5_;
  13137. typename ParamGenerator<T5>::iterator current5_;
  13138. const typename ParamGenerator<T6>::iterator begin6_;
  13139. const typename ParamGenerator<T6>::iterator end6_;
  13140. typename ParamGenerator<T6>::iterator current6_;
  13141. ParamType current_value_;
  13142. }; // class CartesianProductGenerator6::Iterator
  13143. // No implementation - assignment is unsupported.
  13144. void operator=(const CartesianProductGenerator6& other);
  13145. const ParamGenerator<T1> g1_;
  13146. const ParamGenerator<T2> g2_;
  13147. const ParamGenerator<T3> g3_;
  13148. const ParamGenerator<T4> g4_;
  13149. const ParamGenerator<T5> g5_;
  13150. const ParamGenerator<T6> g6_;
  13151. }; // class CartesianProductGenerator6
  13152. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13153. typename T6, typename T7>
  13154. class CartesianProductGenerator7
  13155. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
  13156. T7> > {
  13157. public:
  13158. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
  13159. CartesianProductGenerator7(const ParamGenerator<T1>& g1,
  13160. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  13161. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  13162. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
  13163. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
  13164. virtual ~CartesianProductGenerator7() {}
  13165. virtual ParamIteratorInterface<ParamType>* Begin() const {
  13166. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  13167. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  13168. g7_.begin());
  13169. }
  13170. virtual ParamIteratorInterface<ParamType>* End() const {
  13171. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  13172. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
  13173. }
  13174. private:
  13175. class Iterator : public ParamIteratorInterface<ParamType> {
  13176. public:
  13177. Iterator(const ParamGeneratorInterface<ParamType>* base,
  13178. const ParamGenerator<T1>& g1,
  13179. const typename ParamGenerator<T1>::iterator& current1,
  13180. const ParamGenerator<T2>& g2,
  13181. const typename ParamGenerator<T2>::iterator& current2,
  13182. const ParamGenerator<T3>& g3,
  13183. const typename ParamGenerator<T3>::iterator& current3,
  13184. const ParamGenerator<T4>& g4,
  13185. const typename ParamGenerator<T4>::iterator& current4,
  13186. const ParamGenerator<T5>& g5,
  13187. const typename ParamGenerator<T5>::iterator& current5,
  13188. const ParamGenerator<T6>& g6,
  13189. const typename ParamGenerator<T6>::iterator& current6,
  13190. const ParamGenerator<T7>& g7,
  13191. const typename ParamGenerator<T7>::iterator& current7)
  13192. : base_(base),
  13193. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  13194. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  13195. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  13196. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  13197. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  13198. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  13199. begin7_(g7.begin()), end7_(g7.end()), current7_(current7) {
  13200. ComputeCurrentValue();
  13201. }
  13202. virtual ~Iterator() {}
  13203. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  13204. return base_;
  13205. }
  13206. // Advance should not be called on beyond-of-range iterators
  13207. // so no component iterators must be beyond end of range, either.
  13208. virtual void Advance() {
  13209. assert(!AtEnd());
  13210. ++current7_;
  13211. if (current7_ == end7_) {
  13212. current7_ = begin7_;
  13213. ++current6_;
  13214. }
  13215. if (current6_ == end6_) {
  13216. current6_ = begin6_;
  13217. ++current5_;
  13218. }
  13219. if (current5_ == end5_) {
  13220. current5_ = begin5_;
  13221. ++current4_;
  13222. }
  13223. if (current4_ == end4_) {
  13224. current4_ = begin4_;
  13225. ++current3_;
  13226. }
  13227. if (current3_ == end3_) {
  13228. current3_ = begin3_;
  13229. ++current2_;
  13230. }
  13231. if (current2_ == end2_) {
  13232. current2_ = begin2_;
  13233. ++current1_;
  13234. }
  13235. ComputeCurrentValue();
  13236. }
  13237. virtual ParamIteratorInterface<ParamType>* Clone() const {
  13238. return new Iterator(*this);
  13239. }
  13240. virtual const ParamType* Current() const { return &current_value_; }
  13241. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  13242. // Having the same base generator guarantees that the other
  13243. // iterator is of the same type and we can downcast.
  13244. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  13245. << "The program attempted to compare iterators "
  13246. << "from different generators." << std::endl;
  13247. const Iterator* typed_other =
  13248. CheckedDowncastToActualType<const Iterator>(&other);
  13249. // We must report iterators equal if they both point beyond their
  13250. // respective ranges. That can happen in a variety of fashions,
  13251. // so we have to consult AtEnd().
  13252. return (AtEnd() && typed_other->AtEnd()) ||
  13253. (
  13254. current1_ == typed_other->current1_ &&
  13255. current2_ == typed_other->current2_ &&
  13256. current3_ == typed_other->current3_ &&
  13257. current4_ == typed_other->current4_ &&
  13258. current5_ == typed_other->current5_ &&
  13259. current6_ == typed_other->current6_ &&
  13260. current7_ == typed_other->current7_);
  13261. }
  13262. private:
  13263. Iterator(const Iterator& other)
  13264. : base_(other.base_),
  13265. begin1_(other.begin1_),
  13266. end1_(other.end1_),
  13267. current1_(other.current1_),
  13268. begin2_(other.begin2_),
  13269. end2_(other.end2_),
  13270. current2_(other.current2_),
  13271. begin3_(other.begin3_),
  13272. end3_(other.end3_),
  13273. current3_(other.current3_),
  13274. begin4_(other.begin4_),
  13275. end4_(other.end4_),
  13276. current4_(other.current4_),
  13277. begin5_(other.begin5_),
  13278. end5_(other.end5_),
  13279. current5_(other.current5_),
  13280. begin6_(other.begin6_),
  13281. end6_(other.end6_),
  13282. current6_(other.current6_),
  13283. begin7_(other.begin7_),
  13284. end7_(other.end7_),
  13285. current7_(other.current7_) {
  13286. ComputeCurrentValue();
  13287. }
  13288. void ComputeCurrentValue() {
  13289. if (!AtEnd())
  13290. current_value_ = ParamType(*current1_, *current2_, *current3_,
  13291. *current4_, *current5_, *current6_, *current7_);
  13292. }
  13293. bool AtEnd() const {
  13294. // We must report iterator past the end of the range when either of the
  13295. // component iterators has reached the end of its range.
  13296. return
  13297. current1_ == end1_ ||
  13298. current2_ == end2_ ||
  13299. current3_ == end3_ ||
  13300. current4_ == end4_ ||
  13301. current5_ == end5_ ||
  13302. current6_ == end6_ ||
  13303. current7_ == end7_;
  13304. }
  13305. // No implementation - assignment is unsupported.
  13306. void operator=(const Iterator& other);
  13307. const ParamGeneratorInterface<ParamType>* const base_;
  13308. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  13309. // current[i]_ is the actual traversing iterator.
  13310. const typename ParamGenerator<T1>::iterator begin1_;
  13311. const typename ParamGenerator<T1>::iterator end1_;
  13312. typename ParamGenerator<T1>::iterator current1_;
  13313. const typename ParamGenerator<T2>::iterator begin2_;
  13314. const typename ParamGenerator<T2>::iterator end2_;
  13315. typename ParamGenerator<T2>::iterator current2_;
  13316. const typename ParamGenerator<T3>::iterator begin3_;
  13317. const typename ParamGenerator<T3>::iterator end3_;
  13318. typename ParamGenerator<T3>::iterator current3_;
  13319. const typename ParamGenerator<T4>::iterator begin4_;
  13320. const typename ParamGenerator<T4>::iterator end4_;
  13321. typename ParamGenerator<T4>::iterator current4_;
  13322. const typename ParamGenerator<T5>::iterator begin5_;
  13323. const typename ParamGenerator<T5>::iterator end5_;
  13324. typename ParamGenerator<T5>::iterator current5_;
  13325. const typename ParamGenerator<T6>::iterator begin6_;
  13326. const typename ParamGenerator<T6>::iterator end6_;
  13327. typename ParamGenerator<T6>::iterator current6_;
  13328. const typename ParamGenerator<T7>::iterator begin7_;
  13329. const typename ParamGenerator<T7>::iterator end7_;
  13330. typename ParamGenerator<T7>::iterator current7_;
  13331. ParamType current_value_;
  13332. }; // class CartesianProductGenerator7::Iterator
  13333. // No implementation - assignment is unsupported.
  13334. void operator=(const CartesianProductGenerator7& other);
  13335. const ParamGenerator<T1> g1_;
  13336. const ParamGenerator<T2> g2_;
  13337. const ParamGenerator<T3> g3_;
  13338. const ParamGenerator<T4> g4_;
  13339. const ParamGenerator<T5> g5_;
  13340. const ParamGenerator<T6> g6_;
  13341. const ParamGenerator<T7> g7_;
  13342. }; // class CartesianProductGenerator7
  13343. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13344. typename T6, typename T7, typename T8>
  13345. class CartesianProductGenerator8
  13346. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
  13347. T7, T8> > {
  13348. public:
  13349. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
  13350. CartesianProductGenerator8(const ParamGenerator<T1>& g1,
  13351. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  13352. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  13353. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
  13354. const ParamGenerator<T8>& g8)
  13355. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
  13356. g8_(g8) {}
  13357. virtual ~CartesianProductGenerator8() {}
  13358. virtual ParamIteratorInterface<ParamType>* Begin() const {
  13359. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  13360. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  13361. g7_.begin(), g8_, g8_.begin());
  13362. }
  13363. virtual ParamIteratorInterface<ParamType>* End() const {
  13364. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  13365. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
  13366. g8_.end());
  13367. }
  13368. private:
  13369. class Iterator : public ParamIteratorInterface<ParamType> {
  13370. public:
  13371. Iterator(const ParamGeneratorInterface<ParamType>* base,
  13372. const ParamGenerator<T1>& g1,
  13373. const typename ParamGenerator<T1>::iterator& current1,
  13374. const ParamGenerator<T2>& g2,
  13375. const typename ParamGenerator<T2>::iterator& current2,
  13376. const ParamGenerator<T3>& g3,
  13377. const typename ParamGenerator<T3>::iterator& current3,
  13378. const ParamGenerator<T4>& g4,
  13379. const typename ParamGenerator<T4>::iterator& current4,
  13380. const ParamGenerator<T5>& g5,
  13381. const typename ParamGenerator<T5>::iterator& current5,
  13382. const ParamGenerator<T6>& g6,
  13383. const typename ParamGenerator<T6>::iterator& current6,
  13384. const ParamGenerator<T7>& g7,
  13385. const typename ParamGenerator<T7>::iterator& current7,
  13386. const ParamGenerator<T8>& g8,
  13387. const typename ParamGenerator<T8>::iterator& current8)
  13388. : base_(base),
  13389. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  13390. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  13391. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  13392. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  13393. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  13394. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  13395. begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
  13396. begin8_(g8.begin()), end8_(g8.end()), current8_(current8) {
  13397. ComputeCurrentValue();
  13398. }
  13399. virtual ~Iterator() {}
  13400. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  13401. return base_;
  13402. }
  13403. // Advance should not be called on beyond-of-range iterators
  13404. // so no component iterators must be beyond end of range, either.
  13405. virtual void Advance() {
  13406. assert(!AtEnd());
  13407. ++current8_;
  13408. if (current8_ == end8_) {
  13409. current8_ = begin8_;
  13410. ++current7_;
  13411. }
  13412. if (current7_ == end7_) {
  13413. current7_ = begin7_;
  13414. ++current6_;
  13415. }
  13416. if (current6_ == end6_) {
  13417. current6_ = begin6_;
  13418. ++current5_;
  13419. }
  13420. if (current5_ == end5_) {
  13421. current5_ = begin5_;
  13422. ++current4_;
  13423. }
  13424. if (current4_ == end4_) {
  13425. current4_ = begin4_;
  13426. ++current3_;
  13427. }
  13428. if (current3_ == end3_) {
  13429. current3_ = begin3_;
  13430. ++current2_;
  13431. }
  13432. if (current2_ == end2_) {
  13433. current2_ = begin2_;
  13434. ++current1_;
  13435. }
  13436. ComputeCurrentValue();
  13437. }
  13438. virtual ParamIteratorInterface<ParamType>* Clone() const {
  13439. return new Iterator(*this);
  13440. }
  13441. virtual const ParamType* Current() const { return &current_value_; }
  13442. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  13443. // Having the same base generator guarantees that the other
  13444. // iterator is of the same type and we can downcast.
  13445. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  13446. << "The program attempted to compare iterators "
  13447. << "from different generators." << std::endl;
  13448. const Iterator* typed_other =
  13449. CheckedDowncastToActualType<const Iterator>(&other);
  13450. // We must report iterators equal if they both point beyond their
  13451. // respective ranges. That can happen in a variety of fashions,
  13452. // so we have to consult AtEnd().
  13453. return (AtEnd() && typed_other->AtEnd()) ||
  13454. (
  13455. current1_ == typed_other->current1_ &&
  13456. current2_ == typed_other->current2_ &&
  13457. current3_ == typed_other->current3_ &&
  13458. current4_ == typed_other->current4_ &&
  13459. current5_ == typed_other->current5_ &&
  13460. current6_ == typed_other->current6_ &&
  13461. current7_ == typed_other->current7_ &&
  13462. current8_ == typed_other->current8_);
  13463. }
  13464. private:
  13465. Iterator(const Iterator& other)
  13466. : base_(other.base_),
  13467. begin1_(other.begin1_),
  13468. end1_(other.end1_),
  13469. current1_(other.current1_),
  13470. begin2_(other.begin2_),
  13471. end2_(other.end2_),
  13472. current2_(other.current2_),
  13473. begin3_(other.begin3_),
  13474. end3_(other.end3_),
  13475. current3_(other.current3_),
  13476. begin4_(other.begin4_),
  13477. end4_(other.end4_),
  13478. current4_(other.current4_),
  13479. begin5_(other.begin5_),
  13480. end5_(other.end5_),
  13481. current5_(other.current5_),
  13482. begin6_(other.begin6_),
  13483. end6_(other.end6_),
  13484. current6_(other.current6_),
  13485. begin7_(other.begin7_),
  13486. end7_(other.end7_),
  13487. current7_(other.current7_),
  13488. begin8_(other.begin8_),
  13489. end8_(other.end8_),
  13490. current8_(other.current8_) {
  13491. ComputeCurrentValue();
  13492. }
  13493. void ComputeCurrentValue() {
  13494. if (!AtEnd())
  13495. current_value_ = ParamType(*current1_, *current2_, *current3_,
  13496. *current4_, *current5_, *current6_, *current7_, *current8_);
  13497. }
  13498. bool AtEnd() const {
  13499. // We must report iterator past the end of the range when either of the
  13500. // component iterators has reached the end of its range.
  13501. return
  13502. current1_ == end1_ ||
  13503. current2_ == end2_ ||
  13504. current3_ == end3_ ||
  13505. current4_ == end4_ ||
  13506. current5_ == end5_ ||
  13507. current6_ == end6_ ||
  13508. current7_ == end7_ ||
  13509. current8_ == end8_;
  13510. }
  13511. // No implementation - assignment is unsupported.
  13512. void operator=(const Iterator& other);
  13513. const ParamGeneratorInterface<ParamType>* const base_;
  13514. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  13515. // current[i]_ is the actual traversing iterator.
  13516. const typename ParamGenerator<T1>::iterator begin1_;
  13517. const typename ParamGenerator<T1>::iterator end1_;
  13518. typename ParamGenerator<T1>::iterator current1_;
  13519. const typename ParamGenerator<T2>::iterator begin2_;
  13520. const typename ParamGenerator<T2>::iterator end2_;
  13521. typename ParamGenerator<T2>::iterator current2_;
  13522. const typename ParamGenerator<T3>::iterator begin3_;
  13523. const typename ParamGenerator<T3>::iterator end3_;
  13524. typename ParamGenerator<T3>::iterator current3_;
  13525. const typename ParamGenerator<T4>::iterator begin4_;
  13526. const typename ParamGenerator<T4>::iterator end4_;
  13527. typename ParamGenerator<T4>::iterator current4_;
  13528. const typename ParamGenerator<T5>::iterator begin5_;
  13529. const typename ParamGenerator<T5>::iterator end5_;
  13530. typename ParamGenerator<T5>::iterator current5_;
  13531. const typename ParamGenerator<T6>::iterator begin6_;
  13532. const typename ParamGenerator<T6>::iterator end6_;
  13533. typename ParamGenerator<T6>::iterator current6_;
  13534. const typename ParamGenerator<T7>::iterator begin7_;
  13535. const typename ParamGenerator<T7>::iterator end7_;
  13536. typename ParamGenerator<T7>::iterator current7_;
  13537. const typename ParamGenerator<T8>::iterator begin8_;
  13538. const typename ParamGenerator<T8>::iterator end8_;
  13539. typename ParamGenerator<T8>::iterator current8_;
  13540. ParamType current_value_;
  13541. }; // class CartesianProductGenerator8::Iterator
  13542. // No implementation - assignment is unsupported.
  13543. void operator=(const CartesianProductGenerator8& other);
  13544. const ParamGenerator<T1> g1_;
  13545. const ParamGenerator<T2> g2_;
  13546. const ParamGenerator<T3> g3_;
  13547. const ParamGenerator<T4> g4_;
  13548. const ParamGenerator<T5> g5_;
  13549. const ParamGenerator<T6> g6_;
  13550. const ParamGenerator<T7> g7_;
  13551. const ParamGenerator<T8> g8_;
  13552. }; // class CartesianProductGenerator8
  13553. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13554. typename T6, typename T7, typename T8, typename T9>
  13555. class CartesianProductGenerator9
  13556. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
  13557. T7, T8, T9> > {
  13558. public:
  13559. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
  13560. CartesianProductGenerator9(const ParamGenerator<T1>& g1,
  13561. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  13562. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  13563. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
  13564. const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
  13565. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  13566. g9_(g9) {}
  13567. virtual ~CartesianProductGenerator9() {}
  13568. virtual ParamIteratorInterface<ParamType>* Begin() const {
  13569. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  13570. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  13571. g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
  13572. }
  13573. virtual ParamIteratorInterface<ParamType>* End() const {
  13574. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  13575. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
  13576. g8_.end(), g9_, g9_.end());
  13577. }
  13578. private:
  13579. class Iterator : public ParamIteratorInterface<ParamType> {
  13580. public:
  13581. Iterator(const ParamGeneratorInterface<ParamType>* base,
  13582. const ParamGenerator<T1>& g1,
  13583. const typename ParamGenerator<T1>::iterator& current1,
  13584. const ParamGenerator<T2>& g2,
  13585. const typename ParamGenerator<T2>::iterator& current2,
  13586. const ParamGenerator<T3>& g3,
  13587. const typename ParamGenerator<T3>::iterator& current3,
  13588. const ParamGenerator<T4>& g4,
  13589. const typename ParamGenerator<T4>::iterator& current4,
  13590. const ParamGenerator<T5>& g5,
  13591. const typename ParamGenerator<T5>::iterator& current5,
  13592. const ParamGenerator<T6>& g6,
  13593. const typename ParamGenerator<T6>::iterator& current6,
  13594. const ParamGenerator<T7>& g7,
  13595. const typename ParamGenerator<T7>::iterator& current7,
  13596. const ParamGenerator<T8>& g8,
  13597. const typename ParamGenerator<T8>::iterator& current8,
  13598. const ParamGenerator<T9>& g9,
  13599. const typename ParamGenerator<T9>::iterator& current9)
  13600. : base_(base),
  13601. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  13602. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  13603. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  13604. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  13605. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  13606. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  13607. begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
  13608. begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
  13609. begin9_(g9.begin()), end9_(g9.end()), current9_(current9) {
  13610. ComputeCurrentValue();
  13611. }
  13612. virtual ~Iterator() {}
  13613. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  13614. return base_;
  13615. }
  13616. // Advance should not be called on beyond-of-range iterators
  13617. // so no component iterators must be beyond end of range, either.
  13618. virtual void Advance() {
  13619. assert(!AtEnd());
  13620. ++current9_;
  13621. if (current9_ == end9_) {
  13622. current9_ = begin9_;
  13623. ++current8_;
  13624. }
  13625. if (current8_ == end8_) {
  13626. current8_ = begin8_;
  13627. ++current7_;
  13628. }
  13629. if (current7_ == end7_) {
  13630. current7_ = begin7_;
  13631. ++current6_;
  13632. }
  13633. if (current6_ == end6_) {
  13634. current6_ = begin6_;
  13635. ++current5_;
  13636. }
  13637. if (current5_ == end5_) {
  13638. current5_ = begin5_;
  13639. ++current4_;
  13640. }
  13641. if (current4_ == end4_) {
  13642. current4_ = begin4_;
  13643. ++current3_;
  13644. }
  13645. if (current3_ == end3_) {
  13646. current3_ = begin3_;
  13647. ++current2_;
  13648. }
  13649. if (current2_ == end2_) {
  13650. current2_ = begin2_;
  13651. ++current1_;
  13652. }
  13653. ComputeCurrentValue();
  13654. }
  13655. virtual ParamIteratorInterface<ParamType>* Clone() const {
  13656. return new Iterator(*this);
  13657. }
  13658. virtual const ParamType* Current() const { return &current_value_; }
  13659. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  13660. // Having the same base generator guarantees that the other
  13661. // iterator is of the same type and we can downcast.
  13662. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  13663. << "The program attempted to compare iterators "
  13664. << "from different generators." << std::endl;
  13665. const Iterator* typed_other =
  13666. CheckedDowncastToActualType<const Iterator>(&other);
  13667. // We must report iterators equal if they both point beyond their
  13668. // respective ranges. That can happen in a variety of fashions,
  13669. // so we have to consult AtEnd().
  13670. return (AtEnd() && typed_other->AtEnd()) ||
  13671. (
  13672. current1_ == typed_other->current1_ &&
  13673. current2_ == typed_other->current2_ &&
  13674. current3_ == typed_other->current3_ &&
  13675. current4_ == typed_other->current4_ &&
  13676. current5_ == typed_other->current5_ &&
  13677. current6_ == typed_other->current6_ &&
  13678. current7_ == typed_other->current7_ &&
  13679. current8_ == typed_other->current8_ &&
  13680. current9_ == typed_other->current9_);
  13681. }
  13682. private:
  13683. Iterator(const Iterator& other)
  13684. : base_(other.base_),
  13685. begin1_(other.begin1_),
  13686. end1_(other.end1_),
  13687. current1_(other.current1_),
  13688. begin2_(other.begin2_),
  13689. end2_(other.end2_),
  13690. current2_(other.current2_),
  13691. begin3_(other.begin3_),
  13692. end3_(other.end3_),
  13693. current3_(other.current3_),
  13694. begin4_(other.begin4_),
  13695. end4_(other.end4_),
  13696. current4_(other.current4_),
  13697. begin5_(other.begin5_),
  13698. end5_(other.end5_),
  13699. current5_(other.current5_),
  13700. begin6_(other.begin6_),
  13701. end6_(other.end6_),
  13702. current6_(other.current6_),
  13703. begin7_(other.begin7_),
  13704. end7_(other.end7_),
  13705. current7_(other.current7_),
  13706. begin8_(other.begin8_),
  13707. end8_(other.end8_),
  13708. current8_(other.current8_),
  13709. begin9_(other.begin9_),
  13710. end9_(other.end9_),
  13711. current9_(other.current9_) {
  13712. ComputeCurrentValue();
  13713. }
  13714. void ComputeCurrentValue() {
  13715. if (!AtEnd())
  13716. current_value_ = ParamType(*current1_, *current2_, *current3_,
  13717. *current4_, *current5_, *current6_, *current7_, *current8_,
  13718. *current9_);
  13719. }
  13720. bool AtEnd() const {
  13721. // We must report iterator past the end of the range when either of the
  13722. // component iterators has reached the end of its range.
  13723. return
  13724. current1_ == end1_ ||
  13725. current2_ == end2_ ||
  13726. current3_ == end3_ ||
  13727. current4_ == end4_ ||
  13728. current5_ == end5_ ||
  13729. current6_ == end6_ ||
  13730. current7_ == end7_ ||
  13731. current8_ == end8_ ||
  13732. current9_ == end9_;
  13733. }
  13734. // No implementation - assignment is unsupported.
  13735. void operator=(const Iterator& other);
  13736. const ParamGeneratorInterface<ParamType>* const base_;
  13737. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  13738. // current[i]_ is the actual traversing iterator.
  13739. const typename ParamGenerator<T1>::iterator begin1_;
  13740. const typename ParamGenerator<T1>::iterator end1_;
  13741. typename ParamGenerator<T1>::iterator current1_;
  13742. const typename ParamGenerator<T2>::iterator begin2_;
  13743. const typename ParamGenerator<T2>::iterator end2_;
  13744. typename ParamGenerator<T2>::iterator current2_;
  13745. const typename ParamGenerator<T3>::iterator begin3_;
  13746. const typename ParamGenerator<T3>::iterator end3_;
  13747. typename ParamGenerator<T3>::iterator current3_;
  13748. const typename ParamGenerator<T4>::iterator begin4_;
  13749. const typename ParamGenerator<T4>::iterator end4_;
  13750. typename ParamGenerator<T4>::iterator current4_;
  13751. const typename ParamGenerator<T5>::iterator begin5_;
  13752. const typename ParamGenerator<T5>::iterator end5_;
  13753. typename ParamGenerator<T5>::iterator current5_;
  13754. const typename ParamGenerator<T6>::iterator begin6_;
  13755. const typename ParamGenerator<T6>::iterator end6_;
  13756. typename ParamGenerator<T6>::iterator current6_;
  13757. const typename ParamGenerator<T7>::iterator begin7_;
  13758. const typename ParamGenerator<T7>::iterator end7_;
  13759. typename ParamGenerator<T7>::iterator current7_;
  13760. const typename ParamGenerator<T8>::iterator begin8_;
  13761. const typename ParamGenerator<T8>::iterator end8_;
  13762. typename ParamGenerator<T8>::iterator current8_;
  13763. const typename ParamGenerator<T9>::iterator begin9_;
  13764. const typename ParamGenerator<T9>::iterator end9_;
  13765. typename ParamGenerator<T9>::iterator current9_;
  13766. ParamType current_value_;
  13767. }; // class CartesianProductGenerator9::Iterator
  13768. // No implementation - assignment is unsupported.
  13769. void operator=(const CartesianProductGenerator9& other);
  13770. const ParamGenerator<T1> g1_;
  13771. const ParamGenerator<T2> g2_;
  13772. const ParamGenerator<T3> g3_;
  13773. const ParamGenerator<T4> g4_;
  13774. const ParamGenerator<T5> g5_;
  13775. const ParamGenerator<T6> g6_;
  13776. const ParamGenerator<T7> g7_;
  13777. const ParamGenerator<T8> g8_;
  13778. const ParamGenerator<T9> g9_;
  13779. }; // class CartesianProductGenerator9
  13780. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13781. typename T6, typename T7, typename T8, typename T9, typename T10>
  13782. class CartesianProductGenerator10
  13783. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
  13784. T7, T8, T9, T10> > {
  13785. public:
  13786. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
  13787. CartesianProductGenerator10(const ParamGenerator<T1>& g1,
  13788. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  13789. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  13790. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
  13791. const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
  13792. const ParamGenerator<T10>& g10)
  13793. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  13794. g9_(g9), g10_(g10) {}
  13795. virtual ~CartesianProductGenerator10() {}
  13796. virtual ParamIteratorInterface<ParamType>* Begin() const {
  13797. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  13798. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  13799. g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
  13800. }
  13801. virtual ParamIteratorInterface<ParamType>* End() const {
  13802. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  13803. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
  13804. g8_.end(), g9_, g9_.end(), g10_, g10_.end());
  13805. }
  13806. private:
  13807. class Iterator : public ParamIteratorInterface<ParamType> {
  13808. public:
  13809. Iterator(const ParamGeneratorInterface<ParamType>* base,
  13810. const ParamGenerator<T1>& g1,
  13811. const typename ParamGenerator<T1>::iterator& current1,
  13812. const ParamGenerator<T2>& g2,
  13813. const typename ParamGenerator<T2>::iterator& current2,
  13814. const ParamGenerator<T3>& g3,
  13815. const typename ParamGenerator<T3>::iterator& current3,
  13816. const ParamGenerator<T4>& g4,
  13817. const typename ParamGenerator<T4>::iterator& current4,
  13818. const ParamGenerator<T5>& g5,
  13819. const typename ParamGenerator<T5>::iterator& current5,
  13820. const ParamGenerator<T6>& g6,
  13821. const typename ParamGenerator<T6>::iterator& current6,
  13822. const ParamGenerator<T7>& g7,
  13823. const typename ParamGenerator<T7>::iterator& current7,
  13824. const ParamGenerator<T8>& g8,
  13825. const typename ParamGenerator<T8>::iterator& current8,
  13826. const ParamGenerator<T9>& g9,
  13827. const typename ParamGenerator<T9>::iterator& current9,
  13828. const ParamGenerator<T10>& g10,
  13829. const typename ParamGenerator<T10>::iterator& current10)
  13830. : base_(base),
  13831. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  13832. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  13833. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  13834. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  13835. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  13836. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  13837. begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
  13838. begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
  13839. begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
  13840. begin10_(g10.begin()), end10_(g10.end()), current10_(current10) {
  13841. ComputeCurrentValue();
  13842. }
  13843. virtual ~Iterator() {}
  13844. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  13845. return base_;
  13846. }
  13847. // Advance should not be called on beyond-of-range iterators
  13848. // so no component iterators must be beyond end of range, either.
  13849. virtual void Advance() {
  13850. assert(!AtEnd());
  13851. ++current10_;
  13852. if (current10_ == end10_) {
  13853. current10_ = begin10_;
  13854. ++current9_;
  13855. }
  13856. if (current9_ == end9_) {
  13857. current9_ = begin9_;
  13858. ++current8_;
  13859. }
  13860. if (current8_ == end8_) {
  13861. current8_ = begin8_;
  13862. ++current7_;
  13863. }
  13864. if (current7_ == end7_) {
  13865. current7_ = begin7_;
  13866. ++current6_;
  13867. }
  13868. if (current6_ == end6_) {
  13869. current6_ = begin6_;
  13870. ++current5_;
  13871. }
  13872. if (current5_ == end5_) {
  13873. current5_ = begin5_;
  13874. ++current4_;
  13875. }
  13876. if (current4_ == end4_) {
  13877. current4_ = begin4_;
  13878. ++current3_;
  13879. }
  13880. if (current3_ == end3_) {
  13881. current3_ = begin3_;
  13882. ++current2_;
  13883. }
  13884. if (current2_ == end2_) {
  13885. current2_ = begin2_;
  13886. ++current1_;
  13887. }
  13888. ComputeCurrentValue();
  13889. }
  13890. virtual ParamIteratorInterface<ParamType>* Clone() const {
  13891. return new Iterator(*this);
  13892. }
  13893. virtual const ParamType* Current() const { return &current_value_; }
  13894. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  13895. // Having the same base generator guarantees that the other
  13896. // iterator is of the same type and we can downcast.
  13897. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  13898. << "The program attempted to compare iterators "
  13899. << "from different generators." << std::endl;
  13900. const Iterator* typed_other =
  13901. CheckedDowncastToActualType<const Iterator>(&other);
  13902. // We must report iterators equal if they both point beyond their
  13903. // respective ranges. That can happen in a variety of fashions,
  13904. // so we have to consult AtEnd().
  13905. return (AtEnd() && typed_other->AtEnd()) ||
  13906. (
  13907. current1_ == typed_other->current1_ &&
  13908. current2_ == typed_other->current2_ &&
  13909. current3_ == typed_other->current3_ &&
  13910. current4_ == typed_other->current4_ &&
  13911. current5_ == typed_other->current5_ &&
  13912. current6_ == typed_other->current6_ &&
  13913. current7_ == typed_other->current7_ &&
  13914. current8_ == typed_other->current8_ &&
  13915. current9_ == typed_other->current9_ &&
  13916. current10_ == typed_other->current10_);
  13917. }
  13918. private:
  13919. Iterator(const Iterator& other)
  13920. : base_(other.base_),
  13921. begin1_(other.begin1_),
  13922. end1_(other.end1_),
  13923. current1_(other.current1_),
  13924. begin2_(other.begin2_),
  13925. end2_(other.end2_),
  13926. current2_(other.current2_),
  13927. begin3_(other.begin3_),
  13928. end3_(other.end3_),
  13929. current3_(other.current3_),
  13930. begin4_(other.begin4_),
  13931. end4_(other.end4_),
  13932. current4_(other.current4_),
  13933. begin5_(other.begin5_),
  13934. end5_(other.end5_),
  13935. current5_(other.current5_),
  13936. begin6_(other.begin6_),
  13937. end6_(other.end6_),
  13938. current6_(other.current6_),
  13939. begin7_(other.begin7_),
  13940. end7_(other.end7_),
  13941. current7_(other.current7_),
  13942. begin8_(other.begin8_),
  13943. end8_(other.end8_),
  13944. current8_(other.current8_),
  13945. begin9_(other.begin9_),
  13946. end9_(other.end9_),
  13947. current9_(other.current9_),
  13948. begin10_(other.begin10_),
  13949. end10_(other.end10_),
  13950. current10_(other.current10_) {
  13951. ComputeCurrentValue();
  13952. }
  13953. void ComputeCurrentValue() {
  13954. if (!AtEnd())
  13955. current_value_ = ParamType(*current1_, *current2_, *current3_,
  13956. *current4_, *current5_, *current6_, *current7_, *current8_,
  13957. *current9_, *current10_);
  13958. }
  13959. bool AtEnd() const {
  13960. // We must report iterator past the end of the range when either of the
  13961. // component iterators has reached the end of its range.
  13962. return
  13963. current1_ == end1_ ||
  13964. current2_ == end2_ ||
  13965. current3_ == end3_ ||
  13966. current4_ == end4_ ||
  13967. current5_ == end5_ ||
  13968. current6_ == end6_ ||
  13969. current7_ == end7_ ||
  13970. current8_ == end8_ ||
  13971. current9_ == end9_ ||
  13972. current10_ == end10_;
  13973. }
  13974. // No implementation - assignment is unsupported.
  13975. void operator=(const Iterator& other);
  13976. const ParamGeneratorInterface<ParamType>* const base_;
  13977. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  13978. // current[i]_ is the actual traversing iterator.
  13979. const typename ParamGenerator<T1>::iterator begin1_;
  13980. const typename ParamGenerator<T1>::iterator end1_;
  13981. typename ParamGenerator<T1>::iterator current1_;
  13982. const typename ParamGenerator<T2>::iterator begin2_;
  13983. const typename ParamGenerator<T2>::iterator end2_;
  13984. typename ParamGenerator<T2>::iterator current2_;
  13985. const typename ParamGenerator<T3>::iterator begin3_;
  13986. const typename ParamGenerator<T3>::iterator end3_;
  13987. typename ParamGenerator<T3>::iterator current3_;
  13988. const typename ParamGenerator<T4>::iterator begin4_;
  13989. const typename ParamGenerator<T4>::iterator end4_;
  13990. typename ParamGenerator<T4>::iterator current4_;
  13991. const typename ParamGenerator<T5>::iterator begin5_;
  13992. const typename ParamGenerator<T5>::iterator end5_;
  13993. typename ParamGenerator<T5>::iterator current5_;
  13994. const typename ParamGenerator<T6>::iterator begin6_;
  13995. const typename ParamGenerator<T6>::iterator end6_;
  13996. typename ParamGenerator<T6>::iterator current6_;
  13997. const typename ParamGenerator<T7>::iterator begin7_;
  13998. const typename ParamGenerator<T7>::iterator end7_;
  13999. typename ParamGenerator<T7>::iterator current7_;
  14000. const typename ParamGenerator<T8>::iterator begin8_;
  14001. const typename ParamGenerator<T8>::iterator end8_;
  14002. typename ParamGenerator<T8>::iterator current8_;
  14003. const typename ParamGenerator<T9>::iterator begin9_;
  14004. const typename ParamGenerator<T9>::iterator end9_;
  14005. typename ParamGenerator<T9>::iterator current9_;
  14006. const typename ParamGenerator<T10>::iterator begin10_;
  14007. const typename ParamGenerator<T10>::iterator end10_;
  14008. typename ParamGenerator<T10>::iterator current10_;
  14009. ParamType current_value_;
  14010. }; // class CartesianProductGenerator10::Iterator
  14011. // No implementation - assignment is unsupported.
  14012. void operator=(const CartesianProductGenerator10& other);
  14013. const ParamGenerator<T1> g1_;
  14014. const ParamGenerator<T2> g2_;
  14015. const ParamGenerator<T3> g3_;
  14016. const ParamGenerator<T4> g4_;
  14017. const ParamGenerator<T5> g5_;
  14018. const ParamGenerator<T6> g6_;
  14019. const ParamGenerator<T7> g7_;
  14020. const ParamGenerator<T8> g8_;
  14021. const ParamGenerator<T9> g9_;
  14022. const ParamGenerator<T10> g10_;
  14023. }; // class CartesianProductGenerator10
  14024. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  14025. //
  14026. // Helper classes providing Combine() with polymorphic features. They allow
  14027. // casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
  14028. // convertible to U.
  14029. //
  14030. template <class Generator1, class Generator2>
  14031. class CartesianProductHolder2 {
  14032. public:
  14033. CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
  14034. : g1_(g1), g2_(g2) {}
  14035. template <typename T1, typename T2>
  14036. operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {
  14037. return ParamGenerator< ::std::tr1::tuple<T1, T2> >(
  14038. new CartesianProductGenerator2<T1, T2>(
  14039. static_cast<ParamGenerator<T1> >(g1_),
  14040. static_cast<ParamGenerator<T2> >(g2_)));
  14041. }
  14042. private:
  14043. // No implementation - assignment is unsupported.
  14044. void operator=(const CartesianProductHolder2& other);
  14045. const Generator1 g1_;
  14046. const Generator2 g2_;
  14047. }; // class CartesianProductHolder2
  14048. template <class Generator1, class Generator2, class Generator3>
  14049. class CartesianProductHolder3 {
  14050. public:
  14051. CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
  14052. const Generator3& g3)
  14053. : g1_(g1), g2_(g2), g3_(g3) {}
  14054. template <typename T1, typename T2, typename T3>
  14055. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {
  14056. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(
  14057. new CartesianProductGenerator3<T1, T2, T3>(
  14058. static_cast<ParamGenerator<T1> >(g1_),
  14059. static_cast<ParamGenerator<T2> >(g2_),
  14060. static_cast<ParamGenerator<T3> >(g3_)));
  14061. }
  14062. private:
  14063. // No implementation - assignment is unsupported.
  14064. void operator=(const CartesianProductHolder3& other);
  14065. const Generator1 g1_;
  14066. const Generator2 g2_;
  14067. const Generator3 g3_;
  14068. }; // class CartesianProductHolder3
  14069. template <class Generator1, class Generator2, class Generator3,
  14070. class Generator4>
  14071. class CartesianProductHolder4 {
  14072. public:
  14073. CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
  14074. const Generator3& g3, const Generator4& g4)
  14075. : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
  14076. template <typename T1, typename T2, typename T3, typename T4>
  14077. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {
  14078. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(
  14079. new CartesianProductGenerator4<T1, T2, T3, T4>(
  14080. static_cast<ParamGenerator<T1> >(g1_),
  14081. static_cast<ParamGenerator<T2> >(g2_),
  14082. static_cast<ParamGenerator<T3> >(g3_),
  14083. static_cast<ParamGenerator<T4> >(g4_)));
  14084. }
  14085. private:
  14086. // No implementation - assignment is unsupported.
  14087. void operator=(const CartesianProductHolder4& other);
  14088. const Generator1 g1_;
  14089. const Generator2 g2_;
  14090. const Generator3 g3_;
  14091. const Generator4 g4_;
  14092. }; // class CartesianProductHolder4
  14093. template <class Generator1, class Generator2, class Generator3,
  14094. class Generator4, class Generator5>
  14095. class CartesianProductHolder5 {
  14096. public:
  14097. CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
  14098. const Generator3& g3, const Generator4& g4, const Generator5& g5)
  14099. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
  14100. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  14101. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {
  14102. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(
  14103. new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
  14104. static_cast<ParamGenerator<T1> >(g1_),
  14105. static_cast<ParamGenerator<T2> >(g2_),
  14106. static_cast<ParamGenerator<T3> >(g3_),
  14107. static_cast<ParamGenerator<T4> >(g4_),
  14108. static_cast<ParamGenerator<T5> >(g5_)));
  14109. }
  14110. private:
  14111. // No implementation - assignment is unsupported.
  14112. void operator=(const CartesianProductHolder5& other);
  14113. const Generator1 g1_;
  14114. const Generator2 g2_;
  14115. const Generator3 g3_;
  14116. const Generator4 g4_;
  14117. const Generator5 g5_;
  14118. }; // class CartesianProductHolder5
  14119. template <class Generator1, class Generator2, class Generator3,
  14120. class Generator4, class Generator5, class Generator6>
  14121. class CartesianProductHolder6 {
  14122. public:
  14123. CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
  14124. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  14125. const Generator6& g6)
  14126. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
  14127. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14128. typename T6>
  14129. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {
  14130. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(
  14131. new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
  14132. static_cast<ParamGenerator<T1> >(g1_),
  14133. static_cast<ParamGenerator<T2> >(g2_),
  14134. static_cast<ParamGenerator<T3> >(g3_),
  14135. static_cast<ParamGenerator<T4> >(g4_),
  14136. static_cast<ParamGenerator<T5> >(g5_),
  14137. static_cast<ParamGenerator<T6> >(g6_)));
  14138. }
  14139. private:
  14140. // No implementation - assignment is unsupported.
  14141. void operator=(const CartesianProductHolder6& other);
  14142. const Generator1 g1_;
  14143. const Generator2 g2_;
  14144. const Generator3 g3_;
  14145. const Generator4 g4_;
  14146. const Generator5 g5_;
  14147. const Generator6 g6_;
  14148. }; // class CartesianProductHolder6
  14149. template <class Generator1, class Generator2, class Generator3,
  14150. class Generator4, class Generator5, class Generator6, class Generator7>
  14151. class CartesianProductHolder7 {
  14152. public:
  14153. CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
  14154. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  14155. const Generator6& g6, const Generator7& g7)
  14156. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
  14157. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14158. typename T6, typename T7>
  14159. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
  14160. T7> >() const {
  14161. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(
  14162. new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
  14163. static_cast<ParamGenerator<T1> >(g1_),
  14164. static_cast<ParamGenerator<T2> >(g2_),
  14165. static_cast<ParamGenerator<T3> >(g3_),
  14166. static_cast<ParamGenerator<T4> >(g4_),
  14167. static_cast<ParamGenerator<T5> >(g5_),
  14168. static_cast<ParamGenerator<T6> >(g6_),
  14169. static_cast<ParamGenerator<T7> >(g7_)));
  14170. }
  14171. private:
  14172. // No implementation - assignment is unsupported.
  14173. void operator=(const CartesianProductHolder7& other);
  14174. const Generator1 g1_;
  14175. const Generator2 g2_;
  14176. const Generator3 g3_;
  14177. const Generator4 g4_;
  14178. const Generator5 g5_;
  14179. const Generator6 g6_;
  14180. const Generator7 g7_;
  14181. }; // class CartesianProductHolder7
  14182. template <class Generator1, class Generator2, class Generator3,
  14183. class Generator4, class Generator5, class Generator6, class Generator7,
  14184. class Generator8>
  14185. class CartesianProductHolder8 {
  14186. public:
  14187. CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
  14188. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  14189. const Generator6& g6, const Generator7& g7, const Generator8& g8)
  14190. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
  14191. g8_(g8) {}
  14192. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14193. typename T6, typename T7, typename T8>
  14194. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,
  14195. T8> >() const {
  14196. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
  14197. new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
  14198. static_cast<ParamGenerator<T1> >(g1_),
  14199. static_cast<ParamGenerator<T2> >(g2_),
  14200. static_cast<ParamGenerator<T3> >(g3_),
  14201. static_cast<ParamGenerator<T4> >(g4_),
  14202. static_cast<ParamGenerator<T5> >(g5_),
  14203. static_cast<ParamGenerator<T6> >(g6_),
  14204. static_cast<ParamGenerator<T7> >(g7_),
  14205. static_cast<ParamGenerator<T8> >(g8_)));
  14206. }
  14207. private:
  14208. // No implementation - assignment is unsupported.
  14209. void operator=(const CartesianProductHolder8& other);
  14210. const Generator1 g1_;
  14211. const Generator2 g2_;
  14212. const Generator3 g3_;
  14213. const Generator4 g4_;
  14214. const Generator5 g5_;
  14215. const Generator6 g6_;
  14216. const Generator7 g7_;
  14217. const Generator8 g8_;
  14218. }; // class CartesianProductHolder8
  14219. template <class Generator1, class Generator2, class Generator3,
  14220. class Generator4, class Generator5, class Generator6, class Generator7,
  14221. class Generator8, class Generator9>
  14222. class CartesianProductHolder9 {
  14223. public:
  14224. CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
  14225. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  14226. const Generator6& g6, const Generator7& g7, const Generator8& g8,
  14227. const Generator9& g9)
  14228. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  14229. g9_(g9) {}
  14230. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14231. typename T6, typename T7, typename T8, typename T9>
  14232. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
  14233. T9> >() const {
  14234. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
  14235. T9> >(
  14236. new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
  14237. static_cast<ParamGenerator<T1> >(g1_),
  14238. static_cast<ParamGenerator<T2> >(g2_),
  14239. static_cast<ParamGenerator<T3> >(g3_),
  14240. static_cast<ParamGenerator<T4> >(g4_),
  14241. static_cast<ParamGenerator<T5> >(g5_),
  14242. static_cast<ParamGenerator<T6> >(g6_),
  14243. static_cast<ParamGenerator<T7> >(g7_),
  14244. static_cast<ParamGenerator<T8> >(g8_),
  14245. static_cast<ParamGenerator<T9> >(g9_)));
  14246. }
  14247. private:
  14248. // No implementation - assignment is unsupported.
  14249. void operator=(const CartesianProductHolder9& other);
  14250. const Generator1 g1_;
  14251. const Generator2 g2_;
  14252. const Generator3 g3_;
  14253. const Generator4 g4_;
  14254. const Generator5 g5_;
  14255. const Generator6 g6_;
  14256. const Generator7 g7_;
  14257. const Generator8 g8_;
  14258. const Generator9 g9_;
  14259. }; // class CartesianProductHolder9
  14260. template <class Generator1, class Generator2, class Generator3,
  14261. class Generator4, class Generator5, class Generator6, class Generator7,
  14262. class Generator8, class Generator9, class Generator10>
  14263. class CartesianProductHolder10 {
  14264. public:
  14265. CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
  14266. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  14267. const Generator6& g6, const Generator7& g7, const Generator8& g8,
  14268. const Generator9& g9, const Generator10& g10)
  14269. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  14270. g9_(g9), g10_(g10) {}
  14271. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14272. typename T6, typename T7, typename T8, typename T9, typename T10>
  14273. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
  14274. T9, T10> >() const {
  14275. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
  14276. T9, T10> >(
  14277. new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
  14278. T10>(
  14279. static_cast<ParamGenerator<T1> >(g1_),
  14280. static_cast<ParamGenerator<T2> >(g2_),
  14281. static_cast<ParamGenerator<T3> >(g3_),
  14282. static_cast<ParamGenerator<T4> >(g4_),
  14283. static_cast<ParamGenerator<T5> >(g5_),
  14284. static_cast<ParamGenerator<T6> >(g6_),
  14285. static_cast<ParamGenerator<T7> >(g7_),
  14286. static_cast<ParamGenerator<T8> >(g8_),
  14287. static_cast<ParamGenerator<T9> >(g9_),
  14288. static_cast<ParamGenerator<T10> >(g10_)));
  14289. }
  14290. private:
  14291. // No implementation - assignment is unsupported.
  14292. void operator=(const CartesianProductHolder10& other);
  14293. const Generator1 g1_;
  14294. const Generator2 g2_;
  14295. const Generator3 g3_;
  14296. const Generator4 g4_;
  14297. const Generator5 g5_;
  14298. const Generator6 g6_;
  14299. const Generator7 g7_;
  14300. const Generator8 g8_;
  14301. const Generator9 g9_;
  14302. const Generator10 g10_;
  14303. }; // class CartesianProductHolder10
  14304. # endif // GTEST_HAS_COMBINE
  14305. } // namespace internal
  14306. } // namespace testing
  14307. #endif // GTEST_HAS_PARAM_TEST
  14308. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
  14309. #if GTEST_HAS_PARAM_TEST
  14310. namespace testing {
  14311. // Functions producing parameter generators.
  14312. //
  14313. // Google Test uses these generators to produce parameters for value-
  14314. // parameterized tests. When a parameterized test case is instantiated
  14315. // with a particular generator, Google Test creates and runs tests
  14316. // for each element in the sequence produced by the generator.
  14317. //
  14318. // In the following sample, tests from test case FooTest are instantiated
  14319. // each three times with parameter values 3, 5, and 8:
  14320. //
  14321. // class FooTest : public TestWithParam<int> { ... };
  14322. //
  14323. // TEST_P(FooTest, TestThis) {
  14324. // }
  14325. // TEST_P(FooTest, TestThat) {
  14326. // }
  14327. // INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
  14328. //
  14329. // Range() returns generators providing sequences of values in a range.
  14330. //
  14331. // Synopsis:
  14332. // Range(start, end)
  14333. // - returns a generator producing a sequence of values {start, start+1,
  14334. // start+2, ..., }.
  14335. // Range(start, end, step)
  14336. // - returns a generator producing a sequence of values {start, start+step,
  14337. // start+step+step, ..., }.
  14338. // Notes:
  14339. // * The generated sequences never include end. For example, Range(1, 5)
  14340. // returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
  14341. // returns a generator producing {1, 3, 5, 7}.
  14342. // * start and end must have the same type. That type may be any integral or
  14343. // floating-point type or a user defined type satisfying these conditions:
  14344. // * It must be assignable (have operator=() defined).
  14345. // * It must have operator+() (operator+(int-compatible type) for
  14346. // two-operand version).
  14347. // * It must have operator<() defined.
  14348. // Elements in the resulting sequences will also have that type.
  14349. // * Condition start < end must be satisfied in order for resulting sequences
  14350. // to contain any elements.
  14351. //
  14352. template <typename T, typename IncrementT>
  14353. internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
  14354. return internal::ParamGenerator<T>(
  14355. new internal::RangeGenerator<T, IncrementT>(start, end, step));
  14356. }
  14357. template <typename T>
  14358. internal::ParamGenerator<T> Range(T start, T end) {
  14359. return Range(start, end, 1);
  14360. }
  14361. // ValuesIn() function allows generation of tests with parameters coming from
  14362. // a container.
  14363. //
  14364. // Synopsis:
  14365. // ValuesIn(const T (&array)[N])
  14366. // - returns a generator producing sequences with elements from
  14367. // a C-style array.
  14368. // ValuesIn(const Container& container)
  14369. // - returns a generator producing sequences with elements from
  14370. // an STL-style container.
  14371. // ValuesIn(Iterator begin, Iterator end)
  14372. // - returns a generator producing sequences with elements from
  14373. // a range [begin, end) defined by a pair of STL-style iterators. These
  14374. // iterators can also be plain C pointers.
  14375. //
  14376. // Please note that ValuesIn copies the values from the containers
  14377. // passed in and keeps them to generate tests in RUN_ALL_TESTS().
  14378. //
  14379. // Examples:
  14380. //
  14381. // This instantiates tests from test case StringTest
  14382. // each with C-string values of "foo", "bar", and "baz":
  14383. //
  14384. // const char* strings[] = {"foo", "bar", "baz"};
  14385. // INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
  14386. //
  14387. // This instantiates tests from test case StlStringTest
  14388. // each with STL strings with values "a" and "b":
  14389. //
  14390. // ::std::vector< ::std::string> GetParameterStrings() {
  14391. // ::std::vector< ::std::string> v;
  14392. // v.push_back("a");
  14393. // v.push_back("b");
  14394. // return v;
  14395. // }
  14396. //
  14397. // INSTANTIATE_TEST_CASE_P(CharSequence,
  14398. // StlStringTest,
  14399. // ValuesIn(GetParameterStrings()));
  14400. //
  14401. //
  14402. // This will also instantiate tests from CharTest
  14403. // each with parameter values 'a' and 'b':
  14404. //
  14405. // ::std::list<char> GetParameterChars() {
  14406. // ::std::list<char> list;
  14407. // list.push_back('a');
  14408. // list.push_back('b');
  14409. // return list;
  14410. // }
  14411. // ::std::list<char> l = GetParameterChars();
  14412. // INSTANTIATE_TEST_CASE_P(CharSequence2,
  14413. // CharTest,
  14414. // ValuesIn(l.begin(), l.end()));
  14415. //
  14416. template <typename ForwardIterator>
  14417. internal::ParamGenerator<
  14418. typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
  14419. ValuesIn(ForwardIterator begin, ForwardIterator end) {
  14420. typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
  14421. ::value_type ParamType;
  14422. return internal::ParamGenerator<ParamType>(
  14423. new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
  14424. }
  14425. template <typename T, size_t N>
  14426. internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
  14427. return ValuesIn(array, array + N);
  14428. }
  14429. template <class Container>
  14430. internal::ParamGenerator<typename Container::value_type> ValuesIn(
  14431. const Container& container) {
  14432. return ValuesIn(container.begin(), container.end());
  14433. }
  14434. // Values() allows generating tests from explicitly specified list of
  14435. // parameters.
  14436. //
  14437. // Synopsis:
  14438. // Values(T v1, T v2, ..., T vN)
  14439. // - returns a generator producing sequences with elements v1, v2, ..., vN.
  14440. //
  14441. // For example, this instantiates tests from test case BarTest each
  14442. // with values "one", "two", and "three":
  14443. //
  14444. // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
  14445. //
  14446. // This instantiates tests from test case BazTest each with values 1, 2, 3.5.
  14447. // The exact type of values will depend on the type of parameter in BazTest.
  14448. //
  14449. // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
  14450. //
  14451. // Currently, Values() supports from 1 to 50 parameters.
  14452. //
  14453. template <typename T1>
  14454. internal::ValueArray1<T1> Values(T1 v1) {
  14455. return internal::ValueArray1<T1>(v1);
  14456. }
  14457. template <typename T1, typename T2>
  14458. internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
  14459. return internal::ValueArray2<T1, T2>(v1, v2);
  14460. }
  14461. template <typename T1, typename T2, typename T3>
  14462. internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
  14463. return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
  14464. }
  14465. template <typename T1, typename T2, typename T3, typename T4>
  14466. internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
  14467. return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
  14468. }
  14469. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  14470. internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14471. T5 v5) {
  14472. return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
  14473. }
  14474. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14475. typename T6>
  14476. internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
  14477. T4 v4, T5 v5, T6 v6) {
  14478. return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
  14479. }
  14480. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14481. typename T6, typename T7>
  14482. internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
  14483. T4 v4, T5 v5, T6 v6, T7 v7) {
  14484. return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
  14485. v6, v7);
  14486. }
  14487. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14488. typename T6, typename T7, typename T8>
  14489. internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
  14490. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
  14491. return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
  14492. v5, v6, v7, v8);
  14493. }
  14494. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14495. typename T6, typename T7, typename T8, typename T9>
  14496. internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
  14497. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
  14498. return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
  14499. v4, v5, v6, v7, v8, v9);
  14500. }
  14501. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14502. typename T6, typename T7, typename T8, typename T9, typename T10>
  14503. internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
  14504. T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
  14505. return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
  14506. v2, v3, v4, v5, v6, v7, v8, v9, v10);
  14507. }
  14508. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14509. typename T6, typename T7, typename T8, typename T9, typename T10,
  14510. typename T11>
  14511. internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
  14512. T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14513. T10 v10, T11 v11) {
  14514. return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
  14515. T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
  14516. }
  14517. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14518. typename T6, typename T7, typename T8, typename T9, typename T10,
  14519. typename T11, typename T12>
  14520. internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14521. T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14522. T10 v10, T11 v11, T12 v12) {
  14523. return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14524. T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
  14525. }
  14526. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14527. typename T6, typename T7, typename T8, typename T9, typename T10,
  14528. typename T11, typename T12, typename T13>
  14529. internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  14530. T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14531. T10 v10, T11 v11, T12 v12, T13 v13) {
  14532. return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14533. T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
  14534. }
  14535. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14536. typename T6, typename T7, typename T8, typename T9, typename T10,
  14537. typename T11, typename T12, typename T13, typename T14>
  14538. internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14539. T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14540. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
  14541. return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14542. T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
  14543. v14);
  14544. }
  14545. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14546. typename T6, typename T7, typename T8, typename T9, typename T10,
  14547. typename T11, typename T12, typename T13, typename T14, typename T15>
  14548. internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14549. T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  14550. T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
  14551. return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14552. T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
  14553. v13, v14, v15);
  14554. }
  14555. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14556. typename T6, typename T7, typename T8, typename T9, typename T10,
  14557. typename T11, typename T12, typename T13, typename T14, typename T15,
  14558. typename T16>
  14559. internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14560. T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14561. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14562. T16 v16) {
  14563. return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14564. T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
  14565. v12, v13, v14, v15, v16);
  14566. }
  14567. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14568. typename T6, typename T7, typename T8, typename T9, typename T10,
  14569. typename T11, typename T12, typename T13, typename T14, typename T15,
  14570. typename T16, typename T17>
  14571. internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14572. T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14573. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14574. T16 v16, T17 v17) {
  14575. return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14576. T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
  14577. v11, v12, v13, v14, v15, v16, v17);
  14578. }
  14579. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14580. typename T6, typename T7, typename T8, typename T9, typename T10,
  14581. typename T11, typename T12, typename T13, typename T14, typename T15,
  14582. typename T16, typename T17, typename T18>
  14583. internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14584. T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
  14585. T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14586. T16 v16, T17 v17, T18 v18) {
  14587. return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14588. T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
  14589. v10, v11, v12, v13, v14, v15, v16, v17, v18);
  14590. }
  14591. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14592. typename T6, typename T7, typename T8, typename T9, typename T10,
  14593. typename T11, typename T12, typename T13, typename T14, typename T15,
  14594. typename T16, typename T17, typename T18, typename T19>
  14595. internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14596. T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
  14597. T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
  14598. T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
  14599. return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14600. T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
  14601. v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
  14602. }
  14603. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14604. typename T6, typename T7, typename T8, typename T9, typename T10,
  14605. typename T11, typename T12, typename T13, typename T14, typename T15,
  14606. typename T16, typename T17, typename T18, typename T19, typename T20>
  14607. internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14608. T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14609. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  14610. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
  14611. return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14612. T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
  14613. v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
  14614. }
  14615. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14616. typename T6, typename T7, typename T8, typename T9, typename T10,
  14617. typename T11, typename T12, typename T13, typename T14, typename T15,
  14618. typename T16, typename T17, typename T18, typename T19, typename T20,
  14619. typename T21>
  14620. internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14621. T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14622. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  14623. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
  14624. return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14625. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
  14626. v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
  14627. }
  14628. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14629. typename T6, typename T7, typename T8, typename T9, typename T10,
  14630. typename T11, typename T12, typename T13, typename T14, typename T15,
  14631. typename T16, typename T17, typename T18, typename T19, typename T20,
  14632. typename T21, typename T22>
  14633. internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14634. T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
  14635. T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14636. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14637. T21 v21, T22 v22) {
  14638. return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14639. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
  14640. v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  14641. v20, v21, v22);
  14642. }
  14643. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14644. typename T6, typename T7, typename T8, typename T9, typename T10,
  14645. typename T11, typename T12, typename T13, typename T14, typename T15,
  14646. typename T16, typename T17, typename T18, typename T19, typename T20,
  14647. typename T21, typename T22, typename T23>
  14648. internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14649. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
  14650. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14651. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14652. T21 v21, T22 v22, T23 v23) {
  14653. return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14654. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
  14655. v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  14656. v20, v21, v22, v23);
  14657. }
  14658. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14659. typename T6, typename T7, typename T8, typename T9, typename T10,
  14660. typename T11, typename T12, typename T13, typename T14, typename T15,
  14661. typename T16, typename T17, typename T18, typename T19, typename T20,
  14662. typename T21, typename T22, typename T23, typename T24>
  14663. internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14664. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
  14665. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14666. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14667. T21 v21, T22 v22, T23 v23, T24 v24) {
  14668. return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14669. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
  14670. v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
  14671. v19, v20, v21, v22, v23, v24);
  14672. }
  14673. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14674. typename T6, typename T7, typename T8, typename T9, typename T10,
  14675. typename T11, typename T12, typename T13, typename T14, typename T15,
  14676. typename T16, typename T17, typename T18, typename T19, typename T20,
  14677. typename T21, typename T22, typename T23, typename T24, typename T25>
  14678. internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14679. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
  14680. T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
  14681. T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
  14682. T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
  14683. return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14684. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
  14685. v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
  14686. v18, v19, v20, v21, v22, v23, v24, v25);
  14687. }
  14688. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14689. typename T6, typename T7, typename T8, typename T9, typename T10,
  14690. typename T11, typename T12, typename T13, typename T14, typename T15,
  14691. typename T16, typename T17, typename T18, typename T19, typename T20,
  14692. typename T21, typename T22, typename T23, typename T24, typename T25,
  14693. typename T26>
  14694. internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14695. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14696. T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14697. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14698. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14699. T26 v26) {
  14700. return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14701. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14702. T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
  14703. v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
  14704. }
  14705. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14706. typename T6, typename T7, typename T8, typename T9, typename T10,
  14707. typename T11, typename T12, typename T13, typename T14, typename T15,
  14708. typename T16, typename T17, typename T18, typename T19, typename T20,
  14709. typename T21, typename T22, typename T23, typename T24, typename T25,
  14710. typename T26, typename T27>
  14711. internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14712. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  14713. T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14714. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14715. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14716. T26 v26, T27 v27) {
  14717. return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14718. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14719. T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
  14720. v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
  14721. }
  14722. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14723. typename T6, typename T7, typename T8, typename T9, typename T10,
  14724. typename T11, typename T12, typename T13, typename T14, typename T15,
  14725. typename T16, typename T17, typename T18, typename T19, typename T20,
  14726. typename T21, typename T22, typename T23, typename T24, typename T25,
  14727. typename T26, typename T27, typename T28>
  14728. internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14729. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  14730. T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14731. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14732. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14733. T26 v26, T27 v27, T28 v28) {
  14734. return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14735. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14736. T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
  14737. v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
  14738. v28);
  14739. }
  14740. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14741. typename T6, typename T7, typename T8, typename T9, typename T10,
  14742. typename T11, typename T12, typename T13, typename T14, typename T15,
  14743. typename T16, typename T17, typename T18, typename T19, typename T20,
  14744. typename T21, typename T22, typename T23, typename T24, typename T25,
  14745. typename T26, typename T27, typename T28, typename T29>
  14746. internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14747. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14748. T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14749. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14750. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14751. T26 v26, T27 v27, T28 v28, T29 v29) {
  14752. return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14753. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14754. T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
  14755. v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
  14756. v27, v28, v29);
  14757. }
  14758. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14759. typename T6, typename T7, typename T8, typename T9, typename T10,
  14760. typename T11, typename T12, typename T13, typename T14, typename T15,
  14761. typename T16, typename T17, typename T18, typename T19, typename T20,
  14762. typename T21, typename T22, typename T23, typename T24, typename T25,
  14763. typename T26, typename T27, typename T28, typename T29, typename T30>
  14764. internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14765. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14766. T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  14767. T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
  14768. T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
  14769. T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
  14770. return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14771. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14772. T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
  14773. v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
  14774. v26, v27, v28, v29, v30);
  14775. }
  14776. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14777. typename T6, typename T7, typename T8, typename T9, typename T10,
  14778. typename T11, typename T12, typename T13, typename T14, typename T15,
  14779. typename T16, typename T17, typename T18, typename T19, typename T20,
  14780. typename T21, typename T22, typename T23, typename T24, typename T25,
  14781. typename T26, typename T27, typename T28, typename T29, typename T30,
  14782. typename T31>
  14783. internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14784. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14785. T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14786. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14787. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  14788. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
  14789. return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14790. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14791. T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
  14792. v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
  14793. v25, v26, v27, v28, v29, v30, v31);
  14794. }
  14795. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14796. typename T6, typename T7, typename T8, typename T9, typename T10,
  14797. typename T11, typename T12, typename T13, typename T14, typename T15,
  14798. typename T16, typename T17, typename T18, typename T19, typename T20,
  14799. typename T21, typename T22, typename T23, typename T24, typename T25,
  14800. typename T26, typename T27, typename T28, typename T29, typename T30,
  14801. typename T31, typename T32>
  14802. internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14803. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14804. T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14805. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14806. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  14807. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  14808. T32 v32) {
  14809. return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14810. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14811. T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
  14812. v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  14813. v24, v25, v26, v27, v28, v29, v30, v31, v32);
  14814. }
  14815. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14816. typename T6, typename T7, typename T8, typename T9, typename T10,
  14817. typename T11, typename T12, typename T13, typename T14, typename T15,
  14818. typename T16, typename T17, typename T18, typename T19, typename T20,
  14819. typename T21, typename T22, typename T23, typename T24, typename T25,
  14820. typename T26, typename T27, typename T28, typename T29, typename T30,
  14821. typename T31, typename T32, typename T33>
  14822. internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14823. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14824. T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
  14825. T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14826. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  14827. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  14828. T32 v32, T33 v33) {
  14829. return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14830. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14831. T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
  14832. v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  14833. v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
  14834. }
  14835. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14836. typename T6, typename T7, typename T8, typename T9, typename T10,
  14837. typename T11, typename T12, typename T13, typename T14, typename T15,
  14838. typename T16, typename T17, typename T18, typename T19, typename T20,
  14839. typename T21, typename T22, typename T23, typename T24, typename T25,
  14840. typename T26, typename T27, typename T28, typename T29, typename T30,
  14841. typename T31, typename T32, typename T33, typename T34>
  14842. internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14843. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14844. T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
  14845. T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
  14846. T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
  14847. T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
  14848. T31 v31, T32 v32, T33 v33, T34 v34) {
  14849. return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14850. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14851. T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
  14852. v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
  14853. v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
  14854. }
  14855. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14856. typename T6, typename T7, typename T8, typename T9, typename T10,
  14857. typename T11, typename T12, typename T13, typename T14, typename T15,
  14858. typename T16, typename T17, typename T18, typename T19, typename T20,
  14859. typename T21, typename T22, typename T23, typename T24, typename T25,
  14860. typename T26, typename T27, typename T28, typename T29, typename T30,
  14861. typename T31, typename T32, typename T33, typename T34, typename T35>
  14862. internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14863. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14864. T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14865. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  14866. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
  14867. T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
  14868. T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
  14869. return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14870. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14871. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
  14872. v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
  14873. v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
  14874. }
  14875. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14876. typename T6, typename T7, typename T8, typename T9, typename T10,
  14877. typename T11, typename T12, typename T13, typename T14, typename T15,
  14878. typename T16, typename T17, typename T18, typename T19, typename T20,
  14879. typename T21, typename T22, typename T23, typename T24, typename T25,
  14880. typename T26, typename T27, typename T28, typename T29, typename T30,
  14881. typename T31, typename T32, typename T33, typename T34, typename T35,
  14882. typename T36>
  14883. internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14884. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14885. T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14886. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  14887. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
  14888. T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
  14889. T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
  14890. return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14891. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14892. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
  14893. v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  14894. v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
  14895. v34, v35, v36);
  14896. }
  14897. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14898. typename T6, typename T7, typename T8, typename T9, typename T10,
  14899. typename T11, typename T12, typename T13, typename T14, typename T15,
  14900. typename T16, typename T17, typename T18, typename T19, typename T20,
  14901. typename T21, typename T22, typename T23, typename T24, typename T25,
  14902. typename T26, typename T27, typename T28, typename T29, typename T30,
  14903. typename T31, typename T32, typename T33, typename T34, typename T35,
  14904. typename T36, typename T37>
  14905. internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14906. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14907. T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
  14908. T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14909. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14910. T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
  14911. T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
  14912. T37 v37) {
  14913. return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14914. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14915. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
  14916. v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  14917. v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
  14918. v34, v35, v36, v37);
  14919. }
  14920. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14921. typename T6, typename T7, typename T8, typename T9, typename T10,
  14922. typename T11, typename T12, typename T13, typename T14, typename T15,
  14923. typename T16, typename T17, typename T18, typename T19, typename T20,
  14924. typename T21, typename T22, typename T23, typename T24, typename T25,
  14925. typename T26, typename T27, typename T28, typename T29, typename T30,
  14926. typename T31, typename T32, typename T33, typename T34, typename T35,
  14927. typename T36, typename T37, typename T38>
  14928. internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14929. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14930. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
  14931. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14932. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14933. T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
  14934. T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
  14935. T37 v37, T38 v38) {
  14936. return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14937. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14938. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
  14939. v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
  14940. v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
  14941. v33, v34, v35, v36, v37, v38);
  14942. }
  14943. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14944. typename T6, typename T7, typename T8, typename T9, typename T10,
  14945. typename T11, typename T12, typename T13, typename T14, typename T15,
  14946. typename T16, typename T17, typename T18, typename T19, typename T20,
  14947. typename T21, typename T22, typename T23, typename T24, typename T25,
  14948. typename T26, typename T27, typename T28, typename T29, typename T30,
  14949. typename T31, typename T32, typename T33, typename T34, typename T35,
  14950. typename T36, typename T37, typename T38, typename T39>
  14951. internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14952. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14953. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
  14954. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14955. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14956. T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
  14957. T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
  14958. T37 v37, T38 v38, T39 v39) {
  14959. return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14960. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14961. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
  14962. v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
  14963. v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
  14964. v32, v33, v34, v35, v36, v37, v38, v39);
  14965. }
  14966. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14967. typename T6, typename T7, typename T8, typename T9, typename T10,
  14968. typename T11, typename T12, typename T13, typename T14, typename T15,
  14969. typename T16, typename T17, typename T18, typename T19, typename T20,
  14970. typename T21, typename T22, typename T23, typename T24, typename T25,
  14971. typename T26, typename T27, typename T28, typename T29, typename T30,
  14972. typename T31, typename T32, typename T33, typename T34, typename T35,
  14973. typename T36, typename T37, typename T38, typename T39, typename T40>
  14974. internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14975. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14976. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
  14977. T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
  14978. T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
  14979. T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
  14980. T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
  14981. T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
  14982. return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14983. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14984. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14985. T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
  14986. v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
  14987. v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
  14988. }
  14989. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14990. typename T6, typename T7, typename T8, typename T9, typename T10,
  14991. typename T11, typename T12, typename T13, typename T14, typename T15,
  14992. typename T16, typename T17, typename T18, typename T19, typename T20,
  14993. typename T21, typename T22, typename T23, typename T24, typename T25,
  14994. typename T26, typename T27, typename T28, typename T29, typename T30,
  14995. typename T31, typename T32, typename T33, typename T34, typename T35,
  14996. typename T36, typename T37, typename T38, typename T39, typename T40,
  14997. typename T41>
  14998. internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14999. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15000. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  15001. T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  15002. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  15003. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  15004. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  15005. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
  15006. return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15007. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15008. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  15009. T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
  15010. v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
  15011. v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
  15012. }
  15013. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15014. typename T6, typename T7, typename T8, typename T9, typename T10,
  15015. typename T11, typename T12, typename T13, typename T14, typename T15,
  15016. typename T16, typename T17, typename T18, typename T19, typename T20,
  15017. typename T21, typename T22, typename T23, typename T24, typename T25,
  15018. typename T26, typename T27, typename T28, typename T29, typename T30,
  15019. typename T31, typename T32, typename T33, typename T34, typename T35,
  15020. typename T36, typename T37, typename T38, typename T39, typename T40,
  15021. typename T41, typename T42>
  15022. internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15023. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15024. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  15025. T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  15026. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  15027. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  15028. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  15029. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  15030. T42 v42) {
  15031. return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15032. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15033. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  15034. T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
  15035. v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
  15036. v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
  15037. v42);
  15038. }
  15039. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15040. typename T6, typename T7, typename T8, typename T9, typename T10,
  15041. typename T11, typename T12, typename T13, typename T14, typename T15,
  15042. typename T16, typename T17, typename T18, typename T19, typename T20,
  15043. typename T21, typename T22, typename T23, typename T24, typename T25,
  15044. typename T26, typename T27, typename T28, typename T29, typename T30,
  15045. typename T31, typename T32, typename T33, typename T34, typename T35,
  15046. typename T36, typename T37, typename T38, typename T39, typename T40,
  15047. typename T41, typename T42, typename T43>
  15048. internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15049. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15050. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  15051. T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  15052. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  15053. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  15054. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  15055. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  15056. T42 v42, T43 v43) {
  15057. return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15058. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15059. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  15060. T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
  15061. v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
  15062. v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
  15063. v41, v42, v43);
  15064. }
  15065. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15066. typename T6, typename T7, typename T8, typename T9, typename T10,
  15067. typename T11, typename T12, typename T13, typename T14, typename T15,
  15068. typename T16, typename T17, typename T18, typename T19, typename T20,
  15069. typename T21, typename T22, typename T23, typename T24, typename T25,
  15070. typename T26, typename T27, typename T28, typename T29, typename T30,
  15071. typename T31, typename T32, typename T33, typename T34, typename T35,
  15072. typename T36, typename T37, typename T38, typename T39, typename T40,
  15073. typename T41, typename T42, typename T43, typename T44>
  15074. internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15075. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15076. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  15077. T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  15078. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  15079. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  15080. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  15081. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  15082. T42 v42, T43 v43, T44 v44) {
  15083. return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15084. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15085. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  15086. T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
  15087. v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
  15088. v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
  15089. v40, v41, v42, v43, v44);
  15090. }
  15091. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15092. typename T6, typename T7, typename T8, typename T9, typename T10,
  15093. typename T11, typename T12, typename T13, typename T14, typename T15,
  15094. typename T16, typename T17, typename T18, typename T19, typename T20,
  15095. typename T21, typename T22, typename T23, typename T24, typename T25,
  15096. typename T26, typename T27, typename T28, typename T29, typename T30,
  15097. typename T31, typename T32, typename T33, typename T34, typename T35,
  15098. typename T36, typename T37, typename T38, typename T39, typename T40,
  15099. typename T41, typename T42, typename T43, typename T44, typename T45>
  15100. internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15101. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15102. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  15103. T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  15104. T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
  15105. T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
  15106. T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
  15107. T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
  15108. T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
  15109. return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15110. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15111. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  15112. T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
  15113. v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
  15114. v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
  15115. v39, v40, v41, v42, v43, v44, v45);
  15116. }
  15117. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15118. typename T6, typename T7, typename T8, typename T9, typename T10,
  15119. typename T11, typename T12, typename T13, typename T14, typename T15,
  15120. typename T16, typename T17, typename T18, typename T19, typename T20,
  15121. typename T21, typename T22, typename T23, typename T24, typename T25,
  15122. typename T26, typename T27, typename T28, typename T29, typename T30,
  15123. typename T31, typename T32, typename T33, typename T34, typename T35,
  15124. typename T36, typename T37, typename T38, typename T39, typename T40,
  15125. typename T41, typename T42, typename T43, typename T44, typename T45,
  15126. typename T46>
  15127. internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15128. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15129. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  15130. T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  15131. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  15132. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  15133. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  15134. T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
  15135. T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
  15136. return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15137. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15138. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  15139. T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
  15140. v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  15141. v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
  15142. v38, v39, v40, v41, v42, v43, v44, v45, v46);
  15143. }
  15144. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15145. typename T6, typename T7, typename T8, typename T9, typename T10,
  15146. typename T11, typename T12, typename T13, typename T14, typename T15,
  15147. typename T16, typename T17, typename T18, typename T19, typename T20,
  15148. typename T21, typename T22, typename T23, typename T24, typename T25,
  15149. typename T26, typename T27, typename T28, typename T29, typename T30,
  15150. typename T31, typename T32, typename T33, typename T34, typename T35,
  15151. typename T36, typename T37, typename T38, typename T39, typename T40,
  15152. typename T41, typename T42, typename T43, typename T44, typename T45,
  15153. typename T46, typename T47>
  15154. internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15155. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15156. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  15157. T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  15158. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  15159. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  15160. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  15161. T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
  15162. T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
  15163. return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15164. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15165. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  15166. T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
  15167. v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  15168. v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
  15169. v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
  15170. }
  15171. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15172. typename T6, typename T7, typename T8, typename T9, typename T10,
  15173. typename T11, typename T12, typename T13, typename T14, typename T15,
  15174. typename T16, typename T17, typename T18, typename T19, typename T20,
  15175. typename T21, typename T22, typename T23, typename T24, typename T25,
  15176. typename T26, typename T27, typename T28, typename T29, typename T30,
  15177. typename T31, typename T32, typename T33, typename T34, typename T35,
  15178. typename T36, typename T37, typename T38, typename T39, typename T40,
  15179. typename T41, typename T42, typename T43, typename T44, typename T45,
  15180. typename T46, typename T47, typename T48>
  15181. internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15182. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15183. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  15184. T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
  15185. T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  15186. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  15187. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  15188. T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
  15189. T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
  15190. T48 v48) {
  15191. return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15192. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15193. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  15194. T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
  15195. v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
  15196. v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
  15197. v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
  15198. }
  15199. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15200. typename T6, typename T7, typename T8, typename T9, typename T10,
  15201. typename T11, typename T12, typename T13, typename T14, typename T15,
  15202. typename T16, typename T17, typename T18, typename T19, typename T20,
  15203. typename T21, typename T22, typename T23, typename T24, typename T25,
  15204. typename T26, typename T27, typename T28, typename T29, typename T30,
  15205. typename T31, typename T32, typename T33, typename T34, typename T35,
  15206. typename T36, typename T37, typename T38, typename T39, typename T40,
  15207. typename T41, typename T42, typename T43, typename T44, typename T45,
  15208. typename T46, typename T47, typename T48, typename T49>
  15209. internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15210. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15211. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  15212. T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
  15213. T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
  15214. T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
  15215. T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
  15216. T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
  15217. T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
  15218. T47 v47, T48 v48, T49 v49) {
  15219. return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15220. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15221. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  15222. T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
  15223. v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
  15224. v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
  15225. v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
  15226. }
  15227. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15228. typename T6, typename T7, typename T8, typename T9, typename T10,
  15229. typename T11, typename T12, typename T13, typename T14, typename T15,
  15230. typename T16, typename T17, typename T18, typename T19, typename T20,
  15231. typename T21, typename T22, typename T23, typename T24, typename T25,
  15232. typename T26, typename T27, typename T28, typename T29, typename T30,
  15233. typename T31, typename T32, typename T33, typename T34, typename T35,
  15234. typename T36, typename T37, typename T38, typename T39, typename T40,
  15235. typename T41, typename T42, typename T43, typename T44, typename T45,
  15236. typename T46, typename T47, typename T48, typename T49, typename T50>
  15237. internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15238. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15239. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  15240. T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  15241. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  15242. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
  15243. T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
  15244. T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
  15245. T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
  15246. T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
  15247. return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15248. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15249. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  15250. T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
  15251. v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  15252. v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
  15253. v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
  15254. v48, v49, v50);
  15255. }
  15256. // Bool() allows generating tests with parameters in a set of (false, true).
  15257. //
  15258. // Synopsis:
  15259. // Bool()
  15260. // - returns a generator producing sequences with elements {false, true}.
  15261. //
  15262. // It is useful when testing code that depends on Boolean flags. Combinations
  15263. // of multiple flags can be tested when several Bool()'s are combined using
  15264. // Combine() function.
  15265. //
  15266. // In the following example all tests in the test case FlagDependentTest
  15267. // will be instantiated twice with parameters false and true.
  15268. //
  15269. // class FlagDependentTest : public testing::TestWithParam<bool> {
  15270. // virtual void SetUp() {
  15271. // external_flag = GetParam();
  15272. // }
  15273. // }
  15274. // INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
  15275. //
  15276. inline internal::ParamGenerator<bool> Bool() {
  15277. return Values(false, true);
  15278. }
  15279. # if GTEST_HAS_COMBINE
  15280. // Combine() allows the user to combine two or more sequences to produce
  15281. // values of a Cartesian product of those sequences' elements.
  15282. //
  15283. // Synopsis:
  15284. // Combine(gen1, gen2, ..., genN)
  15285. // - returns a generator producing sequences with elements coming from
  15286. // the Cartesian product of elements from the sequences generated by
  15287. // gen1, gen2, ..., genN. The sequence elements will have a type of
  15288. // tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
  15289. // of elements from sequences produces by gen1, gen2, ..., genN.
  15290. //
  15291. // Combine can have up to 10 arguments. This number is currently limited
  15292. // by the maximum number of elements in the tuple implementation used by Google
  15293. // Test.
  15294. //
  15295. // Example:
  15296. //
  15297. // This will instantiate tests in test case AnimalTest each one with
  15298. // the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
  15299. // tuple("dog", BLACK), and tuple("dog", WHITE):
  15300. //
  15301. // enum Color { BLACK, GRAY, WHITE };
  15302. // class AnimalTest
  15303. // : public testing::TestWithParam<tuple<const char*, Color> > {...};
  15304. //
  15305. // TEST_P(AnimalTest, AnimalLooksNice) {...}
  15306. //
  15307. // INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
  15308. // Combine(Values("cat", "dog"),
  15309. // Values(BLACK, WHITE)));
  15310. //
  15311. // This will instantiate tests in FlagDependentTest with all variations of two
  15312. // Boolean flags:
  15313. //
  15314. // class FlagDependentTest
  15315. // : public testing::TestWithParam<tuple<bool, bool> > {
  15316. // virtual void SetUp() {
  15317. // // Assigns external_flag_1 and external_flag_2 values from the tuple.
  15318. // tie(external_flag_1, external_flag_2) = GetParam();
  15319. // }
  15320. // };
  15321. //
  15322. // TEST_P(FlagDependentTest, TestFeature1) {
  15323. // // Test your code using external_flag_1 and external_flag_2 here.
  15324. // }
  15325. // INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
  15326. // Combine(Bool(), Bool()));
  15327. //
  15328. template <typename Generator1, typename Generator2>
  15329. internal::CartesianProductHolder2<Generator1, Generator2> Combine(
  15330. const Generator1& g1, const Generator2& g2) {
  15331. return internal::CartesianProductHolder2<Generator1, Generator2>(
  15332. g1, g2);
  15333. }
  15334. template <typename Generator1, typename Generator2, typename Generator3>
  15335. internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
  15336. const Generator1& g1, const Generator2& g2, const Generator3& g3) {
  15337. return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
  15338. g1, g2, g3);
  15339. }
  15340. template <typename Generator1, typename Generator2, typename Generator3,
  15341. typename Generator4>
  15342. internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
  15343. Generator4> Combine(
  15344. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  15345. const Generator4& g4) {
  15346. return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
  15347. Generator4>(
  15348. g1, g2, g3, g4);
  15349. }
  15350. template <typename Generator1, typename Generator2, typename Generator3,
  15351. typename Generator4, typename Generator5>
  15352. internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
  15353. Generator4, Generator5> Combine(
  15354. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  15355. const Generator4& g4, const Generator5& g5) {
  15356. return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
  15357. Generator4, Generator5>(
  15358. g1, g2, g3, g4, g5);
  15359. }
  15360. template <typename Generator1, typename Generator2, typename Generator3,
  15361. typename Generator4, typename Generator5, typename Generator6>
  15362. internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
  15363. Generator4, Generator5, Generator6> Combine(
  15364. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  15365. const Generator4& g4, const Generator5& g5, const Generator6& g6) {
  15366. return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
  15367. Generator4, Generator5, Generator6>(
  15368. g1, g2, g3, g4, g5, g6);
  15369. }
  15370. template <typename Generator1, typename Generator2, typename Generator3,
  15371. typename Generator4, typename Generator5, typename Generator6,
  15372. typename Generator7>
  15373. internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
  15374. Generator4, Generator5, Generator6, Generator7> Combine(
  15375. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  15376. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  15377. const Generator7& g7) {
  15378. return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
  15379. Generator4, Generator5, Generator6, Generator7>(
  15380. g1, g2, g3, g4, g5, g6, g7);
  15381. }
  15382. template <typename Generator1, typename Generator2, typename Generator3,
  15383. typename Generator4, typename Generator5, typename Generator6,
  15384. typename Generator7, typename Generator8>
  15385. internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
  15386. Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
  15387. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  15388. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  15389. const Generator7& g7, const Generator8& g8) {
  15390. return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
  15391. Generator4, Generator5, Generator6, Generator7, Generator8>(
  15392. g1, g2, g3, g4, g5, g6, g7, g8);
  15393. }
  15394. template <typename Generator1, typename Generator2, typename Generator3,
  15395. typename Generator4, typename Generator5, typename Generator6,
  15396. typename Generator7, typename Generator8, typename Generator9>
  15397. internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
  15398. Generator4, Generator5, Generator6, Generator7, Generator8,
  15399. Generator9> Combine(
  15400. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  15401. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  15402. const Generator7& g7, const Generator8& g8, const Generator9& g9) {
  15403. return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
  15404. Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
  15405. g1, g2, g3, g4, g5, g6, g7, g8, g9);
  15406. }
  15407. template <typename Generator1, typename Generator2, typename Generator3,
  15408. typename Generator4, typename Generator5, typename Generator6,
  15409. typename Generator7, typename Generator8, typename Generator9,
  15410. typename Generator10>
  15411. internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
  15412. Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
  15413. Generator10> Combine(
  15414. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  15415. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  15416. const Generator7& g7, const Generator8& g8, const Generator9& g9,
  15417. const Generator10& g10) {
  15418. return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
  15419. Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
  15420. Generator10>(
  15421. g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
  15422. }
  15423. # endif // GTEST_HAS_COMBINE
  15424. # define TEST_P(test_case_name, test_name) \
  15425. class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
  15426. : public test_case_name { \
  15427. public: \
  15428. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
  15429. virtual void TestBody(); \
  15430. private: \
  15431. static int AddToRegistry() { \
  15432. ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
  15433. GetTestCasePatternHolder<test_case_name>(\
  15434. #test_case_name, __FILE__, __LINE__)->AddTestPattern(\
  15435. #test_case_name, \
  15436. #test_name, \
  15437. new ::testing::internal::TestMetaFactory< \
  15438. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \
  15439. return 0; \
  15440. } \
  15441. static int gtest_registering_dummy_; \
  15442. GTEST_DISALLOW_COPY_AND_ASSIGN_(\
  15443. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
  15444. }; \
  15445. int GTEST_TEST_CLASS_NAME_(test_case_name, \
  15446. test_name)::gtest_registering_dummy_ = \
  15447. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
  15448. void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
  15449. # define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
  15450. ::testing::internal::ParamGenerator<test_case_name::ParamType> \
  15451. gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
  15452. int gtest_##prefix##test_case_name##_dummy_ = \
  15453. ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
  15454. GetTestCasePatternHolder<test_case_name>(\
  15455. #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\
  15456. #prefix, \
  15457. &gtest_##prefix##test_case_name##_EvalGenerator_, \
  15458. __FILE__, __LINE__)
  15459. } // namespace testing
  15460. #endif // GTEST_HAS_PARAM_TEST
  15461. #endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
  15462. // Copyright 2006, Google Inc.
  15463. // All rights reserved.
  15464. //
  15465. // Redistribution and use in source and binary forms, with or without
  15466. // modification, are permitted provided that the following conditions are
  15467. // met:
  15468. //
  15469. // * Redistributions of source code must retain the above copyright
  15470. // notice, this list of conditions and the following disclaimer.
  15471. // * Redistributions in binary form must reproduce the above
  15472. // copyright notice, this list of conditions and the following disclaimer
  15473. // in the documentation and/or other materials provided with the
  15474. // distribution.
  15475. // * Neither the name of Google Inc. nor the names of its
  15476. // contributors may be used to endorse or promote products derived from
  15477. // this software without specific prior written permission.
  15478. //
  15479. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  15480. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  15481. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  15482. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  15483. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15484. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  15485. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  15486. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  15487. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  15488. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  15489. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  15490. //
  15491. // Author: wan@google.com (Zhanyong Wan)
  15492. //
  15493. // Google C++ Testing Framework definitions useful in production code.
  15494. #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
  15495. #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
  15496. // When you need to test the private or protected members of a class,
  15497. // use the FRIEND_TEST macro to declare your tests as friends of the
  15498. // class. For example:
  15499. //
  15500. // class MyClass {
  15501. // private:
  15502. // void MyMethod();
  15503. // FRIEND_TEST(MyClassTest, MyMethod);
  15504. // };
  15505. //
  15506. // class MyClassTest : public testing::Test {
  15507. // // ...
  15508. // };
  15509. //
  15510. // TEST_F(MyClassTest, MyMethod) {
  15511. // // Can call MyClass::MyMethod() here.
  15512. // }
  15513. #define FRIEND_TEST(test_case_name, test_name)\
  15514. friend class test_case_name##_##test_name##_Test
  15515. #endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
  15516. // Copyright 2008, Google Inc.
  15517. // All rights reserved.
  15518. //
  15519. // Redistribution and use in source and binary forms, with or without
  15520. // modification, are permitted provided that the following conditions are
  15521. // met:
  15522. //
  15523. // * Redistributions of source code must retain the above copyright
  15524. // notice, this list of conditions and the following disclaimer.
  15525. // * Redistributions in binary form must reproduce the above
  15526. // copyright notice, this list of conditions and the following disclaimer
  15527. // in the documentation and/or other materials provided with the
  15528. // distribution.
  15529. // * Neither the name of Google Inc. nor the names of its
  15530. // contributors may be used to endorse or promote products derived from
  15531. // this software without specific prior written permission.
  15532. //
  15533. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  15534. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  15535. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  15536. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  15537. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15538. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  15539. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  15540. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  15541. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  15542. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  15543. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  15544. //
  15545. // Author: mheule@google.com (Markus Heule)
  15546. //
  15547. #ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
  15548. #define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
  15549. #include <iosfwd>
  15550. #include <vector>
  15551. namespace testing {
  15552. // A copyable object representing the result of a test part (i.e. an
  15553. // assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
  15554. //
  15555. // Don't inherit from TestPartResult as its destructor is not virtual.
  15556. class GTEST_API_ TestPartResult {
  15557. public:
  15558. // The possible outcomes of a test part (i.e. an assertion or an
  15559. // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
  15560. enum Type {
  15561. kSuccess, // Succeeded.
  15562. kNonFatalFailure, // Failed but the test can continue.
  15563. kFatalFailure // Failed and the test should be terminated.
  15564. };
  15565. // C'tor. TestPartResult does NOT have a default constructor.
  15566. // Always use this constructor (with parameters) to create a
  15567. // TestPartResult object.
  15568. TestPartResult(Type a_type,
  15569. const char* a_file_name,
  15570. int a_line_number,
  15571. const char* a_message)
  15572. : type_(a_type),
  15573. file_name_(a_file_name == NULL ? "" : a_file_name),
  15574. line_number_(a_line_number),
  15575. summary_(ExtractSummary(a_message)),
  15576. message_(a_message) {
  15577. }
  15578. // Gets the outcome of the test part.
  15579. Type type() const { return type_; }
  15580. // Gets the name of the source file where the test part took place, or
  15581. // NULL if it's unknown.
  15582. const char* file_name() const {
  15583. return file_name_.empty() ? NULL : file_name_.c_str();
  15584. }
  15585. // Gets the line in the source file where the test part took place,
  15586. // or -1 if it's unknown.
  15587. int line_number() const { return line_number_; }
  15588. // Gets the summary of the failure message.
  15589. const char* summary() const { return summary_.c_str(); }
  15590. // Gets the message associated with the test part.
  15591. const char* message() const { return message_.c_str(); }
  15592. // Returns true iff the test part passed.
  15593. bool passed() const { return type_ == kSuccess; }
  15594. // Returns true iff the test part failed.
  15595. bool failed() const { return type_ != kSuccess; }
  15596. // Returns true iff the test part non-fatally failed.
  15597. bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
  15598. // Returns true iff the test part fatally failed.
  15599. bool fatally_failed() const { return type_ == kFatalFailure; }
  15600. private:
  15601. Type type_;
  15602. // Gets the summary of the failure message by omitting the stack
  15603. // trace in it.
  15604. static std::string ExtractSummary(const char* message);
  15605. // The name of the source file where the test part took place, or
  15606. // "" if the source file is unknown.
  15607. std::string file_name_;
  15608. // The line in the source file where the test part took place, or -1
  15609. // if the line number is unknown.
  15610. int line_number_;
  15611. std::string summary_; // The test failure summary.
  15612. std::string message_; // The test failure message.
  15613. };
  15614. // Prints a TestPartResult object.
  15615. std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
  15616. // An array of TestPartResult objects.
  15617. //
  15618. // Don't inherit from TestPartResultArray as its destructor is not
  15619. // virtual.
  15620. class GTEST_API_ TestPartResultArray {
  15621. public:
  15622. TestPartResultArray() {}
  15623. // Appends the given TestPartResult to the array.
  15624. void Append(const TestPartResult& result);
  15625. // Returns the TestPartResult at the given index (0-based).
  15626. const TestPartResult& GetTestPartResult(int index) const;
  15627. // Returns the number of TestPartResult objects in the array.
  15628. int size() const;
  15629. private:
  15630. std::vector<TestPartResult> array_;
  15631. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
  15632. };
  15633. // This interface knows how to report a test part result.
  15634. class TestPartResultReporterInterface {
  15635. public:
  15636. virtual ~TestPartResultReporterInterface() {}
  15637. virtual void ReportTestPartResult(const TestPartResult& result) = 0;
  15638. };
  15639. namespace internal {
  15640. // This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
  15641. // statement generates new fatal failures. To do so it registers itself as the
  15642. // current test part result reporter. Besides checking if fatal failures were
  15643. // reported, it only delegates the reporting to the former result reporter.
  15644. // The original result reporter is restored in the destructor.
  15645. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  15646. class GTEST_API_ HasNewFatalFailureHelper
  15647. : public TestPartResultReporterInterface {
  15648. public:
  15649. HasNewFatalFailureHelper();
  15650. virtual ~HasNewFatalFailureHelper();
  15651. virtual void ReportTestPartResult(const TestPartResult& result);
  15652. bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
  15653. private:
  15654. bool has_new_fatal_failure_;
  15655. TestPartResultReporterInterface* original_reporter_;
  15656. GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
  15657. };
  15658. } // namespace internal
  15659. } // namespace testing
  15660. #endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
  15661. // Copyright 2008 Google Inc.
  15662. // All Rights Reserved.
  15663. //
  15664. // Redistribution and use in source and binary forms, with or without
  15665. // modification, are permitted provided that the following conditions are
  15666. // met:
  15667. //
  15668. // * Redistributions of source code must retain the above copyright
  15669. // notice, this list of conditions and the following disclaimer.
  15670. // * Redistributions in binary form must reproduce the above
  15671. // copyright notice, this list of conditions and the following disclaimer
  15672. // in the documentation and/or other materials provided with the
  15673. // distribution.
  15674. // * Neither the name of Google Inc. nor the names of its
  15675. // contributors may be used to endorse or promote products derived from
  15676. // this software without specific prior written permission.
  15677. //
  15678. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  15679. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  15680. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  15681. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  15682. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15683. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  15684. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  15685. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  15686. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  15687. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  15688. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  15689. //
  15690. // Author: wan@google.com (Zhanyong Wan)
  15691. #ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
  15692. #define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
  15693. // This header implements typed tests and type-parameterized tests.
  15694. // Typed (aka type-driven) tests repeat the same test for types in a
  15695. // list. You must know which types you want to test with when writing
  15696. // typed tests. Here's how you do it:
  15697. #if 0
  15698. // First, define a fixture class template. It should be parameterized
  15699. // by a type. Remember to derive it from testing::Test.
  15700. template <typename T>
  15701. class FooTest : public testing::Test {
  15702. public:
  15703. ...
  15704. typedef std::list<T> List;
  15705. static T shared_;
  15706. T value_;
  15707. };
  15708. // Next, associate a list of types with the test case, which will be
  15709. // repeated for each type in the list. The typedef is necessary for
  15710. // the macro to parse correctly.
  15711. typedef testing::Types<char, int, unsigned int> MyTypes;
  15712. TYPED_TEST_CASE(FooTest, MyTypes);
  15713. // If the type list contains only one type, you can write that type
  15714. // directly without Types<...>:
  15715. // TYPED_TEST_CASE(FooTest, int);
  15716. // Then, use TYPED_TEST() instead of TEST_F() to define as many typed
  15717. // tests for this test case as you want.
  15718. TYPED_TEST(FooTest, DoesBlah) {
  15719. // Inside a test, refer to TypeParam to get the type parameter.
  15720. // Since we are inside a derived class template, C++ requires use to
  15721. // visit the members of FooTest via 'this'.
  15722. TypeParam n = this->value_;
  15723. // To visit static members of the fixture, add the TestFixture::
  15724. // prefix.
  15725. n += TestFixture::shared_;
  15726. // To refer to typedefs in the fixture, add the "typename
  15727. // TestFixture::" prefix.
  15728. typename TestFixture::List values;
  15729. values.push_back(n);
  15730. ...
  15731. }
  15732. TYPED_TEST(FooTest, HasPropertyA) { ... }
  15733. #endif // 0
  15734. // Type-parameterized tests are abstract test patterns parameterized
  15735. // by a type. Compared with typed tests, type-parameterized tests
  15736. // allow you to define the test pattern without knowing what the type
  15737. // parameters are. The defined pattern can be instantiated with
  15738. // different types any number of times, in any number of translation
  15739. // units.
  15740. //
  15741. // If you are designing an interface or concept, you can define a
  15742. // suite of type-parameterized tests to verify properties that any
  15743. // valid implementation of the interface/concept should have. Then,
  15744. // each implementation can easily instantiate the test suite to verify
  15745. // that it conforms to the requirements, without having to write
  15746. // similar tests repeatedly. Here's an example:
  15747. #if 0
  15748. // First, define a fixture class template. It should be parameterized
  15749. // by a type. Remember to derive it from testing::Test.
  15750. template <typename T>
  15751. class FooTest : public testing::Test {
  15752. ...
  15753. };
  15754. // Next, declare that you will define a type-parameterized test case
  15755. // (the _P suffix is for "parameterized" or "pattern", whichever you
  15756. // prefer):
  15757. TYPED_TEST_CASE_P(FooTest);
  15758. // Then, use TYPED_TEST_P() to define as many type-parameterized tests
  15759. // for this type-parameterized test case as you want.
  15760. TYPED_TEST_P(FooTest, DoesBlah) {
  15761. // Inside a test, refer to TypeParam to get the type parameter.
  15762. TypeParam n = 0;
  15763. ...
  15764. }
  15765. TYPED_TEST_P(FooTest, HasPropertyA) { ... }
  15766. // Now the tricky part: you need to register all test patterns before
  15767. // you can instantiate them. The first argument of the macro is the
  15768. // test case name; the rest are the names of the tests in this test
  15769. // case.
  15770. REGISTER_TYPED_TEST_CASE_P(FooTest,
  15771. DoesBlah, HasPropertyA);
  15772. // Finally, you are free to instantiate the pattern with the types you
  15773. // want. If you put the above code in a header file, you can #include
  15774. // it in multiple C++ source files and instantiate it multiple times.
  15775. //
  15776. // To distinguish different instances of the pattern, the first
  15777. // argument to the INSTANTIATE_* macro is a prefix that will be added
  15778. // to the actual test case name. Remember to pick unique prefixes for
  15779. // different instances.
  15780. typedef testing::Types<char, int, unsigned int> MyTypes;
  15781. INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
  15782. // If the type list contains only one type, you can write that type
  15783. // directly without Types<...>:
  15784. // INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
  15785. #endif // 0
  15786. // Implements typed tests.
  15787. #if GTEST_HAS_TYPED_TEST
  15788. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  15789. //
  15790. // Expands to the name of the typedef for the type parameters of the
  15791. // given test case.
  15792. # define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
  15793. // The 'Types' template argument below must have spaces around it
  15794. // since some compilers may choke on '>>' when passing a template
  15795. // instance (e.g. Types<int>)
  15796. # define TYPED_TEST_CASE(CaseName, Types) \
  15797. typedef ::testing::internal::TypeList< Types >::type \
  15798. GTEST_TYPE_PARAMS_(CaseName)
  15799. # define TYPED_TEST(CaseName, TestName) \
  15800. template <typename gtest_TypeParam_> \
  15801. class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
  15802. : public CaseName<gtest_TypeParam_> { \
  15803. private: \
  15804. typedef CaseName<gtest_TypeParam_> TestFixture; \
  15805. typedef gtest_TypeParam_ TypeParam; \
  15806. virtual void TestBody(); \
  15807. }; \
  15808. bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \
  15809. ::testing::internal::TypeParameterizedTest< \
  15810. CaseName, \
  15811. ::testing::internal::TemplateSel< \
  15812. GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
  15813. GTEST_TYPE_PARAMS_(CaseName)>::Register(\
  15814. "", #CaseName, #TestName, 0); \
  15815. template <typename gtest_TypeParam_> \
  15816. void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
  15817. #endif // GTEST_HAS_TYPED_TEST
  15818. // Implements type-parameterized tests.
  15819. #if GTEST_HAS_TYPED_TEST_P
  15820. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  15821. //
  15822. // Expands to the namespace name that the type-parameterized tests for
  15823. // the given type-parameterized test case are defined in. The exact
  15824. // name of the namespace is subject to change without notice.
  15825. # define GTEST_CASE_NAMESPACE_(TestCaseName) \
  15826. gtest_case_##TestCaseName##_
  15827. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  15828. //
  15829. // Expands to the name of the variable used to remember the names of
  15830. // the defined tests in the given test case.
  15831. # define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
  15832. gtest_typed_test_case_p_state_##TestCaseName##_
  15833. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
  15834. //
  15835. // Expands to the name of the variable used to remember the names of
  15836. // the registered tests in the given test case.
  15837. # define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
  15838. gtest_registered_test_names_##TestCaseName##_
  15839. // The variables defined in the type-parameterized test macros are
  15840. // static as typically these macros are used in a .h file that can be
  15841. // #included in multiple translation units linked together.
  15842. # define TYPED_TEST_CASE_P(CaseName) \
  15843. static ::testing::internal::TypedTestCasePState \
  15844. GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
  15845. # define TYPED_TEST_P(CaseName, TestName) \
  15846. namespace GTEST_CASE_NAMESPACE_(CaseName) { \
  15847. template <typename gtest_TypeParam_> \
  15848. class TestName : public CaseName<gtest_TypeParam_> { \
  15849. private: \
  15850. typedef CaseName<gtest_TypeParam_> TestFixture; \
  15851. typedef gtest_TypeParam_ TypeParam; \
  15852. virtual void TestBody(); \
  15853. }; \
  15854. static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
  15855. GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
  15856. __FILE__, __LINE__, #CaseName, #TestName); \
  15857. } \
  15858. template <typename gtest_TypeParam_> \
  15859. void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
  15860. # define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
  15861. namespace GTEST_CASE_NAMESPACE_(CaseName) { \
  15862. typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
  15863. } \
  15864. static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
  15865. GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
  15866. __FILE__, __LINE__, #__VA_ARGS__)
  15867. // The 'Types' template argument below must have spaces around it
  15868. // since some compilers may choke on '>>' when passing a template
  15869. // instance (e.g. Types<int>)
  15870. # define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \
  15871. bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
  15872. ::testing::internal::TypeParameterizedTestCase<CaseName, \
  15873. GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
  15874. ::testing::internal::TypeList< Types >::type>::Register(\
  15875. #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
  15876. #endif // GTEST_HAS_TYPED_TEST_P
  15877. #endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
  15878. // Depending on the platform, different string classes are available.
  15879. // On Linux, in addition to ::std::string, Google also makes use of
  15880. // class ::string, which has the same interface as ::std::string, but
  15881. // has a different implementation.
  15882. //
  15883. // The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
  15884. // ::string is available AND is a distinct type to ::std::string, or
  15885. // define it to 0 to indicate otherwise.
  15886. //
  15887. // If the user's ::std::string and ::string are the same class due to
  15888. // aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0.
  15889. //
  15890. // If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined
  15891. // heuristically.
  15892. namespace testing {
  15893. // Declares the flags.
  15894. // This flag temporary enables the disabled tests.
  15895. GTEST_DECLARE_bool_(also_run_disabled_tests);
  15896. // This flag brings the debugger on an assertion failure.
  15897. GTEST_DECLARE_bool_(break_on_failure);
  15898. // This flag controls whether Google Test catches all test-thrown exceptions
  15899. // and logs them as failures.
  15900. GTEST_DECLARE_bool_(catch_exceptions);
  15901. // This flag enables using colors in terminal output. Available values are
  15902. // "yes" to enable colors, "no" (disable colors), or "auto" (the default)
  15903. // to let Google Test decide.
  15904. GTEST_DECLARE_string_(color);
  15905. // This flag sets up the filter to select by name using a glob pattern
  15906. // the tests to run. If the filter is not given all tests are executed.
  15907. GTEST_DECLARE_string_(filter);
  15908. // This flag causes the Google Test to list tests. None of the tests listed
  15909. // are actually run if the flag is provided.
  15910. GTEST_DECLARE_bool_(list_tests);
  15911. // This flag controls whether Google Test emits a detailed XML report to a file
  15912. // in addition to its normal textual output.
  15913. GTEST_DECLARE_string_(output);
  15914. // This flags control whether Google Test prints the elapsed time for each
  15915. // test.
  15916. GTEST_DECLARE_bool_(print_time);
  15917. // This flag specifies the random number seed.
  15918. GTEST_DECLARE_int32_(random_seed);
  15919. // This flag sets how many times the tests are repeated. The default value
  15920. // is 1. If the value is -1 the tests are repeating forever.
  15921. GTEST_DECLARE_int32_(repeat);
  15922. // This flag controls whether Google Test includes Google Test internal
  15923. // stack frames in failure stack traces.
  15924. GTEST_DECLARE_bool_(show_internal_stack_frames);
  15925. // When this flag is specified, tests' order is randomized on every iteration.
  15926. GTEST_DECLARE_bool_(shuffle);
  15927. // This flag specifies the maximum number of stack frames to be
  15928. // printed in a failure message.
  15929. GTEST_DECLARE_int32_(stack_trace_depth);
  15930. // When this flag is specified, a failed assertion will throw an
  15931. // exception if exceptions are enabled, or exit the program with a
  15932. // non-zero code otherwise.
  15933. GTEST_DECLARE_bool_(throw_on_failure);
  15934. // When this flag is set with a "host:port" string, on supported
  15935. // platforms test results are streamed to the specified port on
  15936. // the specified host machine.
  15937. GTEST_DECLARE_string_(stream_result_to);
  15938. // The upper limit for valid stack trace depths.
  15939. const int kMaxStackTraceDepth = 100;
  15940. namespace internal {
  15941. class AssertHelper;
  15942. class DefaultGlobalTestPartResultReporter;
  15943. class ExecDeathTest;
  15944. class NoExecDeathTest;
  15945. class FinalSuccessChecker;
  15946. class GTestFlagSaver;
  15947. class StreamingListenerTest;
  15948. class TestResultAccessor;
  15949. class TestEventListenersAccessor;
  15950. class TestEventRepeater;
  15951. class UnitTestRecordPropertyTestHelper;
  15952. class WindowsDeathTest;
  15953. class UnitTestImpl* GetUnitTestImpl();
  15954. void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
  15955. const std::string& message);
  15956. } // namespace internal
  15957. // The friend relationship of some of these classes is cyclic.
  15958. // If we don't forward declare them the compiler might confuse the classes
  15959. // in friendship clauses with same named classes on the scope.
  15960. class Test;
  15961. class TestCase;
  15962. class TestInfo;
  15963. class UnitTest;
  15964. // A class for indicating whether an assertion was successful. When
  15965. // the assertion wasn't successful, the AssertionResult object
  15966. // remembers a non-empty message that describes how it failed.
  15967. //
  15968. // To create an instance of this class, use one of the factory functions
  15969. // (AssertionSuccess() and AssertionFailure()).
  15970. //
  15971. // This class is useful for two purposes:
  15972. // 1. Defining predicate functions to be used with Boolean test assertions
  15973. // EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
  15974. // 2. Defining predicate-format functions to be
  15975. // used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
  15976. //
  15977. // For example, if you define IsEven predicate:
  15978. //
  15979. // testing::AssertionResult IsEven(int n) {
  15980. // if ((n % 2) == 0)
  15981. // return testing::AssertionSuccess();
  15982. // else
  15983. // return testing::AssertionFailure() << n << " is odd";
  15984. // }
  15985. //
  15986. // Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
  15987. // will print the message
  15988. //
  15989. // Value of: IsEven(Fib(5))
  15990. // Actual: false (5 is odd)
  15991. // Expected: true
  15992. //
  15993. // instead of a more opaque
  15994. //
  15995. // Value of: IsEven(Fib(5))
  15996. // Actual: false
  15997. // Expected: true
  15998. //
  15999. // in case IsEven is a simple Boolean predicate.
  16000. //
  16001. // If you expect your predicate to be reused and want to support informative
  16002. // messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
  16003. // about half as often as positive ones in our tests), supply messages for
  16004. // both success and failure cases:
  16005. //
  16006. // testing::AssertionResult IsEven(int n) {
  16007. // if ((n % 2) == 0)
  16008. // return testing::AssertionSuccess() << n << " is even";
  16009. // else
  16010. // return testing::AssertionFailure() << n << " is odd";
  16011. // }
  16012. //
  16013. // Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
  16014. //
  16015. // Value of: IsEven(Fib(6))
  16016. // Actual: true (8 is even)
  16017. // Expected: false
  16018. //
  16019. // NB: Predicates that support negative Boolean assertions have reduced
  16020. // performance in positive ones so be careful not to use them in tests
  16021. // that have lots (tens of thousands) of positive Boolean assertions.
  16022. //
  16023. // To use this class with EXPECT_PRED_FORMAT assertions such as:
  16024. //
  16025. // // Verifies that Foo() returns an even number.
  16026. // EXPECT_PRED_FORMAT1(IsEven, Foo());
  16027. //
  16028. // you need to define:
  16029. //
  16030. // testing::AssertionResult IsEven(const char* expr, int n) {
  16031. // if ((n % 2) == 0)
  16032. // return testing::AssertionSuccess();
  16033. // else
  16034. // return testing::AssertionFailure()
  16035. // << "Expected: " << expr << " is even\n Actual: it's " << n;
  16036. // }
  16037. //
  16038. // If Foo() returns 5, you will see the following message:
  16039. //
  16040. // Expected: Foo() is even
  16041. // Actual: it's 5
  16042. //
  16043. class GTEST_API_ AssertionResult {
  16044. public:
  16045. // Copy constructor.
  16046. // Used in EXPECT_TRUE/FALSE(assertion_result).
  16047. AssertionResult(const AssertionResult& other);
  16048. // Used in the EXPECT_TRUE/FALSE(bool_expression).
  16049. explicit AssertionResult(bool success) : success_(success) {}
  16050. // Returns true iff the assertion succeeded.
  16051. operator bool() const { return success_; } // NOLINT
  16052. // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
  16053. AssertionResult operator!() const;
  16054. // Returns the text streamed into this AssertionResult. Test assertions
  16055. // use it when they fail (i.e., the predicate's outcome doesn't match the
  16056. // assertion's expectation). When nothing has been streamed into the
  16057. // object, returns an empty string.
  16058. const char* message() const {
  16059. return message_.get() != NULL ? message_->c_str() : "";
  16060. }
  16061. // TODO(vladl@google.com): Remove this after making sure no clients use it.
  16062. // Deprecated; please use message() instead.
  16063. const char* failure_message() const { return message(); }
  16064. // Streams a custom failure message into this object.
  16065. template <typename T> AssertionResult& operator<<(const T& value) {
  16066. AppendMessage(Message() << value);
  16067. return *this;
  16068. }
  16069. // Allows streaming basic output manipulators such as endl or flush into
  16070. // this object.
  16071. AssertionResult& operator<<(
  16072. ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
  16073. AppendMessage(Message() << basic_manipulator);
  16074. return *this;
  16075. }
  16076. private:
  16077. // Appends the contents of message to message_.
  16078. void AppendMessage(const Message& a_message) {
  16079. if (message_.get() == NULL)
  16080. message_.reset(new ::std::string);
  16081. message_->append(a_message.GetString().c_str());
  16082. }
  16083. // Stores result of the assertion predicate.
  16084. bool success_;
  16085. // Stores the message describing the condition in case the expectation
  16086. // construct is not satisfied with the predicate's outcome.
  16087. // Referenced via a pointer to avoid taking too much stack frame space
  16088. // with test assertions.
  16089. internal::scoped_ptr< ::std::string> message_;
  16090. GTEST_DISALLOW_ASSIGN_(AssertionResult);
  16091. };
  16092. // Makes a successful assertion result.
  16093. GTEST_API_ AssertionResult AssertionSuccess();
  16094. // Makes a failed assertion result.
  16095. GTEST_API_ AssertionResult AssertionFailure();
  16096. // Makes a failed assertion result with the given failure message.
  16097. // Deprecated; use AssertionFailure() << msg.
  16098. GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
  16099. // The abstract class that all tests inherit from.
  16100. //
  16101. // In Google Test, a unit test program contains one or many TestCases, and
  16102. // each TestCase contains one or many Tests.
  16103. //
  16104. // When you define a test using the TEST macro, you don't need to
  16105. // explicitly derive from Test - the TEST macro automatically does
  16106. // this for you.
  16107. //
  16108. // The only time you derive from Test is when defining a test fixture
  16109. // to be used a TEST_F. For example:
  16110. //
  16111. // class FooTest : public testing::Test {
  16112. // protected:
  16113. // virtual void SetUp() { ... }
  16114. // virtual void TearDown() { ... }
  16115. // ...
  16116. // };
  16117. //
  16118. // TEST_F(FooTest, Bar) { ... }
  16119. // TEST_F(FooTest, Baz) { ... }
  16120. //
  16121. // Test is not copyable.
  16122. class GTEST_API_ Test {
  16123. public:
  16124. friend class TestInfo;
  16125. // Defines types for pointers to functions that set up and tear down
  16126. // a test case.
  16127. typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
  16128. typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
  16129. // The d'tor is virtual as we intend to inherit from Test.
  16130. virtual ~Test();
  16131. // Sets up the stuff shared by all tests in this test case.
  16132. //
  16133. // Google Test will call Foo::SetUpTestCase() before running the first
  16134. // test in test case Foo. Hence a sub-class can define its own
  16135. // SetUpTestCase() method to shadow the one defined in the super
  16136. // class.
  16137. static void SetUpTestCase() {}
  16138. // Tears down the stuff shared by all tests in this test case.
  16139. //
  16140. // Google Test will call Foo::TearDownTestCase() after running the last
  16141. // test in test case Foo. Hence a sub-class can define its own
  16142. // TearDownTestCase() method to shadow the one defined in the super
  16143. // class.
  16144. static void TearDownTestCase() {}
  16145. // Returns true iff the current test has a fatal failure.
  16146. static bool HasFatalFailure();
  16147. // Returns true iff the current test has a non-fatal failure.
  16148. static bool HasNonfatalFailure();
  16149. // Returns true iff the current test has a (either fatal or
  16150. // non-fatal) failure.
  16151. static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
  16152. // Logs a property for the current test, test case, or for the entire
  16153. // invocation of the test program when used outside of the context of a
  16154. // test case. Only the last value for a given key is remembered. These
  16155. // are public static so they can be called from utility functions that are
  16156. // not members of the test fixture. Calls to RecordProperty made during
  16157. // lifespan of the test (from the moment its constructor starts to the
  16158. // moment its destructor finishes) will be output in XML as attributes of
  16159. // the <testcase> element. Properties recorded from fixture's
  16160. // SetUpTestCase or TearDownTestCase are logged as attributes of the
  16161. // corresponding <testsuite> element. Calls to RecordProperty made in the
  16162. // global context (before or after invocation of RUN_ALL_TESTS and from
  16163. // SetUp/TearDown method of Environment objects registered with Google
  16164. // Test) will be output as attributes of the <testsuites> element.
  16165. static void RecordProperty(const std::string& key, const std::string& value);
  16166. static void RecordProperty(const std::string& key, int value);
  16167. protected:
  16168. // Creates a Test object.
  16169. Test();
  16170. // Sets up the test fixture.
  16171. virtual void SetUp();
  16172. // Tears down the test fixture.
  16173. virtual void TearDown();
  16174. private:
  16175. // Returns true iff the current test has the same fixture class as
  16176. // the first test in the current test case.
  16177. static bool HasSameFixtureClass();
  16178. // Runs the test after the test fixture has been set up.
  16179. //
  16180. // A sub-class must implement this to define the test logic.
  16181. //
  16182. // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
  16183. // Instead, use the TEST or TEST_F macro.
  16184. virtual void TestBody() = 0;
  16185. // Sets up, executes, and tears down the test.
  16186. void Run();
  16187. // Deletes self. We deliberately pick an unusual name for this
  16188. // internal method to avoid clashing with names used in user TESTs.
  16189. void DeleteSelf_() { delete this; }
  16190. // Uses a GTestFlagSaver to save and restore all Google Test flags.
  16191. const internal::GTestFlagSaver* const gtest_flag_saver_;
  16192. // Often a user mis-spells SetUp() as Setup() and spends a long time
  16193. // wondering why it is never called by Google Test. The declaration of
  16194. // the following method is solely for catching such an error at
  16195. // compile time:
  16196. //
  16197. // - The return type is deliberately chosen to be not void, so it
  16198. // will be a conflict if a user declares void Setup() in his test
  16199. // fixture.
  16200. //
  16201. // - This method is private, so it will be another compiler error
  16202. // if a user calls it from his test fixture.
  16203. //
  16204. // DO NOT OVERRIDE THIS FUNCTION.
  16205. //
  16206. // If you see an error about overriding the following function or
  16207. // about it being private, you have mis-spelled SetUp() as Setup().
  16208. struct Setup_should_be_spelled_SetUp {};
  16209. virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
  16210. // We disallow copying Tests.
  16211. GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
  16212. };
  16213. typedef internal::TimeInMillis TimeInMillis;
  16214. // A copyable object representing a user specified test property which can be
  16215. // output as a key/value string pair.
  16216. //
  16217. // Don't inherit from TestProperty as its destructor is not virtual.
  16218. class TestProperty {
  16219. public:
  16220. // C'tor. TestProperty does NOT have a default constructor.
  16221. // Always use this constructor (with parameters) to create a
  16222. // TestProperty object.
  16223. TestProperty(const std::string& a_key, const std::string& a_value) :
  16224. key_(a_key), value_(a_value) {
  16225. }
  16226. // Gets the user supplied key.
  16227. const char* key() const {
  16228. return key_.c_str();
  16229. }
  16230. // Gets the user supplied value.
  16231. const char* value() const {
  16232. return value_.c_str();
  16233. }
  16234. // Sets a new value, overriding the one supplied in the constructor.
  16235. void SetValue(const std::string& new_value) {
  16236. value_ = new_value;
  16237. }
  16238. private:
  16239. // The key supplied by the user.
  16240. std::string key_;
  16241. // The value supplied by the user.
  16242. std::string value_;
  16243. };
  16244. // The result of a single Test. This includes a list of
  16245. // TestPartResults, a list of TestProperties, a count of how many
  16246. // death tests there are in the Test, and how much time it took to run
  16247. // the Test.
  16248. //
  16249. // TestResult is not copyable.
  16250. class GTEST_API_ TestResult {
  16251. public:
  16252. // Creates an empty TestResult.
  16253. TestResult();
  16254. // D'tor. Do not inherit from TestResult.
  16255. ~TestResult();
  16256. // Gets the number of all test parts. This is the sum of the number
  16257. // of successful test parts and the number of failed test parts.
  16258. int total_part_count() const;
  16259. // Returns the number of the test properties.
  16260. int test_property_count() const;
  16261. // Returns true iff the test passed (i.e. no test part failed).
  16262. bool Passed() const { return !Failed(); }
  16263. // Returns true iff the test failed.
  16264. bool Failed() const;
  16265. // Returns true iff the test fatally failed.
  16266. bool HasFatalFailure() const;
  16267. // Returns true iff the test has a non-fatal failure.
  16268. bool HasNonfatalFailure() const;
  16269. // Returns the elapsed time, in milliseconds.
  16270. TimeInMillis elapsed_time() const { return elapsed_time_; }
  16271. // Returns the i-th test part result among all the results. i can range
  16272. // from 0 to test_property_count() - 1. If i is not in that range, aborts
  16273. // the program.
  16274. const TestPartResult& GetTestPartResult(int i) const;
  16275. // Returns the i-th test property. i can range from 0 to
  16276. // test_property_count() - 1. If i is not in that range, aborts the
  16277. // program.
  16278. const TestProperty& GetTestProperty(int i) const;
  16279. private:
  16280. friend class TestInfo;
  16281. friend class TestCase;
  16282. friend class UnitTest;
  16283. friend class internal::DefaultGlobalTestPartResultReporter;
  16284. friend class internal::ExecDeathTest;
  16285. friend class internal::TestResultAccessor;
  16286. friend class internal::UnitTestImpl;
  16287. friend class internal::WindowsDeathTest;
  16288. // Gets the vector of TestPartResults.
  16289. const std::vector<TestPartResult>& test_part_results() const {
  16290. return test_part_results_;
  16291. }
  16292. // Gets the vector of TestProperties.
  16293. const std::vector<TestProperty>& test_properties() const {
  16294. return test_properties_;
  16295. }
  16296. // Sets the elapsed time.
  16297. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
  16298. // Adds a test property to the list. The property is validated and may add
  16299. // a non-fatal failure if invalid (e.g., if it conflicts with reserved
  16300. // key names). If a property is already recorded for the same key, the
  16301. // value will be updated, rather than storing multiple values for the same
  16302. // key. xml_element specifies the element for which the property is being
  16303. // recorded and is used for validation.
  16304. void RecordProperty(const std::string& xml_element,
  16305. const TestProperty& test_property);
  16306. // Adds a failure if the key is a reserved attribute of Google Test
  16307. // testcase tags. Returns true if the property is valid.
  16308. // TODO(russr): Validate attribute names are legal and human readable.
  16309. static bool ValidateTestProperty(const std::string& xml_element,
  16310. const TestProperty& test_property);
  16311. // Adds a test part result to the list.
  16312. void AddTestPartResult(const TestPartResult& test_part_result);
  16313. // Returns the death test count.
  16314. int death_test_count() const { return death_test_count_; }
  16315. // Increments the death test count, returning the new count.
  16316. int increment_death_test_count() { return ++death_test_count_; }
  16317. // Clears the test part results.
  16318. void ClearTestPartResults();
  16319. // Clears the object.
  16320. void Clear();
  16321. // Protects mutable state of the property vector and of owned
  16322. // properties, whose values may be updated.
  16323. internal::Mutex test_properites_mutex_;
  16324. // The vector of TestPartResults
  16325. std::vector<TestPartResult> test_part_results_;
  16326. // The vector of TestProperties
  16327. std::vector<TestProperty> test_properties_;
  16328. // Running count of death tests.
  16329. int death_test_count_;
  16330. // The elapsed time, in milliseconds.
  16331. TimeInMillis elapsed_time_;
  16332. // We disallow copying TestResult.
  16333. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
  16334. }; // class TestResult
  16335. // A TestInfo object stores the following information about a test:
  16336. //
  16337. // Test case name
  16338. // Test name
  16339. // Whether the test should be run
  16340. // A function pointer that creates the test object when invoked
  16341. // Test result
  16342. //
  16343. // The constructor of TestInfo registers itself with the UnitTest
  16344. // singleton such that the RUN_ALL_TESTS() macro knows which tests to
  16345. // run.
  16346. class GTEST_API_ TestInfo {
  16347. public:
  16348. // Destructs a TestInfo object. This function is not virtual, so
  16349. // don't inherit from TestInfo.
  16350. ~TestInfo();
  16351. // Returns the test case name.
  16352. const char* test_case_name() const { return test_case_name_.c_str(); }
  16353. // Returns the test name.
  16354. const char* name() const { return name_.c_str(); }
  16355. // Returns the name of the parameter type, or NULL if this is not a typed
  16356. // or a type-parameterized test.
  16357. const char* type_param() const {
  16358. if (type_param_.get() != NULL)
  16359. return type_param_->c_str();
  16360. return NULL;
  16361. }
  16362. // Returns the text representation of the value parameter, or NULL if this
  16363. // is not a value-parameterized test.
  16364. const char* value_param() const {
  16365. if (value_param_.get() != NULL)
  16366. return value_param_->c_str();
  16367. return NULL;
  16368. }
  16369. // Returns true if this test should run, that is if the test is not
  16370. // disabled (or it is disabled but the also_run_disabled_tests flag has
  16371. // been specified) and its full name matches the user-specified filter.
  16372. //
  16373. // Google Test allows the user to filter the tests by their full names.
  16374. // The full name of a test Bar in test case Foo is defined as
  16375. // "Foo.Bar". Only the tests that match the filter will run.
  16376. //
  16377. // A filter is a colon-separated list of glob (not regex) patterns,
  16378. // optionally followed by a '-' and a colon-separated list of
  16379. // negative patterns (tests to exclude). A test is run if it
  16380. // matches one of the positive patterns and does not match any of
  16381. // the negative patterns.
  16382. //
  16383. // For example, *A*:Foo.* is a filter that matches any string that
  16384. // contains the character 'A' or starts with "Foo.".
  16385. bool should_run() const { return should_run_; }
  16386. // Returns true iff this test will appear in the XML report.
  16387. bool is_reportable() const {
  16388. // For now, the XML report includes all tests matching the filter.
  16389. // In the future, we may trim tests that are excluded because of
  16390. // sharding.
  16391. return matches_filter_;
  16392. }
  16393. // Returns the result of the test.
  16394. const TestResult* result() const { return &result_; }
  16395. private:
  16396. #if GTEST_HAS_DEATH_TEST
  16397. friend class internal::DefaultDeathTestFactory;
  16398. #endif // GTEST_HAS_DEATH_TEST
  16399. friend class Test;
  16400. friend class TestCase;
  16401. friend class internal::UnitTestImpl;
  16402. friend class internal::StreamingListenerTest;
  16403. friend TestInfo* internal::MakeAndRegisterTestInfo(
  16404. const char* test_case_name,
  16405. const char* name,
  16406. const char* type_param,
  16407. const char* value_param,
  16408. internal::TypeId fixture_class_id,
  16409. Test::SetUpTestCaseFunc set_up_tc,
  16410. Test::TearDownTestCaseFunc tear_down_tc,
  16411. internal::TestFactoryBase* factory);
  16412. // Constructs a TestInfo object. The newly constructed instance assumes
  16413. // ownership of the factory object.
  16414. TestInfo(const std::string& test_case_name,
  16415. const std::string& name,
  16416. const char* a_type_param, // NULL if not a type-parameterized test
  16417. const char* a_value_param, // NULL if not a value-parameterized test
  16418. internal::TypeId fixture_class_id,
  16419. internal::TestFactoryBase* factory);
  16420. // Increments the number of death tests encountered in this test so
  16421. // far.
  16422. int increment_death_test_count() {
  16423. return result_.increment_death_test_count();
  16424. }
  16425. // Creates the test object, runs it, records its result, and then
  16426. // deletes it.
  16427. void Run();
  16428. static void ClearTestResult(TestInfo* test_info) {
  16429. test_info->result_.Clear();
  16430. }
  16431. // These fields are immutable properties of the test.
  16432. const std::string test_case_name_; // Test case name
  16433. const std::string name_; // Test name
  16434. // Name of the parameter type, or NULL if this is not a typed or a
  16435. // type-parameterized test.
  16436. const internal::scoped_ptr<const ::std::string> type_param_;
  16437. // Text representation of the value parameter, or NULL if this is not a
  16438. // value-parameterized test.
  16439. const internal::scoped_ptr<const ::std::string> value_param_;
  16440. const internal::TypeId fixture_class_id_; // ID of the test fixture class
  16441. bool should_run_; // True iff this test should run
  16442. bool is_disabled_; // True iff this test is disabled
  16443. bool matches_filter_; // True if this test matches the
  16444. // user-specified filter.
  16445. internal::TestFactoryBase* const factory_; // The factory that creates
  16446. // the test object
  16447. // This field is mutable and needs to be reset before running the
  16448. // test for the second time.
  16449. TestResult result_;
  16450. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
  16451. };
  16452. // A test case, which consists of a vector of TestInfos.
  16453. //
  16454. // TestCase is not copyable.
  16455. class GTEST_API_ TestCase {
  16456. public:
  16457. // Creates a TestCase with the given name.
  16458. //
  16459. // TestCase does NOT have a default constructor. Always use this
  16460. // constructor to create a TestCase object.
  16461. //
  16462. // Arguments:
  16463. //
  16464. // name: name of the test case
  16465. // a_type_param: the name of the test's type parameter, or NULL if
  16466. // this is not a type-parameterized test.
  16467. // set_up_tc: pointer to the function that sets up the test case
  16468. // tear_down_tc: pointer to the function that tears down the test case
  16469. TestCase(const char* name, const char* a_type_param,
  16470. Test::SetUpTestCaseFunc set_up_tc,
  16471. Test::TearDownTestCaseFunc tear_down_tc);
  16472. // Destructor of TestCase.
  16473. virtual ~TestCase();
  16474. // Gets the name of the TestCase.
  16475. const char* name() const { return name_.c_str(); }
  16476. // Returns the name of the parameter type, or NULL if this is not a
  16477. // type-parameterized test case.
  16478. const char* type_param() const {
  16479. if (type_param_.get() != NULL)
  16480. return type_param_->c_str();
  16481. return NULL;
  16482. }
  16483. // Returns true if any test in this test case should run.
  16484. bool should_run() const { return should_run_; }
  16485. // Gets the number of successful tests in this test case.
  16486. int successful_test_count() const;
  16487. // Gets the number of failed tests in this test case.
  16488. int failed_test_count() const;
  16489. // Gets the number of disabled tests that will be reported in the XML report.
  16490. int reportable_disabled_test_count() const;
  16491. // Gets the number of disabled tests in this test case.
  16492. int disabled_test_count() const;
  16493. // Gets the number of tests to be printed in the XML report.
  16494. int reportable_test_count() const;
  16495. // Get the number of tests in this test case that should run.
  16496. int test_to_run_count() const;
  16497. // Gets the number of all tests in this test case.
  16498. int total_test_count() const;
  16499. // Returns true iff the test case passed.
  16500. bool Passed() const { return !Failed(); }
  16501. // Returns true iff the test case failed.
  16502. bool Failed() const { return failed_test_count() > 0; }
  16503. // Returns the elapsed time, in milliseconds.
  16504. TimeInMillis elapsed_time() const { return elapsed_time_; }
  16505. // Returns the i-th test among all the tests. i can range from 0 to
  16506. // total_test_count() - 1. If i is not in that range, returns NULL.
  16507. const TestInfo* GetTestInfo(int i) const;
  16508. // Returns the TestResult that holds test properties recorded during
  16509. // execution of SetUpTestCase and TearDownTestCase.
  16510. const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; }
  16511. private:
  16512. friend class Test;
  16513. friend class internal::UnitTestImpl;
  16514. // Gets the (mutable) vector of TestInfos in this TestCase.
  16515. std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
  16516. // Gets the (immutable) vector of TestInfos in this TestCase.
  16517. const std::vector<TestInfo*>& test_info_list() const {
  16518. return test_info_list_;
  16519. }
  16520. // Returns the i-th test among all the tests. i can range from 0 to
  16521. // total_test_count() - 1. If i is not in that range, returns NULL.
  16522. TestInfo* GetMutableTestInfo(int i);
  16523. // Sets the should_run member.
  16524. void set_should_run(bool should) { should_run_ = should; }
  16525. // Adds a TestInfo to this test case. Will delete the TestInfo upon
  16526. // destruction of the TestCase object.
  16527. void AddTestInfo(TestInfo * test_info);
  16528. // Clears the results of all tests in this test case.
  16529. void ClearResult();
  16530. // Clears the results of all tests in the given test case.
  16531. static void ClearTestCaseResult(TestCase* test_case) {
  16532. test_case->ClearResult();
  16533. }
  16534. // Runs every test in this TestCase.
  16535. void Run();
  16536. // Runs SetUpTestCase() for this TestCase. This wrapper is needed
  16537. // for catching exceptions thrown from SetUpTestCase().
  16538. void RunSetUpTestCase() { (*set_up_tc_)(); }
  16539. // Runs TearDownTestCase() for this TestCase. This wrapper is
  16540. // needed for catching exceptions thrown from TearDownTestCase().
  16541. void RunTearDownTestCase() { (*tear_down_tc_)(); }
  16542. // Returns true iff test passed.
  16543. static bool TestPassed(const TestInfo* test_info) {
  16544. return test_info->should_run() && test_info->result()->Passed();
  16545. }
  16546. // Returns true iff test failed.
  16547. static bool TestFailed(const TestInfo* test_info) {
  16548. return test_info->should_run() && test_info->result()->Failed();
  16549. }
  16550. // Returns true iff the test is disabled and will be reported in the XML
  16551. // report.
  16552. static bool TestReportableDisabled(const TestInfo* test_info) {
  16553. return test_info->is_reportable() && test_info->is_disabled_;
  16554. }
  16555. // Returns true iff test is disabled.
  16556. static bool TestDisabled(const TestInfo* test_info) {
  16557. return test_info->is_disabled_;
  16558. }
  16559. // Returns true iff this test will appear in the XML report.
  16560. static bool TestReportable(const TestInfo* test_info) {
  16561. return test_info->is_reportable();
  16562. }
  16563. // Returns true if the given test should run.
  16564. static bool ShouldRunTest(const TestInfo* test_info) {
  16565. return test_info->should_run();
  16566. }
  16567. // Shuffles the tests in this test case.
  16568. void ShuffleTests(internal::Random* random);
  16569. // Restores the test order to before the first shuffle.
  16570. void UnshuffleTests();
  16571. // Name of the test case.
  16572. std::string name_;
  16573. // Name of the parameter type, or NULL if this is not a typed or a
  16574. // type-parameterized test.
  16575. const internal::scoped_ptr<const ::std::string> type_param_;
  16576. // The vector of TestInfos in their original order. It owns the
  16577. // elements in the vector.
  16578. std::vector<TestInfo*> test_info_list_;
  16579. // Provides a level of indirection for the test list to allow easy
  16580. // shuffling and restoring the test order. The i-th element in this
  16581. // vector is the index of the i-th test in the shuffled test list.
  16582. std::vector<int> test_indices_;
  16583. // Pointer to the function that sets up the test case.
  16584. Test::SetUpTestCaseFunc set_up_tc_;
  16585. // Pointer to the function that tears down the test case.
  16586. Test::TearDownTestCaseFunc tear_down_tc_;
  16587. // True iff any test in this test case should run.
  16588. bool should_run_;
  16589. // Elapsed time, in milliseconds.
  16590. TimeInMillis elapsed_time_;
  16591. // Holds test properties recorded during execution of SetUpTestCase and
  16592. // TearDownTestCase.
  16593. TestResult ad_hoc_test_result_;
  16594. // We disallow copying TestCases.
  16595. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
  16596. };
  16597. // An Environment object is capable of setting up and tearing down an
  16598. // environment. The user should subclass this to define his own
  16599. // environment(s).
  16600. //
  16601. // An Environment object does the set-up and tear-down in virtual
  16602. // methods SetUp() and TearDown() instead of the constructor and the
  16603. // destructor, as:
  16604. //
  16605. // 1. You cannot safely throw from a destructor. This is a problem
  16606. // as in some cases Google Test is used where exceptions are enabled, and
  16607. // we may want to implement ASSERT_* using exceptions where they are
  16608. // available.
  16609. // 2. You cannot use ASSERT_* directly in a constructor or
  16610. // destructor.
  16611. class Environment {
  16612. public:
  16613. // The d'tor is virtual as we need to subclass Environment.
  16614. virtual ~Environment() {}
  16615. // Override this to define how to set up the environment.
  16616. virtual void SetUp() {}
  16617. // Override this to define how to tear down the environment.
  16618. virtual void TearDown() {}
  16619. private:
  16620. // If you see an error about overriding the following function or
  16621. // about it being private, you have mis-spelled SetUp() as Setup().
  16622. struct Setup_should_be_spelled_SetUp {};
  16623. virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
  16624. };
  16625. // The interface for tracing execution of tests. The methods are organized in
  16626. // the order the corresponding events are fired.
  16627. class TestEventListener {
  16628. public:
  16629. virtual ~TestEventListener() {}
  16630. // Fired before any test activity starts.
  16631. virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
  16632. // Fired before each iteration of tests starts. There may be more than
  16633. // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
  16634. // index, starting from 0.
  16635. virtual void OnTestIterationStart(const UnitTest& unit_test,
  16636. int iteration) = 0;
  16637. // Fired before environment set-up for each iteration of tests starts.
  16638. virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
  16639. // Fired after environment set-up for each iteration of tests ends.
  16640. virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
  16641. // Fired before the test case starts.
  16642. virtual void OnTestCaseStart(const TestCase& test_case) = 0;
  16643. // Fired before the test starts.
  16644. virtual void OnTestStart(const TestInfo& test_info) = 0;
  16645. // Fired after a failed assertion or a SUCCEED() invocation.
  16646. virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
  16647. // Fired after the test ends.
  16648. virtual void OnTestEnd(const TestInfo& test_info) = 0;
  16649. // Fired after the test case ends.
  16650. virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
  16651. // Fired before environment tear-down for each iteration of tests starts.
  16652. virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
  16653. // Fired after environment tear-down for each iteration of tests ends.
  16654. virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
  16655. // Fired after each iteration of tests finishes.
  16656. virtual void OnTestIterationEnd(const UnitTest& unit_test,
  16657. int iteration) = 0;
  16658. // Fired after all test activities have ended.
  16659. virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
  16660. };
  16661. // The convenience class for users who need to override just one or two
  16662. // methods and are not concerned that a possible change to a signature of
  16663. // the methods they override will not be caught during the build. For
  16664. // comments about each method please see the definition of TestEventListener
  16665. // above.
  16666. class EmptyTestEventListener : public TestEventListener {
  16667. public:
  16668. virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
  16669. virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
  16670. int /*iteration*/) {}
  16671. virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
  16672. virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
  16673. virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
  16674. virtual void OnTestStart(const TestInfo& /*test_info*/) {}
  16675. virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
  16676. virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
  16677. virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
  16678. virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
  16679. virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
  16680. virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
  16681. int /*iteration*/) {}
  16682. virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
  16683. };
  16684. // TestEventListeners lets users add listeners to track events in Google Test.
  16685. class GTEST_API_ TestEventListeners {
  16686. public:
  16687. TestEventListeners();
  16688. ~TestEventListeners();
  16689. // Appends an event listener to the end of the list. Google Test assumes
  16690. // the ownership of the listener (i.e. it will delete the listener when
  16691. // the test program finishes).
  16692. void Append(TestEventListener* listener);
  16693. // Removes the given event listener from the list and returns it. It then
  16694. // becomes the caller's responsibility to delete the listener. Returns
  16695. // NULL if the listener is not found in the list.
  16696. TestEventListener* Release(TestEventListener* listener);
  16697. // Returns the standard listener responsible for the default console
  16698. // output. Can be removed from the listeners list to shut down default
  16699. // console output. Note that removing this object from the listener list
  16700. // with Release transfers its ownership to the caller and makes this
  16701. // function return NULL the next time.
  16702. TestEventListener* default_result_printer() const {
  16703. return default_result_printer_;
  16704. }
  16705. // Returns the standard listener responsible for the default XML output
  16706. // controlled by the --gtest_output=xml flag. Can be removed from the
  16707. // listeners list by users who want to shut down the default XML output
  16708. // controlled by this flag and substitute it with custom one. Note that
  16709. // removing this object from the listener list with Release transfers its
  16710. // ownership to the caller and makes this function return NULL the next
  16711. // time.
  16712. TestEventListener* default_xml_generator() const {
  16713. return default_xml_generator_;
  16714. }
  16715. private:
  16716. friend class TestCase;
  16717. friend class TestInfo;
  16718. friend class internal::DefaultGlobalTestPartResultReporter;
  16719. friend class internal::NoExecDeathTest;
  16720. friend class internal::TestEventListenersAccessor;
  16721. friend class internal::UnitTestImpl;
  16722. // Returns repeater that broadcasts the TestEventListener events to all
  16723. // subscribers.
  16724. TestEventListener* repeater();
  16725. // Sets the default_result_printer attribute to the provided listener.
  16726. // The listener is also added to the listener list and previous
  16727. // default_result_printer is removed from it and deleted. The listener can
  16728. // also be NULL in which case it will not be added to the list. Does
  16729. // nothing if the previous and the current listener objects are the same.
  16730. void SetDefaultResultPrinter(TestEventListener* listener);
  16731. // Sets the default_xml_generator attribute to the provided listener. The
  16732. // listener is also added to the listener list and previous
  16733. // default_xml_generator is removed from it and deleted. The listener can
  16734. // also be NULL in which case it will not be added to the list. Does
  16735. // nothing if the previous and the current listener objects are the same.
  16736. void SetDefaultXmlGenerator(TestEventListener* listener);
  16737. // Controls whether events will be forwarded by the repeater to the
  16738. // listeners in the list.
  16739. bool EventForwardingEnabled() const;
  16740. void SuppressEventForwarding();
  16741. // The actual list of listeners.
  16742. internal::TestEventRepeater* repeater_;
  16743. // Listener responsible for the standard result output.
  16744. TestEventListener* default_result_printer_;
  16745. // Listener responsible for the creation of the XML output file.
  16746. TestEventListener* default_xml_generator_;
  16747. // We disallow copying TestEventListeners.
  16748. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
  16749. };
  16750. // A UnitTest consists of a vector of TestCases.
  16751. //
  16752. // This is a singleton class. The only instance of UnitTest is
  16753. // created when UnitTest::GetInstance() is first called. This
  16754. // instance is never deleted.
  16755. //
  16756. // UnitTest is not copyable.
  16757. //
  16758. // This class is thread-safe as long as the methods are called
  16759. // according to their specification.
  16760. class GTEST_API_ UnitTest {
  16761. public:
  16762. // Gets the singleton UnitTest object. The first time this method
  16763. // is called, a UnitTest object is constructed and returned.
  16764. // Consecutive calls will return the same object.
  16765. static UnitTest* GetInstance();
  16766. // Runs all tests in this UnitTest object and prints the result.
  16767. // Returns 0 if successful, or 1 otherwise.
  16768. //
  16769. // This method can only be called from the main thread.
  16770. //
  16771. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16772. int Run() GTEST_MUST_USE_RESULT_;
  16773. // Returns the working directory when the first TEST() or TEST_F()
  16774. // was executed. The UnitTest object owns the string.
  16775. const char* original_working_dir() const;
  16776. // Returns the TestCase object for the test that's currently running,
  16777. // or NULL if no test is running.
  16778. const TestCase* current_test_case() const
  16779. GTEST_LOCK_EXCLUDED_(mutex_);
  16780. // Returns the TestInfo object for the test that's currently running,
  16781. // or NULL if no test is running.
  16782. const TestInfo* current_test_info() const
  16783. GTEST_LOCK_EXCLUDED_(mutex_);
  16784. // Returns the random seed used at the start of the current test run.
  16785. int random_seed() const;
  16786. #if GTEST_HAS_PARAM_TEST
  16787. // Returns the ParameterizedTestCaseRegistry object used to keep track of
  16788. // value-parameterized tests and instantiate and register them.
  16789. //
  16790. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16791. internal::ParameterizedTestCaseRegistry& parameterized_test_registry()
  16792. GTEST_LOCK_EXCLUDED_(mutex_);
  16793. #endif // GTEST_HAS_PARAM_TEST
  16794. // Gets the number of successful test cases.
  16795. int successful_test_case_count() const;
  16796. // Gets the number of failed test cases.
  16797. int failed_test_case_count() const;
  16798. // Gets the number of all test cases.
  16799. int total_test_case_count() const;
  16800. // Gets the number of all test cases that contain at least one test
  16801. // that should run.
  16802. int test_case_to_run_count() const;
  16803. // Gets the number of successful tests.
  16804. int successful_test_count() const;
  16805. // Gets the number of failed tests.
  16806. int failed_test_count() const;
  16807. // Gets the number of disabled tests that will be reported in the XML report.
  16808. int reportable_disabled_test_count() const;
  16809. // Gets the number of disabled tests.
  16810. int disabled_test_count() const;
  16811. // Gets the number of tests to be printed in the XML report.
  16812. int reportable_test_count() const;
  16813. // Gets the number of all tests.
  16814. int total_test_count() const;
  16815. // Gets the number of tests that should run.
  16816. int test_to_run_count() const;
  16817. // Gets the time of the test program start, in ms from the start of the
  16818. // UNIX epoch.
  16819. TimeInMillis start_timestamp() const;
  16820. // Gets the elapsed time, in milliseconds.
  16821. TimeInMillis elapsed_time() const;
  16822. // Returns true iff the unit test passed (i.e. all test cases passed).
  16823. bool Passed() const;
  16824. // Returns true iff the unit test failed (i.e. some test case failed
  16825. // or something outside of all tests failed).
  16826. bool Failed() const;
  16827. // Gets the i-th test case among all the test cases. i can range from 0 to
  16828. // total_test_case_count() - 1. If i is not in that range, returns NULL.
  16829. const TestCase* GetTestCase(int i) const;
  16830. // Returns the TestResult containing information on test failures and
  16831. // properties logged outside of individual test cases.
  16832. const TestResult& ad_hoc_test_result() const;
  16833. // Returns the list of event listeners that can be used to track events
  16834. // inside Google Test.
  16835. TestEventListeners& listeners();
  16836. private:
  16837. // Registers and returns a global test environment. When a test
  16838. // program is run, all global test environments will be set-up in
  16839. // the order they were registered. After all tests in the program
  16840. // have finished, all global test environments will be torn-down in
  16841. // the *reverse* order they were registered.
  16842. //
  16843. // The UnitTest object takes ownership of the given environment.
  16844. //
  16845. // This method can only be called from the main thread.
  16846. Environment* AddEnvironment(Environment* env);
  16847. // Adds a TestPartResult to the current TestResult object. All
  16848. // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
  16849. // eventually call this to report their results. The user code
  16850. // should use the assertion macros instead of calling this directly.
  16851. void AddTestPartResult(TestPartResult::Type result_type,
  16852. const char* file_name,
  16853. int line_number,
  16854. const std::string& message,
  16855. const std::string& os_stack_trace)
  16856. GTEST_LOCK_EXCLUDED_(mutex_);
  16857. // Adds a TestProperty to the current TestResult object when invoked from
  16858. // inside a test, to current TestCase's ad_hoc_test_result_ when invoked
  16859. // from SetUpTestCase or TearDownTestCase, or to the global property set
  16860. // when invoked elsewhere. If the result already contains a property with
  16861. // the same key, the value will be updated.
  16862. void RecordProperty(const std::string& key, const std::string& value);
  16863. // Gets the i-th test case among all the test cases. i can range from 0 to
  16864. // total_test_case_count() - 1. If i is not in that range, returns NULL.
  16865. TestCase* GetMutableTestCase(int i);
  16866. // Accessors for the implementation object.
  16867. internal::UnitTestImpl* impl() { return impl_; }
  16868. const internal::UnitTestImpl* impl() const { return impl_; }
  16869. // These classes and funcions are friends as they need to access private
  16870. // members of UnitTest.
  16871. friend class Test;
  16872. friend class internal::AssertHelper;
  16873. friend class internal::ScopedTrace;
  16874. friend class internal::StreamingListenerTest;
  16875. friend class internal::UnitTestRecordPropertyTestHelper;
  16876. friend Environment* AddGlobalTestEnvironment(Environment* env);
  16877. friend internal::UnitTestImpl* internal::GetUnitTestImpl();
  16878. friend void internal::ReportFailureInUnknownLocation(
  16879. TestPartResult::Type result_type,
  16880. const std::string& message);
  16881. // Creates an empty UnitTest.
  16882. UnitTest();
  16883. // D'tor
  16884. virtual ~UnitTest();
  16885. // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
  16886. // Google Test trace stack.
  16887. void PushGTestTrace(const internal::TraceInfo& trace)
  16888. GTEST_LOCK_EXCLUDED_(mutex_);
  16889. // Pops a trace from the per-thread Google Test trace stack.
  16890. void PopGTestTrace()
  16891. GTEST_LOCK_EXCLUDED_(mutex_);
  16892. // Protects mutable state in *impl_. This is mutable as some const
  16893. // methods need to lock it too.
  16894. mutable internal::Mutex mutex_;
  16895. // Opaque implementation object. This field is never changed once
  16896. // the object is constructed. We don't mark it as const here, as
  16897. // doing so will cause a warning in the constructor of UnitTest.
  16898. // Mutable state in *impl_ is protected by mutex_.
  16899. internal::UnitTestImpl* impl_;
  16900. // We disallow copying UnitTest.
  16901. GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
  16902. };
  16903. // A convenient wrapper for adding an environment for the test
  16904. // program.
  16905. //
  16906. // You should call this before RUN_ALL_TESTS() is called, probably in
  16907. // main(). If you use gtest_main, you need to call this before main()
  16908. // starts for it to take effect. For example, you can define a global
  16909. // variable like this:
  16910. //
  16911. // testing::Environment* const foo_env =
  16912. // testing::AddGlobalTestEnvironment(new FooEnvironment);
  16913. //
  16914. // However, we strongly recommend you to write your own main() and
  16915. // call AddGlobalTestEnvironment() there, as relying on initialization
  16916. // of global variables makes the code harder to read and may cause
  16917. // problems when you register multiple environments from different
  16918. // translation units and the environments have dependencies among them
  16919. // (remember that the compiler doesn't guarantee the order in which
  16920. // global variables from different translation units are initialized).
  16921. inline Environment* AddGlobalTestEnvironment(Environment* env) {
  16922. return UnitTest::GetInstance()->AddEnvironment(env);
  16923. }
  16924. // Initializes Google Test. This must be called before calling
  16925. // RUN_ALL_TESTS(). In particular, it parses a command line for the
  16926. // flags that Google Test recognizes. Whenever a Google Test flag is
  16927. // seen, it is removed from argv, and *argc is decremented.
  16928. //
  16929. // No value is returned. Instead, the Google Test flag variables are
  16930. // updated.
  16931. //
  16932. // Calling the function for the second time has no user-visible effect.
  16933. GTEST_API_ void InitGoogleTest(int* argc, char** argv);
  16934. // This overloaded version can be used in Windows programs compiled in
  16935. // UNICODE mode.
  16936. GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
  16937. namespace internal {
  16938. // FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a
  16939. // value of type ToPrint that is an operand of a comparison assertion
  16940. // (e.g. ASSERT_EQ). OtherOperand is the type of the other operand in
  16941. // the comparison, and is used to help determine the best way to
  16942. // format the value. In particular, when the value is a C string
  16943. // (char pointer) and the other operand is an STL string object, we
  16944. // want to format the C string as a string, since we know it is
  16945. // compared by value with the string object. If the value is a char
  16946. // pointer but the other operand is not an STL string object, we don't
  16947. // know whether the pointer is supposed to point to a NUL-terminated
  16948. // string, and thus want to print it as a pointer to be safe.
  16949. //
  16950. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16951. // The default case.
  16952. template <typename ToPrint, typename OtherOperand>
  16953. class FormatForComparison {
  16954. public:
  16955. static ::std::string Format(const ToPrint& value) {
  16956. return ::testing::PrintToString(value);
  16957. }
  16958. };
  16959. // Array.
  16960. template <typename ToPrint, size_t N, typename OtherOperand>
  16961. class FormatForComparison<ToPrint[N], OtherOperand> {
  16962. public:
  16963. static ::std::string Format(const ToPrint* value) {
  16964. return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);
  16965. }
  16966. };
  16967. // By default, print C string as pointers to be safe, as we don't know
  16968. // whether they actually point to a NUL-terminated string.
  16969. #define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType) \
  16970. template <typename OtherOperand> \
  16971. class FormatForComparison<CharType*, OtherOperand> { \
  16972. public: \
  16973. static ::std::string Format(CharType* value) { \
  16974. return ::testing::PrintToString(static_cast<const void*>(value)); \
  16975. } \
  16976. }
  16977. GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);
  16978. GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);
  16979. GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);
  16980. GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);
  16981. #undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
  16982. // If a C string is compared with an STL string object, we know it's meant
  16983. // to point to a NUL-terminated string, and thus can print it as a string.
  16984. #define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
  16985. template <> \
  16986. class FormatForComparison<CharType*, OtherStringType> { \
  16987. public: \
  16988. static ::std::string Format(CharType* value) { \
  16989. return ::testing::PrintToString(value); \
  16990. } \
  16991. }
  16992. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
  16993. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
  16994. #if GTEST_HAS_GLOBAL_STRING
  16995. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
  16996. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
  16997. #endif
  16998. #if GTEST_HAS_GLOBAL_WSTRING
  16999. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);
  17000. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);
  17001. #endif
  17002. #if GTEST_HAS_STD_WSTRING
  17003. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
  17004. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);
  17005. #endif
  17006. #undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
  17007. // Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
  17008. // operand to be used in a failure message. The type (but not value)
  17009. // of the other operand may affect the format. This allows us to
  17010. // print a char* as a raw pointer when it is compared against another
  17011. // char* or void*, and print it as a C string when it is compared
  17012. // against an std::string object, for example.
  17013. //
  17014. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  17015. template <typename T1, typename T2>
  17016. std::string FormatForComparisonFailureMessage(
  17017. const T1& value, const T2& /* other_operand */) {
  17018. return FormatForComparison<T1, T2>::Format(value);
  17019. }
  17020. // The helper function for {ASSERT|EXPECT}_EQ.
  17021. template <typename T1, typename T2>
  17022. AssertionResult CmpHelperEQ(const char* expected_expression,
  17023. const char* actual_expression,
  17024. const T1& expected,
  17025. const T2& actual) {
  17026. #ifdef _MSC_VER
  17027. # pragma warning(push) // Saves the current warning state.
  17028. # pragma warning(disable:4389) // Temporarily disables warning on
  17029. // signed/unsigned mismatch.
  17030. #endif
  17031. if (expected == actual) {
  17032. return AssertionSuccess();
  17033. }
  17034. #ifdef _MSC_VER
  17035. # pragma warning(pop) // Restores the warning state.
  17036. #endif
  17037. return EqFailure(expected_expression,
  17038. actual_expression,
  17039. FormatForComparisonFailureMessage(expected, actual),
  17040. FormatForComparisonFailureMessage(actual, expected),
  17041. false);
  17042. }
  17043. // With this overloaded version, we allow anonymous enums to be used
  17044. // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
  17045. // can be implicitly cast to BiggestInt.
  17046. GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression,
  17047. const char* actual_expression,
  17048. BiggestInt expected,
  17049. BiggestInt actual);
  17050. // The helper class for {ASSERT|EXPECT}_EQ. The template argument
  17051. // lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
  17052. // is a null pointer literal. The following default implementation is
  17053. // for lhs_is_null_literal being false.
  17054. template <bool lhs_is_null_literal>
  17055. class EqHelper {
  17056. public:
  17057. // This templatized version is for the general case.
  17058. template <typename T1, typename T2>
  17059. static AssertionResult Compare(const char* expected_expression,
  17060. const char* actual_expression,
  17061. const T1& expected,
  17062. const T2& actual) {
  17063. return CmpHelperEQ(expected_expression, actual_expression, expected,
  17064. actual);
  17065. }
  17066. // With this overloaded version, we allow anonymous enums to be used
  17067. // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
  17068. // enums can be implicitly cast to BiggestInt.
  17069. //
  17070. // Even though its body looks the same as the above version, we
  17071. // cannot merge the two, as it will make anonymous enums unhappy.
  17072. static AssertionResult Compare(const char* expected_expression,
  17073. const char* actual_expression,
  17074. BiggestInt expected,
  17075. BiggestInt actual) {
  17076. return CmpHelperEQ(expected_expression, actual_expression, expected,
  17077. actual);
  17078. }
  17079. };
  17080. // This specialization is used when the first argument to ASSERT_EQ()
  17081. // is a null pointer literal, like NULL, false, or 0.
  17082. template <>
  17083. class EqHelper<true> {
  17084. public:
  17085. // We define two overloaded versions of Compare(). The first
  17086. // version will be picked when the second argument to ASSERT_EQ() is
  17087. // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
  17088. // EXPECT_EQ(false, a_bool).
  17089. template <typename T1, typename T2>
  17090. static AssertionResult Compare(
  17091. const char* expected_expression,
  17092. const char* actual_expression,
  17093. const T1& expected,
  17094. const T2& actual,
  17095. // The following line prevents this overload from being considered if T2
  17096. // is not a pointer type. We need this because ASSERT_EQ(NULL, my_ptr)
  17097. // expands to Compare("", "", NULL, my_ptr), which requires a conversion
  17098. // to match the Secret* in the other overload, which would otherwise make
  17099. // this template match better.
  17100. typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
  17101. return CmpHelperEQ(expected_expression, actual_expression, expected,
  17102. actual);
  17103. }
  17104. // This version will be picked when the second argument to ASSERT_EQ() is a
  17105. // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
  17106. template <typename T>
  17107. static AssertionResult Compare(
  17108. const char* expected_expression,
  17109. const char* actual_expression,
  17110. // We used to have a second template parameter instead of Secret*. That
  17111. // template parameter would deduce to 'long', making this a better match
  17112. // than the first overload even without the first overload's EnableIf.
  17113. // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
  17114. // non-pointer argument" (even a deduced integral argument), so the old
  17115. // implementation caused warnings in user code.
  17116. Secret* /* expected (NULL) */,
  17117. T* actual) {
  17118. // We already know that 'expected' is a null pointer.
  17119. return CmpHelperEQ(expected_expression, actual_expression,
  17120. static_cast<T*>(NULL), actual);
  17121. }
  17122. };
  17123. // A macro for implementing the helper functions needed to implement
  17124. // ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste
  17125. // of similar code.
  17126. //
  17127. // For each templatized helper function, we also define an overloaded
  17128. // version for BiggestInt in order to reduce code bloat and allow
  17129. // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
  17130. // with gcc 4.
  17131. //
  17132. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  17133. #define GTEST_IMPL_CMP_HELPER_(op_name, op)\
  17134. template <typename T1, typename T2>\
  17135. AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
  17136. const T1& val1, const T2& val2) {\
  17137. if (val1 op val2) {\
  17138. return AssertionSuccess();\
  17139. } else {\
  17140. return AssertionFailure() \
  17141. << "Expected: (" << expr1 << ") " #op " (" << expr2\
  17142. << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
  17143. << " vs " << FormatForComparisonFailureMessage(val2, val1);\
  17144. }\
  17145. }\
  17146. GTEST_API_ AssertionResult CmpHelper##op_name(\
  17147. const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
  17148. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  17149. // Implements the helper function for {ASSERT|EXPECT}_NE
  17150. GTEST_IMPL_CMP_HELPER_(NE, !=);
  17151. // Implements the helper function for {ASSERT|EXPECT}_LE
  17152. GTEST_IMPL_CMP_HELPER_(LE, <=);
  17153. // Implements the helper function for {ASSERT|EXPECT}_LT
  17154. GTEST_IMPL_CMP_HELPER_(LT, <);
  17155. // Implements the helper function for {ASSERT|EXPECT}_GE
  17156. GTEST_IMPL_CMP_HELPER_(GE, >=);
  17157. // Implements the helper function for {ASSERT|EXPECT}_GT
  17158. GTEST_IMPL_CMP_HELPER_(GT, >);
  17159. #undef GTEST_IMPL_CMP_HELPER_
  17160. // The helper function for {ASSERT|EXPECT}_STREQ.
  17161. //
  17162. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  17163. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
  17164. const char* actual_expression,
  17165. const char* expected,
  17166. const char* actual);
  17167. // The helper function for {ASSERT|EXPECT}_STRCASEEQ.
  17168. //
  17169. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  17170. GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,
  17171. const char* actual_expression,
  17172. const char* expected,
  17173. const char* actual);
  17174. // The helper function for {ASSERT|EXPECT}_STRNE.
  17175. //
  17176. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  17177. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
  17178. const char* s2_expression,
  17179. const char* s1,
  17180. const char* s2);
  17181. // The helper function for {ASSERT|EXPECT}_STRCASENE.
  17182. //
  17183. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  17184. GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
  17185. const char* s2_expression,
  17186. const char* s1,
  17187. const char* s2);
  17188. // Helper function for *_STREQ on wide strings.
  17189. //
  17190. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  17191. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
  17192. const char* actual_expression,
  17193. const wchar_t* expected,
  17194. const wchar_t* actual);
  17195. // Helper function for *_STRNE on wide strings.
  17196. //
  17197. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  17198. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
  17199. const char* s2_expression,
  17200. const wchar_t* s1,
  17201. const wchar_t* s2);
  17202. } // namespace internal
  17203. // IsSubstring() and IsNotSubstring() are intended to be used as the
  17204. // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
  17205. // themselves. They check whether needle is a substring of haystack
  17206. // (NULL is considered a substring of itself only), and return an
  17207. // appropriate error message when they fail.
  17208. //
  17209. // The {needle,haystack}_expr arguments are the stringified
  17210. // expressions that generated the two real arguments.
  17211. GTEST_API_ AssertionResult IsSubstring(
  17212. const char* needle_expr, const char* haystack_expr,
  17213. const char* needle, const char* haystack);
  17214. GTEST_API_ AssertionResult IsSubstring(
  17215. const char* needle_expr, const char* haystack_expr,
  17216. const wchar_t* needle, const wchar_t* haystack);
  17217. GTEST_API_ AssertionResult IsNotSubstring(
  17218. const char* needle_expr, const char* haystack_expr,
  17219. const char* needle, const char* haystack);
  17220. GTEST_API_ AssertionResult IsNotSubstring(
  17221. const char* needle_expr, const char* haystack_expr,
  17222. const wchar_t* needle, const wchar_t* haystack);
  17223. GTEST_API_ AssertionResult IsSubstring(
  17224. const char* needle_expr, const char* haystack_expr,
  17225. const ::std::string& needle, const ::std::string& haystack);
  17226. GTEST_API_ AssertionResult IsNotSubstring(
  17227. const char* needle_expr, const char* haystack_expr,
  17228. const ::std::string& needle, const ::std::string& haystack);
  17229. #if GTEST_HAS_STD_WSTRING
  17230. GTEST_API_ AssertionResult IsSubstring(
  17231. const char* needle_expr, const char* haystack_expr,
  17232. const ::std::wstring& needle, const ::std::wstring& haystack);
  17233. GTEST_API_ AssertionResult IsNotSubstring(
  17234. const char* needle_expr, const char* haystack_expr,
  17235. const ::std::wstring& needle, const ::std::wstring& haystack);
  17236. #endif // GTEST_HAS_STD_WSTRING
  17237. namespace internal {
  17238. // Helper template function for comparing floating-points.
  17239. //
  17240. // Template parameter:
  17241. //
  17242. // RawType: the raw floating-point type (either float or double)
  17243. //
  17244. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  17245. template <typename RawType>
  17246. AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression,
  17247. const char* actual_expression,
  17248. RawType expected,
  17249. RawType actual) {
  17250. const FloatingPoint<RawType> lhs(expected), rhs(actual);
  17251. if (lhs.AlmostEquals(rhs)) {
  17252. return AssertionSuccess();
  17253. }
  17254. ::std::stringstream expected_ss;
  17255. expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
  17256. << expected;
  17257. ::std::stringstream actual_ss;
  17258. actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
  17259. << actual;
  17260. return EqFailure(expected_expression,
  17261. actual_expression,
  17262. StringStreamToString(&expected_ss),
  17263. StringStreamToString(&actual_ss),
  17264. false);
  17265. }
  17266. // Helper function for implementing ASSERT_NEAR.
  17267. //
  17268. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  17269. GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
  17270. const char* expr2,
  17271. const char* abs_error_expr,
  17272. double val1,
  17273. double val2,
  17274. double abs_error);
  17275. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  17276. // A class that enables one to stream messages to assertion macros
  17277. class GTEST_API_ AssertHelper {
  17278. public:
  17279. // Constructor.
  17280. AssertHelper(TestPartResult::Type type,
  17281. const char* file,
  17282. int line,
  17283. const char* message);
  17284. ~AssertHelper();
  17285. // Message assignment is a semantic trick to enable assertion
  17286. // streaming; see the GTEST_MESSAGE_ macro below.
  17287. void operator=(const Message& message) const;
  17288. private:
  17289. // We put our data in a struct so that the size of the AssertHelper class can
  17290. // be as small as possible. This is important because gcc is incapable of
  17291. // re-using stack space even for temporary variables, so every EXPECT_EQ
  17292. // reserves stack space for another AssertHelper.
  17293. struct AssertHelperData {
  17294. AssertHelperData(TestPartResult::Type t,
  17295. const char* srcfile,
  17296. int line_num,
  17297. const char* msg)
  17298. : type(t), file(srcfile), line(line_num), message(msg) { }
  17299. TestPartResult::Type const type;
  17300. const char* const file;
  17301. int const line;
  17302. std::string const message;
  17303. private:
  17304. GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
  17305. };
  17306. AssertHelperData* const data_;
  17307. GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
  17308. };
  17309. } // namespace internal
  17310. #if GTEST_HAS_PARAM_TEST
  17311. // The pure interface class that all value-parameterized tests inherit from.
  17312. // A value-parameterized class must inherit from both ::testing::Test and
  17313. // ::testing::WithParamInterface. In most cases that just means inheriting
  17314. // from ::testing::TestWithParam, but more complicated test hierarchies
  17315. // may need to inherit from Test and WithParamInterface at different levels.
  17316. //
  17317. // This interface has support for accessing the test parameter value via
  17318. // the GetParam() method.
  17319. //
  17320. // Use it with one of the parameter generator defining functions, like Range(),
  17321. // Values(), ValuesIn(), Bool(), and Combine().
  17322. //
  17323. // class FooTest : public ::testing::TestWithParam<int> {
  17324. // protected:
  17325. // FooTest() {
  17326. // // Can use GetParam() here.
  17327. // }
  17328. // virtual ~FooTest() {
  17329. // // Can use GetParam() here.
  17330. // }
  17331. // virtual void SetUp() {
  17332. // // Can use GetParam() here.
  17333. // }
  17334. // virtual void TearDown {
  17335. // // Can use GetParam() here.
  17336. // }
  17337. // };
  17338. // TEST_P(FooTest, DoesBar) {
  17339. // // Can use GetParam() method here.
  17340. // Foo foo;
  17341. // ASSERT_TRUE(foo.DoesBar(GetParam()));
  17342. // }
  17343. // INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
  17344. template <typename T>
  17345. class WithParamInterface {
  17346. public:
  17347. typedef T ParamType;
  17348. virtual ~WithParamInterface() {}
  17349. // The current parameter value. Is also available in the test fixture's
  17350. // constructor. This member function is non-static, even though it only
  17351. // references static data, to reduce the opportunity for incorrect uses
  17352. // like writing 'WithParamInterface<bool>::GetParam()' for a test that
  17353. // uses a fixture whose parameter type is int.
  17354. const ParamType& GetParam() const {
  17355. GTEST_CHECK_(parameter_ != NULL)
  17356. << "GetParam() can only be called inside a value-parameterized test "
  17357. << "-- did you intend to write TEST_P instead of TEST_F?";
  17358. return *parameter_;
  17359. }
  17360. private:
  17361. // Sets parameter value. The caller is responsible for making sure the value
  17362. // remains alive and unchanged throughout the current test.
  17363. static void SetParam(const ParamType* parameter) {
  17364. parameter_ = parameter;
  17365. }
  17366. // Static value used for accessing parameter during a test lifetime.
  17367. static const ParamType* parameter_;
  17368. // TestClass must be a subclass of WithParamInterface<T> and Test.
  17369. template <class TestClass> friend class internal::ParameterizedTestFactory;
  17370. };
  17371. template <typename T>
  17372. const T* WithParamInterface<T>::parameter_ = NULL;
  17373. // Most value-parameterized classes can ignore the existence of
  17374. // WithParamInterface, and can just inherit from ::testing::TestWithParam.
  17375. template <typename T>
  17376. class TestWithParam : public Test, public WithParamInterface<T> {
  17377. };
  17378. #endif // GTEST_HAS_PARAM_TEST
  17379. // Macros for indicating success/failure in test code.
  17380. // ADD_FAILURE unconditionally adds a failure to the current test.
  17381. // SUCCEED generates a success - it doesn't automatically make the
  17382. // current test successful, as a test is only successful when it has
  17383. // no failure.
  17384. //
  17385. // EXPECT_* verifies that a certain condition is satisfied. If not,
  17386. // it behaves like ADD_FAILURE. In particular:
  17387. //
  17388. // EXPECT_TRUE verifies that a Boolean condition is true.
  17389. // EXPECT_FALSE verifies that a Boolean condition is false.
  17390. //
  17391. // FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
  17392. // that they will also abort the current function on failure. People
  17393. // usually want the fail-fast behavior of FAIL and ASSERT_*, but those
  17394. // writing data-driven tests often find themselves using ADD_FAILURE
  17395. // and EXPECT_* more.
  17396. // Generates a nonfatal failure with a generic message.
  17397. #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
  17398. // Generates a nonfatal failure at the given source file location with
  17399. // a generic message.
  17400. #define ADD_FAILURE_AT(file, line) \
  17401. GTEST_MESSAGE_AT_(file, line, "Failed", \
  17402. ::testing::TestPartResult::kNonFatalFailure)
  17403. // Generates a fatal failure with a generic message.
  17404. #define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
  17405. // Define this macro to 1 to omit the definition of FAIL(), which is a
  17406. // generic name and clashes with some other libraries.
  17407. #if !GTEST_DONT_DEFINE_FAIL
  17408. # define FAIL() GTEST_FAIL()
  17409. #endif
  17410. // Generates a success with a generic message.
  17411. #define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
  17412. // Define this macro to 1 to omit the definition of SUCCEED(), which
  17413. // is a generic name and clashes with some other libraries.
  17414. #if !GTEST_DONT_DEFINE_SUCCEED
  17415. # define SUCCEED() GTEST_SUCCEED()
  17416. #endif
  17417. // Macros for testing exceptions.
  17418. //
  17419. // * {ASSERT|EXPECT}_THROW(statement, expected_exception):
  17420. // Tests that the statement throws the expected exception.
  17421. // * {ASSERT|EXPECT}_NO_THROW(statement):
  17422. // Tests that the statement doesn't throw any exception.
  17423. // * {ASSERT|EXPECT}_ANY_THROW(statement):
  17424. // Tests that the statement throws an exception.
  17425. #define EXPECT_THROW(statement, expected_exception) \
  17426. GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
  17427. #define EXPECT_NO_THROW(statement) \
  17428. GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
  17429. #define EXPECT_ANY_THROW(statement) \
  17430. GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
  17431. #define ASSERT_THROW(statement, expected_exception) \
  17432. GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
  17433. #define ASSERT_NO_THROW(statement) \
  17434. GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
  17435. #define ASSERT_ANY_THROW(statement) \
  17436. GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
  17437. // Boolean assertions. Condition can be either a Boolean expression or an
  17438. // AssertionResult. For more information on how to use AssertionResult with
  17439. // these macros see comments on that class.
  17440. #define EXPECT_TRUE(condition) \
  17441. GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
  17442. GTEST_NONFATAL_FAILURE_)
  17443. #define EXPECT_FALSE(condition) \
  17444. GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
  17445. GTEST_NONFATAL_FAILURE_)
  17446. #define ASSERT_TRUE(condition) \
  17447. GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
  17448. GTEST_FATAL_FAILURE_)
  17449. #define ASSERT_FALSE(condition) \
  17450. GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
  17451. GTEST_FATAL_FAILURE_)
  17452. // Includes the auto-generated header that implements a family of
  17453. // generic predicate assertion macros.
  17454. // Copyright 2006, Google Inc.
  17455. // All rights reserved.
  17456. //
  17457. // Redistribution and use in source and binary forms, with or without
  17458. // modification, are permitted provided that the following conditions are
  17459. // met:
  17460. //
  17461. // * Redistributions of source code must retain the above copyright
  17462. // notice, this list of conditions and the following disclaimer.
  17463. // * Redistributions in binary form must reproduce the above
  17464. // copyright notice, this list of conditions and the following disclaimer
  17465. // in the documentation and/or other materials provided with the
  17466. // distribution.
  17467. // * Neither the name of Google Inc. nor the names of its
  17468. // contributors may be used to endorse or promote products derived from
  17469. // this software without specific prior written permission.
  17470. //
  17471. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  17472. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  17473. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  17474. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  17475. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17476. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17477. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  17478. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  17479. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  17480. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  17481. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  17482. // This file is AUTOMATICALLY GENERATED on 10/31/2011 by command
  17483. // 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
  17484. //
  17485. // Implements a family of generic predicate assertion macros.
  17486. #ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
  17487. #define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
  17488. // Makes sure this header is not included before gtest.h.
  17489. #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
  17490. # error Do not include gtest_pred_impl.h directly. Include gtest.h instead.
  17491. #endif // GTEST_INCLUDE_GTEST_GTEST_H_
  17492. // This header implements a family of generic predicate assertion
  17493. // macros:
  17494. //
  17495. // ASSERT_PRED_FORMAT1(pred_format, v1)
  17496. // ASSERT_PRED_FORMAT2(pred_format, v1, v2)
  17497. // ...
  17498. //
  17499. // where pred_format is a function or functor that takes n (in the
  17500. // case of ASSERT_PRED_FORMATn) values and their source expression
  17501. // text, and returns a testing::AssertionResult. See the definition
  17502. // of ASSERT_EQ in gtest.h for an example.
  17503. //
  17504. // If you don't care about formatting, you can use the more
  17505. // restrictive version:
  17506. //
  17507. // ASSERT_PRED1(pred, v1)
  17508. // ASSERT_PRED2(pred, v1, v2)
  17509. // ...
  17510. //
  17511. // where pred is an n-ary function or functor that returns bool,
  17512. // and the values v1, v2, ..., must support the << operator for
  17513. // streaming to std::ostream.
  17514. //
  17515. // We also define the EXPECT_* variations.
  17516. //
  17517. // For now we only support predicates whose arity is at most 5.
  17518. // Please email googletestframework@googlegroups.com if you need
  17519. // support for higher arities.
  17520. // GTEST_ASSERT_ is the basic statement to which all of the assertions
  17521. // in this file reduce. Don't use this in your code.
  17522. #define GTEST_ASSERT_(expression, on_failure) \
  17523. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  17524. if (const ::testing::AssertionResult gtest_ar = (expression)) \
  17525. ; \
  17526. else \
  17527. on_failure(gtest_ar.failure_message())
  17528. // Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use
  17529. // this in your code.
  17530. template <typename Pred,
  17531. typename T1>
  17532. AssertionResult AssertPred1Helper(const char* pred_text,
  17533. const char* e1,
  17534. Pred pred,
  17535. const T1& v1) {
  17536. if (pred(v1)) return AssertionSuccess();
  17537. return AssertionFailure() << pred_text << "("
  17538. << e1 << ") evaluates to false, where"
  17539. << "\n" << e1 << " evaluates to " << v1;
  17540. }
  17541. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
  17542. // Don't use this in your code.
  17543. #define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
  17544. GTEST_ASSERT_(pred_format(#v1, v1), \
  17545. on_failure)
  17546. // Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use
  17547. // this in your code.
  17548. #define GTEST_PRED1_(pred, v1, on_failure)\
  17549. GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
  17550. #v1, \
  17551. pred, \
  17552. v1), on_failure)
  17553. // Unary predicate assertion macros.
  17554. #define EXPECT_PRED_FORMAT1(pred_format, v1) \
  17555. GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
  17556. #define EXPECT_PRED1(pred, v1) \
  17557. GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
  17558. #define ASSERT_PRED_FORMAT1(pred_format, v1) \
  17559. GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
  17560. #define ASSERT_PRED1(pred, v1) \
  17561. GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
  17562. // Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use
  17563. // this in your code.
  17564. template <typename Pred,
  17565. typename T1,
  17566. typename T2>
  17567. AssertionResult AssertPred2Helper(const char* pred_text,
  17568. const char* e1,
  17569. const char* e2,
  17570. Pred pred,
  17571. const T1& v1,
  17572. const T2& v2) {
  17573. if (pred(v1, v2)) return AssertionSuccess();
  17574. return AssertionFailure() << pred_text << "("
  17575. << e1 << ", "
  17576. << e2 << ") evaluates to false, where"
  17577. << "\n" << e1 << " evaluates to " << v1
  17578. << "\n" << e2 << " evaluates to " << v2;
  17579. }
  17580. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
  17581. // Don't use this in your code.
  17582. #define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
  17583. GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \
  17584. on_failure)
  17585. // Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use
  17586. // this in your code.
  17587. #define GTEST_PRED2_(pred, v1, v2, on_failure)\
  17588. GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
  17589. #v1, \
  17590. #v2, \
  17591. pred, \
  17592. v1, \
  17593. v2), on_failure)
  17594. // Binary predicate assertion macros.
  17595. #define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
  17596. GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
  17597. #define EXPECT_PRED2(pred, v1, v2) \
  17598. GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
  17599. #define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
  17600. GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
  17601. #define ASSERT_PRED2(pred, v1, v2) \
  17602. GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
  17603. // Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use
  17604. // this in your code.
  17605. template <typename Pred,
  17606. typename T1,
  17607. typename T2,
  17608. typename T3>
  17609. AssertionResult AssertPred3Helper(const char* pred_text,
  17610. const char* e1,
  17611. const char* e2,
  17612. const char* e3,
  17613. Pred pred,
  17614. const T1& v1,
  17615. const T2& v2,
  17616. const T3& v3) {
  17617. if (pred(v1, v2, v3)) return AssertionSuccess();
  17618. return AssertionFailure() << pred_text << "("
  17619. << e1 << ", "
  17620. << e2 << ", "
  17621. << e3 << ") evaluates to false, where"
  17622. << "\n" << e1 << " evaluates to " << v1
  17623. << "\n" << e2 << " evaluates to " << v2
  17624. << "\n" << e3 << " evaluates to " << v3;
  17625. }
  17626. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
  17627. // Don't use this in your code.
  17628. #define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
  17629. GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \
  17630. on_failure)
  17631. // Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use
  17632. // this in your code.
  17633. #define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
  17634. GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
  17635. #v1, \
  17636. #v2, \
  17637. #v3, \
  17638. pred, \
  17639. v1, \
  17640. v2, \
  17641. v3), on_failure)
  17642. // Ternary predicate assertion macros.
  17643. #define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
  17644. GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
  17645. #define EXPECT_PRED3(pred, v1, v2, v3) \
  17646. GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
  17647. #define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
  17648. GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
  17649. #define ASSERT_PRED3(pred, v1, v2, v3) \
  17650. GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
  17651. // Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use
  17652. // this in your code.
  17653. template <typename Pred,
  17654. typename T1,
  17655. typename T2,
  17656. typename T3,
  17657. typename T4>
  17658. AssertionResult AssertPred4Helper(const char* pred_text,
  17659. const char* e1,
  17660. const char* e2,
  17661. const char* e3,
  17662. const char* e4,
  17663. Pred pred,
  17664. const T1& v1,
  17665. const T2& v2,
  17666. const T3& v3,
  17667. const T4& v4) {
  17668. if (pred(v1, v2, v3, v4)) return AssertionSuccess();
  17669. return AssertionFailure() << pred_text << "("
  17670. << e1 << ", "
  17671. << e2 << ", "
  17672. << e3 << ", "
  17673. << e4 << ") evaluates to false, where"
  17674. << "\n" << e1 << " evaluates to " << v1
  17675. << "\n" << e2 << " evaluates to " << v2
  17676. << "\n" << e3 << " evaluates to " << v3
  17677. << "\n" << e4 << " evaluates to " << v4;
  17678. }
  17679. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
  17680. // Don't use this in your code.
  17681. #define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
  17682. GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \
  17683. on_failure)
  17684. // Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use
  17685. // this in your code.
  17686. #define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
  17687. GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
  17688. #v1, \
  17689. #v2, \
  17690. #v3, \
  17691. #v4, \
  17692. pred, \
  17693. v1, \
  17694. v2, \
  17695. v3, \
  17696. v4), on_failure)
  17697. // 4-ary predicate assertion macros.
  17698. #define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
  17699. GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
  17700. #define EXPECT_PRED4(pred, v1, v2, v3, v4) \
  17701. GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
  17702. #define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
  17703. GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
  17704. #define ASSERT_PRED4(pred, v1, v2, v3, v4) \
  17705. GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
  17706. // Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use
  17707. // this in your code.
  17708. template <typename Pred,
  17709. typename T1,
  17710. typename T2,
  17711. typename T3,
  17712. typename T4,
  17713. typename T5>
  17714. AssertionResult AssertPred5Helper(const char* pred_text,
  17715. const char* e1,
  17716. const char* e2,
  17717. const char* e3,
  17718. const char* e4,
  17719. const char* e5,
  17720. Pred pred,
  17721. const T1& v1,
  17722. const T2& v2,
  17723. const T3& v3,
  17724. const T4& v4,
  17725. const T5& v5) {
  17726. if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
  17727. return AssertionFailure() << pred_text << "("
  17728. << e1 << ", "
  17729. << e2 << ", "
  17730. << e3 << ", "
  17731. << e4 << ", "
  17732. << e5 << ") evaluates to false, where"
  17733. << "\n" << e1 << " evaluates to " << v1
  17734. << "\n" << e2 << " evaluates to " << v2
  17735. << "\n" << e3 << " evaluates to " << v3
  17736. << "\n" << e4 << " evaluates to " << v4
  17737. << "\n" << e5 << " evaluates to " << v5;
  17738. }
  17739. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
  17740. // Don't use this in your code.
  17741. #define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
  17742. GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \
  17743. on_failure)
  17744. // Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use
  17745. // this in your code.
  17746. #define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
  17747. GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
  17748. #v1, \
  17749. #v2, \
  17750. #v3, \
  17751. #v4, \
  17752. #v5, \
  17753. pred, \
  17754. v1, \
  17755. v2, \
  17756. v3, \
  17757. v4, \
  17758. v5), on_failure)
  17759. // 5-ary predicate assertion macros.
  17760. #define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
  17761. GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
  17762. #define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
  17763. GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
  17764. #define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
  17765. GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
  17766. #define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
  17767. GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
  17768. #endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
  17769. // Macros for testing equalities and inequalities.
  17770. //
  17771. // * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual
  17772. // * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
  17773. // * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2
  17774. // * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2
  17775. // * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2
  17776. // * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2
  17777. //
  17778. // When they are not, Google Test prints both the tested expressions and
  17779. // their actual values. The values must be compatible built-in types,
  17780. // or you will get a compiler error. By "compatible" we mean that the
  17781. // values can be compared by the respective operator.
  17782. //
  17783. // Note:
  17784. //
  17785. // 1. It is possible to make a user-defined type work with
  17786. // {ASSERT|EXPECT}_??(), but that requires overloading the
  17787. // comparison operators and is thus discouraged by the Google C++
  17788. // Usage Guide. Therefore, you are advised to use the
  17789. // {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
  17790. // equal.
  17791. //
  17792. // 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
  17793. // pointers (in particular, C strings). Therefore, if you use it
  17794. // with two C strings, you are testing how their locations in memory
  17795. // are related, not how their content is related. To compare two C
  17796. // strings by content, use {ASSERT|EXPECT}_STR*().
  17797. //
  17798. // 3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to
  17799. // {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you
  17800. // what the actual value is when it fails, and similarly for the
  17801. // other comparisons.
  17802. //
  17803. // 4. Do not depend on the order in which {ASSERT|EXPECT}_??()
  17804. // evaluate their arguments, which is undefined.
  17805. //
  17806. // 5. These macros evaluate their arguments exactly once.
  17807. //
  17808. // Examples:
  17809. //
  17810. // EXPECT_NE(5, Foo());
  17811. // EXPECT_EQ(NULL, a_pointer);
  17812. // ASSERT_LT(i, array_size);
  17813. // ASSERT_GT(records.size(), 0) << "There is no record left.";
  17814. #define EXPECT_EQ(expected, actual) \
  17815. EXPECT_PRED_FORMAT2(::testing::internal:: \
  17816. EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
  17817. expected, actual)
  17818. #define EXPECT_NE(expected, actual) \
  17819. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual)
  17820. #define EXPECT_LE(val1, val2) \
  17821. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
  17822. #define EXPECT_LT(val1, val2) \
  17823. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
  17824. #define EXPECT_GE(val1, val2) \
  17825. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
  17826. #define EXPECT_GT(val1, val2) \
  17827. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
  17828. #define GTEST_ASSERT_EQ(expected, actual) \
  17829. ASSERT_PRED_FORMAT2(::testing::internal:: \
  17830. EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
  17831. expected, actual)
  17832. #define GTEST_ASSERT_NE(val1, val2) \
  17833. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
  17834. #define GTEST_ASSERT_LE(val1, val2) \
  17835. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
  17836. #define GTEST_ASSERT_LT(val1, val2) \
  17837. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
  17838. #define GTEST_ASSERT_GE(val1, val2) \
  17839. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
  17840. #define GTEST_ASSERT_GT(val1, val2) \
  17841. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
  17842. // Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
  17843. // ASSERT_XY(), which clashes with some users' own code.
  17844. #if !GTEST_DONT_DEFINE_ASSERT_EQ
  17845. # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
  17846. #endif
  17847. #if !GTEST_DONT_DEFINE_ASSERT_NE
  17848. # define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
  17849. #endif
  17850. #if !GTEST_DONT_DEFINE_ASSERT_LE
  17851. # define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
  17852. #endif
  17853. #if !GTEST_DONT_DEFINE_ASSERT_LT
  17854. # define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
  17855. #endif
  17856. #if !GTEST_DONT_DEFINE_ASSERT_GE
  17857. # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
  17858. #endif
  17859. #if !GTEST_DONT_DEFINE_ASSERT_GT
  17860. # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
  17861. #endif
  17862. // C-string Comparisons. All tests treat NULL and any non-NULL string
  17863. // as different. Two NULLs are equal.
  17864. //
  17865. // * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2
  17866. // * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2
  17867. // * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
  17868. // * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
  17869. //
  17870. // For wide or narrow string objects, you can use the
  17871. // {ASSERT|EXPECT}_??() macros.
  17872. //
  17873. // Don't depend on the order in which the arguments are evaluated,
  17874. // which is undefined.
  17875. //
  17876. // These macros evaluate their arguments exactly once.
  17877. #define EXPECT_STREQ(expected, actual) \
  17878. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
  17879. #define EXPECT_STRNE(s1, s2) \
  17880. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
  17881. #define EXPECT_STRCASEEQ(expected, actual) \
  17882. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
  17883. #define EXPECT_STRCASENE(s1, s2)\
  17884. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
  17885. #define ASSERT_STREQ(expected, actual) \
  17886. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
  17887. #define ASSERT_STRNE(s1, s2) \
  17888. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
  17889. #define ASSERT_STRCASEEQ(expected, actual) \
  17890. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
  17891. #define ASSERT_STRCASENE(s1, s2)\
  17892. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
  17893. // Macros for comparing floating-point numbers.
  17894. //
  17895. // * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual):
  17896. // Tests that two float values are almost equal.
  17897. // * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual):
  17898. // Tests that two double values are almost equal.
  17899. // * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
  17900. // Tests that v1 and v2 are within the given distance to each other.
  17901. //
  17902. // Google Test uses ULP-based comparison to automatically pick a default
  17903. // error bound that is appropriate for the operands. See the
  17904. // FloatingPoint template class in gtest-internal.h if you are
  17905. // interested in the implementation details.
  17906. #define EXPECT_FLOAT_EQ(expected, actual)\
  17907. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
  17908. expected, actual)
  17909. #define EXPECT_DOUBLE_EQ(expected, actual)\
  17910. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
  17911. expected, actual)
  17912. #define ASSERT_FLOAT_EQ(expected, actual)\
  17913. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
  17914. expected, actual)
  17915. #define ASSERT_DOUBLE_EQ(expected, actual)\
  17916. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
  17917. expected, actual)
  17918. #define EXPECT_NEAR(val1, val2, abs_error)\
  17919. EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
  17920. val1, val2, abs_error)
  17921. #define ASSERT_NEAR(val1, val2, abs_error)\
  17922. ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
  17923. val1, val2, abs_error)
  17924. // These predicate format functions work on floating-point values, and
  17925. // can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
  17926. //
  17927. // EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
  17928. // Asserts that val1 is less than, or almost equal to, val2. Fails
  17929. // otherwise. In particular, it fails if either val1 or val2 is NaN.
  17930. GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
  17931. float val1, float val2);
  17932. GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
  17933. double val1, double val2);
  17934. #if GTEST_OS_WINDOWS
  17935. // Macros that test for HRESULT failure and success, these are only useful
  17936. // on Windows, and rely on Windows SDK macros and APIs to compile.
  17937. //
  17938. // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
  17939. //
  17940. // When expr unexpectedly fails or succeeds, Google Test prints the
  17941. // expected result and the actual result with both a human-readable
  17942. // string representation of the error, if available, as well as the
  17943. // hex result code.
  17944. # define EXPECT_HRESULT_SUCCEEDED(expr) \
  17945. EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
  17946. # define ASSERT_HRESULT_SUCCEEDED(expr) \
  17947. ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
  17948. # define EXPECT_HRESULT_FAILED(expr) \
  17949. EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
  17950. # define ASSERT_HRESULT_FAILED(expr) \
  17951. ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
  17952. #endif // GTEST_OS_WINDOWS
  17953. // Macros that execute statement and check that it doesn't generate new fatal
  17954. // failures in the current thread.
  17955. //
  17956. // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
  17957. //
  17958. // Examples:
  17959. //
  17960. // EXPECT_NO_FATAL_FAILURE(Process());
  17961. // ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
  17962. //
  17963. #define ASSERT_NO_FATAL_FAILURE(statement) \
  17964. GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
  17965. #define EXPECT_NO_FATAL_FAILURE(statement) \
  17966. GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
  17967. // Causes a trace (including the source file path, the current line
  17968. // number, and the given message) to be included in every test failure
  17969. // message generated by code in the current scope. The effect is
  17970. // undone when the control leaves the current scope.
  17971. //
  17972. // The message argument can be anything streamable to std::ostream.
  17973. //
  17974. // In the implementation, we include the current line number as part
  17975. // of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
  17976. // to appear in the same block - as long as they are on different
  17977. // lines.
  17978. #define SCOPED_TRACE(message) \
  17979. ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
  17980. __FILE__, __LINE__, ::testing::Message() << (message))
  17981. // Compile-time assertion for type equality.
  17982. // StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
  17983. // the same type. The value it returns is not interesting.
  17984. //
  17985. // Instead of making StaticAssertTypeEq a class template, we make it a
  17986. // function template that invokes a helper class template. This
  17987. // prevents a user from misusing StaticAssertTypeEq<T1, T2> by
  17988. // defining objects of that type.
  17989. //
  17990. // CAVEAT:
  17991. //
  17992. // When used inside a method of a class template,
  17993. // StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
  17994. // instantiated. For example, given:
  17995. //
  17996. // template <typename T> class Foo {
  17997. // public:
  17998. // void Bar() { testing::StaticAssertTypeEq<int, T>(); }
  17999. // };
  18000. //
  18001. // the code:
  18002. //
  18003. // void Test1() { Foo<bool> foo; }
  18004. //
  18005. // will NOT generate a compiler error, as Foo<bool>::Bar() is never
  18006. // actually instantiated. Instead, you need:
  18007. //
  18008. // void Test2() { Foo<bool> foo; foo.Bar(); }
  18009. //
  18010. // to cause a compiler error.
  18011. template <typename T1, typename T2>
  18012. bool StaticAssertTypeEq() {
  18013. (void)internal::StaticAssertTypeEqHelper<T1, T2>();
  18014. return true;
  18015. }
  18016. // Defines a test.
  18017. //
  18018. // The first parameter is the name of the test case, and the second
  18019. // parameter is the name of the test within the test case.
  18020. //
  18021. // The convention is to end the test case name with "Test". For
  18022. // example, a test case for the Foo class can be named FooTest.
  18023. //
  18024. // The user should put his test code between braces after using this
  18025. // macro. Example:
  18026. //
  18027. // TEST(FooTest, InitializesCorrectly) {
  18028. // Foo foo;
  18029. // EXPECT_TRUE(foo.StatusIsOK());
  18030. // }
  18031. // Note that we call GetTestTypeId() instead of GetTypeId<
  18032. // ::testing::Test>() here to get the type ID of testing::Test. This
  18033. // is to work around a suspected linker bug when using Google Test as
  18034. // a framework on Mac OS X. The bug causes GetTypeId<
  18035. // ::testing::Test>() to return different values depending on whether
  18036. // the call is from the Google Test framework itself or from user test
  18037. // code. GetTestTypeId() is guaranteed to always return the same
  18038. // value, as it always calls GetTypeId<>() from the Google Test
  18039. // framework.
  18040. #define GTEST_TEST(test_case_name, test_name)\
  18041. GTEST_TEST_(test_case_name, test_name, \
  18042. ::testing::Test, ::testing::internal::GetTestTypeId())
  18043. // Define this macro to 1 to omit the definition of TEST(), which
  18044. // is a generic name and clashes with some other libraries.
  18045. #if !GTEST_DONT_DEFINE_TEST
  18046. # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
  18047. #endif
  18048. // Defines a test that uses a test fixture.
  18049. //
  18050. // The first parameter is the name of the test fixture class, which
  18051. // also doubles as the test case name. The second parameter is the
  18052. // name of the test within the test case.
  18053. //
  18054. // A test fixture class must be declared earlier. The user should put
  18055. // his test code between braces after using this macro. Example:
  18056. //
  18057. // class FooTest : public testing::Test {
  18058. // protected:
  18059. // virtual void SetUp() { b_.AddElement(3); }
  18060. //
  18061. // Foo a_;
  18062. // Foo b_;
  18063. // };
  18064. //
  18065. // TEST_F(FooTest, InitializesCorrectly) {
  18066. // EXPECT_TRUE(a_.StatusIsOK());
  18067. // }
  18068. //
  18069. // TEST_F(FooTest, ReturnsElementCountCorrectly) {
  18070. // EXPECT_EQ(0, a_.size());
  18071. // EXPECT_EQ(1, b_.size());
  18072. // }
  18073. #define TEST_F(test_fixture, test_name)\
  18074. GTEST_TEST_(test_fixture, test_name, test_fixture, \
  18075. ::testing::internal::GetTypeId<test_fixture>())
  18076. } // namespace testing
  18077. // Use this function in main() to run all tests. It returns 0 if all
  18078. // tests are successful, or 1 otherwise.
  18079. //
  18080. // RUN_ALL_TESTS() should be invoked after the command line has been
  18081. // parsed by InitGoogleTest().
  18082. //
  18083. // This function was formerly a macro; thus, it is in the global
  18084. // namespace and has an all-caps name.
  18085. int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;
  18086. inline int RUN_ALL_TESTS() {
  18087. return ::testing::UnitTest::GetInstance()->Run();
  18088. }
  18089. #endif // GTEST_INCLUDE_GTEST_GTEST_H_