gtest.h 851 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192
  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. All macros ending with _ and symbols defined in an
  125. // internal namespace are subject to change without notice. Code
  126. // outside Google Test MUST NOT USE THEM DIRECTLY. Macros that don't
  127. // end with _ are part of Google Test's public API and can be used by
  128. // code outside Google Test.
  129. //
  130. // This file is fundamental to Google Test. All other Google Test source
  131. // files are expected to #include this. Therefore, it cannot #include
  132. // any other Google Test header.
  133. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
  134. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
  135. // Environment-describing macros
  136. // -----------------------------
  137. //
  138. // Google Test can be used in many different environments. Macros in
  139. // this section tell Google Test what kind of environment it is being
  140. // used in, such that Google Test can provide environment-specific
  141. // features and implementations.
  142. //
  143. // Google Test tries to automatically detect the properties of its
  144. // environment, so users usually don't need to worry about these
  145. // macros. However, the automatic detection is not perfect.
  146. // Sometimes it's necessary for a user to define some of the following
  147. // macros in the build script to override Google Test's decisions.
  148. //
  149. // If the user doesn't define a macro in the list, Google Test will
  150. // provide a default definition. After this header is #included, all
  151. // macros in this list will be defined to either 1 or 0.
  152. //
  153. // Notes to maintainers:
  154. // - Each macro here is a user-tweakable knob; do not grow the list
  155. // lightly.
  156. // - Use #if to key off these macros. Don't use #ifdef or "#if
  157. // defined(...)", which will not work as these macros are ALWAYS
  158. // defined.
  159. //
  160. // GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2)
  161. // is/isn't available.
  162. // GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions
  163. // are enabled.
  164. // GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string
  165. // is/isn't available (some systems define
  166. // ::string, which is different to std::string).
  167. // GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
  168. // is/isn't available (some systems define
  169. // ::wstring, which is different to std::wstring).
  170. // GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular
  171. // expressions are/aren't available.
  172. // GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that <pthread.h>
  173. // is/isn't available.
  174. // GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't
  175. // enabled.
  176. // GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that
  177. // std::wstring does/doesn't work (Google Test can
  178. // be used where std::wstring is unavailable).
  179. // GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple
  180. // is/isn't available.
  181. // GTEST_HAS_SEH - Define it to 1/0 to indicate whether the
  182. // compiler supports Microsoft's "Structured
  183. // Exception Handling".
  184. // GTEST_HAS_STREAM_REDIRECTION
  185. // - Define it to 1/0 to indicate whether the
  186. // platform supports I/O stream redirection using
  187. // dup() and dup2().
  188. // GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google
  189. // Test's own tr1 tuple implementation should be
  190. // used. Unused when the user sets
  191. // GTEST_HAS_TR1_TUPLE to 0.
  192. // GTEST_LANG_CXX11 - Define it to 1/0 to indicate that Google Test
  193. // is building in C++11/C++98 mode.
  194. // GTEST_LINKED_AS_SHARED_LIBRARY
  195. // - Define to 1 when compiling tests that use
  196. // Google Test as a shared library (known as
  197. // DLL on Windows).
  198. // GTEST_CREATE_SHARED_LIBRARY
  199. // - Define to 1 when compiling Google Test itself
  200. // as a shared library.
  201. // Platform-indicating macros
  202. // --------------------------
  203. //
  204. // Macros indicating the platform on which Google Test is being used
  205. // (a macro is defined to 1 if compiled on the given platform;
  206. // otherwise UNDEFINED -- it's never defined to 0.). Google Test
  207. // defines these macros automatically. Code outside Google Test MUST
  208. // NOT define them.
  209. //
  210. // GTEST_OS_AIX - IBM AIX
  211. // GTEST_OS_CYGWIN - Cygwin
  212. // GTEST_OS_FREEBSD - FreeBSD
  213. // GTEST_OS_HPUX - HP-UX
  214. // GTEST_OS_LINUX - Linux
  215. // GTEST_OS_LINUX_ANDROID - Google Android
  216. // GTEST_OS_MAC - Mac OS X
  217. // GTEST_OS_IOS - iOS
  218. // GTEST_OS_NACL - Google Native Client (NaCl)
  219. // GTEST_OS_OPENBSD - OpenBSD
  220. // GTEST_OS_QNX - QNX
  221. // GTEST_OS_SOLARIS - Sun Solaris
  222. // GTEST_OS_SYMBIAN - Symbian
  223. // GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile)
  224. // GTEST_OS_WINDOWS_DESKTOP - Windows Desktop
  225. // GTEST_OS_WINDOWS_MINGW - MinGW
  226. // GTEST_OS_WINDOWS_MOBILE - Windows Mobile
  227. // GTEST_OS_WINDOWS_PHONE - Windows Phone
  228. // GTEST_OS_WINDOWS_RT - Windows Store App/WinRT
  229. // GTEST_OS_ZOS - z/OS
  230. //
  231. // Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
  232. // most stable support. Since core members of the Google Test project
  233. // don't have access to other platforms, support for them may be less
  234. // stable. If you notice any problems on your platform, please notify
  235. // googletestframework@googlegroups.com (patches for fixing them are
  236. // even more welcome!).
  237. //
  238. // It is possible that none of the GTEST_OS_* macros are defined.
  239. // Feature-indicating macros
  240. // -------------------------
  241. //
  242. // Macros indicating which Google Test features are available (a macro
  243. // is defined to 1 if the corresponding feature is supported;
  244. // otherwise UNDEFINED -- it's never defined to 0.). Google Test
  245. // defines these macros automatically. Code outside Google Test MUST
  246. // NOT define them.
  247. //
  248. // These macros are public so that portable tests can be written.
  249. // Such tests typically surround code using a feature with an #if
  250. // which controls that code. For example:
  251. //
  252. // #if GTEST_HAS_DEATH_TEST
  253. // EXPECT_DEATH(DoSomethingDeadly());
  254. // #endif
  255. //
  256. // GTEST_HAS_COMBINE - the Combine() function (for value-parameterized
  257. // tests)
  258. // GTEST_HAS_DEATH_TEST - death tests
  259. // GTEST_HAS_PARAM_TEST - value-parameterized tests
  260. // GTEST_HAS_TYPED_TEST - typed tests
  261. // GTEST_HAS_TYPED_TEST_P - type-parameterized tests
  262. // GTEST_IS_THREADSAFE - Google Test is thread-safe.
  263. // GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with
  264. // GTEST_HAS_POSIX_RE (see above) which users can
  265. // define themselves.
  266. // GTEST_USES_SIMPLE_RE - our own simple regex is used;
  267. // the above two are mutually exclusive.
  268. // GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
  269. // Misc public macros
  270. // ------------------
  271. //
  272. // GTEST_FLAG(flag_name) - references the variable corresponding to
  273. // the given Google Test flag.
  274. // Internal utilities
  275. // ------------------
  276. //
  277. // The following macros and utilities are for Google Test's INTERNAL
  278. // use only. Code outside Google Test MUST NOT USE THEM DIRECTLY.
  279. //
  280. // Macros for basic C++ coding:
  281. // GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
  282. // GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a
  283. // variable don't have to be used.
  284. // GTEST_DISALLOW_ASSIGN_ - disables operator=.
  285. // GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
  286. // GTEST_MUST_USE_RESULT_ - declares that a function's result must be used.
  287. // GTEST_INTENTIONAL_CONST_COND_PUSH_ - start code section where MSVC C4127 is
  288. // suppressed (constant conditional).
  289. // GTEST_INTENTIONAL_CONST_COND_POP_ - finish code section where MSVC C4127
  290. // is suppressed.
  291. //
  292. // C++11 feature wrappers:
  293. //
  294. // testing::internal::move - portability wrapper for std::move.
  295. //
  296. // Synchronization:
  297. // Mutex, MutexLock, ThreadLocal, GetThreadCount()
  298. // - synchronization primitives.
  299. //
  300. // Template meta programming:
  301. // is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only.
  302. // IteratorTraits - partial implementation of std::iterator_traits, which
  303. // is not available in libCstd when compiled with Sun C++.
  304. //
  305. // Smart pointers:
  306. // scoped_ptr - as in TR2.
  307. //
  308. // Regular expressions:
  309. // RE - a simple regular expression class using the POSIX
  310. // Extended Regular Expression syntax on UNIX-like
  311. // platforms, or a reduced regular exception syntax on
  312. // other platforms, including Windows.
  313. //
  314. // Logging:
  315. // GTEST_LOG_() - logs messages at the specified severity level.
  316. // LogToStderr() - directs all log messages to stderr.
  317. // FlushInfoLog() - flushes informational log messages.
  318. //
  319. // Stdout and stderr capturing:
  320. // CaptureStdout() - starts capturing stdout.
  321. // GetCapturedStdout() - stops capturing stdout and returns the captured
  322. // string.
  323. // CaptureStderr() - starts capturing stderr.
  324. // GetCapturedStderr() - stops capturing stderr and returns the captured
  325. // string.
  326. //
  327. // Integer types:
  328. // TypeWithSize - maps an integer to a int type.
  329. // Int32, UInt32, Int64, UInt64, TimeInMillis
  330. // - integers of known sizes.
  331. // BiggestInt - the biggest signed integer type.
  332. //
  333. // Command-line utilities:
  334. // GTEST_DECLARE_*() - declares a flag.
  335. // GTEST_DEFINE_*() - defines a flag.
  336. // GetInjectableArgvs() - returns the command line as a vector of strings.
  337. //
  338. // Environment variable utilities:
  339. // GetEnv() - gets the value of an environment variable.
  340. // BoolFromGTestEnv() - parses a bool environment variable.
  341. // Int32FromGTestEnv() - parses an Int32 environment variable.
  342. // StringFromGTestEnv() - parses a string environment variable.
  343. #include <ctype.h> // for isspace, etc
  344. #include <stddef.h> // for ptrdiff_t
  345. #include <stdlib.h>
  346. #include <stdio.h>
  347. #include <string.h>
  348. #ifndef _WIN32_WCE
  349. # include <sys/types.h>
  350. # include <sys/stat.h>
  351. #endif // !_WIN32_WCE
  352. #if defined __APPLE__
  353. # include <AvailabilityMacros.h>
  354. # include <TargetConditionals.h>
  355. #endif
  356. #include <algorithm> // NOLINT
  357. #include <iostream> // NOLINT
  358. #include <sstream> // NOLINT
  359. #include <string> // NOLINT
  360. #include <utility>
  361. #include <vector> // NOLINT
  362. // Copyright 2015, Google Inc.
  363. // All rights reserved.
  364. //
  365. // Redistribution and use in source and binary forms, with or without
  366. // modification, are permitted provided that the following conditions are
  367. // met:
  368. //
  369. // * Redistributions of source code must retain the above copyright
  370. // notice, this list of conditions and the following disclaimer.
  371. // * Redistributions in binary form must reproduce the above
  372. // copyright notice, this list of conditions and the following disclaimer
  373. // in the documentation and/or other materials provided with the
  374. // distribution.
  375. // * Neither the name of Google Inc. nor the names of its
  376. // contributors may be used to endorse or promote products derived from
  377. // this software without specific prior written permission.
  378. //
  379. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  380. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  381. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  382. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  383. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  384. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  385. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  386. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  387. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  388. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  389. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  390. //
  391. // The Google C++ Testing Framework (Google Test)
  392. //
  393. // This header file defines the GTEST_OS_* macro.
  394. // It is separate from gtest-port.h so that custom/gtest-port.h can include it.
  395. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
  396. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
  397. // Determines the platform on which Google Test is compiled.
  398. #ifdef __CYGWIN__
  399. # define GTEST_OS_CYGWIN 1
  400. #elif defined __SYMBIAN32__
  401. # define GTEST_OS_SYMBIAN 1
  402. #elif defined _WIN32
  403. # define GTEST_OS_WINDOWS 1
  404. # ifdef _WIN32_WCE
  405. # define GTEST_OS_WINDOWS_MOBILE 1
  406. # elif defined(__MINGW__) || defined(__MINGW32__)
  407. # define GTEST_OS_WINDOWS_MINGW 1
  408. # elif defined(WINAPI_FAMILY)
  409. # include <winapifamily.h>
  410. # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  411. # define GTEST_OS_WINDOWS_DESKTOP 1
  412. # elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
  413. # define GTEST_OS_WINDOWS_PHONE 1
  414. # elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
  415. # define GTEST_OS_WINDOWS_RT 1
  416. # else
  417. // WINAPI_FAMILY defined but no known partition matched.
  418. // Default to desktop.
  419. # define GTEST_OS_WINDOWS_DESKTOP 1
  420. # endif
  421. # else
  422. # define GTEST_OS_WINDOWS_DESKTOP 1
  423. # endif // _WIN32_WCE
  424. #elif defined __APPLE__
  425. # define GTEST_OS_MAC 1
  426. # if TARGET_OS_IPHONE
  427. # define GTEST_OS_IOS 1
  428. # endif
  429. #elif defined __FreeBSD__
  430. # define GTEST_OS_FREEBSD 1
  431. #elif defined __linux__
  432. # define GTEST_OS_LINUX 1
  433. # if defined __ANDROID__
  434. # define GTEST_OS_LINUX_ANDROID 1
  435. # endif
  436. #elif defined __MVS__
  437. # define GTEST_OS_ZOS 1
  438. #elif defined(__sun) && defined(__SVR4)
  439. # define GTEST_OS_SOLARIS 1
  440. #elif defined(_AIX)
  441. # define GTEST_OS_AIX 1
  442. #elif defined(__hpux)
  443. # define GTEST_OS_HPUX 1
  444. #elif defined __native_client__
  445. # define GTEST_OS_NACL 1
  446. #elif defined __OpenBSD__
  447. # define GTEST_OS_OPENBSD 1
  448. #elif defined __QNX__
  449. # define GTEST_OS_QNX 1
  450. #endif // __CYGWIN__
  451. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
  452. // Copyright 2015, Google Inc.
  453. // All rights reserved.
  454. //
  455. // Redistribution and use in source and binary forms, with or without
  456. // modification, are permitted provided that the following conditions are
  457. // met:
  458. //
  459. // * Redistributions of source code must retain the above copyright
  460. // notice, this list of conditions and the following disclaimer.
  461. // * Redistributions in binary form must reproduce the above
  462. // copyright notice, this list of conditions and the following disclaimer
  463. // in the documentation and/or other materials provided with the
  464. // distribution.
  465. // * Neither the name of Google Inc. nor the names of its
  466. // contributors may be used to endorse or promote products derived from
  467. // this software without specific prior written permission.
  468. //
  469. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  470. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  471. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  472. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  473. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  474. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  475. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  476. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  477. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  478. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  479. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  480. //
  481. // Injection point for custom user configurations.
  482. // The following macros can be defined:
  483. //
  484. // Flag related macros:
  485. // GTEST_FLAG(flag_name)
  486. // GTEST_USE_OWN_FLAGFILE_FLAG_ - Define to 0 when the system provides its
  487. // own flagfile flag parsing.
  488. // GTEST_DECLARE_bool_(name)
  489. // GTEST_DECLARE_int32_(name)
  490. // GTEST_DECLARE_string_(name)
  491. // GTEST_DEFINE_bool_(name, default_val, doc)
  492. // GTEST_DEFINE_int32_(name, default_val, doc)
  493. // GTEST_DEFINE_string_(name, default_val, doc)
  494. //
  495. // Test filtering:
  496. // GTEST_TEST_FILTER_ENV_VAR_ - The name of an environment variable that
  497. // will be used if --GTEST_FLAG(test_filter)
  498. // is not provided.
  499. //
  500. // Logging:
  501. // GTEST_LOG_(severity)
  502. // GTEST_CHECK_(condition)
  503. // Functions LogToStderr() and FlushInfoLog() have to be provided too.
  504. //
  505. // Threading:
  506. // GTEST_HAS_NOTIFICATION_ - Enabled if Notification is already provided.
  507. // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ - Enabled if Mutex and ThreadLocal are
  508. // already provided.
  509. // Must also provide GTEST_DECLARE_STATIC_MUTEX_(mutex) and
  510. // GTEST_DEFINE_STATIC_MUTEX_(mutex)
  511. //
  512. // GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
  513. // GTEST_LOCK_EXCLUDED_(locks)
  514. //
  515. // ** Custom implementation starts here **
  516. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
  517. #define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
  518. #endif // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
  519. #if !defined(GTEST_DEV_EMAIL_)
  520. # define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
  521. # define GTEST_FLAG_PREFIX_ "gtest_"
  522. # define GTEST_FLAG_PREFIX_DASH_ "gtest-"
  523. # define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
  524. # define GTEST_NAME_ "Google Test"
  525. # define GTEST_PROJECT_URL_ "https://github.com/google/googletest/"
  526. #endif // !defined(GTEST_DEV_EMAIL_)
  527. #if !defined(GTEST_INIT_GOOGLE_TEST_NAME_)
  528. # define GTEST_INIT_GOOGLE_TEST_NAME_ "testing::InitGoogleTest"
  529. #endif // !defined(GTEST_INIT_GOOGLE_TEST_NAME_)
  530. // Determines the version of gcc that is used to compile this.
  531. #ifdef __GNUC__
  532. // 40302 means version 4.3.2.
  533. # define GTEST_GCC_VER_ \
  534. (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
  535. #endif // __GNUC__
  536. // Macros for disabling Microsoft Visual C++ warnings.
  537. //
  538. // GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 4385)
  539. // /* code that triggers warnings C4800 and C4385 */
  540. // GTEST_DISABLE_MSC_WARNINGS_POP_()
  541. #if _MSC_VER >= 1500
  542. # define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings) \
  543. __pragma(warning(push)) \
  544. __pragma(warning(disable: warnings))
  545. # define GTEST_DISABLE_MSC_WARNINGS_POP_() \
  546. __pragma(warning(pop))
  547. #else
  548. // Older versions of MSVC don't have __pragma.
  549. # define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
  550. # define GTEST_DISABLE_MSC_WARNINGS_POP_()
  551. #endif
  552. #ifndef GTEST_LANG_CXX11
  553. // gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when
  554. // -std={c,gnu}++{0x,11} is passed. The C++11 standard specifies a
  555. // value for __cplusplus, and recent versions of clang, gcc, and
  556. // probably other compilers set that too in C++11 mode.
  557. # if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L
  558. // Compiling in at least C++11 mode.
  559. # define GTEST_LANG_CXX11 1
  560. # else
  561. # define GTEST_LANG_CXX11 0
  562. # endif
  563. #endif
  564. // Distinct from C++11 language support, some environments don't provide
  565. // proper C++11 library support. Notably, it's possible to build in
  566. // C++11 mode when targeting Mac OS X 10.6, which has an old libstdc++
  567. // with no C++11 support.
  568. //
  569. // libstdc++ has sufficient C++11 support as of GCC 4.6.0, __GLIBCXX__
  570. // 20110325, but maintenance releases in the 4.4 and 4.5 series followed
  571. // this date, so check for those versions by their date stamps.
  572. // https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html#abi.versioning
  573. #if GTEST_LANG_CXX11 && \
  574. (!defined(__GLIBCXX__) || ( \
  575. __GLIBCXX__ >= 20110325ul && /* GCC >= 4.6.0 */ \
  576. /* Blacklist of patch releases of older branches: */ \
  577. __GLIBCXX__ != 20110416ul && /* GCC 4.4.6 */ \
  578. __GLIBCXX__ != 20120313ul && /* GCC 4.4.7 */ \
  579. __GLIBCXX__ != 20110428ul && /* GCC 4.5.3 */ \
  580. __GLIBCXX__ != 20120702ul)) /* GCC 4.5.4 */
  581. # define GTEST_STDLIB_CXX11 1
  582. #endif
  583. // Only use C++11 library features if the library provides them.
  584. #if GTEST_STDLIB_CXX11
  585. # define GTEST_HAS_STD_BEGIN_AND_END_ 1
  586. # define GTEST_HAS_STD_FORWARD_LIST_ 1
  587. # define GTEST_HAS_STD_FUNCTION_ 1
  588. # define GTEST_HAS_STD_INITIALIZER_LIST_ 1
  589. # define GTEST_HAS_STD_MOVE_ 1
  590. # define GTEST_HAS_STD_SHARED_PTR_ 1
  591. # define GTEST_HAS_STD_TYPE_TRAITS_ 1
  592. # define GTEST_HAS_STD_UNIQUE_PTR_ 1
  593. #endif
  594. // C++11 specifies that <tuple> provides std::tuple.
  595. // Some platforms still might not have it, however.
  596. #if GTEST_LANG_CXX11
  597. # define GTEST_HAS_STD_TUPLE_ 1
  598. # if defined(__clang__)
  599. // Inspired by http://clang.llvm.org/docs/LanguageExtensions.html#__has_include
  600. # if defined(__has_include) && !__has_include(<tuple>)
  601. # undef GTEST_HAS_STD_TUPLE_
  602. # endif
  603. # elif defined(_MSC_VER)
  604. // Inspired by boost/config/stdlib/dinkumware.hpp
  605. # if defined(_CPPLIB_VER) && _CPPLIB_VER < 520
  606. # undef GTEST_HAS_STD_TUPLE_
  607. # endif
  608. # elif defined(__GLIBCXX__)
  609. // Inspired by boost/config/stdlib/libstdcpp3.hpp,
  610. // http://gcc.gnu.org/gcc-4.2/changes.html and
  611. // http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt01ch01.html#manual.intro.status.standard.200x
  612. # if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
  613. # undef GTEST_HAS_STD_TUPLE_
  614. # endif
  615. # endif
  616. #endif
  617. // Brings in definitions for functions used in the testing::internal::posix
  618. // namespace (read, write, close, chdir, isatty, stat). We do not currently
  619. // use them on Windows Mobile.
  620. #if GTEST_OS_WINDOWS
  621. # if !GTEST_OS_WINDOWS_MOBILE
  622. # include <direct.h>
  623. # include <io.h>
  624. # endif
  625. // In order to avoid having to include <windows.h>, use forward declaration
  626. // assuming CRITICAL_SECTION is a typedef of _RTL_CRITICAL_SECTION.
  627. // This assumption is verified by
  628. // WindowsTypesTest.CRITICAL_SECTIONIs_RTL_CRITICAL_SECTION.
  629. struct _RTL_CRITICAL_SECTION;
  630. #else
  631. // This assumes that non-Windows OSes provide unistd.h. For OSes where this
  632. // is not the case, we need to include headers that provide the functions
  633. // mentioned above.
  634. # include <unistd.h>
  635. # include <strings.h>
  636. #endif // GTEST_OS_WINDOWS
  637. #if GTEST_OS_LINUX_ANDROID
  638. // Used to define __ANDROID_API__ matching the target NDK API level.
  639. # include <android/api-level.h> // NOLINT
  640. #endif
  641. // Defines this to true iff Google Test can use POSIX regular expressions.
  642. #ifndef GTEST_HAS_POSIX_RE
  643. # if GTEST_OS_LINUX_ANDROID
  644. // On Android, <regex.h> is only available starting with Gingerbread.
  645. # define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 9)
  646. # else
  647. # define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)
  648. # endif
  649. #endif
  650. #if GTEST_USES_PCRE
  651. // The appropriate headers have already been included.
  652. #elif GTEST_HAS_POSIX_RE
  653. // On some platforms, <regex.h> needs someone to define size_t, and
  654. // won't compile otherwise. We can #include it here as we already
  655. // included <stdlib.h>, which is guaranteed to define size_t through
  656. // <stddef.h>.
  657. # include <regex.h> // NOLINT
  658. # define GTEST_USES_POSIX_RE 1
  659. #elif GTEST_OS_WINDOWS
  660. // <regex.h> is not available on Windows. Use our own simple regex
  661. // implementation instead.
  662. # define GTEST_USES_SIMPLE_RE 1
  663. #else
  664. // <regex.h> may not be available on this platform. Use our own
  665. // simple regex implementation instead.
  666. # define GTEST_USES_SIMPLE_RE 1
  667. #endif // GTEST_USES_PCRE
  668. #ifndef GTEST_HAS_EXCEPTIONS
  669. // The user didn't tell us whether exceptions are enabled, so we need
  670. // to figure it out.
  671. # if defined(_MSC_VER) || defined(__BORLANDC__)
  672. // MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS
  673. // macro to enable exceptions, so we'll do the same.
  674. // Assumes that exceptions are enabled by default.
  675. # ifndef _HAS_EXCEPTIONS
  676. # define _HAS_EXCEPTIONS 1
  677. # endif // _HAS_EXCEPTIONS
  678. # define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
  679. # elif defined(__clang__)
  680. // clang defines __EXCEPTIONS iff exceptions are enabled before clang 220714,
  681. // but iff cleanups are enabled after that. In Obj-C++ files, there can be
  682. // cleanups for ObjC exceptions which also need cleanups, even if C++ exceptions
  683. // are disabled. clang has __has_feature(cxx_exceptions) which checks for C++
  684. // exceptions starting at clang r206352, but which checked for cleanups prior to
  685. // that. To reliably check for C++ exception availability with clang, check for
  686. // __EXCEPTIONS && __has_feature(cxx_exceptions).
  687. # define GTEST_HAS_EXCEPTIONS (__EXCEPTIONS && __has_feature(cxx_exceptions))
  688. # elif defined(__GNUC__) && __EXCEPTIONS
  689. // gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
  690. # define GTEST_HAS_EXCEPTIONS 1
  691. # elif defined(__SUNPRO_CC)
  692. // Sun Pro CC supports exceptions. However, there is no compile-time way of
  693. // detecting whether they are enabled or not. Therefore, we assume that
  694. // they are enabled unless the user tells us otherwise.
  695. # define GTEST_HAS_EXCEPTIONS 1
  696. # elif defined(__IBMCPP__) && __EXCEPTIONS
  697. // xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
  698. # define GTEST_HAS_EXCEPTIONS 1
  699. # elif defined(__HP_aCC)
  700. // Exception handling is in effect by default in HP aCC compiler. It has to
  701. // be turned of by +noeh compiler option if desired.
  702. # define GTEST_HAS_EXCEPTIONS 1
  703. # else
  704. // For other compilers, we assume exceptions are disabled to be
  705. // conservative.
  706. # define GTEST_HAS_EXCEPTIONS 0
  707. # endif // defined(_MSC_VER) || defined(__BORLANDC__)
  708. #endif // GTEST_HAS_EXCEPTIONS
  709. #if !defined(GTEST_HAS_STD_STRING)
  710. // Even though we don't use this macro any longer, we keep it in case
  711. // some clients still depend on it.
  712. # define GTEST_HAS_STD_STRING 1
  713. #elif !GTEST_HAS_STD_STRING
  714. // The user told us that ::std::string isn't available.
  715. # error "Google Test cannot be used where ::std::string isn't available."
  716. #endif // !defined(GTEST_HAS_STD_STRING)
  717. #ifndef GTEST_HAS_GLOBAL_STRING
  718. // The user didn't tell us whether ::string is available, so we need
  719. // to figure it out.
  720. # define GTEST_HAS_GLOBAL_STRING 0
  721. #endif // GTEST_HAS_GLOBAL_STRING
  722. #ifndef GTEST_HAS_STD_WSTRING
  723. // The user didn't tell us whether ::std::wstring is available, so we need
  724. // to figure it out.
  725. // TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
  726. // is available.
  727. // Cygwin 1.7 and below doesn't support ::std::wstring.
  728. // Solaris' libc++ doesn't support it either. Android has
  729. // no support for it at least as recent as Froyo (2.2).
  730. # define GTEST_HAS_STD_WSTRING \
  731. (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
  732. #endif // GTEST_HAS_STD_WSTRING
  733. #ifndef GTEST_HAS_GLOBAL_WSTRING
  734. // The user didn't tell us whether ::wstring is available, so we need
  735. // to figure it out.
  736. # define GTEST_HAS_GLOBAL_WSTRING \
  737. (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
  738. #endif // GTEST_HAS_GLOBAL_WSTRING
  739. // Determines whether RTTI is available.
  740. #ifndef GTEST_HAS_RTTI
  741. // The user didn't tell us whether RTTI is enabled, so we need to
  742. // figure it out.
  743. # ifdef _MSC_VER
  744. # ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled.
  745. # define GTEST_HAS_RTTI 1
  746. # else
  747. # define GTEST_HAS_RTTI 0
  748. # endif
  749. // Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
  750. # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
  751. # ifdef __GXX_RTTI
  752. // When building against STLport with the Android NDK and with
  753. // -frtti -fno-exceptions, the build fails at link time with undefined
  754. // references to __cxa_bad_typeid. Note sure if STL or toolchain bug,
  755. // so disable RTTI when detected.
  756. # if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \
  757. !defined(__EXCEPTIONS)
  758. # define GTEST_HAS_RTTI 0
  759. # else
  760. # define GTEST_HAS_RTTI 1
  761. # endif // GTEST_OS_LINUX_ANDROID && __STLPORT_MAJOR && !__EXCEPTIONS
  762. # else
  763. # define GTEST_HAS_RTTI 0
  764. # endif // __GXX_RTTI
  765. // Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends
  766. // using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the
  767. // first version with C++ support.
  768. # elif defined(__clang__)
  769. # define GTEST_HAS_RTTI __has_feature(cxx_rtti)
  770. // Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
  771. // both the typeid and dynamic_cast features are present.
  772. # elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
  773. # ifdef __RTTI_ALL__
  774. # define GTEST_HAS_RTTI 1
  775. # else
  776. # define GTEST_HAS_RTTI 0
  777. # endif
  778. # else
  779. // For all other compilers, we assume RTTI is enabled.
  780. # define GTEST_HAS_RTTI 1
  781. # endif // _MSC_VER
  782. #endif // GTEST_HAS_RTTI
  783. // It's this header's responsibility to #include <typeinfo> when RTTI
  784. // is enabled.
  785. #if GTEST_HAS_RTTI
  786. # include <typeinfo>
  787. #endif
  788. // Determines whether Google Test can use the pthreads library.
  789. #ifndef GTEST_HAS_PTHREAD
  790. // The user didn't tell us explicitly, so we make reasonable assumptions about
  791. // which platforms have pthreads support.
  792. //
  793. // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
  794. // to your compiler flags.
  795. # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \
  796. || GTEST_OS_QNX || GTEST_OS_FREEBSD || GTEST_OS_NACL)
  797. #endif // GTEST_HAS_PTHREAD
  798. #if GTEST_HAS_PTHREAD
  799. // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
  800. // true.
  801. # include <pthread.h> // NOLINT
  802. // For timespec and nanosleep, used below.
  803. # include <time.h> // NOLINT
  804. #endif
  805. // Determines if hash_map/hash_set are available.
  806. // Only used for testing against those containers.
  807. #if !defined(GTEST_HAS_HASH_MAP_)
  808. # if _MSC_VER
  809. # define GTEST_HAS_HASH_MAP_ 1 // Indicates that hash_map is available.
  810. # define GTEST_HAS_HASH_SET_ 1 // Indicates that hash_set is available.
  811. # endif // _MSC_VER
  812. #endif // !defined(GTEST_HAS_HASH_MAP_)
  813. // Determines whether Google Test can use tr1/tuple. You can define
  814. // this macro to 0 to prevent Google Test from using tuple (any
  815. // feature depending on tuple with be disabled in this mode).
  816. #ifndef GTEST_HAS_TR1_TUPLE
  817. # if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR)
  818. // STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>.
  819. # define GTEST_HAS_TR1_TUPLE 0
  820. # else
  821. // The user didn't tell us not to do it, so we assume it's OK.
  822. # define GTEST_HAS_TR1_TUPLE 1
  823. # endif
  824. #endif // GTEST_HAS_TR1_TUPLE
  825. // Determines whether Google Test's own tr1 tuple implementation
  826. // should be used.
  827. #ifndef GTEST_USE_OWN_TR1_TUPLE
  828. // The user didn't tell us, so we need to figure it out.
  829. // We use our own TR1 tuple if we aren't sure the user has an
  830. // implementation of it already. At this time, libstdc++ 4.0.0+ and
  831. // MSVC 2010 are the only mainstream standard libraries that come
  832. // with a TR1 tuple implementation. NVIDIA's CUDA NVCC compiler
  833. // pretends to be GCC by defining __GNUC__ and friends, but cannot
  834. // compile GCC's tuple implementation. MSVC 2008 (9.0) provides TR1
  835. // tuple in a 323 MB Feature Pack download, which we cannot assume the
  836. // user has. QNX's QCC compiler is a modified GCC but it doesn't
  837. // support TR1 tuple. libc++ only provides std::tuple, in C++11 mode,
  838. // and it can be used with some compilers that define __GNUC__.
  839. # if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \
  840. && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) || _MSC_VER >= 1600
  841. # define GTEST_ENV_HAS_TR1_TUPLE_ 1
  842. # endif
  843. // C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used
  844. // in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6
  845. // can build with clang but need to use gcc4.2's libstdc++).
  846. # if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325)
  847. # define GTEST_ENV_HAS_STD_TUPLE_ 1
  848. # endif
  849. # if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_
  850. # define GTEST_USE_OWN_TR1_TUPLE 0
  851. # else
  852. # define GTEST_USE_OWN_TR1_TUPLE 1
  853. # endif
  854. #endif // GTEST_USE_OWN_TR1_TUPLE
  855. // To avoid conditional compilation everywhere, we make it
  856. // gtest-port.h's responsibility to #include the header implementing
  857. // tuple.
  858. #if GTEST_HAS_STD_TUPLE_
  859. # include <tuple> // IWYU pragma: export
  860. # define GTEST_TUPLE_NAMESPACE_ ::std
  861. #endif // GTEST_HAS_STD_TUPLE_
  862. // We include tr1::tuple even if std::tuple is available to define printers for
  863. // them.
  864. #if GTEST_HAS_TR1_TUPLE
  865. # ifndef GTEST_TUPLE_NAMESPACE_
  866. # define GTEST_TUPLE_NAMESPACE_ ::std::tr1
  867. # endif // GTEST_TUPLE_NAMESPACE_
  868. # if GTEST_USE_OWN_TR1_TUPLE
  869. // This file was GENERATED by command:
  870. // pump.py gtest-tuple.h.pump
  871. // DO NOT EDIT BY HAND!!!
  872. // Copyright 2009 Google Inc.
  873. // All Rights Reserved.
  874. //
  875. // Redistribution and use in source and binary forms, with or without
  876. // modification, are permitted provided that the following conditions are
  877. // met:
  878. //
  879. // * Redistributions of source code must retain the above copyright
  880. // notice, this list of conditions and the following disclaimer.
  881. // * Redistributions in binary form must reproduce the above
  882. // copyright notice, this list of conditions and the following disclaimer
  883. // in the documentation and/or other materials provided with the
  884. // distribution.
  885. // * Neither the name of Google Inc. nor the names of its
  886. // contributors may be used to endorse or promote products derived from
  887. // this software without specific prior written permission.
  888. //
  889. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  890. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  891. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  892. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  893. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  894. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  895. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  896. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  897. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  898. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  899. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  900. //
  901. // Author: wan@google.com (Zhanyong Wan)
  902. // Implements a subset of TR1 tuple needed by Google Test and Google Mock.
  903. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
  904. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
  905. #include <utility> // For ::std::pair.
  906. // The compiler used in Symbian has a bug that prevents us from declaring the
  907. // tuple template as a friend (it complains that tuple is redefined). This
  908. // hack bypasses the bug by declaring the members that should otherwise be
  909. // private as public.
  910. // Sun Studio versions < 12 also have the above bug.
  911. #if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
  912. # define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
  913. #else
  914. # define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
  915. template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
  916. private:
  917. #endif
  918. // Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that conflict
  919. // with our own definitions. Therefore using our own tuple does not work on
  920. // those compilers.
  921. #if defined(_MSC_VER) && _MSC_VER >= 1600 /* 1600 is Visual Studio 2010 */
  922. # error "gtest's tuple doesn't compile on Visual Studio 2010 or later. \
  923. GTEST_USE_OWN_TR1_TUPLE must be set to 0 on those compilers."
  924. #endif
  925. // GTEST_n_TUPLE_(T) is the type of an n-tuple.
  926. #define GTEST_0_TUPLE_(T) tuple<>
  927. #define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
  928. void, void, void>
  929. #define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
  930. void, void, void>
  931. #define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
  932. void, void, void>
  933. #define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
  934. void, void, void>
  935. #define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
  936. void, void, void>
  937. #define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
  938. void, void, void>
  939. #define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  940. void, void, void>
  941. #define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  942. T##7, void, void>
  943. #define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  944. T##7, T##8, void>
  945. #define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  946. T##7, T##8, T##9>
  947. // GTEST_n_TYPENAMES_(T) declares a list of n typenames.
  948. #define GTEST_0_TYPENAMES_(T)
  949. #define GTEST_1_TYPENAMES_(T) typename T##0
  950. #define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
  951. #define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
  952. #define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  953. typename T##3
  954. #define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  955. typename T##3, typename T##4
  956. #define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  957. typename T##3, typename T##4, typename T##5
  958. #define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  959. typename T##3, typename T##4, typename T##5, typename T##6
  960. #define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  961. typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
  962. #define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  963. typename T##3, typename T##4, typename T##5, typename T##6, \
  964. typename T##7, typename T##8
  965. #define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  966. typename T##3, typename T##4, typename T##5, typename T##6, \
  967. typename T##7, typename T##8, typename T##9
  968. // In theory, defining stuff in the ::std namespace is undefined
  969. // behavior. We can do this as we are playing the role of a standard
  970. // library vendor.
  971. namespace std {
  972. namespace tr1 {
  973. template <typename T0 = void, typename T1 = void, typename T2 = void,
  974. typename T3 = void, typename T4 = void, typename T5 = void,
  975. typename T6 = void, typename T7 = void, typename T8 = void,
  976. typename T9 = void>
  977. class tuple;
  978. // Anything in namespace gtest_internal is Google Test's INTERNAL
  979. // IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
  980. namespace gtest_internal {
  981. // ByRef<T>::type is T if T is a reference; otherwise it's const T&.
  982. template <typename T>
  983. struct ByRef { typedef const T& type; }; // NOLINT
  984. template <typename T>
  985. struct ByRef<T&> { typedef T& type; }; // NOLINT
  986. // A handy wrapper for ByRef.
  987. #define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
  988. // AddRef<T>::type is T if T is a reference; otherwise it's T&. This
  989. // is the same as tr1::add_reference<T>::type.
  990. template <typename T>
  991. struct AddRef { typedef T& type; }; // NOLINT
  992. template <typename T>
  993. struct AddRef<T&> { typedef T& type; }; // NOLINT
  994. // A handy wrapper for AddRef.
  995. #define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
  996. // A helper for implementing get<k>().
  997. template <int k> class Get;
  998. // A helper for implementing tuple_element<k, T>. kIndexValid is true
  999. // iff k < the number of fields in tuple type T.
  1000. template <bool kIndexValid, int kIndex, class Tuple>
  1001. struct TupleElement;
  1002. template <GTEST_10_TYPENAMES_(T)>
  1003. struct TupleElement<true, 0, GTEST_10_TUPLE_(T) > {
  1004. typedef T0 type;
  1005. };
  1006. template <GTEST_10_TYPENAMES_(T)>
  1007. struct TupleElement<true, 1, GTEST_10_TUPLE_(T) > {
  1008. typedef T1 type;
  1009. };
  1010. template <GTEST_10_TYPENAMES_(T)>
  1011. struct TupleElement<true, 2, GTEST_10_TUPLE_(T) > {
  1012. typedef T2 type;
  1013. };
  1014. template <GTEST_10_TYPENAMES_(T)>
  1015. struct TupleElement<true, 3, GTEST_10_TUPLE_(T) > {
  1016. typedef T3 type;
  1017. };
  1018. template <GTEST_10_TYPENAMES_(T)>
  1019. struct TupleElement<true, 4, GTEST_10_TUPLE_(T) > {
  1020. typedef T4 type;
  1021. };
  1022. template <GTEST_10_TYPENAMES_(T)>
  1023. struct TupleElement<true, 5, GTEST_10_TUPLE_(T) > {
  1024. typedef T5 type;
  1025. };
  1026. template <GTEST_10_TYPENAMES_(T)>
  1027. struct TupleElement<true, 6, GTEST_10_TUPLE_(T) > {
  1028. typedef T6 type;
  1029. };
  1030. template <GTEST_10_TYPENAMES_(T)>
  1031. struct TupleElement<true, 7, GTEST_10_TUPLE_(T) > {
  1032. typedef T7 type;
  1033. };
  1034. template <GTEST_10_TYPENAMES_(T)>
  1035. struct TupleElement<true, 8, GTEST_10_TUPLE_(T) > {
  1036. typedef T8 type;
  1037. };
  1038. template <GTEST_10_TYPENAMES_(T)>
  1039. struct TupleElement<true, 9, GTEST_10_TUPLE_(T) > {
  1040. typedef T9 type;
  1041. };
  1042. } // namespace gtest_internal
  1043. template <>
  1044. class tuple<> {
  1045. public:
  1046. tuple() {}
  1047. tuple(const tuple& /* t */) {}
  1048. tuple& operator=(const tuple& /* t */) { return *this; }
  1049. };
  1050. template <GTEST_1_TYPENAMES_(T)>
  1051. class GTEST_1_TUPLE_(T) {
  1052. public:
  1053. template <int k> friend class gtest_internal::Get;
  1054. tuple() : f0_() {}
  1055. explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
  1056. tuple(const tuple& t) : f0_(t.f0_) {}
  1057. template <GTEST_1_TYPENAMES_(U)>
  1058. tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
  1059. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1060. template <GTEST_1_TYPENAMES_(U)>
  1061. tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
  1062. return CopyFrom(t);
  1063. }
  1064. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1065. template <GTEST_1_TYPENAMES_(U)>
  1066. tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
  1067. f0_ = t.f0_;
  1068. return *this;
  1069. }
  1070. T0 f0_;
  1071. };
  1072. template <GTEST_2_TYPENAMES_(T)>
  1073. class GTEST_2_TUPLE_(T) {
  1074. public:
  1075. template <int k> friend class gtest_internal::Get;
  1076. tuple() : f0_(), f1_() {}
  1077. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
  1078. f1_(f1) {}
  1079. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
  1080. template <GTEST_2_TYPENAMES_(U)>
  1081. tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
  1082. template <typename U0, typename U1>
  1083. tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
  1084. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1085. template <GTEST_2_TYPENAMES_(U)>
  1086. tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
  1087. return CopyFrom(t);
  1088. }
  1089. template <typename U0, typename U1>
  1090. tuple& operator=(const ::std::pair<U0, U1>& p) {
  1091. f0_ = p.first;
  1092. f1_ = p.second;
  1093. return *this;
  1094. }
  1095. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1096. template <GTEST_2_TYPENAMES_(U)>
  1097. tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
  1098. f0_ = t.f0_;
  1099. f1_ = t.f1_;
  1100. return *this;
  1101. }
  1102. T0 f0_;
  1103. T1 f1_;
  1104. };
  1105. template <GTEST_3_TYPENAMES_(T)>
  1106. class GTEST_3_TUPLE_(T) {
  1107. public:
  1108. template <int k> friend class gtest_internal::Get;
  1109. tuple() : f0_(), f1_(), f2_() {}
  1110. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  1111. GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
  1112. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
  1113. template <GTEST_3_TYPENAMES_(U)>
  1114. tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
  1115. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1116. template <GTEST_3_TYPENAMES_(U)>
  1117. tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
  1118. return CopyFrom(t);
  1119. }
  1120. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1121. template <GTEST_3_TYPENAMES_(U)>
  1122. tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
  1123. f0_ = t.f0_;
  1124. f1_ = t.f1_;
  1125. f2_ = t.f2_;
  1126. return *this;
  1127. }
  1128. T0 f0_;
  1129. T1 f1_;
  1130. T2 f2_;
  1131. };
  1132. template <GTEST_4_TYPENAMES_(T)>
  1133. class GTEST_4_TUPLE_(T) {
  1134. public:
  1135. template <int k> friend class gtest_internal::Get;
  1136. tuple() : f0_(), f1_(), f2_(), f3_() {}
  1137. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  1138. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
  1139. f3_(f3) {}
  1140. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
  1141. template <GTEST_4_TYPENAMES_(U)>
  1142. tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  1143. f3_(t.f3_) {}
  1144. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1145. template <GTEST_4_TYPENAMES_(U)>
  1146. tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
  1147. return CopyFrom(t);
  1148. }
  1149. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1150. template <GTEST_4_TYPENAMES_(U)>
  1151. tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
  1152. f0_ = t.f0_;
  1153. f1_ = t.f1_;
  1154. f2_ = t.f2_;
  1155. f3_ = t.f3_;
  1156. return *this;
  1157. }
  1158. T0 f0_;
  1159. T1 f1_;
  1160. T2 f2_;
  1161. T3 f3_;
  1162. };
  1163. template <GTEST_5_TYPENAMES_(T)>
  1164. class GTEST_5_TUPLE_(T) {
  1165. public:
  1166. template <int k> friend class gtest_internal::Get;
  1167. tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
  1168. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  1169. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
  1170. GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
  1171. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  1172. f4_(t.f4_) {}
  1173. template <GTEST_5_TYPENAMES_(U)>
  1174. tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  1175. f3_(t.f3_), f4_(t.f4_) {}
  1176. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1177. template <GTEST_5_TYPENAMES_(U)>
  1178. tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
  1179. return CopyFrom(t);
  1180. }
  1181. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1182. template <GTEST_5_TYPENAMES_(U)>
  1183. tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
  1184. f0_ = t.f0_;
  1185. f1_ = t.f1_;
  1186. f2_ = t.f2_;
  1187. f3_ = t.f3_;
  1188. f4_ = t.f4_;
  1189. return *this;
  1190. }
  1191. T0 f0_;
  1192. T1 f1_;
  1193. T2 f2_;
  1194. T3 f3_;
  1195. T4 f4_;
  1196. };
  1197. template <GTEST_6_TYPENAMES_(T)>
  1198. class GTEST_6_TUPLE_(T) {
  1199. public:
  1200. template <int k> friend class gtest_internal::Get;
  1201. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
  1202. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  1203. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  1204. GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
  1205. f5_(f5) {}
  1206. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  1207. f4_(t.f4_), f5_(t.f5_) {}
  1208. template <GTEST_6_TYPENAMES_(U)>
  1209. tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  1210. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
  1211. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1212. template <GTEST_6_TYPENAMES_(U)>
  1213. tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
  1214. return CopyFrom(t);
  1215. }
  1216. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1217. template <GTEST_6_TYPENAMES_(U)>
  1218. tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
  1219. f0_ = t.f0_;
  1220. f1_ = t.f1_;
  1221. f2_ = t.f2_;
  1222. f3_ = t.f3_;
  1223. f4_ = t.f4_;
  1224. f5_ = t.f5_;
  1225. return *this;
  1226. }
  1227. T0 f0_;
  1228. T1 f1_;
  1229. T2 f2_;
  1230. T3 f3_;
  1231. T4 f4_;
  1232. T5 f5_;
  1233. };
  1234. template <GTEST_7_TYPENAMES_(T)>
  1235. class GTEST_7_TUPLE_(T) {
  1236. public:
  1237. template <int k> friend class gtest_internal::Get;
  1238. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
  1239. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  1240. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  1241. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
  1242. f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
  1243. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  1244. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
  1245. template <GTEST_7_TYPENAMES_(U)>
  1246. tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  1247. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
  1248. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1249. template <GTEST_7_TYPENAMES_(U)>
  1250. tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
  1251. return CopyFrom(t);
  1252. }
  1253. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1254. template <GTEST_7_TYPENAMES_(U)>
  1255. tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
  1256. f0_ = t.f0_;
  1257. f1_ = t.f1_;
  1258. f2_ = t.f2_;
  1259. f3_ = t.f3_;
  1260. f4_ = t.f4_;
  1261. f5_ = t.f5_;
  1262. f6_ = t.f6_;
  1263. return *this;
  1264. }
  1265. T0 f0_;
  1266. T1 f1_;
  1267. T2 f2_;
  1268. T3 f3_;
  1269. T4 f4_;
  1270. T5 f5_;
  1271. T6 f6_;
  1272. };
  1273. template <GTEST_8_TYPENAMES_(T)>
  1274. class GTEST_8_TUPLE_(T) {
  1275. public:
  1276. template <int k> friend class gtest_internal::Get;
  1277. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
  1278. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  1279. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  1280. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
  1281. GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
  1282. f5_(f5), f6_(f6), f7_(f7) {}
  1283. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  1284. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
  1285. template <GTEST_8_TYPENAMES_(U)>
  1286. tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  1287. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
  1288. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1289. template <GTEST_8_TYPENAMES_(U)>
  1290. tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
  1291. return CopyFrom(t);
  1292. }
  1293. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1294. template <GTEST_8_TYPENAMES_(U)>
  1295. tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
  1296. f0_ = t.f0_;
  1297. f1_ = t.f1_;
  1298. f2_ = t.f2_;
  1299. f3_ = t.f3_;
  1300. f4_ = t.f4_;
  1301. f5_ = t.f5_;
  1302. f6_ = t.f6_;
  1303. f7_ = t.f7_;
  1304. return *this;
  1305. }
  1306. T0 f0_;
  1307. T1 f1_;
  1308. T2 f2_;
  1309. T3 f3_;
  1310. T4 f4_;
  1311. T5 f5_;
  1312. T6 f6_;
  1313. T7 f7_;
  1314. };
  1315. template <GTEST_9_TYPENAMES_(T)>
  1316. class GTEST_9_TUPLE_(T) {
  1317. public:
  1318. template <int k> friend class gtest_internal::Get;
  1319. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
  1320. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  1321. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  1322. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
  1323. GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
  1324. f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
  1325. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  1326. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
  1327. template <GTEST_9_TYPENAMES_(U)>
  1328. tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  1329. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
  1330. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1331. template <GTEST_9_TYPENAMES_(U)>
  1332. tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
  1333. return CopyFrom(t);
  1334. }
  1335. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1336. template <GTEST_9_TYPENAMES_(U)>
  1337. tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
  1338. f0_ = t.f0_;
  1339. f1_ = t.f1_;
  1340. f2_ = t.f2_;
  1341. f3_ = t.f3_;
  1342. f4_ = t.f4_;
  1343. f5_ = t.f5_;
  1344. f6_ = t.f6_;
  1345. f7_ = t.f7_;
  1346. f8_ = t.f8_;
  1347. return *this;
  1348. }
  1349. T0 f0_;
  1350. T1 f1_;
  1351. T2 f2_;
  1352. T3 f3_;
  1353. T4 f4_;
  1354. T5 f5_;
  1355. T6 f6_;
  1356. T7 f7_;
  1357. T8 f8_;
  1358. };
  1359. template <GTEST_10_TYPENAMES_(T)>
  1360. class tuple {
  1361. public:
  1362. template <int k> friend class gtest_internal::Get;
  1363. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
  1364. f9_() {}
  1365. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  1366. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  1367. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
  1368. GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
  1369. f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
  1370. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  1371. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
  1372. template <GTEST_10_TYPENAMES_(U)>
  1373. tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  1374. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
  1375. f9_(t.f9_) {}
  1376. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  1377. template <GTEST_10_TYPENAMES_(U)>
  1378. tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
  1379. return CopyFrom(t);
  1380. }
  1381. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1382. template <GTEST_10_TYPENAMES_(U)>
  1383. tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
  1384. f0_ = t.f0_;
  1385. f1_ = t.f1_;
  1386. f2_ = t.f2_;
  1387. f3_ = t.f3_;
  1388. f4_ = t.f4_;
  1389. f5_ = t.f5_;
  1390. f6_ = t.f6_;
  1391. f7_ = t.f7_;
  1392. f8_ = t.f8_;
  1393. f9_ = t.f9_;
  1394. return *this;
  1395. }
  1396. T0 f0_;
  1397. T1 f1_;
  1398. T2 f2_;
  1399. T3 f3_;
  1400. T4 f4_;
  1401. T5 f5_;
  1402. T6 f6_;
  1403. T7 f7_;
  1404. T8 f8_;
  1405. T9 f9_;
  1406. };
  1407. // 6.1.3.2 Tuple creation functions.
  1408. // Known limitations: we don't support passing an
  1409. // std::tr1::reference_wrapper<T> to make_tuple(). And we don't
  1410. // implement tie().
  1411. inline tuple<> make_tuple() { return tuple<>(); }
  1412. template <GTEST_1_TYPENAMES_(T)>
  1413. inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
  1414. return GTEST_1_TUPLE_(T)(f0);
  1415. }
  1416. template <GTEST_2_TYPENAMES_(T)>
  1417. inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
  1418. return GTEST_2_TUPLE_(T)(f0, f1);
  1419. }
  1420. template <GTEST_3_TYPENAMES_(T)>
  1421. inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
  1422. return GTEST_3_TUPLE_(T)(f0, f1, f2);
  1423. }
  1424. template <GTEST_4_TYPENAMES_(T)>
  1425. inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1426. const T3& f3) {
  1427. return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
  1428. }
  1429. template <GTEST_5_TYPENAMES_(T)>
  1430. inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1431. const T3& f3, const T4& f4) {
  1432. return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
  1433. }
  1434. template <GTEST_6_TYPENAMES_(T)>
  1435. inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1436. const T3& f3, const T4& f4, const T5& f5) {
  1437. return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
  1438. }
  1439. template <GTEST_7_TYPENAMES_(T)>
  1440. inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1441. const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
  1442. return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
  1443. }
  1444. template <GTEST_8_TYPENAMES_(T)>
  1445. inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1446. const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
  1447. return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
  1448. }
  1449. template <GTEST_9_TYPENAMES_(T)>
  1450. inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1451. const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
  1452. const T8& f8) {
  1453. return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
  1454. }
  1455. template <GTEST_10_TYPENAMES_(T)>
  1456. inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1457. const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
  1458. const T8& f8, const T9& f9) {
  1459. return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
  1460. }
  1461. // 6.1.3.3 Tuple helper classes.
  1462. template <typename Tuple> struct tuple_size;
  1463. template <GTEST_0_TYPENAMES_(T)>
  1464. struct tuple_size<GTEST_0_TUPLE_(T) > {
  1465. static const int value = 0;
  1466. };
  1467. template <GTEST_1_TYPENAMES_(T)>
  1468. struct tuple_size<GTEST_1_TUPLE_(T) > {
  1469. static const int value = 1;
  1470. };
  1471. template <GTEST_2_TYPENAMES_(T)>
  1472. struct tuple_size<GTEST_2_TUPLE_(T) > {
  1473. static const int value = 2;
  1474. };
  1475. template <GTEST_3_TYPENAMES_(T)>
  1476. struct tuple_size<GTEST_3_TUPLE_(T) > {
  1477. static const int value = 3;
  1478. };
  1479. template <GTEST_4_TYPENAMES_(T)>
  1480. struct tuple_size<GTEST_4_TUPLE_(T) > {
  1481. static const int value = 4;
  1482. };
  1483. template <GTEST_5_TYPENAMES_(T)>
  1484. struct tuple_size<GTEST_5_TUPLE_(T) > {
  1485. static const int value = 5;
  1486. };
  1487. template <GTEST_6_TYPENAMES_(T)>
  1488. struct tuple_size<GTEST_6_TUPLE_(T) > {
  1489. static const int value = 6;
  1490. };
  1491. template <GTEST_7_TYPENAMES_(T)>
  1492. struct tuple_size<GTEST_7_TUPLE_(T) > {
  1493. static const int value = 7;
  1494. };
  1495. template <GTEST_8_TYPENAMES_(T)>
  1496. struct tuple_size<GTEST_8_TUPLE_(T) > {
  1497. static const int value = 8;
  1498. };
  1499. template <GTEST_9_TYPENAMES_(T)>
  1500. struct tuple_size<GTEST_9_TUPLE_(T) > {
  1501. static const int value = 9;
  1502. };
  1503. template <GTEST_10_TYPENAMES_(T)>
  1504. struct tuple_size<GTEST_10_TUPLE_(T) > {
  1505. static const int value = 10;
  1506. };
  1507. template <int k, class Tuple>
  1508. struct tuple_element {
  1509. typedef typename gtest_internal::TupleElement<
  1510. k < (tuple_size<Tuple>::value), k, Tuple>::type type;
  1511. };
  1512. #define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
  1513. // 6.1.3.4 Element access.
  1514. namespace gtest_internal {
  1515. template <>
  1516. class Get<0> {
  1517. public:
  1518. template <class Tuple>
  1519. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
  1520. Field(Tuple& t) { return t.f0_; } // NOLINT
  1521. template <class Tuple>
  1522. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
  1523. ConstField(const Tuple& t) { return t.f0_; }
  1524. };
  1525. template <>
  1526. class Get<1> {
  1527. public:
  1528. template <class Tuple>
  1529. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
  1530. Field(Tuple& t) { return t.f1_; } // NOLINT
  1531. template <class Tuple>
  1532. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
  1533. ConstField(const Tuple& t) { return t.f1_; }
  1534. };
  1535. template <>
  1536. class Get<2> {
  1537. public:
  1538. template <class Tuple>
  1539. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
  1540. Field(Tuple& t) { return t.f2_; } // NOLINT
  1541. template <class Tuple>
  1542. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
  1543. ConstField(const Tuple& t) { return t.f2_; }
  1544. };
  1545. template <>
  1546. class Get<3> {
  1547. public:
  1548. template <class Tuple>
  1549. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
  1550. Field(Tuple& t) { return t.f3_; } // NOLINT
  1551. template <class Tuple>
  1552. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
  1553. ConstField(const Tuple& t) { return t.f3_; }
  1554. };
  1555. template <>
  1556. class Get<4> {
  1557. public:
  1558. template <class Tuple>
  1559. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
  1560. Field(Tuple& t) { return t.f4_; } // NOLINT
  1561. template <class Tuple>
  1562. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
  1563. ConstField(const Tuple& t) { return t.f4_; }
  1564. };
  1565. template <>
  1566. class Get<5> {
  1567. public:
  1568. template <class Tuple>
  1569. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
  1570. Field(Tuple& t) { return t.f5_; } // NOLINT
  1571. template <class Tuple>
  1572. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
  1573. ConstField(const Tuple& t) { return t.f5_; }
  1574. };
  1575. template <>
  1576. class Get<6> {
  1577. public:
  1578. template <class Tuple>
  1579. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
  1580. Field(Tuple& t) { return t.f6_; } // NOLINT
  1581. template <class Tuple>
  1582. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
  1583. ConstField(const Tuple& t) { return t.f6_; }
  1584. };
  1585. template <>
  1586. class Get<7> {
  1587. public:
  1588. template <class Tuple>
  1589. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
  1590. Field(Tuple& t) { return t.f7_; } // NOLINT
  1591. template <class Tuple>
  1592. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
  1593. ConstField(const Tuple& t) { return t.f7_; }
  1594. };
  1595. template <>
  1596. class Get<8> {
  1597. public:
  1598. template <class Tuple>
  1599. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
  1600. Field(Tuple& t) { return t.f8_; } // NOLINT
  1601. template <class Tuple>
  1602. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
  1603. ConstField(const Tuple& t) { return t.f8_; }
  1604. };
  1605. template <>
  1606. class Get<9> {
  1607. public:
  1608. template <class Tuple>
  1609. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
  1610. Field(Tuple& t) { return t.f9_; } // NOLINT
  1611. template <class Tuple>
  1612. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
  1613. ConstField(const Tuple& t) { return t.f9_; }
  1614. };
  1615. } // namespace gtest_internal
  1616. template <int k, GTEST_10_TYPENAMES_(T)>
  1617. GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
  1618. get(GTEST_10_TUPLE_(T)& t) {
  1619. return gtest_internal::Get<k>::Field(t);
  1620. }
  1621. template <int k, GTEST_10_TYPENAMES_(T)>
  1622. GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
  1623. get(const GTEST_10_TUPLE_(T)& t) {
  1624. return gtest_internal::Get<k>::ConstField(t);
  1625. }
  1626. // 6.1.3.5 Relational operators
  1627. // We only implement == and !=, as we don't have a need for the rest yet.
  1628. namespace gtest_internal {
  1629. // SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
  1630. // first k fields of t1 equals the first k fields of t2.
  1631. // SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
  1632. // k1 != k2.
  1633. template <int kSize1, int kSize2>
  1634. struct SameSizeTuplePrefixComparator;
  1635. template <>
  1636. struct SameSizeTuplePrefixComparator<0, 0> {
  1637. template <class Tuple1, class Tuple2>
  1638. static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
  1639. return true;
  1640. }
  1641. };
  1642. template <int k>
  1643. struct SameSizeTuplePrefixComparator<k, k> {
  1644. template <class Tuple1, class Tuple2>
  1645. static bool Eq(const Tuple1& t1, const Tuple2& t2) {
  1646. return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
  1647. ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
  1648. }
  1649. };
  1650. } // namespace gtest_internal
  1651. template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
  1652. inline bool operator==(const GTEST_10_TUPLE_(T)& t,
  1653. const GTEST_10_TUPLE_(U)& u) {
  1654. return gtest_internal::SameSizeTuplePrefixComparator<
  1655. tuple_size<GTEST_10_TUPLE_(T) >::value,
  1656. tuple_size<GTEST_10_TUPLE_(U) >::value>::Eq(t, u);
  1657. }
  1658. template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
  1659. inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
  1660. const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
  1661. // 6.1.4 Pairs.
  1662. // Unimplemented.
  1663. } // namespace tr1
  1664. } // namespace std
  1665. #undef GTEST_0_TUPLE_
  1666. #undef GTEST_1_TUPLE_
  1667. #undef GTEST_2_TUPLE_
  1668. #undef GTEST_3_TUPLE_
  1669. #undef GTEST_4_TUPLE_
  1670. #undef GTEST_5_TUPLE_
  1671. #undef GTEST_6_TUPLE_
  1672. #undef GTEST_7_TUPLE_
  1673. #undef GTEST_8_TUPLE_
  1674. #undef GTEST_9_TUPLE_
  1675. #undef GTEST_10_TUPLE_
  1676. #undef GTEST_0_TYPENAMES_
  1677. #undef GTEST_1_TYPENAMES_
  1678. #undef GTEST_2_TYPENAMES_
  1679. #undef GTEST_3_TYPENAMES_
  1680. #undef GTEST_4_TYPENAMES_
  1681. #undef GTEST_5_TYPENAMES_
  1682. #undef GTEST_6_TYPENAMES_
  1683. #undef GTEST_7_TYPENAMES_
  1684. #undef GTEST_8_TYPENAMES_
  1685. #undef GTEST_9_TYPENAMES_
  1686. #undef GTEST_10_TYPENAMES_
  1687. #undef GTEST_DECLARE_TUPLE_AS_FRIEND_
  1688. #undef GTEST_BY_REF_
  1689. #undef GTEST_ADD_REF_
  1690. #undef GTEST_TUPLE_ELEMENT_
  1691. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
  1692. # elif GTEST_ENV_HAS_STD_TUPLE_
  1693. # include <tuple>
  1694. // C++11 puts its tuple into the ::std namespace rather than
  1695. // ::std::tr1. gtest expects tuple to live in ::std::tr1, so put it there.
  1696. // This causes undefined behavior, but supported compilers react in
  1697. // the way we intend.
  1698. namespace std {
  1699. namespace tr1 {
  1700. using ::std::get;
  1701. using ::std::make_tuple;
  1702. using ::std::tuple;
  1703. using ::std::tuple_element;
  1704. using ::std::tuple_size;
  1705. }
  1706. }
  1707. # elif GTEST_OS_SYMBIAN
  1708. // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
  1709. // use STLport's tuple implementation, which unfortunately doesn't
  1710. // work as the copy of STLport distributed with Symbian is incomplete.
  1711. // By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
  1712. // use its own tuple implementation.
  1713. # ifdef BOOST_HAS_TR1_TUPLE
  1714. # undef BOOST_HAS_TR1_TUPLE
  1715. # endif // BOOST_HAS_TR1_TUPLE
  1716. // This prevents <boost/tr1/detail/config.hpp>, which defines
  1717. // BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
  1718. # define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
  1719. # include <tuple> // IWYU pragma: export // NOLINT
  1720. # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
  1721. // GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header. This does
  1722. // not conform to the TR1 spec, which requires the header to be <tuple>.
  1723. # if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
  1724. // Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
  1725. // which is #included by <tr1/tuple>, to not compile when RTTI is
  1726. // disabled. _TR1_FUNCTIONAL is the header guard for
  1727. // <tr1/functional>. Hence the following #define is a hack to prevent
  1728. // <tr1/functional> from being included.
  1729. # define _TR1_FUNCTIONAL 1
  1730. # include <tr1/tuple>
  1731. # undef _TR1_FUNCTIONAL // Allows the user to #include
  1732. // <tr1/functional> if he chooses to.
  1733. # else
  1734. # include <tr1/tuple> // NOLINT
  1735. # endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
  1736. # else
  1737. // If the compiler is not GCC 4.0+, we assume the user is using a
  1738. // spec-conforming TR1 implementation.
  1739. # include <tuple> // IWYU pragma: export // NOLINT
  1740. # endif // GTEST_USE_OWN_TR1_TUPLE
  1741. #endif // GTEST_HAS_TR1_TUPLE
  1742. // Determines whether clone(2) is supported.
  1743. // Usually it will only be available on Linux, excluding
  1744. // Linux on the Itanium architecture.
  1745. // Also see http://linux.die.net/man/2/clone.
  1746. #ifndef GTEST_HAS_CLONE
  1747. // The user didn't tell us, so we need to figure it out.
  1748. # if GTEST_OS_LINUX && !defined(__ia64__)
  1749. # if GTEST_OS_LINUX_ANDROID
  1750. // On Android, clone() is only available on ARM starting with Gingerbread.
  1751. # if defined(__arm__) && __ANDROID_API__ >= 9
  1752. # define GTEST_HAS_CLONE 1
  1753. # else
  1754. # define GTEST_HAS_CLONE 0
  1755. # endif
  1756. # else
  1757. # define GTEST_HAS_CLONE 1
  1758. # endif
  1759. # else
  1760. # define GTEST_HAS_CLONE 0
  1761. # endif // GTEST_OS_LINUX && !defined(__ia64__)
  1762. #endif // GTEST_HAS_CLONE
  1763. // Determines whether to support stream redirection. This is used to test
  1764. // output correctness and to implement death tests.
  1765. #ifndef GTEST_HAS_STREAM_REDIRECTION
  1766. // By default, we assume that stream redirection is supported on all
  1767. // platforms except known mobile ones.
  1768. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || \
  1769. GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
  1770. # define GTEST_HAS_STREAM_REDIRECTION 0
  1771. # else
  1772. # define GTEST_HAS_STREAM_REDIRECTION 1
  1773. # endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
  1774. #endif // GTEST_HAS_STREAM_REDIRECTION
  1775. // Determines whether to support death tests.
  1776. // Google Test does not support death tests for VC 7.1 and earlier as
  1777. // abort() in a VC 7.1 application compiled as GUI in debug config
  1778. // pops up a dialog window that cannot be suppressed programmatically.
  1779. #if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
  1780. (GTEST_OS_MAC && !GTEST_OS_IOS) || \
  1781. (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
  1782. GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
  1783. GTEST_OS_OPENBSD || GTEST_OS_QNX || GTEST_OS_FREEBSD)
  1784. # define GTEST_HAS_DEATH_TEST 1
  1785. #endif
  1786. // We don't support MSVC 7.1 with exceptions disabled now. Therefore
  1787. // all the compilers we care about are adequate for supporting
  1788. // value-parameterized tests.
  1789. #define GTEST_HAS_PARAM_TEST 1
  1790. // Determines whether to support type-driven tests.
  1791. // Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
  1792. // Sun Pro CC, IBM Visual Age, and HP aCC support.
  1793. #if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
  1794. defined(__IBMCPP__) || defined(__HP_aCC)
  1795. # define GTEST_HAS_TYPED_TEST 1
  1796. # define GTEST_HAS_TYPED_TEST_P 1
  1797. #endif
  1798. // Determines whether to support Combine(). This only makes sense when
  1799. // value-parameterized tests are enabled. The implementation doesn't
  1800. // work on Sun Studio since it doesn't understand templated conversion
  1801. // operators.
  1802. #if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)
  1803. # define GTEST_HAS_COMBINE 1
  1804. #endif
  1805. // Determines whether the system compiler uses UTF-16 for encoding wide strings.
  1806. #define GTEST_WIDE_STRING_USES_UTF16_ \
  1807. (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
  1808. // Determines whether test results can be streamed to a socket.
  1809. #if GTEST_OS_LINUX
  1810. # define GTEST_CAN_STREAM_RESULTS_ 1
  1811. #endif
  1812. // Defines some utility macros.
  1813. // The GNU compiler emits a warning if nested "if" statements are followed by
  1814. // an "else" statement and braces are not used to explicitly disambiguate the
  1815. // "else" binding. This leads to problems with code like:
  1816. //
  1817. // if (gate)
  1818. // ASSERT_*(condition) << "Some message";
  1819. //
  1820. // The "switch (0) case 0:" idiom is used to suppress this.
  1821. #ifdef __INTEL_COMPILER
  1822. # define GTEST_AMBIGUOUS_ELSE_BLOCKER_
  1823. #else
  1824. # define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default: // NOLINT
  1825. #endif
  1826. // Use this annotation at the end of a struct/class definition to
  1827. // prevent the compiler from optimizing away instances that are never
  1828. // used. This is useful when all interesting logic happens inside the
  1829. // c'tor and / or d'tor. Example:
  1830. //
  1831. // struct Foo {
  1832. // Foo() { ... }
  1833. // } GTEST_ATTRIBUTE_UNUSED_;
  1834. //
  1835. // Also use it after a variable or parameter declaration to tell the
  1836. // compiler the variable/parameter does not have to be used.
  1837. #if defined(__GNUC__) && !defined(COMPILER_ICC)
  1838. # define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
  1839. #elif defined(__clang__)
  1840. # if __has_attribute(unused)
  1841. # define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
  1842. # endif
  1843. #endif
  1844. #ifndef GTEST_ATTRIBUTE_UNUSED_
  1845. # define GTEST_ATTRIBUTE_UNUSED_
  1846. #endif
  1847. // A macro to disallow operator=
  1848. // This should be used in the private: declarations for a class.
  1849. #define GTEST_DISALLOW_ASSIGN_(type)\
  1850. void operator=(type const &)
  1851. // A macro to disallow copy constructor and operator=
  1852. // This should be used in the private: declarations for a class.
  1853. #define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
  1854. type(type const &);\
  1855. GTEST_DISALLOW_ASSIGN_(type)
  1856. // Tell the compiler to warn about unused return values for functions declared
  1857. // with this macro. The macro should be used on function declarations
  1858. // following the argument list:
  1859. //
  1860. // Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
  1861. #if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
  1862. # define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
  1863. #else
  1864. # define GTEST_MUST_USE_RESULT_
  1865. #endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
  1866. // MS C++ compiler emits warning when a conditional expression is compile time
  1867. // constant. In some contexts this warning is false positive and needs to be
  1868. // suppressed. Use the following two macros in such cases:
  1869. //
  1870. // GTEST_INTENTIONAL_CONST_COND_PUSH_()
  1871. // while (true) {
  1872. // GTEST_INTENTIONAL_CONST_COND_POP_()
  1873. // }
  1874. # define GTEST_INTENTIONAL_CONST_COND_PUSH_() \
  1875. GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127)
  1876. # define GTEST_INTENTIONAL_CONST_COND_POP_() \
  1877. GTEST_DISABLE_MSC_WARNINGS_POP_()
  1878. // Determine whether the compiler supports Microsoft's Structured Exception
  1879. // Handling. This is supported by several Windows compilers but generally
  1880. // does not exist on any other system.
  1881. #ifndef GTEST_HAS_SEH
  1882. // The user didn't tell us, so we need to figure it out.
  1883. # if defined(_MSC_VER) || defined(__BORLANDC__)
  1884. // These two compilers are known to support SEH.
  1885. # define GTEST_HAS_SEH 1
  1886. # else
  1887. // Assume no SEH.
  1888. # define GTEST_HAS_SEH 0
  1889. # endif
  1890. #define GTEST_IS_THREADSAFE \
  1891. (GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ \
  1892. || (GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT) \
  1893. || GTEST_HAS_PTHREAD)
  1894. #endif // GTEST_HAS_SEH
  1895. #ifdef _MSC_VER
  1896. # if GTEST_LINKED_AS_SHARED_LIBRARY
  1897. # define GTEST_API_ __declspec(dllimport)
  1898. # elif GTEST_CREATE_SHARED_LIBRARY
  1899. # define GTEST_API_ __declspec(dllexport)
  1900. # endif
  1901. #elif __GNUC__ >= 4 || defined(__clang__)
  1902. # define GTEST_API_ __attribute__((visibility ("default")))
  1903. #endif // _MSC_VER
  1904. #ifndef GTEST_API_
  1905. # define GTEST_API_
  1906. #endif
  1907. #ifdef __GNUC__
  1908. // Ask the compiler to never inline a given function.
  1909. # define GTEST_NO_INLINE_ __attribute__((noinline))
  1910. #else
  1911. # define GTEST_NO_INLINE_
  1912. #endif
  1913. // _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.
  1914. #if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION)
  1915. # define GTEST_HAS_CXXABI_H_ 1
  1916. #else
  1917. # define GTEST_HAS_CXXABI_H_ 0
  1918. #endif
  1919. // A function level attribute to disable checking for use of uninitialized
  1920. // memory when built with MemorySanitizer.
  1921. #if defined(__clang__)
  1922. # if __has_feature(memory_sanitizer)
  1923. # define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ \
  1924. __attribute__((no_sanitize_memory))
  1925. # else
  1926. # define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
  1927. # endif // __has_feature(memory_sanitizer)
  1928. #else
  1929. # define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
  1930. #endif // __clang__
  1931. // A function level attribute to disable AddressSanitizer instrumentation.
  1932. #if defined(__clang__)
  1933. # if __has_feature(address_sanitizer)
  1934. # define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ \
  1935. __attribute__((no_sanitize_address))
  1936. # else
  1937. # define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
  1938. # endif // __has_feature(address_sanitizer)
  1939. #else
  1940. # define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
  1941. #endif // __clang__
  1942. // A function level attribute to disable ThreadSanitizer instrumentation.
  1943. #if defined(__clang__)
  1944. # if __has_feature(thread_sanitizer)
  1945. # define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ \
  1946. __attribute__((no_sanitize_thread))
  1947. # else
  1948. # define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
  1949. # endif // __has_feature(thread_sanitizer)
  1950. #else
  1951. # define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
  1952. #endif // __clang__
  1953. namespace testing {
  1954. class Message;
  1955. #if defined(GTEST_TUPLE_NAMESPACE_)
  1956. // Import tuple and friends into the ::testing namespace.
  1957. // It is part of our interface, having them in ::testing allows us to change
  1958. // their types as needed.
  1959. using GTEST_TUPLE_NAMESPACE_::get;
  1960. using GTEST_TUPLE_NAMESPACE_::make_tuple;
  1961. using GTEST_TUPLE_NAMESPACE_::tuple;
  1962. using GTEST_TUPLE_NAMESPACE_::tuple_size;
  1963. using GTEST_TUPLE_NAMESPACE_::tuple_element;
  1964. #endif // defined(GTEST_TUPLE_NAMESPACE_)
  1965. namespace internal {
  1966. // A secret type that Google Test users don't know about. It has no
  1967. // definition on purpose. Therefore it's impossible to create a
  1968. // Secret object, which is what we want.
  1969. class Secret;
  1970. // The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
  1971. // expression is true. For example, you could use it to verify the
  1972. // size of a static array:
  1973. //
  1974. // GTEST_COMPILE_ASSERT_(GTEST_ARRAY_SIZE_(names) == NUM_NAMES,
  1975. // names_incorrect_size);
  1976. //
  1977. // or to make sure a struct is smaller than a certain size:
  1978. //
  1979. // GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
  1980. //
  1981. // The second argument to the macro is the name of the variable. If
  1982. // the expression is false, most compilers will issue a warning/error
  1983. // containing the name of the variable.
  1984. #if GTEST_LANG_CXX11
  1985. # define GTEST_COMPILE_ASSERT_(expr, msg) static_assert(expr, #msg)
  1986. #else // !GTEST_LANG_CXX11
  1987. template <bool>
  1988. struct CompileAssert {
  1989. };
  1990. # define GTEST_COMPILE_ASSERT_(expr, msg) \
  1991. typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \
  1992. msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_
  1993. #endif // !GTEST_LANG_CXX11
  1994. // Implementation details of GTEST_COMPILE_ASSERT_:
  1995. //
  1996. // (In C++11, we simply use static_assert instead of the following)
  1997. //
  1998. // - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
  1999. // elements (and thus is invalid) when the expression is false.
  2000. //
  2001. // - The simpler definition
  2002. //
  2003. // #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
  2004. //
  2005. // does not work, as gcc supports variable-length arrays whose sizes
  2006. // are determined at run-time (this is gcc's extension and not part
  2007. // of the C++ standard). As a result, gcc fails to reject the
  2008. // following code with the simple definition:
  2009. //
  2010. // int foo;
  2011. // GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
  2012. // // not a compile-time constant.
  2013. //
  2014. // - By using the type CompileAssert<(bool(expr))>, we ensures that
  2015. // expr is a compile-time constant. (Template arguments must be
  2016. // determined at compile-time.)
  2017. //
  2018. // - The outter parentheses in CompileAssert<(bool(expr))> are necessary
  2019. // to work around a bug in gcc 3.4.4 and 4.0.1. If we had written
  2020. //
  2021. // CompileAssert<bool(expr)>
  2022. //
  2023. // instead, these compilers will refuse to compile
  2024. //
  2025. // GTEST_COMPILE_ASSERT_(5 > 0, some_message);
  2026. //
  2027. // (They seem to think the ">" in "5 > 0" marks the end of the
  2028. // template argument list.)
  2029. //
  2030. // - The array size is (bool(expr) ? 1 : -1), instead of simply
  2031. //
  2032. // ((expr) ? 1 : -1).
  2033. //
  2034. // This is to avoid running into a bug in MS VC 7.1, which
  2035. // causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
  2036. // StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
  2037. //
  2038. // This template is declared, but intentionally undefined.
  2039. template <typename T1, typename T2>
  2040. struct StaticAssertTypeEqHelper;
  2041. template <typename T>
  2042. struct StaticAssertTypeEqHelper<T, T> {
  2043. enum { value = true };
  2044. };
  2045. // Evaluates to the number of elements in 'array'.
  2046. #define GTEST_ARRAY_SIZE_(array) (sizeof(array) / sizeof(array[0]))
  2047. #if GTEST_HAS_GLOBAL_STRING
  2048. typedef ::string string;
  2049. #else
  2050. typedef ::std::string string;
  2051. #endif // GTEST_HAS_GLOBAL_STRING
  2052. #if GTEST_HAS_GLOBAL_WSTRING
  2053. typedef ::wstring wstring;
  2054. #elif GTEST_HAS_STD_WSTRING
  2055. typedef ::std::wstring wstring;
  2056. #endif // GTEST_HAS_GLOBAL_WSTRING
  2057. // A helper for suppressing warnings on constant condition. It just
  2058. // returns 'condition'.
  2059. GTEST_API_ bool IsTrue(bool condition);
  2060. // Defines scoped_ptr.
  2061. // This implementation of scoped_ptr is PARTIAL - it only contains
  2062. // enough stuff to satisfy Google Test's need.
  2063. template <typename T>
  2064. class scoped_ptr {
  2065. public:
  2066. typedef T element_type;
  2067. explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
  2068. ~scoped_ptr() { reset(); }
  2069. T& operator*() const { return *ptr_; }
  2070. T* operator->() const { return ptr_; }
  2071. T* get() const { return ptr_; }
  2072. T* release() {
  2073. T* const ptr = ptr_;
  2074. ptr_ = NULL;
  2075. return ptr;
  2076. }
  2077. void reset(T* p = NULL) {
  2078. if (p != ptr_) {
  2079. if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type.
  2080. delete ptr_;
  2081. }
  2082. ptr_ = p;
  2083. }
  2084. }
  2085. friend void swap(scoped_ptr& a, scoped_ptr& b) {
  2086. using std::swap;
  2087. swap(a.ptr_, b.ptr_);
  2088. }
  2089. private:
  2090. T* ptr_;
  2091. GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
  2092. };
  2093. // Defines RE.
  2094. // A simple C++ wrapper for <regex.h>. It uses the POSIX Extended
  2095. // Regular Expression syntax.
  2096. class GTEST_API_ RE {
  2097. public:
  2098. // A copy constructor is required by the Standard to initialize object
  2099. // references from r-values.
  2100. RE(const RE& other) { Init(other.pattern()); }
  2101. // Constructs an RE from a string.
  2102. RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT
  2103. #if GTEST_HAS_GLOBAL_STRING
  2104. RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT
  2105. #endif // GTEST_HAS_GLOBAL_STRING
  2106. RE(const char* regex) { Init(regex); } // NOLINT
  2107. ~RE();
  2108. // Returns the string representation of the regex.
  2109. const char* pattern() const { return pattern_; }
  2110. // FullMatch(str, re) returns true iff regular expression re matches
  2111. // the entire str.
  2112. // PartialMatch(str, re) returns true iff regular expression re
  2113. // matches a substring of str (including str itself).
  2114. //
  2115. // TODO(wan@google.com): make FullMatch() and PartialMatch() work
  2116. // when str contains NUL characters.
  2117. static bool FullMatch(const ::std::string& str, const RE& re) {
  2118. return FullMatch(str.c_str(), re);
  2119. }
  2120. static bool PartialMatch(const ::std::string& str, const RE& re) {
  2121. return PartialMatch(str.c_str(), re);
  2122. }
  2123. #if GTEST_HAS_GLOBAL_STRING
  2124. static bool FullMatch(const ::string& str, const RE& re) {
  2125. return FullMatch(str.c_str(), re);
  2126. }
  2127. static bool PartialMatch(const ::string& str, const RE& re) {
  2128. return PartialMatch(str.c_str(), re);
  2129. }
  2130. #endif // GTEST_HAS_GLOBAL_STRING
  2131. static bool FullMatch(const char* str, const RE& re);
  2132. static bool PartialMatch(const char* str, const RE& re);
  2133. private:
  2134. void Init(const char* regex);
  2135. // We use a const char* instead of an std::string, as Google Test used to be
  2136. // used where std::string is not available. TODO(wan@google.com): change to
  2137. // std::string.
  2138. const char* pattern_;
  2139. bool is_valid_;
  2140. #if GTEST_USES_POSIX_RE
  2141. regex_t full_regex_; // For FullMatch().
  2142. regex_t partial_regex_; // For PartialMatch().
  2143. #else // GTEST_USES_SIMPLE_RE
  2144. const char* full_pattern_; // For FullMatch();
  2145. #endif
  2146. GTEST_DISALLOW_ASSIGN_(RE);
  2147. };
  2148. // Formats a source file path and a line number as they would appear
  2149. // in an error message from the compiler used to compile this code.
  2150. GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
  2151. // Formats a file location for compiler-independent XML output.
  2152. // Although this function is not platform dependent, we put it next to
  2153. // FormatFileLocation in order to contrast the two functions.
  2154. GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
  2155. int line);
  2156. // Defines logging utilities:
  2157. // GTEST_LOG_(severity) - logs messages at the specified severity level. The
  2158. // message itself is streamed into the macro.
  2159. // LogToStderr() - directs all log messages to stderr.
  2160. // FlushInfoLog() - flushes informational log messages.
  2161. enum GTestLogSeverity {
  2162. GTEST_INFO,
  2163. GTEST_WARNING,
  2164. GTEST_ERROR,
  2165. GTEST_FATAL
  2166. };
  2167. // Formats log entry severity, provides a stream object for streaming the
  2168. // log message, and terminates the message with a newline when going out of
  2169. // scope.
  2170. class GTEST_API_ GTestLog {
  2171. public:
  2172. GTestLog(GTestLogSeverity severity, const char* file, int line);
  2173. // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
  2174. ~GTestLog();
  2175. ::std::ostream& GetStream() { return ::std::cerr; }
  2176. private:
  2177. const GTestLogSeverity severity_;
  2178. GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
  2179. };
  2180. #if !defined(GTEST_LOG_)
  2181. # define GTEST_LOG_(severity) \
  2182. ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
  2183. __FILE__, __LINE__).GetStream()
  2184. inline void LogToStderr() {}
  2185. inline void FlushInfoLog() { fflush(NULL); }
  2186. #endif // !defined(GTEST_LOG_)
  2187. #if !defined(GTEST_CHECK_)
  2188. // INTERNAL IMPLEMENTATION - DO NOT USE.
  2189. //
  2190. // GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
  2191. // is not satisfied.
  2192. // Synopsys:
  2193. // GTEST_CHECK_(boolean_condition);
  2194. // or
  2195. // GTEST_CHECK_(boolean_condition) << "Additional message";
  2196. //
  2197. // This checks the condition and if the condition is not satisfied
  2198. // it prints message about the condition violation, including the
  2199. // condition itself, plus additional message streamed into it, if any,
  2200. // and then it aborts the program. It aborts the program irrespective of
  2201. // whether it is built in the debug mode or not.
  2202. # define GTEST_CHECK_(condition) \
  2203. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  2204. if (::testing::internal::IsTrue(condition)) \
  2205. ; \
  2206. else \
  2207. GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
  2208. #endif // !defined(GTEST_CHECK_)
  2209. // An all-mode assert to verify that the given POSIX-style function
  2210. // call returns 0 (indicating success). Known limitation: this
  2211. // doesn't expand to a balanced 'if' statement, so enclose the macro
  2212. // in {} if you need to use it as the only statement in an 'if'
  2213. // branch.
  2214. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
  2215. if (const int gtest_error = (posix_call)) \
  2216. GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
  2217. << gtest_error
  2218. #if GTEST_HAS_STD_MOVE_
  2219. using std::move;
  2220. #else // GTEST_HAS_STD_MOVE_
  2221. template <typename T>
  2222. const T& move(const T& t) {
  2223. return t;
  2224. }
  2225. #endif // GTEST_HAS_STD_MOVE_
  2226. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  2227. //
  2228. // Use ImplicitCast_ as a safe version of static_cast for upcasting in
  2229. // the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
  2230. // const Foo*). When you use ImplicitCast_, the compiler checks that
  2231. // the cast is safe. Such explicit ImplicitCast_s are necessary in
  2232. // surprisingly many situations where C++ demands an exact type match
  2233. // instead of an argument type convertable to a target type.
  2234. //
  2235. // The syntax for using ImplicitCast_ is the same as for static_cast:
  2236. //
  2237. // ImplicitCast_<ToType>(expr)
  2238. //
  2239. // ImplicitCast_ would have been part of the C++ standard library,
  2240. // but the proposal was submitted too late. It will probably make
  2241. // its way into the language in the future.
  2242. //
  2243. // This relatively ugly name is intentional. It prevents clashes with
  2244. // similar functions users may have (e.g., implicit_cast). The internal
  2245. // namespace alone is not enough because the function can be found by ADL.
  2246. template<typename To>
  2247. inline To ImplicitCast_(To x) { return x; }
  2248. // When you upcast (that is, cast a pointer from type Foo to type
  2249. // SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
  2250. // always succeed. When you downcast (that is, cast a pointer from
  2251. // type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
  2252. // how do you know the pointer is really of type SubclassOfFoo? It
  2253. // could be a bare Foo, or of type DifferentSubclassOfFoo. Thus,
  2254. // when you downcast, you should use this macro. In debug mode, we
  2255. // use dynamic_cast<> to double-check the downcast is legal (we die
  2256. // if it's not). In normal mode, we do the efficient static_cast<>
  2257. // instead. Thus, it's important to test in debug mode to make sure
  2258. // the cast is legal!
  2259. // This is the only place in the code we should use dynamic_cast<>.
  2260. // In particular, you SHOULDN'T be using dynamic_cast<> in order to
  2261. // do RTTI (eg code like this:
  2262. // if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
  2263. // if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
  2264. // You should design the code some other way not to need this.
  2265. //
  2266. // This relatively ugly name is intentional. It prevents clashes with
  2267. // similar functions users may have (e.g., down_cast). The internal
  2268. // namespace alone is not enough because the function can be found by ADL.
  2269. template<typename To, typename From> // use like this: DownCast_<T*>(foo);
  2270. inline To DownCast_(From* f) { // so we only accept pointers
  2271. // Ensures that To is a sub-type of From *. This test is here only
  2272. // for compile-time type checking, and has no overhead in an
  2273. // optimized build at run-time, as it will be optimized away
  2274. // completely.
  2275. GTEST_INTENTIONAL_CONST_COND_PUSH_()
  2276. if (false) {
  2277. GTEST_INTENTIONAL_CONST_COND_POP_()
  2278. const To to = NULL;
  2279. ::testing::internal::ImplicitCast_<From*>(to);
  2280. }
  2281. #if GTEST_HAS_RTTI
  2282. // RTTI: debug mode only!
  2283. GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
  2284. #endif
  2285. return static_cast<To>(f);
  2286. }
  2287. // Downcasts the pointer of type Base to Derived.
  2288. // Derived must be a subclass of Base. The parameter MUST
  2289. // point to a class of type Derived, not any subclass of it.
  2290. // When RTTI is available, the function performs a runtime
  2291. // check to enforce this.
  2292. template <class Derived, class Base>
  2293. Derived* CheckedDowncastToActualType(Base* base) {
  2294. #if GTEST_HAS_RTTI
  2295. GTEST_CHECK_(typeid(*base) == typeid(Derived));
  2296. #endif
  2297. #if GTEST_HAS_DOWNCAST_
  2298. return ::down_cast<Derived*>(base);
  2299. #elif GTEST_HAS_RTTI
  2300. return dynamic_cast<Derived*>(base); // NOLINT
  2301. #else
  2302. return static_cast<Derived*>(base); // Poor man's downcast.
  2303. #endif
  2304. }
  2305. #if GTEST_HAS_STREAM_REDIRECTION
  2306. // Defines the stderr capturer:
  2307. // CaptureStdout - starts capturing stdout.
  2308. // GetCapturedStdout - stops capturing stdout and returns the captured string.
  2309. // CaptureStderr - starts capturing stderr.
  2310. // GetCapturedStderr - stops capturing stderr and returns the captured string.
  2311. //
  2312. GTEST_API_ void CaptureStdout();
  2313. GTEST_API_ std::string GetCapturedStdout();
  2314. GTEST_API_ void CaptureStderr();
  2315. GTEST_API_ std::string GetCapturedStderr();
  2316. #endif // GTEST_HAS_STREAM_REDIRECTION
  2317. // Returns a path to temporary directory.
  2318. GTEST_API_ std::string TempDir();
  2319. // Returns the size (in bytes) of a file.
  2320. GTEST_API_ size_t GetFileSize(FILE* file);
  2321. // Reads the entire content of a file as a string.
  2322. GTEST_API_ std::string ReadEntireFile(FILE* file);
  2323. // All command line arguments.
  2324. GTEST_API_ const ::std::vector<testing::internal::string>& GetArgvs();
  2325. #if GTEST_HAS_DEATH_TEST
  2326. const ::std::vector<testing::internal::string>& GetInjectableArgvs();
  2327. void SetInjectableArgvs(const ::std::vector<testing::internal::string>*
  2328. new_argvs);
  2329. #endif // GTEST_HAS_DEATH_TEST
  2330. // Defines synchronization primitives.
  2331. #if GTEST_IS_THREADSAFE
  2332. # if GTEST_HAS_PTHREAD
  2333. // Sleeps for (roughly) n milliseconds. This function is only for testing
  2334. // Google Test's own constructs. Don't use it in user tests, either
  2335. // directly or indirectly.
  2336. inline void SleepMilliseconds(int n) {
  2337. const timespec time = {
  2338. 0, // 0 seconds.
  2339. n * 1000L * 1000L, // And n ms.
  2340. };
  2341. nanosleep(&time, NULL);
  2342. }
  2343. # endif // GTEST_HAS_PTHREAD
  2344. # if GTEST_HAS_NOTIFICATION_
  2345. // Notification has already been imported into the namespace.
  2346. // Nothing to do here.
  2347. # elif GTEST_HAS_PTHREAD
  2348. // Allows a controller thread to pause execution of newly created
  2349. // threads until notified. Instances of this class must be created
  2350. // and destroyed in the controller thread.
  2351. //
  2352. // This class is only for testing Google Test's own constructs. Do not
  2353. // use it in user tests, either directly or indirectly.
  2354. class Notification {
  2355. public:
  2356. Notification() : notified_(false) {
  2357. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
  2358. }
  2359. ~Notification() {
  2360. pthread_mutex_destroy(&mutex_);
  2361. }
  2362. // Notifies all threads created with this notification to start. Must
  2363. // be called from the controller thread.
  2364. void Notify() {
  2365. pthread_mutex_lock(&mutex_);
  2366. notified_ = true;
  2367. pthread_mutex_unlock(&mutex_);
  2368. }
  2369. // Blocks until the controller thread notifies. Must be called from a test
  2370. // thread.
  2371. void WaitForNotification() {
  2372. for (;;) {
  2373. pthread_mutex_lock(&mutex_);
  2374. const bool notified = notified_;
  2375. pthread_mutex_unlock(&mutex_);
  2376. if (notified)
  2377. break;
  2378. SleepMilliseconds(10);
  2379. }
  2380. }
  2381. private:
  2382. pthread_mutex_t mutex_;
  2383. bool notified_;
  2384. GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
  2385. };
  2386. # elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
  2387. GTEST_API_ void SleepMilliseconds(int n);
  2388. // Provides leak-safe Windows kernel handle ownership.
  2389. // Used in death tests and in threading support.
  2390. class GTEST_API_ AutoHandle {
  2391. public:
  2392. // Assume that Win32 HANDLE type is equivalent to void*. Doing so allows us to
  2393. // avoid including <windows.h> in this header file. Including <windows.h> is
  2394. // undesirable because it defines a lot of symbols and macros that tend to
  2395. // conflict with client code. This assumption is verified by
  2396. // WindowsTypesTest.HANDLEIsVoidStar.
  2397. typedef void* Handle;
  2398. AutoHandle();
  2399. explicit AutoHandle(Handle handle);
  2400. ~AutoHandle();
  2401. Handle Get() const;
  2402. void Reset();
  2403. void Reset(Handle handle);
  2404. private:
  2405. // Returns true iff the handle is a valid handle object that can be closed.
  2406. bool IsCloseable() const;
  2407. Handle handle_;
  2408. GTEST_DISALLOW_COPY_AND_ASSIGN_(AutoHandle);
  2409. };
  2410. // Allows a controller thread to pause execution of newly created
  2411. // threads until notified. Instances of this class must be created
  2412. // and destroyed in the controller thread.
  2413. //
  2414. // This class is only for testing Google Test's own constructs. Do not
  2415. // use it in user tests, either directly or indirectly.
  2416. class GTEST_API_ Notification {
  2417. public:
  2418. Notification();
  2419. void Notify();
  2420. void WaitForNotification();
  2421. private:
  2422. AutoHandle event_;
  2423. GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
  2424. };
  2425. # endif // GTEST_HAS_NOTIFICATION_
  2426. // On MinGW, we can have both GTEST_OS_WINDOWS and GTEST_HAS_PTHREAD
  2427. // defined, but we don't want to use MinGW's pthreads implementation, which
  2428. // has conformance problems with some versions of the POSIX standard.
  2429. # if GTEST_HAS_PTHREAD && !GTEST_OS_WINDOWS_MINGW
  2430. // As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
  2431. // Consequently, it cannot select a correct instantiation of ThreadWithParam
  2432. // in order to call its Run(). Introducing ThreadWithParamBase as a
  2433. // non-templated base class for ThreadWithParam allows us to bypass this
  2434. // problem.
  2435. class ThreadWithParamBase {
  2436. public:
  2437. virtual ~ThreadWithParamBase() {}
  2438. virtual void Run() = 0;
  2439. };
  2440. // pthread_create() accepts a pointer to a function type with the C linkage.
  2441. // According to the Standard (7.5/1), function types with different linkages
  2442. // are different even if they are otherwise identical. Some compilers (for
  2443. // example, SunStudio) treat them as different types. Since class methods
  2444. // cannot be defined with C-linkage we need to define a free C-function to
  2445. // pass into pthread_create().
  2446. extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
  2447. static_cast<ThreadWithParamBase*>(thread)->Run();
  2448. return NULL;
  2449. }
  2450. // Helper class for testing Google Test's multi-threading constructs.
  2451. // To use it, write:
  2452. //
  2453. // void ThreadFunc(int param) { /* Do things with param */ }
  2454. // Notification thread_can_start;
  2455. // ...
  2456. // // The thread_can_start parameter is optional; you can supply NULL.
  2457. // ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
  2458. // thread_can_start.Notify();
  2459. //
  2460. // These classes are only for testing Google Test's own constructs. Do
  2461. // not use them in user tests, either directly or indirectly.
  2462. template <typename T>
  2463. class ThreadWithParam : public ThreadWithParamBase {
  2464. public:
  2465. typedef void UserThreadFunc(T);
  2466. ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
  2467. : func_(func),
  2468. param_(param),
  2469. thread_can_start_(thread_can_start),
  2470. finished_(false) {
  2471. ThreadWithParamBase* const base = this;
  2472. // The thread can be created only after all fields except thread_
  2473. // have been initialized.
  2474. GTEST_CHECK_POSIX_SUCCESS_(
  2475. pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
  2476. }
  2477. ~ThreadWithParam() { Join(); }
  2478. void Join() {
  2479. if (!finished_) {
  2480. GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
  2481. finished_ = true;
  2482. }
  2483. }
  2484. virtual void Run() {
  2485. if (thread_can_start_ != NULL)
  2486. thread_can_start_->WaitForNotification();
  2487. func_(param_);
  2488. }
  2489. private:
  2490. UserThreadFunc* const func_; // User-supplied thread function.
  2491. const T param_; // User-supplied parameter to the thread function.
  2492. // When non-NULL, used to block execution until the controller thread
  2493. // notifies.
  2494. Notification* const thread_can_start_;
  2495. bool finished_; // true iff we know that the thread function has finished.
  2496. pthread_t thread_; // The native thread object.
  2497. GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
  2498. };
  2499. # endif // !GTEST_OS_WINDOWS && GTEST_HAS_PTHREAD ||
  2500. // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
  2501. # if GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
  2502. // Mutex and ThreadLocal have already been imported into the namespace.
  2503. // Nothing to do here.
  2504. # elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
  2505. // Mutex implements mutex on Windows platforms. It is used in conjunction
  2506. // with class MutexLock:
  2507. //
  2508. // Mutex mutex;
  2509. // ...
  2510. // MutexLock lock(&mutex); // Acquires the mutex and releases it at the
  2511. // // end of the current scope.
  2512. //
  2513. // A static Mutex *must* be defined or declared using one of the following
  2514. // macros:
  2515. // GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
  2516. // GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
  2517. //
  2518. // (A non-static Mutex is defined/declared in the usual way).
  2519. class GTEST_API_ Mutex {
  2520. public:
  2521. enum MutexType { kStatic = 0, kDynamic = 1 };
  2522. // We rely on kStaticMutex being 0 as it is to what the linker initializes
  2523. // type_ in static mutexes. critical_section_ will be initialized lazily
  2524. // in ThreadSafeLazyInit().
  2525. enum StaticConstructorSelector { kStaticMutex = 0 };
  2526. // This constructor intentionally does nothing. It relies on type_ being
  2527. // statically initialized to 0 (effectively setting it to kStatic) and on
  2528. // ThreadSafeLazyInit() to lazily initialize the rest of the members.
  2529. explicit Mutex(StaticConstructorSelector /*dummy*/) {}
  2530. Mutex();
  2531. ~Mutex();
  2532. void Lock();
  2533. void Unlock();
  2534. // Does nothing if the current thread holds the mutex. Otherwise, crashes
  2535. // with high probability.
  2536. void AssertHeld();
  2537. private:
  2538. // Initializes owner_thread_id_ and critical_section_ in static mutexes.
  2539. void ThreadSafeLazyInit();
  2540. // Per http://blogs.msdn.com/b/oldnewthing/archive/2004/02/23/78395.aspx,
  2541. // we assume that 0 is an invalid value for thread IDs.
  2542. unsigned int owner_thread_id_;
  2543. // For static mutexes, we rely on these members being initialized to zeros
  2544. // by the linker.
  2545. MutexType type_;
  2546. long critical_section_init_phase_; // NOLINT
  2547. _RTL_CRITICAL_SECTION* critical_section_;
  2548. GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
  2549. };
  2550. # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
  2551. extern ::testing::internal::Mutex mutex
  2552. # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
  2553. ::testing::internal::Mutex mutex(::testing::internal::Mutex::kStaticMutex)
  2554. // We cannot name this class MutexLock because the ctor declaration would
  2555. // conflict with a macro named MutexLock, which is defined on some
  2556. // platforms. That macro is used as a defensive measure to prevent against
  2557. // inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
  2558. // "MutexLock l(&mu)". Hence the typedef trick below.
  2559. class GTestMutexLock {
  2560. public:
  2561. explicit GTestMutexLock(Mutex* mutex)
  2562. : mutex_(mutex) { mutex_->Lock(); }
  2563. ~GTestMutexLock() { mutex_->Unlock(); }
  2564. private:
  2565. Mutex* const mutex_;
  2566. GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
  2567. };
  2568. typedef GTestMutexLock MutexLock;
  2569. // Base class for ValueHolder<T>. Allows a caller to hold and delete a value
  2570. // without knowing its type.
  2571. class ThreadLocalValueHolderBase {
  2572. public:
  2573. virtual ~ThreadLocalValueHolderBase() {}
  2574. };
  2575. // Provides a way for a thread to send notifications to a ThreadLocal
  2576. // regardless of its parameter type.
  2577. class ThreadLocalBase {
  2578. public:
  2579. // Creates a new ValueHolder<T> object holding a default value passed to
  2580. // this ThreadLocal<T>'s constructor and returns it. It is the caller's
  2581. // responsibility not to call this when the ThreadLocal<T> instance already
  2582. // has a value on the current thread.
  2583. virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const = 0;
  2584. protected:
  2585. ThreadLocalBase() {}
  2586. virtual ~ThreadLocalBase() {}
  2587. private:
  2588. GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocalBase);
  2589. };
  2590. // Maps a thread to a set of ThreadLocals that have values instantiated on that
  2591. // thread and notifies them when the thread exits. A ThreadLocal instance is
  2592. // expected to persist until all threads it has values on have terminated.
  2593. class GTEST_API_ ThreadLocalRegistry {
  2594. public:
  2595. // Registers thread_local_instance as having value on the current thread.
  2596. // Returns a value that can be used to identify the thread from other threads.
  2597. static ThreadLocalValueHolderBase* GetValueOnCurrentThread(
  2598. const ThreadLocalBase* thread_local_instance);
  2599. // Invoked when a ThreadLocal instance is destroyed.
  2600. static void OnThreadLocalDestroyed(
  2601. const ThreadLocalBase* thread_local_instance);
  2602. };
  2603. class GTEST_API_ ThreadWithParamBase {
  2604. public:
  2605. void Join();
  2606. protected:
  2607. class Runnable {
  2608. public:
  2609. virtual ~Runnable() {}
  2610. virtual void Run() = 0;
  2611. };
  2612. ThreadWithParamBase(Runnable *runnable, Notification* thread_can_start);
  2613. virtual ~ThreadWithParamBase();
  2614. private:
  2615. AutoHandle thread_;
  2616. };
  2617. // Helper class for testing Google Test's multi-threading constructs.
  2618. template <typename T>
  2619. class ThreadWithParam : public ThreadWithParamBase {
  2620. public:
  2621. typedef void UserThreadFunc(T);
  2622. ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
  2623. : ThreadWithParamBase(new RunnableImpl(func, param), thread_can_start) {
  2624. }
  2625. virtual ~ThreadWithParam() {}
  2626. private:
  2627. class RunnableImpl : public Runnable {
  2628. public:
  2629. RunnableImpl(UserThreadFunc* func, T param)
  2630. : func_(func),
  2631. param_(param) {
  2632. }
  2633. virtual ~RunnableImpl() {}
  2634. virtual void Run() {
  2635. func_(param_);
  2636. }
  2637. private:
  2638. UserThreadFunc* const func_;
  2639. const T param_;
  2640. GTEST_DISALLOW_COPY_AND_ASSIGN_(RunnableImpl);
  2641. };
  2642. GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
  2643. };
  2644. // Implements thread-local storage on Windows systems.
  2645. //
  2646. // // Thread 1
  2647. // ThreadLocal<int> tl(100); // 100 is the default value for each thread.
  2648. //
  2649. // // Thread 2
  2650. // tl.set(150); // Changes the value for thread 2 only.
  2651. // EXPECT_EQ(150, tl.get());
  2652. //
  2653. // // Thread 1
  2654. // EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value.
  2655. // tl.set(200);
  2656. // EXPECT_EQ(200, tl.get());
  2657. //
  2658. // The template type argument T must have a public copy constructor.
  2659. // In addition, the default ThreadLocal constructor requires T to have
  2660. // a public default constructor.
  2661. //
  2662. // The users of a TheadLocal instance have to make sure that all but one
  2663. // threads (including the main one) using that instance have exited before
  2664. // destroying it. Otherwise, the per-thread objects managed for them by the
  2665. // ThreadLocal instance are not guaranteed to be destroyed on all platforms.
  2666. //
  2667. // Google Test only uses global ThreadLocal objects. That means they
  2668. // will die after main() has returned. Therefore, no per-thread
  2669. // object managed by Google Test will be leaked as long as all threads
  2670. // using Google Test have exited when main() returns.
  2671. template <typename T>
  2672. class ThreadLocal : public ThreadLocalBase {
  2673. public:
  2674. ThreadLocal() : default_factory_(new DefaultValueHolderFactory()) {}
  2675. explicit ThreadLocal(const T& value)
  2676. : default_factory_(new InstanceValueHolderFactory(value)) {}
  2677. ~ThreadLocal() { ThreadLocalRegistry::OnThreadLocalDestroyed(this); }
  2678. T* pointer() { return GetOrCreateValue(); }
  2679. const T* pointer() const { return GetOrCreateValue(); }
  2680. const T& get() const { return *pointer(); }
  2681. void set(const T& value) { *pointer() = value; }
  2682. private:
  2683. // Holds a value of T. Can be deleted via its base class without the caller
  2684. // knowing the type of T.
  2685. class ValueHolder : public ThreadLocalValueHolderBase {
  2686. public:
  2687. ValueHolder() : value_() {}
  2688. explicit ValueHolder(const T& value) : value_(value) {}
  2689. T* pointer() { return &value_; }
  2690. private:
  2691. T value_;
  2692. GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
  2693. };
  2694. T* GetOrCreateValue() const {
  2695. return static_cast<ValueHolder*>(
  2696. ThreadLocalRegistry::GetValueOnCurrentThread(this))->pointer();
  2697. }
  2698. virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const {
  2699. return default_factory_->MakeNewHolder();
  2700. }
  2701. class ValueHolderFactory {
  2702. public:
  2703. ValueHolderFactory() {}
  2704. virtual ~ValueHolderFactory() {}
  2705. virtual ValueHolder* MakeNewHolder() const = 0;
  2706. private:
  2707. GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);
  2708. };
  2709. class DefaultValueHolderFactory : public ValueHolderFactory {
  2710. public:
  2711. DefaultValueHolderFactory() {}
  2712. virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }
  2713. private:
  2714. GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
  2715. };
  2716. class InstanceValueHolderFactory : public ValueHolderFactory {
  2717. public:
  2718. explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
  2719. virtual ValueHolder* MakeNewHolder() const {
  2720. return new ValueHolder(value_);
  2721. }
  2722. private:
  2723. const T value_; // The value for each thread.
  2724. GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);
  2725. };
  2726. scoped_ptr<ValueHolderFactory> default_factory_;
  2727. GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
  2728. };
  2729. # elif GTEST_HAS_PTHREAD
  2730. // MutexBase and Mutex implement mutex on pthreads-based platforms.
  2731. class MutexBase {
  2732. public:
  2733. // Acquires this mutex.
  2734. void Lock() {
  2735. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
  2736. owner_ = pthread_self();
  2737. has_owner_ = true;
  2738. }
  2739. // Releases this mutex.
  2740. void Unlock() {
  2741. // Since the lock is being released the owner_ field should no longer be
  2742. // considered valid. We don't protect writing to has_owner_ here, as it's
  2743. // the caller's responsibility to ensure that the current thread holds the
  2744. // mutex when this is called.
  2745. has_owner_ = false;
  2746. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
  2747. }
  2748. // Does nothing if the current thread holds the mutex. Otherwise, crashes
  2749. // with high probability.
  2750. void AssertHeld() const {
  2751. GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))
  2752. << "The current thread is not holding the mutex @" << this;
  2753. }
  2754. // A static mutex may be used before main() is entered. It may even
  2755. // be used before the dynamic initialization stage. Therefore we
  2756. // must be able to initialize a static mutex object at link time.
  2757. // This means MutexBase has to be a POD and its member variables
  2758. // have to be public.
  2759. public:
  2760. pthread_mutex_t mutex_; // The underlying pthread mutex.
  2761. // has_owner_ indicates whether the owner_ field below contains a valid thread
  2762. // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All
  2763. // accesses to the owner_ field should be protected by a check of this field.
  2764. // An alternative might be to memset() owner_ to all zeros, but there's no
  2765. // guarantee that a zero'd pthread_t is necessarily invalid or even different
  2766. // from pthread_self().
  2767. bool has_owner_;
  2768. pthread_t owner_; // The thread holding the mutex.
  2769. };
  2770. // Forward-declares a static mutex.
  2771. # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
  2772. extern ::testing::internal::MutexBase mutex
  2773. // Defines and statically (i.e. at link time) initializes a static mutex.
  2774. # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
  2775. ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false, pthread_t() }
  2776. // The Mutex class can only be used for mutexes created at runtime. It
  2777. // shares its API with MutexBase otherwise.
  2778. class Mutex : public MutexBase {
  2779. public:
  2780. Mutex() {
  2781. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
  2782. has_owner_ = false;
  2783. }
  2784. ~Mutex() {
  2785. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
  2786. }
  2787. private:
  2788. GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
  2789. };
  2790. // We cannot name this class MutexLock because the ctor declaration would
  2791. // conflict with a macro named MutexLock, which is defined on some
  2792. // platforms. That macro is used as a defensive measure to prevent against
  2793. // inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
  2794. // "MutexLock l(&mu)". Hence the typedef trick below.
  2795. class GTestMutexLock {
  2796. public:
  2797. explicit GTestMutexLock(MutexBase* mutex)
  2798. : mutex_(mutex) { mutex_->Lock(); }
  2799. ~GTestMutexLock() { mutex_->Unlock(); }
  2800. private:
  2801. MutexBase* const mutex_;
  2802. GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
  2803. };
  2804. typedef GTestMutexLock MutexLock;
  2805. // Helpers for ThreadLocal.
  2806. // pthread_key_create() requires DeleteThreadLocalValue() to have
  2807. // C-linkage. Therefore it cannot be templatized to access
  2808. // ThreadLocal<T>. Hence the need for class
  2809. // ThreadLocalValueHolderBase.
  2810. class ThreadLocalValueHolderBase {
  2811. public:
  2812. virtual ~ThreadLocalValueHolderBase() {}
  2813. };
  2814. // Called by pthread to delete thread-local data stored by
  2815. // pthread_setspecific().
  2816. extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
  2817. delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
  2818. }
  2819. // Implements thread-local storage on pthreads-based systems.
  2820. template <typename T>
  2821. class ThreadLocal {
  2822. public:
  2823. ThreadLocal()
  2824. : key_(CreateKey()), default_factory_(new DefaultValueHolderFactory()) {}
  2825. explicit ThreadLocal(const T& value)
  2826. : key_(CreateKey()),
  2827. default_factory_(new InstanceValueHolderFactory(value)) {}
  2828. ~ThreadLocal() {
  2829. // Destroys the managed object for the current thread, if any.
  2830. DeleteThreadLocalValue(pthread_getspecific(key_));
  2831. // Releases resources associated with the key. This will *not*
  2832. // delete managed objects for other threads.
  2833. GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
  2834. }
  2835. T* pointer() { return GetOrCreateValue(); }
  2836. const T* pointer() const { return GetOrCreateValue(); }
  2837. const T& get() const { return *pointer(); }
  2838. void set(const T& value) { *pointer() = value; }
  2839. private:
  2840. // Holds a value of type T.
  2841. class ValueHolder : public ThreadLocalValueHolderBase {
  2842. public:
  2843. ValueHolder() : value_() {}
  2844. explicit ValueHolder(const T& value) : value_(value) {}
  2845. T* pointer() { return &value_; }
  2846. private:
  2847. T value_;
  2848. GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
  2849. };
  2850. static pthread_key_t CreateKey() {
  2851. pthread_key_t key;
  2852. // When a thread exits, DeleteThreadLocalValue() will be called on
  2853. // the object managed for that thread.
  2854. GTEST_CHECK_POSIX_SUCCESS_(
  2855. pthread_key_create(&key, &DeleteThreadLocalValue));
  2856. return key;
  2857. }
  2858. T* GetOrCreateValue() const {
  2859. ThreadLocalValueHolderBase* const holder =
  2860. static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
  2861. if (holder != NULL) {
  2862. return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
  2863. }
  2864. ValueHolder* const new_holder = default_factory_->MakeNewHolder();
  2865. ThreadLocalValueHolderBase* const holder_base = new_holder;
  2866. GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
  2867. return new_holder->pointer();
  2868. }
  2869. class ValueHolderFactory {
  2870. public:
  2871. ValueHolderFactory() {}
  2872. virtual ~ValueHolderFactory() {}
  2873. virtual ValueHolder* MakeNewHolder() const = 0;
  2874. private:
  2875. GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);
  2876. };
  2877. class DefaultValueHolderFactory : public ValueHolderFactory {
  2878. public:
  2879. DefaultValueHolderFactory() {}
  2880. virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }
  2881. private:
  2882. GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
  2883. };
  2884. class InstanceValueHolderFactory : public ValueHolderFactory {
  2885. public:
  2886. explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
  2887. virtual ValueHolder* MakeNewHolder() const {
  2888. return new ValueHolder(value_);
  2889. }
  2890. private:
  2891. const T value_; // The value for each thread.
  2892. GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);
  2893. };
  2894. // A key pthreads uses for looking up per-thread values.
  2895. const pthread_key_t key_;
  2896. scoped_ptr<ValueHolderFactory> default_factory_;
  2897. GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
  2898. };
  2899. # endif // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
  2900. #else // GTEST_IS_THREADSAFE
  2901. // A dummy implementation of synchronization primitives (mutex, lock,
  2902. // and thread-local variable). Necessary for compiling Google Test where
  2903. // mutex is not supported - using Google Test in multiple threads is not
  2904. // supported on such platforms.
  2905. class Mutex {
  2906. public:
  2907. Mutex() {}
  2908. void Lock() {}
  2909. void Unlock() {}
  2910. void AssertHeld() const {}
  2911. };
  2912. # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
  2913. extern ::testing::internal::Mutex mutex
  2914. # define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
  2915. // We cannot name this class MutexLock because the ctor declaration would
  2916. // conflict with a macro named MutexLock, which is defined on some
  2917. // platforms. That macro is used as a defensive measure to prevent against
  2918. // inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
  2919. // "MutexLock l(&mu)". Hence the typedef trick below.
  2920. class GTestMutexLock {
  2921. public:
  2922. explicit GTestMutexLock(Mutex*) {} // NOLINT
  2923. };
  2924. typedef GTestMutexLock MutexLock;
  2925. template <typename T>
  2926. class ThreadLocal {
  2927. public:
  2928. ThreadLocal() : value_() {}
  2929. explicit ThreadLocal(const T& value) : value_(value) {}
  2930. T* pointer() { return &value_; }
  2931. const T* pointer() const { return &value_; }
  2932. const T& get() const { return value_; }
  2933. void set(const T& value) { value_ = value; }
  2934. private:
  2935. T value_;
  2936. };
  2937. #endif // GTEST_IS_THREADSAFE
  2938. // Returns the number of threads running in the process, or 0 to indicate that
  2939. // we cannot detect it.
  2940. GTEST_API_ size_t GetThreadCount();
  2941. // Passing non-POD classes through ellipsis (...) crashes the ARM
  2942. // compiler and generates a warning in Sun Studio. The Nokia Symbian
  2943. // and the IBM XL C/C++ compiler try to instantiate a copy constructor
  2944. // for objects passed through ellipsis (...), failing for uncopyable
  2945. // objects. We define this to ensure that only POD is passed through
  2946. // ellipsis on these systems.
  2947. #if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
  2948. // We lose support for NULL detection where the compiler doesn't like
  2949. // passing non-POD classes through ellipsis (...).
  2950. # define GTEST_ELLIPSIS_NEEDS_POD_ 1
  2951. #else
  2952. # define GTEST_CAN_COMPARE_NULL 1
  2953. #endif
  2954. // The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
  2955. // const T& and const T* in a function template. These compilers
  2956. // _can_ decide between class template specializations for T and T*,
  2957. // so a tr1::type_traits-like is_pointer works.
  2958. #if defined(__SYMBIAN32__) || defined(__IBMCPP__)
  2959. # define GTEST_NEEDS_IS_POINTER_ 1
  2960. #endif
  2961. template <bool bool_value>
  2962. struct bool_constant {
  2963. typedef bool_constant<bool_value> type;
  2964. static const bool value = bool_value;
  2965. };
  2966. template <bool bool_value> const bool bool_constant<bool_value>::value;
  2967. typedef bool_constant<false> false_type;
  2968. typedef bool_constant<true> true_type;
  2969. template <typename T>
  2970. struct is_pointer : public false_type {};
  2971. template <typename T>
  2972. struct is_pointer<T*> : public true_type {};
  2973. template <typename Iterator>
  2974. struct IteratorTraits {
  2975. typedef typename Iterator::value_type value_type;
  2976. };
  2977. template <typename T>
  2978. struct IteratorTraits<T*> {
  2979. typedef T value_type;
  2980. };
  2981. template <typename T>
  2982. struct IteratorTraits<const T*> {
  2983. typedef T value_type;
  2984. };
  2985. #if GTEST_OS_WINDOWS
  2986. # define GTEST_PATH_SEP_ "\\"
  2987. # define GTEST_HAS_ALT_PATH_SEP_ 1
  2988. // The biggest signed integer type the compiler supports.
  2989. typedef __int64 BiggestInt;
  2990. #else
  2991. # define GTEST_PATH_SEP_ "/"
  2992. # define GTEST_HAS_ALT_PATH_SEP_ 0
  2993. typedef long long BiggestInt; // NOLINT
  2994. #endif // GTEST_OS_WINDOWS
  2995. // Utilities for char.
  2996. // isspace(int ch) and friends accept an unsigned char or EOF. char
  2997. // may be signed, depending on the compiler (or compiler flags).
  2998. // Therefore we need to cast a char to unsigned char before calling
  2999. // isspace(), etc.
  3000. inline bool IsAlpha(char ch) {
  3001. return isalpha(static_cast<unsigned char>(ch)) != 0;
  3002. }
  3003. inline bool IsAlNum(char ch) {
  3004. return isalnum(static_cast<unsigned char>(ch)) != 0;
  3005. }
  3006. inline bool IsDigit(char ch) {
  3007. return isdigit(static_cast<unsigned char>(ch)) != 0;
  3008. }
  3009. inline bool IsLower(char ch) {
  3010. return islower(static_cast<unsigned char>(ch)) != 0;
  3011. }
  3012. inline bool IsSpace(char ch) {
  3013. return isspace(static_cast<unsigned char>(ch)) != 0;
  3014. }
  3015. inline bool IsUpper(char ch) {
  3016. return isupper(static_cast<unsigned char>(ch)) != 0;
  3017. }
  3018. inline bool IsXDigit(char ch) {
  3019. return isxdigit(static_cast<unsigned char>(ch)) != 0;
  3020. }
  3021. inline bool IsXDigit(wchar_t ch) {
  3022. const unsigned char low_byte = static_cast<unsigned char>(ch);
  3023. return ch == low_byte && isxdigit(low_byte) != 0;
  3024. }
  3025. inline char ToLower(char ch) {
  3026. return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
  3027. }
  3028. inline char ToUpper(char ch) {
  3029. return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
  3030. }
  3031. inline std::string StripTrailingSpaces(std::string str) {
  3032. std::string::iterator it = str.end();
  3033. while (it != str.begin() && IsSpace(*--it))
  3034. it = str.erase(it);
  3035. return str;
  3036. }
  3037. // The testing::internal::posix namespace holds wrappers for common
  3038. // POSIX functions. These wrappers hide the differences between
  3039. // Windows/MSVC and POSIX systems. Since some compilers define these
  3040. // standard functions as macros, the wrapper cannot have the same name
  3041. // as the wrapped function.
  3042. namespace posix {
  3043. // Functions with a different name on Windows.
  3044. #if GTEST_OS_WINDOWS
  3045. typedef struct _stat StatStruct;
  3046. # ifdef __BORLANDC__
  3047. inline int IsATTY(int fd) { return isatty(fd); }
  3048. inline int StrCaseCmp(const char* s1, const char* s2) {
  3049. return stricmp(s1, s2);
  3050. }
  3051. inline char* StrDup(const char* src) { return strdup(src); }
  3052. # else // !__BORLANDC__
  3053. # if GTEST_OS_WINDOWS_MOBILE
  3054. inline int IsATTY(int /* fd */) { return 0; }
  3055. # else
  3056. inline int IsATTY(int fd) { return _isatty(fd); }
  3057. # endif // GTEST_OS_WINDOWS_MOBILE
  3058. inline int StrCaseCmp(const char* s1, const char* s2) {
  3059. return _stricmp(s1, s2);
  3060. }
  3061. inline char* StrDup(const char* src) { return _strdup(src); }
  3062. # endif // __BORLANDC__
  3063. # if GTEST_OS_WINDOWS_MOBILE
  3064. inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
  3065. // Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
  3066. // time and thus not defined there.
  3067. # else
  3068. inline int FileNo(FILE* file) { return _fileno(file); }
  3069. inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
  3070. inline int RmDir(const char* dir) { return _rmdir(dir); }
  3071. inline bool IsDir(const StatStruct& st) {
  3072. return (_S_IFDIR & st.st_mode) != 0;
  3073. }
  3074. # endif // GTEST_OS_WINDOWS_MOBILE
  3075. #else
  3076. typedef struct stat StatStruct;
  3077. inline int FileNo(FILE* file) { return fileno(file); }
  3078. inline int IsATTY(int fd) { return isatty(fd); }
  3079. inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
  3080. inline int StrCaseCmp(const char* s1, const char* s2) {
  3081. return strcasecmp(s1, s2);
  3082. }
  3083. inline char* StrDup(const char* src) { return strdup(src); }
  3084. inline int RmDir(const char* dir) { return rmdir(dir); }
  3085. inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
  3086. #endif // GTEST_OS_WINDOWS
  3087. // Functions deprecated by MSVC 8.0.
  3088. GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996 /* deprecated function */)
  3089. inline const char* StrNCpy(char* dest, const char* src, size_t n) {
  3090. return strncpy(dest, src, n);
  3091. }
  3092. // ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
  3093. // StrError() aren't needed on Windows CE at this time and thus not
  3094. // defined there.
  3095. #if !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
  3096. inline int ChDir(const char* dir) { return chdir(dir); }
  3097. #endif
  3098. inline FILE* FOpen(const char* path, const char* mode) {
  3099. return fopen(path, mode);
  3100. }
  3101. #if !GTEST_OS_WINDOWS_MOBILE
  3102. inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
  3103. return freopen(path, mode, stream);
  3104. }
  3105. inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
  3106. #endif
  3107. inline int FClose(FILE* fp) { return fclose(fp); }
  3108. #if !GTEST_OS_WINDOWS_MOBILE
  3109. inline int Read(int fd, void* buf, unsigned int count) {
  3110. return static_cast<int>(read(fd, buf, count));
  3111. }
  3112. inline int Write(int fd, const void* buf, unsigned int count) {
  3113. return static_cast<int>(write(fd, buf, count));
  3114. }
  3115. inline int Close(int fd) { return close(fd); }
  3116. inline const char* StrError(int errnum) { return strerror(errnum); }
  3117. #endif
  3118. inline const char* GetEnv(const char* name) {
  3119. #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE | GTEST_OS_WINDOWS_RT
  3120. // We are on Windows CE, which has no environment variables.
  3121. static_cast<void>(name); // To prevent 'unused argument' warning.
  3122. return NULL;
  3123. #elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
  3124. // Environment variables which we programmatically clear will be set to the
  3125. // empty string rather than unset (NULL). Handle that case.
  3126. const char* const env = getenv(name);
  3127. return (env != NULL && env[0] != '\0') ? env : NULL;
  3128. #else
  3129. return getenv(name);
  3130. #endif
  3131. }
  3132. GTEST_DISABLE_MSC_WARNINGS_POP_()
  3133. #if GTEST_OS_WINDOWS_MOBILE
  3134. // Windows CE has no C library. The abort() function is used in
  3135. // several places in Google Test. This implementation provides a reasonable
  3136. // imitation of standard behaviour.
  3137. void Abort();
  3138. #else
  3139. inline void Abort() { abort(); }
  3140. #endif // GTEST_OS_WINDOWS_MOBILE
  3141. } // namespace posix
  3142. // MSVC "deprecates" snprintf and issues warnings wherever it is used. In
  3143. // order to avoid these warnings, we need to use _snprintf or _snprintf_s on
  3144. // MSVC-based platforms. We map the GTEST_SNPRINTF_ macro to the appropriate
  3145. // function in order to achieve that. We use macro definition here because
  3146. // snprintf is a variadic function.
  3147. #if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
  3148. // MSVC 2005 and above support variadic macros.
  3149. # define GTEST_SNPRINTF_(buffer, size, format, ...) \
  3150. _snprintf_s(buffer, size, size, format, __VA_ARGS__)
  3151. #elif defined(_MSC_VER)
  3152. // Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't
  3153. // complain about _snprintf.
  3154. # define GTEST_SNPRINTF_ _snprintf
  3155. #else
  3156. # define GTEST_SNPRINTF_ snprintf
  3157. #endif
  3158. // The maximum number a BiggestInt can represent. This definition
  3159. // works no matter BiggestInt is represented in one's complement or
  3160. // two's complement.
  3161. //
  3162. // We cannot rely on numeric_limits in STL, as __int64 and long long
  3163. // are not part of standard C++ and numeric_limits doesn't need to be
  3164. // defined for them.
  3165. const BiggestInt kMaxBiggestInt =
  3166. ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
  3167. // This template class serves as a compile-time function from size to
  3168. // type. It maps a size in bytes to a primitive type with that
  3169. // size. e.g.
  3170. //
  3171. // TypeWithSize<4>::UInt
  3172. //
  3173. // is typedef-ed to be unsigned int (unsigned integer made up of 4
  3174. // bytes).
  3175. //
  3176. // Such functionality should belong to STL, but I cannot find it
  3177. // there.
  3178. //
  3179. // Google Test uses this class in the implementation of floating-point
  3180. // comparison.
  3181. //
  3182. // For now it only handles UInt (unsigned int) as that's all Google Test
  3183. // needs. Other types can be easily added in the future if need
  3184. // arises.
  3185. template <size_t size>
  3186. class TypeWithSize {
  3187. public:
  3188. // This prevents the user from using TypeWithSize<N> with incorrect
  3189. // values of N.
  3190. typedef void UInt;
  3191. };
  3192. // The specialization for size 4.
  3193. template <>
  3194. class TypeWithSize<4> {
  3195. public:
  3196. // unsigned int has size 4 in both gcc and MSVC.
  3197. //
  3198. // As base/basictypes.h doesn't compile on Windows, we cannot use
  3199. // uint32, uint64, and etc here.
  3200. typedef int Int;
  3201. typedef unsigned int UInt;
  3202. };
  3203. // The specialization for size 8.
  3204. template <>
  3205. class TypeWithSize<8> {
  3206. public:
  3207. #if GTEST_OS_WINDOWS
  3208. typedef __int64 Int;
  3209. typedef unsigned __int64 UInt;
  3210. #else
  3211. typedef long long Int; // NOLINT
  3212. typedef unsigned long long UInt; // NOLINT
  3213. #endif // GTEST_OS_WINDOWS
  3214. };
  3215. // Integer types of known sizes.
  3216. typedef TypeWithSize<4>::Int Int32;
  3217. typedef TypeWithSize<4>::UInt UInt32;
  3218. typedef TypeWithSize<8>::Int Int64;
  3219. typedef TypeWithSize<8>::UInt UInt64;
  3220. typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds.
  3221. // Utilities for command line flags and environment variables.
  3222. // Macro for referencing flags.
  3223. #if !defined(GTEST_FLAG)
  3224. # define GTEST_FLAG(name) FLAGS_gtest_##name
  3225. #endif // !defined(GTEST_FLAG)
  3226. #if !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)
  3227. # define GTEST_USE_OWN_FLAGFILE_FLAG_ 1
  3228. #endif // !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)
  3229. #if !defined(GTEST_DECLARE_bool_)
  3230. # define GTEST_FLAG_SAVER_ ::testing::internal::GTestFlagSaver
  3231. // Macros for declaring flags.
  3232. # define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
  3233. # define GTEST_DECLARE_int32_(name) \
  3234. GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
  3235. #define GTEST_DECLARE_string_(name) \
  3236. GTEST_API_ extern ::std::string GTEST_FLAG(name)
  3237. // Macros for defining flags.
  3238. #define GTEST_DEFINE_bool_(name, default_val, doc) \
  3239. GTEST_API_ bool GTEST_FLAG(name) = (default_val)
  3240. #define GTEST_DEFINE_int32_(name, default_val, doc) \
  3241. GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
  3242. #define GTEST_DEFINE_string_(name, default_val, doc) \
  3243. GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)
  3244. #endif // !defined(GTEST_DECLARE_bool_)
  3245. // Thread annotations
  3246. #if !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)
  3247. # define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
  3248. # define GTEST_LOCK_EXCLUDED_(locks)
  3249. #endif // !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)
  3250. // Parses 'str' for a 32-bit signed integer. If successful, writes the result
  3251. // to *value and returns true; otherwise leaves *value unchanged and returns
  3252. // false.
  3253. // TODO(chandlerc): Find a better way to refactor flag and environment parsing
  3254. // out of both gtest-port.cc and gtest.cc to avoid exporting this utility
  3255. // function.
  3256. bool ParseInt32(const Message& src_text, const char* str, Int32* value);
  3257. // Parses a bool/Int32/string from the environment variable
  3258. // corresponding to the given Google Test flag.
  3259. bool BoolFromGTestEnv(const char* flag, bool default_val);
  3260. GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
  3261. std::string StringFromGTestEnv(const char* flag, const char* default_val);
  3262. } // namespace internal
  3263. } // namespace testing
  3264. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
  3265. #if GTEST_OS_LINUX
  3266. # include <stdlib.h>
  3267. # include <sys/types.h>
  3268. # include <sys/wait.h>
  3269. # include <unistd.h>
  3270. #endif // GTEST_OS_LINUX
  3271. #if GTEST_HAS_EXCEPTIONS
  3272. # include <stdexcept>
  3273. #endif
  3274. #include <ctype.h>
  3275. #include <float.h>
  3276. #include <string.h>
  3277. #include <iomanip>
  3278. #include <limits>
  3279. #include <map>
  3280. #include <set>
  3281. #include <string>
  3282. #include <vector>
  3283. // Copyright 2005, Google Inc.
  3284. // All rights reserved.
  3285. //
  3286. // Redistribution and use in source and binary forms, with or without
  3287. // modification, are permitted provided that the following conditions are
  3288. // met:
  3289. //
  3290. // * Redistributions of source code must retain the above copyright
  3291. // notice, this list of conditions and the following disclaimer.
  3292. // * Redistributions in binary form must reproduce the above
  3293. // copyright notice, this list of conditions and the following disclaimer
  3294. // in the documentation and/or other materials provided with the
  3295. // distribution.
  3296. // * Neither the name of Google Inc. nor the names of its
  3297. // contributors may be used to endorse or promote products derived from
  3298. // this software without specific prior written permission.
  3299. //
  3300. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  3301. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  3302. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  3303. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  3304. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  3305. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  3306. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  3307. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  3308. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3309. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  3310. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3311. //
  3312. // Author: wan@google.com (Zhanyong Wan)
  3313. //
  3314. // The Google C++ Testing Framework (Google Test)
  3315. //
  3316. // This header file defines the Message class.
  3317. //
  3318. // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
  3319. // leave some internal implementation details in this header file.
  3320. // They are clearly marked by comments like this:
  3321. //
  3322. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  3323. //
  3324. // Such code is NOT meant to be used by a user directly, and is subject
  3325. // to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
  3326. // program!
  3327. #ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
  3328. #define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
  3329. #include <limits>
  3330. // Ensures that there is at least one operator<< in the global namespace.
  3331. // See Message& operator<<(...) below for why.
  3332. void operator<<(const testing::internal::Secret&, int);
  3333. namespace testing {
  3334. // The Message class works like an ostream repeater.
  3335. //
  3336. // Typical usage:
  3337. //
  3338. // 1. You stream a bunch of values to a Message object.
  3339. // It will remember the text in a stringstream.
  3340. // 2. Then you stream the Message object to an ostream.
  3341. // This causes the text in the Message to be streamed
  3342. // to the ostream.
  3343. //
  3344. // For example;
  3345. //
  3346. // testing::Message foo;
  3347. // foo << 1 << " != " << 2;
  3348. // std::cout << foo;
  3349. //
  3350. // will print "1 != 2".
  3351. //
  3352. // Message is not intended to be inherited from. In particular, its
  3353. // destructor is not virtual.
  3354. //
  3355. // Note that stringstream behaves differently in gcc and in MSVC. You
  3356. // can stream a NULL char pointer to it in the former, but not in the
  3357. // latter (it causes an access violation if you do). The Message
  3358. // class hides this difference by treating a NULL char pointer as
  3359. // "(null)".
  3360. class GTEST_API_ Message {
  3361. private:
  3362. // The type of basic IO manipulators (endl, ends, and flush) for
  3363. // narrow streams.
  3364. typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
  3365. public:
  3366. // Constructs an empty Message.
  3367. Message();
  3368. // Copy constructor.
  3369. Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT
  3370. *ss_ << msg.GetString();
  3371. }
  3372. // Constructs a Message from a C-string.
  3373. explicit Message(const char* str) : ss_(new ::std::stringstream) {
  3374. *ss_ << str;
  3375. }
  3376. #if GTEST_OS_SYMBIAN
  3377. // Streams a value (either a pointer or not) to this object.
  3378. template <typename T>
  3379. inline Message& operator <<(const T& value) {
  3380. StreamHelper(typename internal::is_pointer<T>::type(), value);
  3381. return *this;
  3382. }
  3383. #else
  3384. // Streams a non-pointer value to this object.
  3385. template <typename T>
  3386. inline Message& operator <<(const T& val) {
  3387. // Some libraries overload << for STL containers. These
  3388. // overloads are defined in the global namespace instead of ::std.
  3389. //
  3390. // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
  3391. // overloads are visible in either the std namespace or the global
  3392. // namespace, but not other namespaces, including the testing
  3393. // namespace which Google Test's Message class is in.
  3394. //
  3395. // To allow STL containers (and other types that has a << operator
  3396. // defined in the global namespace) to be used in Google Test
  3397. // assertions, testing::Message must access the custom << operator
  3398. // from the global namespace. With this using declaration,
  3399. // overloads of << defined in the global namespace and those
  3400. // visible via Koenig lookup are both exposed in this function.
  3401. using ::operator <<;
  3402. *ss_ << val;
  3403. return *this;
  3404. }
  3405. // Streams a pointer value to this object.
  3406. //
  3407. // This function is an overload of the previous one. When you
  3408. // stream a pointer to a Message, this definition will be used as it
  3409. // is more specialized. (The C++ Standard, section
  3410. // [temp.func.order].) If you stream a non-pointer, then the
  3411. // previous definition will be used.
  3412. //
  3413. // The reason for this overload is that streaming a NULL pointer to
  3414. // ostream is undefined behavior. Depending on the compiler, you
  3415. // may get "0", "(nil)", "(null)", or an access violation. To
  3416. // ensure consistent result across compilers, we always treat NULL
  3417. // as "(null)".
  3418. template <typename T>
  3419. inline Message& operator <<(T* const& pointer) { // NOLINT
  3420. if (pointer == NULL) {
  3421. *ss_ << "(null)";
  3422. } else {
  3423. *ss_ << pointer;
  3424. }
  3425. return *this;
  3426. }
  3427. #endif // GTEST_OS_SYMBIAN
  3428. // Since the basic IO manipulators are overloaded for both narrow
  3429. // and wide streams, we have to provide this specialized definition
  3430. // of operator <<, even though its body is the same as the
  3431. // templatized version above. Without this definition, streaming
  3432. // endl or other basic IO manipulators to Message will confuse the
  3433. // compiler.
  3434. Message& operator <<(BasicNarrowIoManip val) {
  3435. *ss_ << val;
  3436. return *this;
  3437. }
  3438. // Instead of 1/0, we want to see true/false for bool values.
  3439. Message& operator <<(bool b) {
  3440. return *this << (b ? "true" : "false");
  3441. }
  3442. // These two overloads allow streaming a wide C string to a Message
  3443. // using the UTF-8 encoding.
  3444. Message& operator <<(const wchar_t* wide_c_str);
  3445. Message& operator <<(wchar_t* wide_c_str);
  3446. #if GTEST_HAS_STD_WSTRING
  3447. // Converts the given wide string to a narrow string using the UTF-8
  3448. // encoding, and streams the result to this Message object.
  3449. Message& operator <<(const ::std::wstring& wstr);
  3450. #endif // GTEST_HAS_STD_WSTRING
  3451. #if GTEST_HAS_GLOBAL_WSTRING
  3452. // Converts the given wide string to a narrow string using the UTF-8
  3453. // encoding, and streams the result to this Message object.
  3454. Message& operator <<(const ::wstring& wstr);
  3455. #endif // GTEST_HAS_GLOBAL_WSTRING
  3456. // Gets the text streamed to this object so far as an std::string.
  3457. // Each '\0' character in the buffer is replaced with "\\0".
  3458. //
  3459. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  3460. std::string GetString() const;
  3461. private:
  3462. #if GTEST_OS_SYMBIAN
  3463. // These are needed as the Nokia Symbian Compiler cannot decide between
  3464. // const T& and const T* in a function template. The Nokia compiler _can_
  3465. // decide between class template specializations for T and T*, so a
  3466. // tr1::type_traits-like is_pointer works, and we can overload on that.
  3467. template <typename T>
  3468. inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) {
  3469. if (pointer == NULL) {
  3470. *ss_ << "(null)";
  3471. } else {
  3472. *ss_ << pointer;
  3473. }
  3474. }
  3475. template <typename T>
  3476. inline void StreamHelper(internal::false_type /*is_pointer*/,
  3477. const T& value) {
  3478. // See the comments in Message& operator <<(const T&) above for why
  3479. // we need this using statement.
  3480. using ::operator <<;
  3481. *ss_ << value;
  3482. }
  3483. #endif // GTEST_OS_SYMBIAN
  3484. // We'll hold the text streamed to this object here.
  3485. const internal::scoped_ptr< ::std::stringstream> ss_;
  3486. // We declare (but don't implement) this to prevent the compiler
  3487. // from implementing the assignment operator.
  3488. void operator=(const Message&);
  3489. };
  3490. // Streams a Message to an ostream.
  3491. inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
  3492. return os << sb.GetString();
  3493. }
  3494. namespace internal {
  3495. // Converts a streamable value to an std::string. A NULL pointer is
  3496. // converted to "(null)". When the input value is a ::string,
  3497. // ::std::string, ::wstring, or ::std::wstring object, each NUL
  3498. // character in it is replaced with "\\0".
  3499. template <typename T>
  3500. std::string StreamableToString(const T& streamable) {
  3501. return (Message() << streamable).GetString();
  3502. }
  3503. } // namespace internal
  3504. } // namespace testing
  3505. #endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
  3506. // Copyright 2005, Google Inc.
  3507. // All rights reserved.
  3508. //
  3509. // Redistribution and use in source and binary forms, with or without
  3510. // modification, are permitted provided that the following conditions are
  3511. // met:
  3512. //
  3513. // * Redistributions of source code must retain the above copyright
  3514. // notice, this list of conditions and the following disclaimer.
  3515. // * Redistributions in binary form must reproduce the above
  3516. // copyright notice, this list of conditions and the following disclaimer
  3517. // in the documentation and/or other materials provided with the
  3518. // distribution.
  3519. // * Neither the name of Google Inc. nor the names of its
  3520. // contributors may be used to endorse or promote products derived from
  3521. // this software without specific prior written permission.
  3522. //
  3523. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  3524. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  3525. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  3526. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  3527. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  3528. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  3529. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  3530. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  3531. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3532. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  3533. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3534. //
  3535. // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
  3536. //
  3537. // The Google C++ Testing Framework (Google Test)
  3538. //
  3539. // This header file declares the String class and functions used internally by
  3540. // Google Test. They are subject to change without notice. They should not used
  3541. // by code external to Google Test.
  3542. //
  3543. // This header file is #included by <gtest/internal/gtest-internal.h>.
  3544. // It should not be #included by other files.
  3545. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
  3546. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
  3547. #ifdef __BORLANDC__
  3548. // string.h is not guaranteed to provide strcpy on C++ Builder.
  3549. # include <mem.h>
  3550. #endif
  3551. #include <string.h>
  3552. #include <string>
  3553. namespace testing {
  3554. namespace internal {
  3555. // String - an abstract class holding static string utilities.
  3556. class GTEST_API_ String {
  3557. public:
  3558. // Static utility methods
  3559. // Clones a 0-terminated C string, allocating memory using new. The
  3560. // caller is responsible for deleting the return value using
  3561. // delete[]. Returns the cloned string, or NULL if the input is
  3562. // NULL.
  3563. //
  3564. // This is different from strdup() in string.h, which allocates
  3565. // memory using malloc().
  3566. static const char* CloneCString(const char* c_str);
  3567. #if GTEST_OS_WINDOWS_MOBILE
  3568. // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
  3569. // able to pass strings to Win32 APIs on CE we need to convert them
  3570. // to 'Unicode', UTF-16.
  3571. // Creates a UTF-16 wide string from the given ANSI string, allocating
  3572. // memory using new. The caller is responsible for deleting the return
  3573. // value using delete[]. Returns the wide string, or NULL if the
  3574. // input is NULL.
  3575. //
  3576. // The wide string is created using the ANSI codepage (CP_ACP) to
  3577. // match the behaviour of the ANSI versions of Win32 calls and the
  3578. // C runtime.
  3579. static LPCWSTR AnsiToUtf16(const char* c_str);
  3580. // Creates an ANSI string from the given wide string, allocating
  3581. // memory using new. The caller is responsible for deleting the return
  3582. // value using delete[]. Returns the ANSI string, or NULL if the
  3583. // input is NULL.
  3584. //
  3585. // The returned string is created using the ANSI codepage (CP_ACP) to
  3586. // match the behaviour of the ANSI versions of Win32 calls and the
  3587. // C runtime.
  3588. static const char* Utf16ToAnsi(LPCWSTR utf16_str);
  3589. #endif
  3590. // Compares two C strings. Returns true iff they have the same content.
  3591. //
  3592. // Unlike strcmp(), this function can handle NULL argument(s). A
  3593. // NULL C string is considered different to any non-NULL C string,
  3594. // including the empty string.
  3595. static bool CStringEquals(const char* lhs, const char* rhs);
  3596. // Converts a wide C string to a String using the UTF-8 encoding.
  3597. // NULL will be converted to "(null)". If an error occurred during
  3598. // the conversion, "(failed to convert from wide string)" is
  3599. // returned.
  3600. static std::string ShowWideCString(const wchar_t* wide_c_str);
  3601. // Compares two wide C strings. Returns true iff they have the same
  3602. // content.
  3603. //
  3604. // Unlike wcscmp(), this function can handle NULL argument(s). A
  3605. // NULL C string is considered different to any non-NULL C string,
  3606. // including the empty string.
  3607. static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
  3608. // Compares two C strings, ignoring case. Returns true iff they
  3609. // have the same content.
  3610. //
  3611. // Unlike strcasecmp(), this function can handle NULL argument(s).
  3612. // A NULL C string is considered different to any non-NULL C string,
  3613. // including the empty string.
  3614. static bool CaseInsensitiveCStringEquals(const char* lhs,
  3615. const char* rhs);
  3616. // Compares two wide C strings, ignoring case. Returns true iff they
  3617. // have the same content.
  3618. //
  3619. // Unlike wcscasecmp(), this function can handle NULL argument(s).
  3620. // A NULL C string is considered different to any non-NULL wide C string,
  3621. // including the empty string.
  3622. // NB: The implementations on different platforms slightly differ.
  3623. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
  3624. // environment variable. On GNU platform this method uses wcscasecmp
  3625. // which compares according to LC_CTYPE category of the current locale.
  3626. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
  3627. // current locale.
  3628. static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
  3629. const wchar_t* rhs);
  3630. // Returns true iff the given string ends with the given suffix, ignoring
  3631. // case. Any string is considered to end with an empty suffix.
  3632. static bool EndsWithCaseInsensitive(
  3633. const std::string& str, const std::string& suffix);
  3634. // Formats an int value as "%02d".
  3635. static std::string FormatIntWidth2(int value); // "%02d" for width == 2
  3636. // Formats an int value as "%X".
  3637. static std::string FormatHexInt(int value);
  3638. // Formats a byte as "%02X".
  3639. static std::string FormatByte(unsigned char value);
  3640. private:
  3641. String(); // Not meant to be instantiated.
  3642. }; // class String
  3643. // Gets the content of the stringstream's buffer as an std::string. Each '\0'
  3644. // character in the buffer is replaced with "\\0".
  3645. GTEST_API_ std::string StringStreamToString(::std::stringstream* stream);
  3646. } // namespace internal
  3647. } // namespace testing
  3648. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
  3649. // Copyright 2008, Google Inc.
  3650. // All rights reserved.
  3651. //
  3652. // Redistribution and use in source and binary forms, with or without
  3653. // modification, are permitted provided that the following conditions are
  3654. // met:
  3655. //
  3656. // * Redistributions of source code must retain the above copyright
  3657. // notice, this list of conditions and the following disclaimer.
  3658. // * Redistributions in binary form must reproduce the above
  3659. // copyright notice, this list of conditions and the following disclaimer
  3660. // in the documentation and/or other materials provided with the
  3661. // distribution.
  3662. // * Neither the name of Google Inc. nor the names of its
  3663. // contributors may be used to endorse or promote products derived from
  3664. // this software without specific prior written permission.
  3665. //
  3666. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  3667. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  3668. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  3669. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  3670. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  3671. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  3672. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  3673. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  3674. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3675. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  3676. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3677. //
  3678. // Author: keith.ray@gmail.com (Keith Ray)
  3679. //
  3680. // Google Test filepath utilities
  3681. //
  3682. // This header file declares classes and functions used internally by
  3683. // Google Test. They are subject to change without notice.
  3684. //
  3685. // This file is #included in <gtest/internal/gtest-internal.h>.
  3686. // Do not include this header file separately!
  3687. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
  3688. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
  3689. namespace testing {
  3690. namespace internal {
  3691. // FilePath - a class for file and directory pathname manipulation which
  3692. // handles platform-specific conventions (like the pathname separator).
  3693. // Used for helper functions for naming files in a directory for xml output.
  3694. // Except for Set methods, all methods are const or static, which provides an
  3695. // "immutable value object" -- useful for peace of mind.
  3696. // A FilePath with a value ending in a path separator ("like/this/") represents
  3697. // a directory, otherwise it is assumed to represent a file. In either case,
  3698. // it may or may not represent an actual file or directory in the file system.
  3699. // Names are NOT checked for syntax correctness -- no checking for illegal
  3700. // characters, malformed paths, etc.
  3701. class GTEST_API_ FilePath {
  3702. public:
  3703. FilePath() : pathname_("") { }
  3704. FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
  3705. explicit FilePath(const std::string& pathname) : pathname_(pathname) {
  3706. Normalize();
  3707. }
  3708. FilePath& operator=(const FilePath& rhs) {
  3709. Set(rhs);
  3710. return *this;
  3711. }
  3712. void Set(const FilePath& rhs) {
  3713. pathname_ = rhs.pathname_;
  3714. }
  3715. const std::string& string() const { return pathname_; }
  3716. const char* c_str() const { return pathname_.c_str(); }
  3717. // Returns the current working directory, or "" if unsuccessful.
  3718. static FilePath GetCurrentDir();
  3719. // Given directory = "dir", base_name = "test", number = 0,
  3720. // extension = "xml", returns "dir/test.xml". If number is greater
  3721. // than zero (e.g., 12), returns "dir/test_12.xml".
  3722. // On Windows platform, uses \ as the separator rather than /.
  3723. static FilePath MakeFileName(const FilePath& directory,
  3724. const FilePath& base_name,
  3725. int number,
  3726. const char* extension);
  3727. // Given directory = "dir", relative_path = "test.xml",
  3728. // returns "dir/test.xml".
  3729. // On Windows, uses \ as the separator rather than /.
  3730. static FilePath ConcatPaths(const FilePath& directory,
  3731. const FilePath& relative_path);
  3732. // Returns a pathname for a file that does not currently exist. The pathname
  3733. // will be directory/base_name.extension or
  3734. // directory/base_name_<number>.extension if directory/base_name.extension
  3735. // already exists. The number will be incremented until a pathname is found
  3736. // that does not already exist.
  3737. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
  3738. // There could be a race condition if two or more processes are calling this
  3739. // function at the same time -- they could both pick the same filename.
  3740. static FilePath GenerateUniqueFileName(const FilePath& directory,
  3741. const FilePath& base_name,
  3742. const char* extension);
  3743. // Returns true iff the path is "".
  3744. bool IsEmpty() const { return pathname_.empty(); }
  3745. // If input name has a trailing separator character, removes it and returns
  3746. // the name, otherwise return the name string unmodified.
  3747. // On Windows platform, uses \ as the separator, other platforms use /.
  3748. FilePath RemoveTrailingPathSeparator() const;
  3749. // Returns a copy of the FilePath with the directory part removed.
  3750. // Example: FilePath("path/to/file").RemoveDirectoryName() returns
  3751. // FilePath("file"). If there is no directory part ("just_a_file"), it returns
  3752. // the FilePath unmodified. If there is no file part ("just_a_dir/") it
  3753. // returns an empty FilePath ("").
  3754. // On Windows platform, '\' is the path separator, otherwise it is '/'.
  3755. FilePath RemoveDirectoryName() const;
  3756. // RemoveFileName returns the directory path with the filename removed.
  3757. // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
  3758. // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
  3759. // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
  3760. // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
  3761. // On Windows platform, '\' is the path separator, otherwise it is '/'.
  3762. FilePath RemoveFileName() const;
  3763. // Returns a copy of the FilePath with the case-insensitive extension removed.
  3764. // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
  3765. // FilePath("dir/file"). If a case-insensitive extension is not
  3766. // found, returns a copy of the original FilePath.
  3767. FilePath RemoveExtension(const char* extension) const;
  3768. // Creates directories so that path exists. Returns true if successful or if
  3769. // the directories already exist; returns false if unable to create
  3770. // directories for any reason. Will also return false if the FilePath does
  3771. // not represent a directory (that is, it doesn't end with a path separator).
  3772. bool CreateDirectoriesRecursively() const;
  3773. // Create the directory so that path exists. Returns true if successful or
  3774. // if the directory already exists; returns false if unable to create the
  3775. // directory for any reason, including if the parent directory does not
  3776. // exist. Not named "CreateDirectory" because that's a macro on Windows.
  3777. bool CreateFolder() const;
  3778. // Returns true if FilePath describes something in the file-system,
  3779. // either a file, directory, or whatever, and that something exists.
  3780. bool FileOrDirectoryExists() const;
  3781. // Returns true if pathname describes a directory in the file-system
  3782. // that exists.
  3783. bool DirectoryExists() const;
  3784. // Returns true if FilePath ends with a path separator, which indicates that
  3785. // it is intended to represent a directory. Returns false otherwise.
  3786. // This does NOT check that a directory (or file) actually exists.
  3787. bool IsDirectory() const;
  3788. // Returns true if pathname describes a root directory. (Windows has one
  3789. // root directory per disk drive.)
  3790. bool IsRootDirectory() const;
  3791. // Returns true if pathname describes an absolute path.
  3792. bool IsAbsolutePath() const;
  3793. private:
  3794. // Replaces multiple consecutive separators with a single separator.
  3795. // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
  3796. // redundancies that might be in a pathname involving "." or "..".
  3797. //
  3798. // A pathname with multiple consecutive separators may occur either through
  3799. // user error or as a result of some scripts or APIs that generate a pathname
  3800. // with a trailing separator. On other platforms the same API or script
  3801. // may NOT generate a pathname with a trailing "/". Then elsewhere that
  3802. // pathname may have another "/" and pathname components added to it,
  3803. // without checking for the separator already being there.
  3804. // The script language and operating system may allow paths like "foo//bar"
  3805. // but some of the functions in FilePath will not handle that correctly. In
  3806. // particular, RemoveTrailingPathSeparator() only removes one separator, and
  3807. // it is called in CreateDirectoriesRecursively() assuming that it will change
  3808. // a pathname from directory syntax (trailing separator) to filename syntax.
  3809. //
  3810. // On Windows this method also replaces the alternate path separator '/' with
  3811. // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
  3812. // "bar\\foo".
  3813. void Normalize();
  3814. // Returns a pointer to the last occurence of a valid path separator in
  3815. // the FilePath. On Windows, for example, both '/' and '\' are valid path
  3816. // separators. Returns NULL if no path separator was found.
  3817. const char* FindLastPathSeparator() const;
  3818. std::string pathname_;
  3819. }; // class FilePath
  3820. } // namespace internal
  3821. } // namespace testing
  3822. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
  3823. // This file was GENERATED by command:
  3824. // pump.py gtest-type-util.h.pump
  3825. // DO NOT EDIT BY HAND!!!
  3826. // Copyright 2008 Google Inc.
  3827. // All Rights Reserved.
  3828. //
  3829. // Redistribution and use in source and binary forms, with or without
  3830. // modification, are permitted provided that the following conditions are
  3831. // met:
  3832. //
  3833. // * Redistributions of source code must retain the above copyright
  3834. // notice, this list of conditions and the following disclaimer.
  3835. // * Redistributions in binary form must reproduce the above
  3836. // copyright notice, this list of conditions and the following disclaimer
  3837. // in the documentation and/or other materials provided with the
  3838. // distribution.
  3839. // * Neither the name of Google Inc. nor the names of its
  3840. // contributors may be used to endorse or promote products derived from
  3841. // this software without specific prior written permission.
  3842. //
  3843. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  3844. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  3845. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  3846. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  3847. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  3848. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  3849. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  3850. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  3851. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3852. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  3853. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3854. //
  3855. // Author: wan@google.com (Zhanyong Wan)
  3856. // Type utilities needed for implementing typed and type-parameterized
  3857. // tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
  3858. //
  3859. // Currently we support at most 50 types in a list, and at most 50
  3860. // type-parameterized tests in one type-parameterized test case.
  3861. // Please contact googletestframework@googlegroups.com if you need
  3862. // more.
  3863. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
  3864. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
  3865. // #ifdef __GNUC__ is too general here. It is possible to use gcc without using
  3866. // libstdc++ (which is where cxxabi.h comes from).
  3867. # if GTEST_HAS_CXXABI_H_
  3868. # include <cxxabi.h>
  3869. # elif defined(__HP_aCC)
  3870. # include <acxx_demangle.h>
  3871. # endif // GTEST_HASH_CXXABI_H_
  3872. namespace testing {
  3873. namespace internal {
  3874. // GetTypeName<T>() returns a human-readable name of type T.
  3875. // NB: This function is also used in Google Mock, so don't move it inside of
  3876. // the typed-test-only section below.
  3877. template <typename T>
  3878. std::string GetTypeName() {
  3879. # if GTEST_HAS_RTTI
  3880. const char* const name = typeid(T).name();
  3881. # if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
  3882. int status = 0;
  3883. // gcc's implementation of typeid(T).name() mangles the type name,
  3884. // so we have to demangle it.
  3885. # if GTEST_HAS_CXXABI_H_
  3886. using abi::__cxa_demangle;
  3887. # endif // GTEST_HAS_CXXABI_H_
  3888. char* const readable_name = __cxa_demangle(name, 0, 0, &status);
  3889. const std::string name_str(status == 0 ? readable_name : name);
  3890. free(readable_name);
  3891. return name_str;
  3892. # else
  3893. return name;
  3894. # endif // GTEST_HAS_CXXABI_H_ || __HP_aCC
  3895. # else
  3896. return "<type>";
  3897. # endif // GTEST_HAS_RTTI
  3898. }
  3899. #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  3900. // AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
  3901. // type. This can be used as a compile-time assertion to ensure that
  3902. // two types are equal.
  3903. template <typename T1, typename T2>
  3904. struct AssertTypeEq;
  3905. template <typename T>
  3906. struct AssertTypeEq<T, T> {
  3907. typedef bool type;
  3908. };
  3909. // A unique type used as the default value for the arguments of class
  3910. // template Types. This allows us to simulate variadic templates
  3911. // (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
  3912. // support directly.
  3913. struct None {};
  3914. // The following family of struct and struct templates are used to
  3915. // represent type lists. In particular, TypesN<T1, T2, ..., TN>
  3916. // represents a type list with N types (T1, T2, ..., and TN) in it.
  3917. // Except for Types0, every struct in the family has two member types:
  3918. // Head for the first type in the list, and Tail for the rest of the
  3919. // list.
  3920. // The empty type list.
  3921. struct Types0 {};
  3922. // Type lists of length 1, 2, 3, and so on.
  3923. template <typename T1>
  3924. struct Types1 {
  3925. typedef T1 Head;
  3926. typedef Types0 Tail;
  3927. };
  3928. template <typename T1, typename T2>
  3929. struct Types2 {
  3930. typedef T1 Head;
  3931. typedef Types1<T2> Tail;
  3932. };
  3933. template <typename T1, typename T2, typename T3>
  3934. struct Types3 {
  3935. typedef T1 Head;
  3936. typedef Types2<T2, T3> Tail;
  3937. };
  3938. template <typename T1, typename T2, typename T3, typename T4>
  3939. struct Types4 {
  3940. typedef T1 Head;
  3941. typedef Types3<T2, T3, T4> Tail;
  3942. };
  3943. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  3944. struct Types5 {
  3945. typedef T1 Head;
  3946. typedef Types4<T2, T3, T4, T5> Tail;
  3947. };
  3948. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3949. typename T6>
  3950. struct Types6 {
  3951. typedef T1 Head;
  3952. typedef Types5<T2, T3, T4, T5, T6> Tail;
  3953. };
  3954. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3955. typename T6, typename T7>
  3956. struct Types7 {
  3957. typedef T1 Head;
  3958. typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
  3959. };
  3960. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3961. typename T6, typename T7, typename T8>
  3962. struct Types8 {
  3963. typedef T1 Head;
  3964. typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
  3965. };
  3966. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3967. typename T6, typename T7, typename T8, typename T9>
  3968. struct Types9 {
  3969. typedef T1 Head;
  3970. typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
  3971. };
  3972. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3973. typename T6, typename T7, typename T8, typename T9, typename T10>
  3974. struct Types10 {
  3975. typedef T1 Head;
  3976. typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
  3977. };
  3978. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3979. typename T6, typename T7, typename T8, typename T9, typename T10,
  3980. typename T11>
  3981. struct Types11 {
  3982. typedef T1 Head;
  3983. typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
  3984. };
  3985. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3986. typename T6, typename T7, typename T8, typename T9, typename T10,
  3987. typename T11, typename T12>
  3988. struct Types12 {
  3989. typedef T1 Head;
  3990. typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
  3991. };
  3992. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3993. typename T6, typename T7, typename T8, typename T9, typename T10,
  3994. typename T11, typename T12, typename T13>
  3995. struct Types13 {
  3996. typedef T1 Head;
  3997. typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
  3998. };
  3999. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4000. typename T6, typename T7, typename T8, typename T9, typename T10,
  4001. typename T11, typename T12, typename T13, typename T14>
  4002. struct Types14 {
  4003. typedef T1 Head;
  4004. typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
  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, typename T12, typename T13, typename T14, typename T15>
  4009. struct Types15 {
  4010. typedef T1 Head;
  4011. typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4012. T15> Tail;
  4013. };
  4014. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4015. typename T6, typename T7, typename T8, typename T9, typename T10,
  4016. typename T11, typename T12, typename T13, typename T14, typename T15,
  4017. typename T16>
  4018. struct Types16 {
  4019. typedef T1 Head;
  4020. typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4021. T16> Tail;
  4022. };
  4023. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4024. typename T6, typename T7, typename T8, typename T9, typename T10,
  4025. typename T11, typename T12, typename T13, typename T14, typename T15,
  4026. typename T16, typename T17>
  4027. struct Types17 {
  4028. typedef T1 Head;
  4029. typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4030. T16, T17> Tail;
  4031. };
  4032. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4033. typename T6, typename T7, typename T8, typename T9, typename T10,
  4034. typename T11, typename T12, typename T13, typename T14, typename T15,
  4035. typename T16, typename T17, typename T18>
  4036. struct Types18 {
  4037. typedef T1 Head;
  4038. typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4039. T16, T17, T18> Tail;
  4040. };
  4041. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4042. typename T6, typename T7, typename T8, typename T9, typename T10,
  4043. typename T11, typename T12, typename T13, typename T14, typename T15,
  4044. typename T16, typename T17, typename T18, typename T19>
  4045. struct Types19 {
  4046. typedef T1 Head;
  4047. typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4048. T16, T17, T18, T19> Tail;
  4049. };
  4050. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4051. typename T6, typename T7, typename T8, typename T9, typename T10,
  4052. typename T11, typename T12, typename T13, typename T14, typename T15,
  4053. typename T16, typename T17, typename T18, typename T19, typename T20>
  4054. struct Types20 {
  4055. typedef T1 Head;
  4056. typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4057. T16, T17, T18, T19, T20> Tail;
  4058. };
  4059. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4060. typename T6, typename T7, typename T8, typename T9, typename T10,
  4061. typename T11, typename T12, typename T13, typename T14, typename T15,
  4062. typename T16, typename T17, typename T18, typename T19, typename T20,
  4063. typename T21>
  4064. struct Types21 {
  4065. typedef T1 Head;
  4066. typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4067. T16, T17, T18, T19, T20, T21> Tail;
  4068. };
  4069. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4070. typename T6, typename T7, typename T8, typename T9, typename T10,
  4071. typename T11, typename T12, typename T13, typename T14, typename T15,
  4072. typename T16, typename T17, typename T18, typename T19, typename T20,
  4073. typename T21, typename T22>
  4074. struct Types22 {
  4075. typedef T1 Head;
  4076. typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4077. T16, T17, T18, T19, T20, T21, T22> Tail;
  4078. };
  4079. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4080. typename T6, typename T7, typename T8, typename T9, typename T10,
  4081. typename T11, typename T12, typename T13, typename T14, typename T15,
  4082. typename T16, typename T17, typename T18, typename T19, typename T20,
  4083. typename T21, typename T22, typename T23>
  4084. struct Types23 {
  4085. typedef T1 Head;
  4086. typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4087. T16, T17, T18, T19, T20, T21, T22, T23> Tail;
  4088. };
  4089. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4090. typename T6, typename T7, typename T8, typename T9, typename T10,
  4091. typename T11, typename T12, typename T13, typename T14, typename T15,
  4092. typename T16, typename T17, typename T18, typename T19, typename T20,
  4093. typename T21, typename T22, typename T23, typename T24>
  4094. struct Types24 {
  4095. typedef T1 Head;
  4096. typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4097. T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
  4098. };
  4099. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4100. typename T6, typename T7, typename T8, typename T9, typename T10,
  4101. typename T11, typename T12, typename T13, typename T14, typename T15,
  4102. typename T16, typename T17, typename T18, typename T19, typename T20,
  4103. typename T21, typename T22, typename T23, typename T24, typename T25>
  4104. struct Types25 {
  4105. typedef T1 Head;
  4106. typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4107. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
  4108. };
  4109. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4110. typename T6, typename T7, typename T8, typename T9, typename T10,
  4111. typename T11, typename T12, typename T13, typename T14, typename T15,
  4112. typename T16, typename T17, typename T18, typename T19, typename T20,
  4113. typename T21, typename T22, typename T23, typename T24, typename T25,
  4114. typename T26>
  4115. struct Types26 {
  4116. typedef T1 Head;
  4117. typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4118. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
  4119. };
  4120. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4121. typename T6, typename T7, typename T8, typename T9, typename T10,
  4122. typename T11, typename T12, typename T13, typename T14, typename T15,
  4123. typename T16, typename T17, typename T18, typename T19, typename T20,
  4124. typename T21, typename T22, typename T23, typename T24, typename T25,
  4125. typename T26, typename T27>
  4126. struct Types27 {
  4127. typedef T1 Head;
  4128. typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4129. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
  4130. };
  4131. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4132. typename T6, typename T7, typename T8, typename T9, typename T10,
  4133. typename T11, typename T12, typename T13, typename T14, typename T15,
  4134. typename T16, typename T17, typename T18, typename T19, typename T20,
  4135. typename T21, typename T22, typename T23, typename T24, typename T25,
  4136. typename T26, typename T27, typename T28>
  4137. struct Types28 {
  4138. typedef T1 Head;
  4139. typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4140. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
  4141. };
  4142. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4143. typename T6, typename T7, typename T8, typename T9, typename T10,
  4144. typename T11, typename T12, typename T13, typename T14, typename T15,
  4145. typename T16, typename T17, typename T18, typename T19, typename T20,
  4146. typename T21, typename T22, typename T23, typename T24, typename T25,
  4147. typename T26, typename T27, typename T28, typename T29>
  4148. struct Types29 {
  4149. typedef T1 Head;
  4150. typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4151. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4152. T29> Tail;
  4153. };
  4154. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4155. typename T6, typename T7, typename T8, typename T9, typename T10,
  4156. typename T11, typename T12, typename T13, typename T14, typename T15,
  4157. typename T16, typename T17, typename T18, typename T19, typename T20,
  4158. typename T21, typename T22, typename T23, typename T24, typename T25,
  4159. typename T26, typename T27, typename T28, typename T29, typename T30>
  4160. struct Types30 {
  4161. typedef T1 Head;
  4162. typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4163. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4164. T30> Tail;
  4165. };
  4166. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4167. typename T6, typename T7, typename T8, typename T9, typename T10,
  4168. typename T11, typename T12, typename T13, typename T14, typename T15,
  4169. typename T16, typename T17, typename T18, typename T19, typename T20,
  4170. typename T21, typename T22, typename T23, typename T24, typename T25,
  4171. typename T26, typename T27, typename T28, typename T29, typename T30,
  4172. typename T31>
  4173. struct Types31 {
  4174. typedef T1 Head;
  4175. typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4176. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4177. T30, T31> Tail;
  4178. };
  4179. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4180. typename T6, typename T7, typename T8, typename T9, typename T10,
  4181. typename T11, typename T12, typename T13, typename T14, typename T15,
  4182. typename T16, typename T17, typename T18, typename T19, typename T20,
  4183. typename T21, typename T22, typename T23, typename T24, typename T25,
  4184. typename T26, typename T27, typename T28, typename T29, typename T30,
  4185. typename T31, typename T32>
  4186. struct Types32 {
  4187. typedef T1 Head;
  4188. typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4189. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4190. T30, T31, T32> Tail;
  4191. };
  4192. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4193. typename T6, typename T7, typename T8, typename T9, typename T10,
  4194. typename T11, typename T12, typename T13, typename T14, typename T15,
  4195. typename T16, typename T17, typename T18, typename T19, typename T20,
  4196. typename T21, typename T22, typename T23, typename T24, typename T25,
  4197. typename T26, typename T27, typename T28, typename T29, typename T30,
  4198. typename T31, typename T32, typename T33>
  4199. struct Types33 {
  4200. typedef T1 Head;
  4201. typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4202. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4203. T30, T31, T32, T33> Tail;
  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, typename T24, typename T25,
  4210. typename T26, typename T27, typename T28, typename T29, typename T30,
  4211. typename T31, typename T32, typename T33, typename T34>
  4212. struct Types34 {
  4213. typedef T1 Head;
  4214. typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4215. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4216. T30, T31, T32, T33, T34> Tail;
  4217. };
  4218. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4219. typename T6, typename T7, typename T8, typename T9, typename T10,
  4220. typename T11, typename T12, typename T13, typename T14, typename T15,
  4221. typename T16, typename T17, typename T18, typename T19, typename T20,
  4222. typename T21, typename T22, typename T23, typename T24, typename T25,
  4223. typename T26, typename T27, typename T28, typename T29, typename T30,
  4224. typename T31, typename T32, typename T33, typename T34, typename T35>
  4225. struct Types35 {
  4226. typedef T1 Head;
  4227. typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4228. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4229. T30, T31, T32, T33, T34, T35> Tail;
  4230. };
  4231. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4232. typename T6, typename T7, typename T8, typename T9, typename T10,
  4233. typename T11, typename T12, typename T13, typename T14, typename T15,
  4234. typename T16, typename T17, typename T18, typename T19, typename T20,
  4235. typename T21, typename T22, typename T23, typename T24, typename T25,
  4236. typename T26, typename T27, typename T28, typename T29, typename T30,
  4237. typename T31, typename T32, typename T33, typename T34, typename T35,
  4238. typename T36>
  4239. struct Types36 {
  4240. typedef T1 Head;
  4241. typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4242. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4243. T30, T31, T32, T33, T34, T35, T36> Tail;
  4244. };
  4245. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4246. typename T6, typename T7, typename T8, typename T9, typename T10,
  4247. typename T11, typename T12, typename T13, typename T14, typename T15,
  4248. typename T16, typename T17, typename T18, typename T19, typename T20,
  4249. typename T21, typename T22, typename T23, typename T24, typename T25,
  4250. typename T26, typename T27, typename T28, typename T29, typename T30,
  4251. typename T31, typename T32, typename T33, typename T34, typename T35,
  4252. typename T36, typename T37>
  4253. struct Types37 {
  4254. typedef T1 Head;
  4255. typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4256. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4257. T30, T31, T32, T33, T34, T35, T36, T37> Tail;
  4258. };
  4259. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4260. typename T6, typename T7, typename T8, typename T9, typename T10,
  4261. typename T11, typename T12, typename T13, typename T14, typename T15,
  4262. typename T16, typename T17, typename T18, typename T19, typename T20,
  4263. typename T21, typename T22, typename T23, typename T24, typename T25,
  4264. typename T26, typename T27, typename T28, typename T29, typename T30,
  4265. typename T31, typename T32, typename T33, typename T34, typename T35,
  4266. typename T36, typename T37, typename T38>
  4267. struct Types38 {
  4268. typedef T1 Head;
  4269. typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4270. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4271. T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
  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, typename T28, typename T29, typename T30,
  4279. typename T31, typename T32, typename T33, typename T34, typename T35,
  4280. typename T36, typename T37, typename T38, typename T39>
  4281. struct Types39 {
  4282. typedef T1 Head;
  4283. typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4284. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4285. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
  4286. };
  4287. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4288. typename T6, typename T7, typename T8, typename T9, typename T10,
  4289. typename T11, typename T12, typename T13, typename T14, typename T15,
  4290. typename T16, typename T17, typename T18, typename T19, typename T20,
  4291. typename T21, typename T22, typename T23, typename T24, typename T25,
  4292. typename T26, typename T27, typename T28, typename T29, typename T30,
  4293. typename T31, typename T32, typename T33, typename T34, typename T35,
  4294. typename T36, typename T37, typename T38, typename T39, typename T40>
  4295. struct Types40 {
  4296. typedef T1 Head;
  4297. typedef Types39<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, T29,
  4299. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
  4300. };
  4301. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4302. typename T6, typename T7, typename T8, typename T9, typename T10,
  4303. typename T11, typename T12, typename T13, typename T14, typename T15,
  4304. typename T16, typename T17, typename T18, typename T19, typename T20,
  4305. typename T21, typename T22, typename T23, typename T24, typename T25,
  4306. typename T26, typename T27, typename T28, typename T29, typename T30,
  4307. typename T31, typename T32, typename T33, typename T34, typename T35,
  4308. typename T36, typename T37, typename T38, typename T39, typename T40,
  4309. typename T41>
  4310. struct Types41 {
  4311. typedef T1 Head;
  4312. typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4313. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4314. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
  4315. };
  4316. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4317. typename T6, typename T7, typename T8, typename T9, typename T10,
  4318. typename T11, typename T12, typename T13, typename T14, typename T15,
  4319. typename T16, typename T17, typename T18, typename T19, typename T20,
  4320. typename T21, typename T22, typename T23, typename T24, typename T25,
  4321. typename T26, typename T27, typename T28, typename T29, typename T30,
  4322. typename T31, typename T32, typename T33, typename T34, typename T35,
  4323. typename T36, typename T37, typename T38, typename T39, typename T40,
  4324. typename T41, typename T42>
  4325. struct Types42 {
  4326. typedef T1 Head;
  4327. typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4328. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4329. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
  4330. };
  4331. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4332. typename T6, typename T7, typename T8, typename T9, typename T10,
  4333. typename T11, typename T12, typename T13, typename T14, typename T15,
  4334. typename T16, typename T17, typename T18, typename T19, typename T20,
  4335. typename T21, typename T22, typename T23, typename T24, typename T25,
  4336. typename T26, typename T27, typename T28, typename T29, typename T30,
  4337. typename T31, typename T32, typename T33, typename T34, typename T35,
  4338. typename T36, typename T37, typename T38, typename T39, typename T40,
  4339. typename T41, typename T42, typename T43>
  4340. struct Types43 {
  4341. typedef T1 Head;
  4342. typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4343. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4344. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  4345. T43> Tail;
  4346. };
  4347. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4348. typename T6, typename T7, typename T8, typename T9, typename T10,
  4349. typename T11, typename T12, typename T13, typename T14, typename T15,
  4350. typename T16, typename T17, typename T18, typename T19, typename T20,
  4351. typename T21, typename T22, typename T23, typename T24, typename T25,
  4352. typename T26, typename T27, typename T28, typename T29, typename T30,
  4353. typename T31, typename T32, typename T33, typename T34, typename T35,
  4354. typename T36, typename T37, typename T38, typename T39, typename T40,
  4355. typename T41, typename T42, typename T43, typename T44>
  4356. struct Types44 {
  4357. typedef T1 Head;
  4358. typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4359. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4360. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  4361. T44> Tail;
  4362. };
  4363. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4364. typename T6, typename T7, typename T8, typename T9, typename T10,
  4365. typename T11, typename T12, typename T13, typename T14, typename T15,
  4366. typename T16, typename T17, typename T18, typename T19, typename T20,
  4367. typename T21, typename T22, typename T23, typename T24, typename T25,
  4368. typename T26, typename T27, typename T28, typename T29, typename T30,
  4369. typename T31, typename T32, typename T33, typename T34, typename T35,
  4370. typename T36, typename T37, typename T38, typename T39, typename T40,
  4371. typename T41, typename T42, typename T43, typename T44, typename T45>
  4372. struct Types45 {
  4373. typedef T1 Head;
  4374. typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4375. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4376. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  4377. T44, T45> Tail;
  4378. };
  4379. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4380. typename T6, typename T7, typename T8, typename T9, typename T10,
  4381. typename T11, typename T12, typename T13, typename T14, typename T15,
  4382. typename T16, typename T17, typename T18, typename T19, typename T20,
  4383. typename T21, typename T22, typename T23, typename T24, typename T25,
  4384. typename T26, typename T27, typename T28, typename T29, typename T30,
  4385. typename T31, typename T32, typename T33, typename T34, typename T35,
  4386. typename T36, typename T37, typename T38, typename T39, typename T40,
  4387. typename T41, typename T42, typename T43, typename T44, typename T45,
  4388. typename T46>
  4389. struct Types46 {
  4390. typedef T1 Head;
  4391. typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4392. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4393. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  4394. T44, T45, T46> Tail;
  4395. };
  4396. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4397. typename T6, typename T7, typename T8, typename T9, typename T10,
  4398. typename T11, typename T12, typename T13, typename T14, typename T15,
  4399. typename T16, typename T17, typename T18, typename T19, typename T20,
  4400. typename T21, typename T22, typename T23, typename T24, typename T25,
  4401. typename T26, typename T27, typename T28, typename T29, typename T30,
  4402. typename T31, typename T32, typename T33, typename T34, typename T35,
  4403. typename T36, typename T37, typename T38, typename T39, typename T40,
  4404. typename T41, typename T42, typename T43, typename T44, typename T45,
  4405. typename T46, typename T47>
  4406. struct Types47 {
  4407. typedef T1 Head;
  4408. typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4409. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4410. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  4411. T44, T45, T46, T47> Tail;
  4412. };
  4413. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4414. typename T6, typename T7, typename T8, typename T9, typename T10,
  4415. typename T11, typename T12, typename T13, typename T14, typename T15,
  4416. typename T16, typename T17, typename T18, typename T19, typename T20,
  4417. typename T21, typename T22, typename T23, typename T24, typename T25,
  4418. typename T26, typename T27, typename T28, typename T29, typename T30,
  4419. typename T31, typename T32, typename T33, typename T34, typename T35,
  4420. typename T36, typename T37, typename T38, typename T39, typename T40,
  4421. typename T41, typename T42, typename T43, typename T44, typename T45,
  4422. typename T46, typename T47, typename T48>
  4423. struct Types48 {
  4424. typedef T1 Head;
  4425. typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4426. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4427. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  4428. T44, T45, T46, T47, T48> Tail;
  4429. };
  4430. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4431. typename T6, typename T7, typename T8, typename T9, typename T10,
  4432. typename T11, typename T12, typename T13, typename T14, typename T15,
  4433. typename T16, typename T17, typename T18, typename T19, typename T20,
  4434. typename T21, typename T22, typename T23, typename T24, typename T25,
  4435. typename T26, typename T27, typename T28, typename T29, typename T30,
  4436. typename T31, typename T32, typename T33, typename T34, typename T35,
  4437. typename T36, typename T37, typename T38, typename T39, typename T40,
  4438. typename T41, typename T42, typename T43, typename T44, typename T45,
  4439. typename T46, typename T47, typename T48, typename T49>
  4440. struct Types49 {
  4441. typedef T1 Head;
  4442. typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4443. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4444. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  4445. T44, T45, T46, T47, T48, T49> Tail;
  4446. };
  4447. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4448. typename T6, typename T7, typename T8, typename T9, typename T10,
  4449. typename T11, typename T12, typename T13, typename T14, typename T15,
  4450. typename T16, typename T17, typename T18, typename T19, typename T20,
  4451. typename T21, typename T22, typename T23, typename T24, typename T25,
  4452. typename T26, typename T27, typename T28, typename T29, typename T30,
  4453. typename T31, typename T32, typename T33, typename T34, typename T35,
  4454. typename T36, typename T37, typename T38, typename T39, typename T40,
  4455. typename T41, typename T42, typename T43, typename T44, typename T45,
  4456. typename T46, typename T47, typename T48, typename T49, typename T50>
  4457. struct Types50 {
  4458. typedef T1 Head;
  4459. typedef Types49<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,
  4461. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  4462. T44, T45, T46, T47, T48, T49, T50> Tail;
  4463. };
  4464. } // namespace internal
  4465. // We don't want to require the users to write TypesN<...> directly,
  4466. // as that would require them to count the length. Types<...> is much
  4467. // easier to write, but generates horrible messages when there is a
  4468. // compiler error, as gcc insists on printing out each template
  4469. // argument, even if it has the default value (this means Types<int>
  4470. // will appear as Types<int, None, None, ..., None> in the compiler
  4471. // errors).
  4472. //
  4473. // Our solution is to combine the best part of the two approaches: a
  4474. // user would write Types<T1, ..., TN>, and Google Test will translate
  4475. // that to TypesN<T1, ..., TN> internally to make error messages
  4476. // readable. The translation is done by the 'type' member of the
  4477. // Types template.
  4478. template <typename T1 = internal::None, typename T2 = internal::None,
  4479. typename T3 = internal::None, typename T4 = internal::None,
  4480. typename T5 = internal::None, typename T6 = internal::None,
  4481. typename T7 = internal::None, typename T8 = internal::None,
  4482. typename T9 = internal::None, typename T10 = internal::None,
  4483. typename T11 = internal::None, typename T12 = internal::None,
  4484. typename T13 = internal::None, typename T14 = internal::None,
  4485. typename T15 = internal::None, typename T16 = internal::None,
  4486. typename T17 = internal::None, typename T18 = internal::None,
  4487. typename T19 = internal::None, typename T20 = internal::None,
  4488. typename T21 = internal::None, typename T22 = internal::None,
  4489. typename T23 = internal::None, typename T24 = internal::None,
  4490. typename T25 = internal::None, typename T26 = internal::None,
  4491. typename T27 = internal::None, typename T28 = internal::None,
  4492. typename T29 = internal::None, typename T30 = internal::None,
  4493. typename T31 = internal::None, typename T32 = internal::None,
  4494. typename T33 = internal::None, typename T34 = internal::None,
  4495. typename T35 = internal::None, typename T36 = internal::None,
  4496. typename T37 = internal::None, typename T38 = internal::None,
  4497. typename T39 = internal::None, typename T40 = internal::None,
  4498. typename T41 = internal::None, typename T42 = internal::None,
  4499. typename T43 = internal::None, typename T44 = internal::None,
  4500. typename T45 = internal::None, typename T46 = internal::None,
  4501. typename T47 = internal::None, typename T48 = internal::None,
  4502. typename T49 = internal::None, typename T50 = internal::None>
  4503. struct Types {
  4504. typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4505. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4506. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4507. T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
  4508. };
  4509. template <>
  4510. struct Types<internal::None, internal::None, internal::None, internal::None,
  4511. internal::None, internal::None, internal::None, internal::None,
  4512. internal::None, internal::None, internal::None, internal::None,
  4513. internal::None, internal::None, internal::None, internal::None,
  4514. internal::None, internal::None, internal::None, internal::None,
  4515. internal::None, internal::None, internal::None, internal::None,
  4516. internal::None, internal::None, internal::None, internal::None,
  4517. internal::None, internal::None, internal::None, internal::None,
  4518. internal::None, internal::None, internal::None, internal::None,
  4519. internal::None, internal::None, internal::None, internal::None,
  4520. internal::None, internal::None, internal::None, internal::None,
  4521. internal::None, internal::None, internal::None, internal::None,
  4522. internal::None, internal::None> {
  4523. typedef internal::Types0 type;
  4524. };
  4525. template <typename T1>
  4526. struct Types<T1, internal::None, internal::None, internal::None,
  4527. internal::None, internal::None, internal::None, internal::None,
  4528. internal::None, internal::None, internal::None, internal::None,
  4529. internal::None, internal::None, internal::None, internal::None,
  4530. internal::None, internal::None, internal::None, internal::None,
  4531. internal::None, internal::None, internal::None, internal::None,
  4532. internal::None, internal::None, internal::None, internal::None,
  4533. internal::None, internal::None, internal::None, internal::None,
  4534. internal::None, internal::None, internal::None, internal::None,
  4535. internal::None, internal::None, internal::None, internal::None,
  4536. internal::None, internal::None, internal::None, internal::None,
  4537. internal::None, internal::None, internal::None, internal::None,
  4538. internal::None, internal::None> {
  4539. typedef internal::Types1<T1> type;
  4540. };
  4541. template <typename T1, typename T2>
  4542. struct Types<T1, T2, internal::None, internal::None, internal::None,
  4543. internal::None, internal::None, internal::None, internal::None,
  4544. internal::None, internal::None, internal::None, internal::None,
  4545. internal::None, internal::None, internal::None, internal::None,
  4546. internal::None, internal::None, internal::None, internal::None,
  4547. internal::None, internal::None, internal::None, internal::None,
  4548. internal::None, internal::None, internal::None, internal::None,
  4549. internal::None, internal::None, internal::None, internal::None,
  4550. internal::None, internal::None, internal::None, internal::None,
  4551. internal::None, internal::None, internal::None, internal::None,
  4552. internal::None, internal::None, internal::None, internal::None,
  4553. internal::None, internal::None, internal::None, internal::None,
  4554. internal::None> {
  4555. typedef internal::Types2<T1, T2> type;
  4556. };
  4557. template <typename T1, typename T2, typename T3>
  4558. struct Types<T1, T2, T3, internal::None, internal::None, internal::None,
  4559. internal::None, internal::None, internal::None, internal::None,
  4560. internal::None, internal::None, internal::None, internal::None,
  4561. internal::None, internal::None, internal::None, internal::None,
  4562. internal::None, internal::None, internal::None, internal::None,
  4563. internal::None, internal::None, internal::None, internal::None,
  4564. internal::None, internal::None, internal::None, internal::None,
  4565. internal::None, internal::None, internal::None, internal::None,
  4566. internal::None, internal::None, internal::None, internal::None,
  4567. internal::None, internal::None, internal::None, internal::None,
  4568. internal::None, internal::None, internal::None, internal::None,
  4569. internal::None, internal::None, internal::None, internal::None> {
  4570. typedef internal::Types3<T1, T2, T3> type;
  4571. };
  4572. template <typename T1, typename T2, typename T3, typename T4>
  4573. struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,
  4574. internal::None, internal::None, internal::None, internal::None,
  4575. internal::None, internal::None, internal::None, internal::None,
  4576. internal::None, internal::None, internal::None, internal::None,
  4577. internal::None, internal::None, internal::None, internal::None,
  4578. internal::None, internal::None, internal::None, internal::None,
  4579. internal::None, internal::None, internal::None, internal::None,
  4580. internal::None, internal::None, internal::None, internal::None,
  4581. internal::None, internal::None, internal::None, internal::None,
  4582. internal::None, internal::None, internal::None, internal::None,
  4583. internal::None, internal::None, internal::None, internal::None,
  4584. internal::None, internal::None, internal::None> {
  4585. typedef internal::Types4<T1, T2, T3, T4> type;
  4586. };
  4587. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  4588. struct Types<T1, T2, T3, T4, T5, internal::None, internal::None,
  4589. internal::None, internal::None, internal::None, internal::None,
  4590. internal::None, internal::None, internal::None, internal::None,
  4591. internal::None, internal::None, internal::None, internal::None,
  4592. internal::None, internal::None, internal::None, internal::None,
  4593. internal::None, internal::None, internal::None, internal::None,
  4594. internal::None, internal::None, internal::None, internal::None,
  4595. internal::None, internal::None, internal::None, internal::None,
  4596. internal::None, internal::None, internal::None, internal::None,
  4597. internal::None, internal::None, internal::None, internal::None,
  4598. internal::None, internal::None, internal::None, internal::None,
  4599. internal::None, internal::None, internal::None> {
  4600. typedef internal::Types5<T1, T2, T3, T4, T5> type;
  4601. };
  4602. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4603. typename T6>
  4604. struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,
  4605. internal::None, internal::None, internal::None, internal::None,
  4606. internal::None, internal::None, internal::None, internal::None,
  4607. internal::None, internal::None, internal::None, internal::None,
  4608. internal::None, internal::None, internal::None, internal::None,
  4609. internal::None, internal::None, internal::None, internal::None,
  4610. internal::None, internal::None, internal::None, internal::None,
  4611. internal::None, internal::None, internal::None, internal::None,
  4612. internal::None, internal::None, internal::None, internal::None,
  4613. internal::None, internal::None, internal::None, internal::None,
  4614. internal::None, internal::None, internal::None, internal::None,
  4615. internal::None, internal::None> {
  4616. typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
  4617. };
  4618. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4619. typename T6, typename T7>
  4620. struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,
  4621. internal::None, internal::None, internal::None, internal::None,
  4622. internal::None, internal::None, internal::None, internal::None,
  4623. internal::None, internal::None, internal::None, internal::None,
  4624. internal::None, internal::None, internal::None, internal::None,
  4625. internal::None, internal::None, internal::None, internal::None,
  4626. internal::None, internal::None, internal::None, internal::None,
  4627. internal::None, internal::None, internal::None, internal::None,
  4628. internal::None, internal::None, internal::None, internal::None,
  4629. internal::None, internal::None, internal::None, internal::None,
  4630. internal::None, internal::None, internal::None, internal::None,
  4631. internal::None> {
  4632. typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
  4633. };
  4634. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4635. typename T6, typename T7, typename T8>
  4636. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,
  4637. internal::None, internal::None, internal::None, internal::None,
  4638. internal::None, internal::None, internal::None, internal::None,
  4639. internal::None, internal::None, internal::None, internal::None,
  4640. internal::None, internal::None, internal::None, internal::None,
  4641. internal::None, internal::None, internal::None, internal::None,
  4642. internal::None, internal::None, internal::None, internal::None,
  4643. internal::None, internal::None, internal::None, internal::None,
  4644. internal::None, internal::None, internal::None, internal::None,
  4645. internal::None, internal::None, internal::None, internal::None,
  4646. internal::None, internal::None, internal::None, internal::None> {
  4647. typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
  4648. };
  4649. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4650. typename T6, typename T7, typename T8, typename T9>
  4651. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,
  4652. internal::None, internal::None, internal::None, internal::None,
  4653. internal::None, internal::None, internal::None, internal::None,
  4654. internal::None, internal::None, internal::None, internal::None,
  4655. internal::None, internal::None, internal::None, internal::None,
  4656. internal::None, internal::None, internal::None, internal::None,
  4657. internal::None, internal::None, internal::None, internal::None,
  4658. internal::None, internal::None, internal::None, internal::None,
  4659. internal::None, internal::None, internal::None, internal::None,
  4660. internal::None, internal::None, internal::None, internal::None,
  4661. internal::None, internal::None, internal::None, internal::None> {
  4662. typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
  4663. };
  4664. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4665. typename T6, typename T7, typename T8, typename T9, typename T10>
  4666. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,
  4667. internal::None, internal::None, internal::None, internal::None,
  4668. internal::None, internal::None, internal::None, internal::None,
  4669. internal::None, internal::None, internal::None, internal::None,
  4670. internal::None, internal::None, internal::None, internal::None,
  4671. internal::None, internal::None, internal::None, internal::None,
  4672. internal::None, internal::None, internal::None, internal::None,
  4673. internal::None, internal::None, internal::None, internal::None,
  4674. internal::None, internal::None, internal::None, internal::None,
  4675. internal::None, internal::None, internal::None, internal::None,
  4676. internal::None, internal::None, internal::None> {
  4677. typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
  4678. };
  4679. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4680. typename T6, typename T7, typename T8, typename T9, typename T10,
  4681. typename T11>
  4682. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,
  4683. internal::None, internal::None, internal::None, internal::None,
  4684. internal::None, internal::None, internal::None, internal::None,
  4685. internal::None, internal::None, internal::None, internal::None,
  4686. internal::None, internal::None, internal::None, internal::None,
  4687. internal::None, internal::None, internal::None, internal::None,
  4688. internal::None, internal::None, internal::None, internal::None,
  4689. internal::None, internal::None, internal::None, internal::None,
  4690. internal::None, internal::None, internal::None, internal::None,
  4691. internal::None, internal::None, internal::None, internal::None,
  4692. internal::None, internal::None> {
  4693. typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
  4694. };
  4695. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4696. typename T6, typename T7, typename T8, typename T9, typename T10,
  4697. typename T11, typename T12>
  4698. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,
  4699. internal::None, internal::None, internal::None, internal::None,
  4700. internal::None, internal::None, internal::None, internal::None,
  4701. internal::None, internal::None, internal::None, internal::None,
  4702. internal::None, internal::None, internal::None, internal::None,
  4703. internal::None, internal::None, internal::None, internal::None,
  4704. internal::None, internal::None, internal::None, internal::None,
  4705. internal::None, internal::None, internal::None, internal::None,
  4706. internal::None, internal::None, internal::None, internal::None,
  4707. internal::None, internal::None, internal::None, internal::None,
  4708. internal::None> {
  4709. typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  4710. T12> type;
  4711. };
  4712. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4713. typename T6, typename T7, typename T8, typename T9, typename T10,
  4714. typename T11, typename T12, typename T13>
  4715. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  4716. internal::None, internal::None, internal::None, internal::None,
  4717. internal::None, internal::None, internal::None, internal::None,
  4718. internal::None, internal::None, internal::None, internal::None,
  4719. internal::None, internal::None, internal::None, internal::None,
  4720. internal::None, internal::None, internal::None, internal::None,
  4721. internal::None, internal::None, internal::None, internal::None,
  4722. internal::None, internal::None, internal::None, internal::None,
  4723. internal::None, internal::None, internal::None, internal::None,
  4724. internal::None, internal::None, internal::None, internal::None,
  4725. internal::None> {
  4726. typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4727. T13> type;
  4728. };
  4729. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4730. typename T6, typename T7, typename T8, typename T9, typename T10,
  4731. typename T11, typename T12, typename T13, typename T14>
  4732. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4733. internal::None, internal::None, internal::None, internal::None,
  4734. internal::None, internal::None, internal::None, internal::None,
  4735. internal::None, internal::None, internal::None, internal::None,
  4736. internal::None, internal::None, internal::None, internal::None,
  4737. internal::None, internal::None, internal::None, internal::None,
  4738. internal::None, internal::None, internal::None, internal::None,
  4739. internal::None, internal::None, internal::None, internal::None,
  4740. internal::None, internal::None, internal::None, internal::None,
  4741. internal::None, internal::None, internal::None, internal::None> {
  4742. typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4743. T13, T14> type;
  4744. };
  4745. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4746. typename T6, typename T7, typename T8, typename T9, typename T10,
  4747. typename T11, typename T12, typename T13, typename T14, typename T15>
  4748. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4749. internal::None, internal::None, internal::None, internal::None,
  4750. internal::None, internal::None, internal::None, internal::None,
  4751. internal::None, internal::None, internal::None, internal::None,
  4752. internal::None, internal::None, internal::None, internal::None,
  4753. internal::None, internal::None, internal::None, internal::None,
  4754. internal::None, internal::None, internal::None, internal::None,
  4755. internal::None, internal::None, internal::None, internal::None,
  4756. internal::None, internal::None, internal::None, internal::None,
  4757. internal::None, internal::None, internal::None> {
  4758. typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4759. T13, T14, T15> type;
  4760. };
  4761. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4762. typename T6, typename T7, typename T8, typename T9, typename T10,
  4763. typename T11, typename T12, typename T13, typename T14, typename T15,
  4764. typename T16>
  4765. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4766. T16, internal::None, internal::None, internal::None, internal::None,
  4767. internal::None, internal::None, internal::None, internal::None,
  4768. internal::None, internal::None, internal::None, internal::None,
  4769. internal::None, internal::None, internal::None, internal::None,
  4770. internal::None, internal::None, internal::None, internal::None,
  4771. internal::None, internal::None, internal::None, internal::None,
  4772. internal::None, internal::None, internal::None, internal::None,
  4773. internal::None, internal::None, internal::None, internal::None,
  4774. internal::None, internal::None> {
  4775. typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4776. T13, T14, T15, T16> type;
  4777. };
  4778. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4779. typename T6, typename T7, typename T8, typename T9, typename T10,
  4780. typename T11, typename T12, typename T13, typename T14, typename T15,
  4781. typename T16, typename T17>
  4782. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4783. T16, T17, internal::None, internal::None, internal::None, internal::None,
  4784. internal::None, internal::None, internal::None, internal::None,
  4785. internal::None, internal::None, internal::None, internal::None,
  4786. internal::None, internal::None, internal::None, internal::None,
  4787. internal::None, internal::None, internal::None, internal::None,
  4788. internal::None, internal::None, internal::None, internal::None,
  4789. internal::None, internal::None, internal::None, internal::None,
  4790. internal::None, internal::None, internal::None, internal::None,
  4791. internal::None> {
  4792. typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4793. T13, T14, T15, T16, T17> type;
  4794. };
  4795. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4796. typename T6, typename T7, typename T8, typename T9, typename T10,
  4797. typename T11, typename T12, typename T13, typename T14, typename T15,
  4798. typename T16, typename T17, typename T18>
  4799. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4800. T16, T17, T18, internal::None, internal::None, internal::None,
  4801. internal::None, internal::None, internal::None, internal::None,
  4802. internal::None, internal::None, internal::None, internal::None,
  4803. internal::None, internal::None, internal::None, internal::None,
  4804. internal::None, internal::None, internal::None, internal::None,
  4805. internal::None, internal::None, internal::None, internal::None,
  4806. internal::None, internal::None, internal::None, internal::None,
  4807. internal::None, internal::None, internal::None, internal::None,
  4808. internal::None> {
  4809. typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4810. T13, T14, T15, T16, T17, T18> type;
  4811. };
  4812. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4813. typename T6, typename T7, typename T8, typename T9, typename T10,
  4814. typename T11, typename T12, typename T13, typename T14, typename T15,
  4815. typename T16, typename T17, typename T18, typename T19>
  4816. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4817. T16, T17, T18, T19, internal::None, internal::None, internal::None,
  4818. internal::None, internal::None, internal::None, internal::None,
  4819. internal::None, internal::None, internal::None, internal::None,
  4820. internal::None, internal::None, internal::None, internal::None,
  4821. internal::None, internal::None, internal::None, internal::None,
  4822. internal::None, internal::None, internal::None, internal::None,
  4823. internal::None, internal::None, internal::None, internal::None,
  4824. internal::None, internal::None, internal::None, internal::None> {
  4825. typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4826. T13, T14, T15, T16, T17, T18, T19> type;
  4827. };
  4828. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4829. typename T6, typename T7, typename T8, typename T9, typename T10,
  4830. typename T11, typename T12, typename T13, typename T14, typename T15,
  4831. typename T16, typename T17, typename T18, typename T19, typename T20>
  4832. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4833. T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,
  4834. internal::None, internal::None, internal::None, internal::None,
  4835. internal::None, internal::None, internal::None, internal::None,
  4836. internal::None, internal::None, internal::None, internal::None,
  4837. internal::None, internal::None, internal::None, internal::None,
  4838. internal::None, internal::None, internal::None, internal::None,
  4839. internal::None, internal::None, internal::None, internal::None,
  4840. internal::None, internal::None, internal::None> {
  4841. typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4842. T13, T14, T15, T16, T17, T18, T19, T20> type;
  4843. };
  4844. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4845. typename T6, typename T7, typename T8, typename T9, typename T10,
  4846. typename T11, typename T12, typename T13, typename T14, typename T15,
  4847. typename T16, typename T17, typename T18, typename T19, typename T20,
  4848. typename T21>
  4849. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4850. T16, T17, T18, T19, T20, T21, internal::None, internal::None,
  4851. internal::None, internal::None, internal::None, internal::None,
  4852. internal::None, internal::None, internal::None, internal::None,
  4853. internal::None, internal::None, internal::None, internal::None,
  4854. internal::None, internal::None, internal::None, internal::None,
  4855. internal::None, internal::None, internal::None, internal::None,
  4856. internal::None, internal::None, internal::None, internal::None,
  4857. internal::None, internal::None, internal::None> {
  4858. typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4859. T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
  4860. };
  4861. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4862. typename T6, typename T7, typename T8, typename T9, typename T10,
  4863. typename T11, typename T12, typename T13, typename T14, typename T15,
  4864. typename T16, typename T17, typename T18, typename T19, typename T20,
  4865. typename T21, typename T22>
  4866. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4867. T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None,
  4868. internal::None, internal::None, internal::None, internal::None,
  4869. internal::None, internal::None, internal::None, internal::None,
  4870. internal::None, internal::None, internal::None, internal::None,
  4871. internal::None, internal::None, internal::None, internal::None,
  4872. internal::None, internal::None, internal::None, internal::None,
  4873. internal::None, internal::None, internal::None, internal::None,
  4874. internal::None, internal::None> {
  4875. typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4876. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
  4877. };
  4878. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4879. typename T6, typename T7, typename T8, typename T9, typename T10,
  4880. typename T11, typename T12, typename T13, typename T14, typename T15,
  4881. typename T16, typename T17, typename T18, typename T19, typename T20,
  4882. typename T21, typename T22, typename T23>
  4883. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4884. T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None,
  4885. internal::None, internal::None, internal::None, internal::None,
  4886. internal::None, internal::None, internal::None, internal::None,
  4887. internal::None, internal::None, internal::None, internal::None,
  4888. internal::None, internal::None, internal::None, internal::None,
  4889. internal::None, internal::None, internal::None, internal::None,
  4890. internal::None, internal::None, internal::None, internal::None,
  4891. internal::None> {
  4892. typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4893. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
  4894. };
  4895. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4896. typename T6, typename T7, typename T8, typename T9, typename T10,
  4897. typename T11, typename T12, typename T13, typename T14, typename T15,
  4898. typename T16, typename T17, typename T18, typename T19, typename T20,
  4899. typename T21, typename T22, typename T23, typename T24>
  4900. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4901. T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,
  4902. internal::None, internal::None, internal::None, internal::None,
  4903. internal::None, internal::None, internal::None, internal::None,
  4904. internal::None, internal::None, internal::None, internal::None,
  4905. internal::None, internal::None, internal::None, internal::None,
  4906. internal::None, internal::None, internal::None, internal::None,
  4907. internal::None, internal::None, internal::None, internal::None,
  4908. internal::None> {
  4909. typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4910. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
  4911. };
  4912. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4913. typename T6, typename T7, typename T8, typename T9, typename T10,
  4914. typename T11, typename T12, typename T13, typename T14, typename T15,
  4915. typename T16, typename T17, typename T18, typename T19, typename T20,
  4916. typename T21, typename T22, typename T23, typename T24, typename T25>
  4917. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4918. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,
  4919. internal::None, internal::None, internal::None, internal::None,
  4920. internal::None, internal::None, internal::None, internal::None,
  4921. internal::None, internal::None, internal::None, internal::None,
  4922. internal::None, internal::None, internal::None, internal::None,
  4923. internal::None, internal::None, internal::None, internal::None,
  4924. internal::None, internal::None, internal::None, internal::None> {
  4925. typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4926. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
  4927. };
  4928. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4929. typename T6, typename T7, typename T8, typename T9, typename T10,
  4930. typename T11, typename T12, typename T13, typename T14, typename T15,
  4931. typename T16, typename T17, typename T18, typename T19, typename T20,
  4932. typename T21, typename T22, typename T23, typename T24, typename T25,
  4933. typename T26>
  4934. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4935. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,
  4936. internal::None, internal::None, internal::None, internal::None,
  4937. internal::None, internal::None, internal::None, internal::None,
  4938. internal::None, internal::None, internal::None, internal::None,
  4939. internal::None, internal::None, internal::None, internal::None,
  4940. internal::None, internal::None, internal::None, internal::None,
  4941. internal::None, internal::None, internal::None> {
  4942. typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4943. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  4944. T26> type;
  4945. };
  4946. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4947. typename T6, typename T7, typename T8, typename T9, typename T10,
  4948. typename T11, typename T12, typename T13, typename T14, typename T15,
  4949. typename T16, typename T17, typename T18, typename T19, typename T20,
  4950. typename T21, typename T22, typename T23, typename T24, typename T25,
  4951. typename T26, typename T27>
  4952. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4953. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,
  4954. internal::None, internal::None, internal::None, internal::None,
  4955. internal::None, internal::None, internal::None, internal::None,
  4956. internal::None, internal::None, internal::None, internal::None,
  4957. internal::None, internal::None, internal::None, internal::None,
  4958. internal::None, internal::None, internal::None, internal::None,
  4959. internal::None, internal::None> {
  4960. typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4961. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4962. T27> type;
  4963. };
  4964. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4965. typename T6, typename T7, typename T8, typename T9, typename T10,
  4966. typename T11, typename T12, typename T13, typename T14, typename T15,
  4967. typename T16, typename T17, typename T18, typename T19, typename T20,
  4968. typename T21, typename T22, typename T23, typename T24, typename T25,
  4969. typename T26, typename T27, typename T28>
  4970. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4971. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4972. internal::None, internal::None, internal::None, internal::None,
  4973. internal::None, internal::None, internal::None, internal::None,
  4974. internal::None, internal::None, internal::None, internal::None,
  4975. internal::None, internal::None, internal::None, internal::None,
  4976. internal::None, internal::None, internal::None, internal::None,
  4977. internal::None, internal::None> {
  4978. typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4979. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4980. T27, T28> type;
  4981. };
  4982. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4983. typename T6, typename T7, typename T8, typename T9, typename T10,
  4984. typename T11, typename T12, typename T13, typename T14, typename T15,
  4985. typename T16, typename T17, typename T18, typename T19, typename T20,
  4986. typename T21, typename T22, typename T23, typename T24, typename T25,
  4987. typename T26, typename T27, typename T28, typename T29>
  4988. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4989. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4990. internal::None, internal::None, internal::None, internal::None,
  4991. internal::None, internal::None, internal::None, internal::None,
  4992. internal::None, internal::None, internal::None, internal::None,
  4993. internal::None, internal::None, internal::None, internal::None,
  4994. internal::None, internal::None, internal::None, internal::None,
  4995. internal::None> {
  4996. typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4997. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4998. T27, T28, T29> type;
  4999. };
  5000. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5001. typename T6, typename T7, typename T8, typename T9, typename T10,
  5002. typename T11, typename T12, typename T13, typename T14, typename T15,
  5003. typename T16, typename T17, typename T18, typename T19, typename T20,
  5004. typename T21, typename T22, typename T23, typename T24, typename T25,
  5005. typename T26, typename T27, typename T28, typename T29, typename T30>
  5006. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5007. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5008. internal::None, internal::None, internal::None, internal::None,
  5009. internal::None, internal::None, internal::None, internal::None,
  5010. internal::None, internal::None, internal::None, internal::None,
  5011. internal::None, internal::None, internal::None, internal::None,
  5012. internal::None, internal::None, internal::None, internal::None> {
  5013. typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5014. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5015. T27, T28, T29, T30> type;
  5016. };
  5017. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5018. typename T6, typename T7, typename T8, typename T9, typename T10,
  5019. typename T11, typename T12, typename T13, typename T14, typename T15,
  5020. typename T16, typename T17, typename T18, typename T19, typename T20,
  5021. typename T21, typename T22, typename T23, typename T24, typename T25,
  5022. typename T26, typename T27, typename T28, typename T29, typename T30,
  5023. typename T31>
  5024. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5025. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5026. T31, internal::None, internal::None, internal::None, internal::None,
  5027. internal::None, internal::None, internal::None, internal::None,
  5028. internal::None, internal::None, internal::None, internal::None,
  5029. internal::None, internal::None, internal::None, internal::None,
  5030. internal::None, internal::None, internal::None> {
  5031. typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5032. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5033. T27, T28, T29, T30, T31> type;
  5034. };
  5035. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5036. typename T6, typename T7, typename T8, typename T9, typename T10,
  5037. typename T11, typename T12, typename T13, typename T14, typename T15,
  5038. typename T16, typename T17, typename T18, typename T19, typename T20,
  5039. typename T21, typename T22, typename T23, typename T24, typename T25,
  5040. typename T26, typename T27, typename T28, typename T29, typename T30,
  5041. typename T31, typename T32>
  5042. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5043. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5044. T31, T32, internal::None, internal::None, internal::None, internal::None,
  5045. internal::None, internal::None, internal::None, internal::None,
  5046. internal::None, internal::None, internal::None, internal::None,
  5047. internal::None, internal::None, internal::None, internal::None,
  5048. internal::None, internal::None> {
  5049. typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5050. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5051. T27, T28, T29, T30, T31, T32> type;
  5052. };
  5053. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5054. typename T6, typename T7, typename T8, typename T9, typename T10,
  5055. typename T11, typename T12, typename T13, typename T14, typename T15,
  5056. typename T16, typename T17, typename T18, typename T19, typename T20,
  5057. typename T21, typename T22, typename T23, typename T24, typename T25,
  5058. typename T26, typename T27, typename T28, typename T29, typename T30,
  5059. typename T31, typename T32, typename T33>
  5060. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5061. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5062. T31, T32, T33, internal::None, internal::None, internal::None,
  5063. internal::None, internal::None, internal::None, internal::None,
  5064. internal::None, internal::None, internal::None, internal::None,
  5065. internal::None, internal::None, internal::None, internal::None,
  5066. internal::None, internal::None> {
  5067. typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5068. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5069. T27, T28, T29, T30, T31, T32, T33> type;
  5070. };
  5071. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5072. typename T6, typename T7, typename T8, typename T9, typename T10,
  5073. typename T11, typename T12, typename T13, typename T14, typename T15,
  5074. typename T16, typename T17, typename T18, typename T19, typename T20,
  5075. typename T21, typename T22, typename T23, typename T24, typename T25,
  5076. typename T26, typename T27, typename T28, typename T29, typename T30,
  5077. typename T31, typename T32, typename T33, typename T34>
  5078. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5079. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5080. T31, T32, T33, T34, internal::None, internal::None, internal::None,
  5081. internal::None, internal::None, internal::None, internal::None,
  5082. internal::None, internal::None, internal::None, internal::None,
  5083. internal::None, internal::None, internal::None, internal::None,
  5084. internal::None> {
  5085. typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5086. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5087. T27, T28, T29, T30, T31, T32, T33, T34> type;
  5088. };
  5089. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5090. typename T6, typename T7, typename T8, typename T9, typename T10,
  5091. typename T11, typename T12, typename T13, typename T14, typename T15,
  5092. typename T16, typename T17, typename T18, typename T19, typename T20,
  5093. typename T21, typename T22, typename T23, typename T24, typename T25,
  5094. typename T26, typename T27, typename T28, typename T29, typename T30,
  5095. typename T31, typename T32, typename T33, typename T34, typename T35>
  5096. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5097. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5098. T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
  5099. internal::None, internal::None, internal::None, internal::None,
  5100. internal::None, internal::None, internal::None, internal::None,
  5101. internal::None, internal::None, internal::None, internal::None> {
  5102. typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5103. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5104. T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
  5105. };
  5106. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5107. typename T6, typename T7, typename T8, typename T9, typename T10,
  5108. typename T11, typename T12, typename T13, typename T14, typename T15,
  5109. typename T16, typename T17, typename T18, typename T19, typename T20,
  5110. typename T21, typename T22, typename T23, typename T24, typename T25,
  5111. typename T26, typename T27, typename T28, typename T29, typename T30,
  5112. typename T31, typename T32, typename T33, typename T34, typename T35,
  5113. typename T36>
  5114. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5115. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5116. T31, T32, T33, T34, T35, T36, internal::None, internal::None,
  5117. internal::None, internal::None, internal::None, internal::None,
  5118. internal::None, internal::None, internal::None, internal::None,
  5119. internal::None, internal::None, internal::None, internal::None> {
  5120. typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5121. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5122. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
  5123. };
  5124. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5125. typename T6, typename T7, typename T8, typename T9, typename T10,
  5126. typename T11, typename T12, typename T13, typename T14, typename T15,
  5127. typename T16, typename T17, typename T18, typename T19, typename T20,
  5128. typename T21, typename T22, typename T23, typename T24, typename T25,
  5129. typename T26, typename T27, typename T28, typename T29, typename T30,
  5130. typename T31, typename T32, typename T33, typename T34, typename T35,
  5131. typename T36, typename T37>
  5132. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5133. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5134. T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
  5135. internal::None, internal::None, internal::None, internal::None,
  5136. internal::None, internal::None, internal::None, internal::None,
  5137. internal::None, internal::None, internal::None> {
  5138. typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5139. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5140. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
  5141. };
  5142. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5143. typename T6, typename T7, typename T8, typename T9, typename T10,
  5144. typename T11, typename T12, typename T13, typename T14, typename T15,
  5145. typename T16, typename T17, typename T18, typename T19, typename T20,
  5146. typename T21, typename T22, typename T23, typename T24, typename T25,
  5147. typename T26, typename T27, typename T28, typename T29, typename T30,
  5148. typename T31, typename T32, typename T33, typename T34, typename T35,
  5149. typename T36, typename T37, typename T38>
  5150. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5151. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5152. T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
  5153. internal::None, internal::None, internal::None, internal::None,
  5154. internal::None, internal::None, internal::None, internal::None,
  5155. internal::None, internal::None> {
  5156. typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5157. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5158. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
  5159. };
  5160. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5161. typename T6, typename T7, typename T8, typename T9, typename T10,
  5162. typename T11, typename T12, typename T13, typename T14, typename T15,
  5163. typename T16, typename T17, typename T18, typename T19, typename T20,
  5164. typename T21, typename T22, typename T23, typename T24, typename T25,
  5165. typename T26, typename T27, typename T28, typename T29, typename T30,
  5166. typename T31, typename T32, typename T33, typename T34, typename T35,
  5167. typename T36, typename T37, typename T38, typename T39>
  5168. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5169. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5170. T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
  5171. internal::None, internal::None, internal::None, internal::None,
  5172. internal::None, internal::None, internal::None, internal::None,
  5173. internal::None, internal::None> {
  5174. typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5175. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5176. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
  5177. };
  5178. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5179. typename T6, typename T7, typename T8, typename T9, typename T10,
  5180. typename T11, typename T12, typename T13, typename T14, typename T15,
  5181. typename T16, typename T17, typename T18, typename T19, typename T20,
  5182. typename T21, typename T22, typename T23, typename T24, typename T25,
  5183. typename T26, typename T27, typename T28, typename T29, typename T30,
  5184. typename T31, typename T32, typename T33, typename T34, typename T35,
  5185. typename T36, typename T37, typename T38, typename T39, typename T40>
  5186. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5187. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5188. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
  5189. internal::None, internal::None, internal::None, internal::None,
  5190. internal::None, internal::None, internal::None, internal::None,
  5191. internal::None> {
  5192. typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5193. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5194. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  5195. T40> type;
  5196. };
  5197. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5198. typename T6, typename T7, typename T8, typename T9, typename T10,
  5199. typename T11, typename T12, typename T13, typename T14, typename T15,
  5200. typename T16, typename T17, typename T18, typename T19, typename T20,
  5201. typename T21, typename T22, typename T23, typename T24, typename T25,
  5202. typename T26, typename T27, typename T28, typename T29, typename T30,
  5203. typename T31, typename T32, typename T33, typename T34, typename T35,
  5204. typename T36, typename T37, typename T38, typename T39, typename T40,
  5205. typename T41>
  5206. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5207. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5208. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
  5209. internal::None, internal::None, internal::None, internal::None,
  5210. internal::None, internal::None, internal::None, internal::None> {
  5211. typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5212. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5213. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  5214. T41> type;
  5215. };
  5216. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5217. typename T6, typename T7, typename T8, typename T9, typename T10,
  5218. typename T11, typename T12, typename T13, typename T14, typename T15,
  5219. typename T16, typename T17, typename T18, typename T19, typename T20,
  5220. typename T21, typename T22, typename T23, typename T24, typename T25,
  5221. typename T26, typename T27, typename T28, typename T29, typename T30,
  5222. typename T31, typename T32, typename T33, typename T34, typename T35,
  5223. typename T36, typename T37, typename T38, typename T39, typename T40,
  5224. typename T41, typename T42>
  5225. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5226. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5227. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
  5228. internal::None, internal::None, internal::None, internal::None,
  5229. internal::None, internal::None, internal::None> {
  5230. typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5231. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5232. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  5233. T41, T42> type;
  5234. };
  5235. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5236. typename T6, typename T7, typename T8, typename T9, typename T10,
  5237. typename T11, typename T12, typename T13, typename T14, typename T15,
  5238. typename T16, typename T17, typename T18, typename T19, typename T20,
  5239. typename T21, typename T22, typename T23, typename T24, typename T25,
  5240. typename T26, typename T27, typename T28, typename T29, typename T30,
  5241. typename T31, typename T32, typename T33, typename T34, typename T35,
  5242. typename T36, typename T37, typename T38, typename T39, typename T40,
  5243. typename T41, typename T42, typename T43>
  5244. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5245. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5246. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  5247. internal::None, internal::None, internal::None, internal::None,
  5248. internal::None, internal::None, internal::None> {
  5249. typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5250. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5251. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  5252. T41, T42, T43> type;
  5253. };
  5254. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5255. typename T6, typename T7, typename T8, typename T9, typename T10,
  5256. typename T11, typename T12, typename T13, typename T14, typename T15,
  5257. typename T16, typename T17, typename T18, typename T19, typename T20,
  5258. typename T21, typename T22, typename T23, typename T24, typename T25,
  5259. typename T26, typename T27, typename T28, typename T29, typename T30,
  5260. typename T31, typename T32, typename T33, typename T34, typename T35,
  5261. typename T36, typename T37, typename T38, typename T39, typename T40,
  5262. typename T41, typename T42, typename T43, typename T44>
  5263. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5264. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5265. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  5266. internal::None, internal::None, internal::None, internal::None,
  5267. internal::None, internal::None> {
  5268. typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5269. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5270. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  5271. T41, T42, T43, T44> type;
  5272. };
  5273. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5274. typename T6, typename T7, typename T8, typename T9, typename T10,
  5275. typename T11, typename T12, typename T13, typename T14, typename T15,
  5276. typename T16, typename T17, typename T18, typename T19, typename T20,
  5277. typename T21, typename T22, typename T23, typename T24, typename T25,
  5278. typename T26, typename T27, typename T28, typename T29, typename T30,
  5279. typename T31, typename T32, typename T33, typename T34, typename T35,
  5280. typename T36, typename T37, typename T38, typename T39, typename T40,
  5281. typename T41, typename T42, typename T43, typename T44, typename T45>
  5282. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5283. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5284. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  5285. internal::None, internal::None, internal::None, internal::None,
  5286. internal::None> {
  5287. typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5288. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5289. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  5290. T41, T42, T43, T44, T45> type;
  5291. };
  5292. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5293. typename T6, typename T7, typename T8, typename T9, typename T10,
  5294. typename T11, typename T12, typename T13, typename T14, typename T15,
  5295. typename T16, typename T17, typename T18, typename T19, typename T20,
  5296. typename T21, typename T22, typename T23, typename T24, typename T25,
  5297. typename T26, typename T27, typename T28, typename T29, typename T30,
  5298. typename T31, typename T32, typename T33, typename T34, typename T35,
  5299. typename T36, typename T37, typename T38, typename T39, typename T40,
  5300. typename T41, typename T42, typename T43, typename T44, typename T45,
  5301. typename T46>
  5302. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5303. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5304. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  5305. T46, internal::None, internal::None, internal::None, internal::None> {
  5306. typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5307. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5308. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  5309. T41, T42, T43, T44, T45, T46> type;
  5310. };
  5311. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5312. typename T6, typename T7, typename T8, typename T9, typename T10,
  5313. typename T11, typename T12, typename T13, typename T14, typename T15,
  5314. typename T16, typename T17, typename T18, typename T19, typename T20,
  5315. typename T21, typename T22, typename T23, typename T24, typename T25,
  5316. typename T26, typename T27, typename T28, typename T29, typename T30,
  5317. typename T31, typename T32, typename T33, typename T34, typename T35,
  5318. typename T36, typename T37, typename T38, typename T39, typename T40,
  5319. typename T41, typename T42, typename T43, typename T44, typename T45,
  5320. typename T46, typename T47>
  5321. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5322. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5323. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  5324. T46, T47, internal::None, internal::None, internal::None> {
  5325. typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5326. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5327. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  5328. T41, T42, T43, T44, T45, T46, T47> type;
  5329. };
  5330. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5331. typename T6, typename T7, typename T8, typename T9, typename T10,
  5332. typename T11, typename T12, typename T13, typename T14, typename T15,
  5333. typename T16, typename T17, typename T18, typename T19, typename T20,
  5334. typename T21, typename T22, typename T23, typename T24, typename T25,
  5335. typename T26, typename T27, typename T28, typename T29, typename T30,
  5336. typename T31, typename T32, typename T33, typename T34, typename T35,
  5337. typename T36, typename T37, typename T38, typename T39, typename T40,
  5338. typename T41, typename T42, typename T43, typename T44, typename T45,
  5339. typename T46, typename T47, typename T48>
  5340. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5341. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5342. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  5343. T46, T47, T48, internal::None, internal::None> {
  5344. typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5345. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5346. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  5347. T41, T42, T43, T44, T45, T46, T47, T48> type;
  5348. };
  5349. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  5350. typename T6, typename T7, typename T8, typename T9, typename T10,
  5351. typename T11, typename T12, typename T13, typename T14, typename T15,
  5352. typename T16, typename T17, typename T18, typename T19, typename T20,
  5353. typename T21, typename T22, typename T23, typename T24, typename T25,
  5354. typename T26, typename T27, typename T28, typename T29, typename T30,
  5355. typename T31, typename T32, typename T33, typename T34, typename T35,
  5356. typename T36, typename T37, typename T38, typename T39, typename T40,
  5357. typename T41, typename T42, typename T43, typename T44, typename T45,
  5358. typename T46, typename T47, typename T48, typename T49>
  5359. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  5360. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  5361. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  5362. T46, T47, T48, T49, internal::None> {
  5363. typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5364. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5365. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  5366. T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
  5367. };
  5368. namespace internal {
  5369. # define GTEST_TEMPLATE_ template <typename T> class
  5370. // The template "selector" struct TemplateSel<Tmpl> is used to
  5371. // represent Tmpl, which must be a class template with one type
  5372. // parameter, as a type. TemplateSel<Tmpl>::Bind<T>::type is defined
  5373. // as the type Tmpl<T>. This allows us to actually instantiate the
  5374. // template "selected" by TemplateSel<Tmpl>.
  5375. //
  5376. // This trick is necessary for simulating typedef for class templates,
  5377. // which C++ doesn't support directly.
  5378. template <GTEST_TEMPLATE_ Tmpl>
  5379. struct TemplateSel {
  5380. template <typename T>
  5381. struct Bind {
  5382. typedef Tmpl<T> type;
  5383. };
  5384. };
  5385. # define GTEST_BIND_(TmplSel, T) \
  5386. TmplSel::template Bind<T>::type
  5387. // A unique struct template used as the default value for the
  5388. // arguments of class template Templates. This allows us to simulate
  5389. // variadic templates (e.g. Templates<int>, Templates<int, double>,
  5390. // and etc), which C++ doesn't support directly.
  5391. template <typename T>
  5392. struct NoneT {};
  5393. // The following family of struct and struct templates are used to
  5394. // represent template lists. In particular, TemplatesN<T1, T2, ...,
  5395. // TN> represents a list of N templates (T1, T2, ..., and TN). Except
  5396. // for Templates0, every struct in the family has two member types:
  5397. // Head for the selector of the first template in the list, and Tail
  5398. // for the rest of the list.
  5399. // The empty template list.
  5400. struct Templates0 {};
  5401. // Template lists of length 1, 2, 3, and so on.
  5402. template <GTEST_TEMPLATE_ T1>
  5403. struct Templates1 {
  5404. typedef TemplateSel<T1> Head;
  5405. typedef Templates0 Tail;
  5406. };
  5407. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
  5408. struct Templates2 {
  5409. typedef TemplateSel<T1> Head;
  5410. typedef Templates1<T2> Tail;
  5411. };
  5412. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
  5413. struct Templates3 {
  5414. typedef TemplateSel<T1> Head;
  5415. typedef Templates2<T2, T3> Tail;
  5416. };
  5417. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5418. GTEST_TEMPLATE_ T4>
  5419. struct Templates4 {
  5420. typedef TemplateSel<T1> Head;
  5421. typedef Templates3<T2, T3, T4> Tail;
  5422. };
  5423. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5424. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
  5425. struct Templates5 {
  5426. typedef TemplateSel<T1> Head;
  5427. typedef Templates4<T2, T3, T4, T5> Tail;
  5428. };
  5429. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5430. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
  5431. struct Templates6 {
  5432. typedef TemplateSel<T1> Head;
  5433. typedef Templates5<T2, T3, T4, T5, T6> Tail;
  5434. };
  5435. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5436. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5437. GTEST_TEMPLATE_ T7>
  5438. struct Templates7 {
  5439. typedef TemplateSel<T1> Head;
  5440. typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
  5441. };
  5442. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5443. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5444. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
  5445. struct Templates8 {
  5446. typedef TemplateSel<T1> Head;
  5447. typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
  5448. };
  5449. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5450. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5451. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
  5452. struct Templates9 {
  5453. typedef TemplateSel<T1> Head;
  5454. typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
  5455. };
  5456. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5457. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5458. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5459. GTEST_TEMPLATE_ T10>
  5460. struct Templates10 {
  5461. typedef TemplateSel<T1> Head;
  5462. typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
  5463. };
  5464. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5465. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5466. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5467. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
  5468. struct Templates11 {
  5469. typedef TemplateSel<T1> Head;
  5470. typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
  5471. };
  5472. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5473. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5474. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5475. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
  5476. struct Templates12 {
  5477. typedef TemplateSel<T1> Head;
  5478. typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
  5479. };
  5480. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5481. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5482. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5483. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5484. GTEST_TEMPLATE_ T13>
  5485. struct Templates13 {
  5486. typedef TemplateSel<T1> Head;
  5487. typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
  5488. };
  5489. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5490. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5491. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5492. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5493. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
  5494. struct Templates14 {
  5495. typedef TemplateSel<T1> Head;
  5496. typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5497. T14> Tail;
  5498. };
  5499. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5500. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5501. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5502. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5503. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
  5504. struct Templates15 {
  5505. typedef TemplateSel<T1> Head;
  5506. typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5507. T15> Tail;
  5508. };
  5509. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5510. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5511. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5512. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5513. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5514. GTEST_TEMPLATE_ T16>
  5515. struct Templates16 {
  5516. typedef TemplateSel<T1> Head;
  5517. typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5518. T15, T16> Tail;
  5519. };
  5520. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5521. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5522. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5523. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5524. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5525. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
  5526. struct Templates17 {
  5527. typedef TemplateSel<T1> Head;
  5528. typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5529. T15, T16, T17> Tail;
  5530. };
  5531. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5532. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5533. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5534. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5535. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5536. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
  5537. struct Templates18 {
  5538. typedef TemplateSel<T1> Head;
  5539. typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5540. T15, T16, T17, T18> Tail;
  5541. };
  5542. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5543. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5544. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5545. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5546. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5547. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5548. GTEST_TEMPLATE_ T19>
  5549. struct Templates19 {
  5550. typedef TemplateSel<T1> Head;
  5551. typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5552. T15, T16, T17, T18, T19> Tail;
  5553. };
  5554. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5555. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5556. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5557. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5558. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5559. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5560. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
  5561. struct Templates20 {
  5562. typedef TemplateSel<T1> Head;
  5563. typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5564. T15, T16, T17, T18, T19, T20> Tail;
  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. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5570. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5571. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5572. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
  5573. struct Templates21 {
  5574. typedef TemplateSel<T1> Head;
  5575. typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5576. T15, T16, T17, T18, T19, T20, T21> Tail;
  5577. };
  5578. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5579. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5580. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5581. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5582. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5583. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5584. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5585. GTEST_TEMPLATE_ T22>
  5586. struct Templates22 {
  5587. typedef TemplateSel<T1> Head;
  5588. typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5589. T15, T16, T17, T18, T19, T20, T21, T22> Tail;
  5590. };
  5591. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5592. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5593. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5594. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5595. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5596. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5597. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5598. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
  5599. struct Templates23 {
  5600. typedef TemplateSel<T1> Head;
  5601. typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5602. T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
  5603. };
  5604. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5605. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5606. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5607. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5608. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5609. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5610. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5611. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
  5612. struct Templates24 {
  5613. typedef TemplateSel<T1> Head;
  5614. typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5615. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
  5616. };
  5617. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5618. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5619. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5620. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5621. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5622. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5623. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5624. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5625. GTEST_TEMPLATE_ T25>
  5626. struct Templates25 {
  5627. typedef TemplateSel<T1> Head;
  5628. typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5629. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
  5630. };
  5631. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5632. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5633. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5634. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5635. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5636. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5637. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5638. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5639. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
  5640. struct Templates26 {
  5641. typedef TemplateSel<T1> Head;
  5642. typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5643. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
  5644. };
  5645. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5646. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5647. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5648. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5649. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5650. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5651. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5652. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5653. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
  5654. struct Templates27 {
  5655. typedef TemplateSel<T1> Head;
  5656. typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5657. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
  5658. };
  5659. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5660. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5661. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5662. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5663. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5664. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5665. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5666. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5667. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5668. GTEST_TEMPLATE_ T28>
  5669. struct Templates28 {
  5670. typedef TemplateSel<T1> Head;
  5671. typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5672. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5673. T28> Tail;
  5674. };
  5675. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5676. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5677. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5678. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5679. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5680. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5681. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5682. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5683. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5684. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
  5685. struct Templates29 {
  5686. typedef TemplateSel<T1> Head;
  5687. typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5688. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5689. T29> Tail;
  5690. };
  5691. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5692. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5693. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5694. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5695. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5696. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5697. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5698. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5699. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5700. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
  5701. struct Templates30 {
  5702. typedef TemplateSel<T1> Head;
  5703. typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5704. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5705. T29, T30> Tail;
  5706. };
  5707. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5708. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5709. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5710. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5711. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5712. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5713. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5714. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5715. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5716. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5717. GTEST_TEMPLATE_ T31>
  5718. struct Templates31 {
  5719. typedef TemplateSel<T1> Head;
  5720. typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5721. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5722. T29, T30, T31> Tail;
  5723. };
  5724. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5725. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5726. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5727. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5728. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5729. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5730. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5731. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5732. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5733. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5734. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
  5735. struct Templates32 {
  5736. typedef TemplateSel<T1> Head;
  5737. typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5738. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5739. T29, T30, T31, T32> Tail;
  5740. };
  5741. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5742. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5743. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5744. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5745. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5746. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5747. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5748. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5749. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5750. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5751. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
  5752. struct Templates33 {
  5753. typedef TemplateSel<T1> Head;
  5754. typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5755. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5756. T29, T30, T31, T32, T33> Tail;
  5757. };
  5758. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5759. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5760. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5761. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5762. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5763. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5764. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5765. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5766. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5767. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5768. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5769. GTEST_TEMPLATE_ T34>
  5770. struct Templates34 {
  5771. typedef TemplateSel<T1> Head;
  5772. typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5773. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5774. T29, T30, T31, T32, T33, T34> Tail;
  5775. };
  5776. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5777. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5778. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5779. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5780. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5781. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5782. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5783. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5784. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5785. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5786. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5787. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
  5788. struct Templates35 {
  5789. typedef TemplateSel<T1> Head;
  5790. typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5791. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5792. T29, T30, T31, T32, T33, T34, T35> Tail;
  5793. };
  5794. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5795. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5796. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5797. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5798. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5799. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5800. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5801. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5802. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5803. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5804. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5805. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
  5806. struct Templates36 {
  5807. typedef TemplateSel<T1> Head;
  5808. typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5809. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5810. T29, T30, T31, T32, T33, T34, T35, T36> Tail;
  5811. };
  5812. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5813. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5814. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5815. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5816. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5817. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5818. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5819. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5820. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5821. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5822. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5823. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5824. GTEST_TEMPLATE_ T37>
  5825. struct Templates37 {
  5826. typedef TemplateSel<T1> Head;
  5827. typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5828. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5829. T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
  5830. };
  5831. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5832. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5833. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5834. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5835. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5836. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5837. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5838. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5839. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5840. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5841. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5842. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5843. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
  5844. struct Templates38 {
  5845. typedef TemplateSel<T1> Head;
  5846. typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5847. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5848. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
  5849. };
  5850. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5851. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5852. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5853. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5854. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5855. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5856. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5857. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5858. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5859. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5860. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5861. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5862. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
  5863. struct Templates39 {
  5864. typedef TemplateSel<T1> Head;
  5865. typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5866. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5867. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
  5868. };
  5869. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5870. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5871. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5872. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5873. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5874. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5875. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5876. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5877. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5878. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5879. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5880. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5881. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5882. GTEST_TEMPLATE_ T40>
  5883. struct Templates40 {
  5884. typedef TemplateSel<T1> Head;
  5885. typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5886. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5887. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
  5888. };
  5889. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5890. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5891. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5892. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5893. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5894. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5895. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5896. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5897. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5898. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5899. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5900. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5901. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5902. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
  5903. struct Templates41 {
  5904. typedef TemplateSel<T1> Head;
  5905. typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5906. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5907. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
  5908. };
  5909. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5910. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5911. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5912. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5913. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5914. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5915. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5916. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5917. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5918. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5919. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5920. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5921. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5922. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
  5923. struct Templates42 {
  5924. typedef TemplateSel<T1> Head;
  5925. typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5926. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5927. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5928. T42> Tail;
  5929. };
  5930. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5931. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5932. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5933. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5934. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5935. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5936. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5937. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5938. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5939. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5940. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5941. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5942. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5943. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5944. GTEST_TEMPLATE_ T43>
  5945. struct Templates43 {
  5946. typedef TemplateSel<T1> Head;
  5947. typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5948. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5949. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5950. T43> Tail;
  5951. };
  5952. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5953. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5954. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5955. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5956. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5957. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5958. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5959. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5960. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5961. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5962. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5963. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5964. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5965. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5966. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
  5967. struct Templates44 {
  5968. typedef TemplateSel<T1> Head;
  5969. typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5970. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5971. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5972. T43, T44> Tail;
  5973. };
  5974. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5975. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5976. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5977. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5978. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5979. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5980. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5981. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5982. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5983. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5984. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5985. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5986. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5987. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5988. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
  5989. struct Templates45 {
  5990. typedef TemplateSel<T1> Head;
  5991. typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5992. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5993. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5994. T43, T44, T45> Tail;
  5995. };
  5996. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5997. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5998. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5999. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6000. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6001. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6002. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6003. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6004. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6005. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6006. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6007. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6008. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6009. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6010. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6011. GTEST_TEMPLATE_ T46>
  6012. struct Templates46 {
  6013. typedef TemplateSel<T1> Head;
  6014. typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6015. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6016. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  6017. T43, T44, T45, T46> Tail;
  6018. };
  6019. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6020. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6021. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6022. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6023. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6024. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6025. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6026. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6027. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6028. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6029. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6030. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6031. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6032. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6033. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6034. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
  6035. struct Templates47 {
  6036. typedef TemplateSel<T1> Head;
  6037. typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6038. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6039. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  6040. T43, T44, T45, T46, T47> Tail;
  6041. };
  6042. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6043. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6044. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6045. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6046. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6047. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6048. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6049. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6050. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6051. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6052. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6053. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6054. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6055. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6056. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6057. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
  6058. struct Templates48 {
  6059. typedef TemplateSel<T1> Head;
  6060. typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6061. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6062. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  6063. T43, T44, T45, T46, T47, T48> Tail;
  6064. };
  6065. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6066. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6067. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6068. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6069. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6070. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6071. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6072. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6073. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6074. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6075. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6076. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6077. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6078. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6079. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6080. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
  6081. GTEST_TEMPLATE_ T49>
  6082. struct Templates49 {
  6083. typedef TemplateSel<T1> Head;
  6084. typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6085. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6086. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  6087. T43, T44, T45, T46, T47, T48, T49> Tail;
  6088. };
  6089. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6090. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6091. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6092. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6093. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6094. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6095. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6096. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6097. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6098. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6099. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6100. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6101. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6102. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6103. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6104. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
  6105. GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
  6106. struct Templates50 {
  6107. typedef TemplateSel<T1> Head;
  6108. typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6109. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6110. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  6111. T43, T44, T45, T46, T47, T48, T49, T50> Tail;
  6112. };
  6113. // We don't want to require the users to write TemplatesN<...> directly,
  6114. // as that would require them to count the length. Templates<...> is much
  6115. // easier to write, but generates horrible messages when there is a
  6116. // compiler error, as gcc insists on printing out each template
  6117. // argument, even if it has the default value (this means Templates<list>
  6118. // will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
  6119. // errors).
  6120. //
  6121. // Our solution is to combine the best part of the two approaches: a
  6122. // user would write Templates<T1, ..., TN>, and Google Test will translate
  6123. // that to TemplatesN<T1, ..., TN> internally to make error messages
  6124. // readable. The translation is done by the 'type' member of the
  6125. // Templates template.
  6126. template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
  6127. GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
  6128. GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
  6129. GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
  6130. GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
  6131. GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
  6132. GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
  6133. GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
  6134. GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
  6135. GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
  6136. GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
  6137. GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
  6138. GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
  6139. GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
  6140. GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
  6141. GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
  6142. GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
  6143. GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
  6144. GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
  6145. GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
  6146. GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
  6147. GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
  6148. GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
  6149. GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
  6150. GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
  6151. struct Templates {
  6152. typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6153. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6154. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6155. T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
  6156. };
  6157. template <>
  6158. struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6159. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6160. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6161. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6162. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6163. NoneT> {
  6164. typedef Templates0 type;
  6165. };
  6166. template <GTEST_TEMPLATE_ T1>
  6167. struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6168. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6169. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6170. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6171. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6172. NoneT> {
  6173. typedef Templates1<T1> type;
  6174. };
  6175. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
  6176. struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6177. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6178. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6179. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6180. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6181. NoneT> {
  6182. typedef Templates2<T1, T2> type;
  6183. };
  6184. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
  6185. struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6186. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6187. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6188. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6189. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6190. typedef Templates3<T1, T2, T3> type;
  6191. };
  6192. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6193. GTEST_TEMPLATE_ T4>
  6194. struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6195. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6196. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6197. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6198. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6199. typedef Templates4<T1, T2, T3, T4> type;
  6200. };
  6201. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6202. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
  6203. struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6204. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6205. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6206. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6207. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6208. typedef Templates5<T1, T2, T3, T4, T5> type;
  6209. };
  6210. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6211. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
  6212. struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
  6213. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6214. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6215. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6216. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6217. typedef Templates6<T1, T2, T3, T4, T5, T6> type;
  6218. };
  6219. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6220. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6221. GTEST_TEMPLATE_ T7>
  6222. struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
  6223. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6224. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6225. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6226. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6227. typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
  6228. };
  6229. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6230. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6231. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
  6232. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
  6233. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6234. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6235. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6236. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6237. typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
  6238. };
  6239. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6240. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6241. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
  6242. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
  6243. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6244. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6245. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6246. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6247. typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
  6248. };
  6249. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6250. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6251. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6252. GTEST_TEMPLATE_ T10>
  6253. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
  6254. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6255. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6256. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6257. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6258. typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
  6259. };
  6260. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6261. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6262. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6263. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
  6264. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
  6265. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6266. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6267. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6268. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6269. typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
  6270. };
  6271. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6272. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6273. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6274. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
  6275. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
  6276. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6277. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6278. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6279. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6280. typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
  6281. };
  6282. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6283. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6284. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6285. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6286. GTEST_TEMPLATE_ T13>
  6287. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
  6288. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6289. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6290. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6291. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6292. typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  6293. T13> type;
  6294. };
  6295. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6296. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6297. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6298. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6299. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
  6300. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6301. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6302. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6303. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6304. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6305. typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6306. T14> type;
  6307. };
  6308. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6309. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6310. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6311. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6312. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
  6313. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6314. T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6315. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6316. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6317. NoneT, NoneT, NoneT, NoneT, NoneT> {
  6318. typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6319. T14, T15> type;
  6320. };
  6321. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6322. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6323. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6324. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6325. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6326. GTEST_TEMPLATE_ T16>
  6327. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6328. T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6329. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6330. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6331. NoneT, NoneT, NoneT, NoneT, NoneT> {
  6332. typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6333. T14, T15, T16> type;
  6334. };
  6335. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6336. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6337. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6338. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6339. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6340. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
  6341. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6342. T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6343. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6344. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6345. NoneT, NoneT, NoneT, NoneT, NoneT> {
  6346. typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6347. T14, T15, T16, T17> type;
  6348. };
  6349. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6350. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6351. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6352. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6353. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6354. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
  6355. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6356. T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6357. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6358. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6359. NoneT, NoneT, NoneT, NoneT> {
  6360. typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6361. T14, T15, T16, T17, T18> type;
  6362. };
  6363. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6364. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6365. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6366. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6367. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6368. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6369. GTEST_TEMPLATE_ T19>
  6370. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6371. T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6372. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6373. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6374. NoneT, NoneT, NoneT, NoneT> {
  6375. typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6376. T14, T15, T16, T17, T18, T19> type;
  6377. };
  6378. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6379. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6380. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6381. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6382. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6383. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6384. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
  6385. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6386. T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6387. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6388. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6389. NoneT, NoneT, NoneT, NoneT> {
  6390. typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6391. T14, T15, T16, T17, T18, T19, T20> type;
  6392. };
  6393. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6394. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6395. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6396. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6397. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6398. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6399. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
  6400. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6401. T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
  6402. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6403. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6404. NoneT, NoneT, NoneT, NoneT> {
  6405. typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6406. T14, T15, T16, T17, T18, T19, T20, T21> type;
  6407. };
  6408. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6409. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6410. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6411. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6412. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6413. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6414. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6415. GTEST_TEMPLATE_ T22>
  6416. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6417. T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
  6418. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6419. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6420. NoneT, NoneT, NoneT> {
  6421. typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6422. T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
  6423. };
  6424. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6425. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6426. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6427. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6428. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6429. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6430. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6431. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
  6432. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6433. T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
  6434. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6435. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6436. NoneT, NoneT, NoneT> {
  6437. typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6438. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
  6439. };
  6440. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6441. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6442. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6443. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6444. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6445. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6446. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6447. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
  6448. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6449. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
  6450. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6451. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6452. NoneT, NoneT, NoneT> {
  6453. typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6454. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
  6455. };
  6456. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6457. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6458. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6459. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6460. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6461. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6462. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6463. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6464. GTEST_TEMPLATE_ T25>
  6465. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6466. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
  6467. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6468. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6469. NoneT, NoneT> {
  6470. typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6471. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
  6472. };
  6473. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6474. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6475. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6476. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6477. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6478. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6479. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6480. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6481. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
  6482. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6483. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
  6484. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6485. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6486. NoneT, NoneT> {
  6487. typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6488. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
  6489. };
  6490. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6491. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6492. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6493. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6494. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6495. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6496. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6497. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6498. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
  6499. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6500. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
  6501. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6502. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6503. NoneT, NoneT> {
  6504. typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6505. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  6506. T27> type;
  6507. };
  6508. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6509. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6510. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6511. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6512. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6513. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6514. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6515. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6516. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6517. GTEST_TEMPLATE_ T28>
  6518. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6519. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6520. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6521. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6522. NoneT, NoneT> {
  6523. typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6524. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6525. T28> type;
  6526. };
  6527. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6528. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6529. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6530. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6531. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6532. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6533. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6534. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6535. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6536. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
  6537. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6538. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6539. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6540. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6541. NoneT> {
  6542. typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6543. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6544. T28, T29> type;
  6545. };
  6546. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6547. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6548. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6549. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6550. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6551. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6552. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6553. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6554. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6555. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
  6556. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6557. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6558. T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6559. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6560. typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6561. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6562. T28, T29, T30> type;
  6563. };
  6564. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6565. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6566. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6567. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6568. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6569. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6570. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6571. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6572. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6573. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6574. GTEST_TEMPLATE_ T31>
  6575. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6576. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6577. T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6578. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6579. typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6580. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6581. T28, T29, T30, T31> type;
  6582. };
  6583. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6584. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6585. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6586. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6587. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6588. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6589. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6590. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6591. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6592. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6593. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
  6594. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6595. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6596. T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6597. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6598. typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6599. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6600. T28, T29, T30, T31, T32> type;
  6601. };
  6602. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6603. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6604. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6605. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6606. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6607. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6608. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6609. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6610. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6611. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6612. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
  6613. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6614. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6615. T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6616. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6617. typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6618. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6619. T28, T29, T30, T31, T32, T33> type;
  6620. };
  6621. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6622. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6623. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6624. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6625. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6626. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6627. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6628. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6629. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6630. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6631. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6632. GTEST_TEMPLATE_ T34>
  6633. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6634. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6635. T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6636. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6637. typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6638. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6639. T28, T29, T30, T31, T32, T33, T34> type;
  6640. };
  6641. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6642. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6643. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6644. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6645. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6646. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6647. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6648. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6649. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6650. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6651. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6652. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
  6653. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6654. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6655. T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  6656. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6657. typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6658. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6659. T28, T29, T30, T31, T32, T33, T34, T35> type;
  6660. };
  6661. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6662. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6663. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6664. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6665. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6666. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6667. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6668. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6669. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6670. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6671. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6672. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
  6673. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6674. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6675. T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
  6676. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6677. typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6678. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6679. T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
  6680. };
  6681. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6682. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6683. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6684. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6685. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6686. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6687. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6688. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6689. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6690. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6691. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6692. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6693. GTEST_TEMPLATE_ T37>
  6694. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6695. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6696. T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
  6697. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6698. typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6699. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6700. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
  6701. };
  6702. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6703. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6704. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6705. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6706. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6707. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6708. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6709. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6710. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6711. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6712. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6713. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6714. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
  6715. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6716. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6717. T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
  6718. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6719. typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6720. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6721. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
  6722. };
  6723. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6724. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6725. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6726. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6727. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6728. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6729. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6730. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6731. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6732. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6733. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6734. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6735. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
  6736. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6737. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6738. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
  6739. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6740. typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6741. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6742. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
  6743. };
  6744. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6745. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6746. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6747. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6748. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6749. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6750. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6751. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6752. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6753. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6754. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6755. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6756. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6757. GTEST_TEMPLATE_ T40>
  6758. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6759. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6760. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
  6761. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6762. typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6763. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6764. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
  6765. };
  6766. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6767. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6768. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6769. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6770. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6771. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6772. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6773. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6774. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6775. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6776. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6777. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6778. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6779. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
  6780. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6781. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6782. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
  6783. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6784. typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6785. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6786. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  6787. T41> type;
  6788. };
  6789. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6790. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6791. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6792. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6793. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6794. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6795. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6796. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6797. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6798. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6799. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6800. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6801. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6802. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
  6803. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6804. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6805. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
  6806. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6807. typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6808. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6809. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6810. T42> type;
  6811. };
  6812. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6813. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6814. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6815. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6816. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6817. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6818. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6819. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6820. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6821. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6822. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6823. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6824. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6825. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6826. GTEST_TEMPLATE_ T43>
  6827. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6828. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6829. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  6830. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6831. typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6832. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6833. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6834. T42, T43> type;
  6835. };
  6836. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6837. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6838. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6839. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6840. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6841. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6842. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6843. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6844. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6845. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6846. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6847. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6848. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6849. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6850. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
  6851. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6852. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6853. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  6854. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6855. typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6856. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6857. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6858. T42, T43, T44> type;
  6859. };
  6860. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6861. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6862. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6863. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6864. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6865. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6866. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6867. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6868. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6869. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6870. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6871. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6872. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6873. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6874. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
  6875. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6876. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6877. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  6878. T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
  6879. typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6880. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6881. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6882. T42, T43, T44, T45> type;
  6883. };
  6884. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6885. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6886. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6887. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6888. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6889. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6890. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6891. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6892. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6893. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6894. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6895. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6896. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6897. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6898. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6899. GTEST_TEMPLATE_ T46>
  6900. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6901. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6902. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  6903. T45, T46, NoneT, NoneT, NoneT, NoneT> {
  6904. typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6905. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6906. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6907. T42, T43, T44, T45, T46> type;
  6908. };
  6909. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6910. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6911. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6912. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6913. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6914. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6915. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6916. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6917. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6918. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6919. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6920. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6921. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6922. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6923. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6924. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
  6925. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6926. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6927. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  6928. T45, T46, T47, NoneT, NoneT, NoneT> {
  6929. typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6930. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6931. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6932. T42, T43, T44, T45, T46, T47> type;
  6933. };
  6934. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6935. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6936. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6937. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6938. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6939. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6940. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6941. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6942. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6943. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6944. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6945. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6946. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6947. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6948. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6949. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
  6950. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6951. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6952. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  6953. T45, T46, T47, T48, NoneT, NoneT> {
  6954. typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6955. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6956. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6957. T42, T43, T44, T45, T46, T47, T48> type;
  6958. };
  6959. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6960. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6961. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6962. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6963. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6964. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6965. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6966. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6967. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6968. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6969. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6970. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6971. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6972. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6973. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6974. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
  6975. GTEST_TEMPLATE_ T49>
  6976. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6977. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6978. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  6979. T45, T46, T47, T48, T49, NoneT> {
  6980. typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6981. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6982. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6983. T42, T43, T44, T45, T46, T47, T48, T49> type;
  6984. };
  6985. // The TypeList template makes it possible to use either a single type
  6986. // or a Types<...> list in TYPED_TEST_CASE() and
  6987. // INSTANTIATE_TYPED_TEST_CASE_P().
  6988. template <typename T>
  6989. struct TypeList {
  6990. typedef Types1<T> type;
  6991. };
  6992. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  6993. typename T6, typename T7, typename T8, typename T9, typename T10,
  6994. typename T11, typename T12, typename T13, typename T14, typename T15,
  6995. typename T16, typename T17, typename T18, typename T19, typename T20,
  6996. typename T21, typename T22, typename T23, typename T24, typename T25,
  6997. typename T26, typename T27, typename T28, typename T29, typename T30,
  6998. typename T31, typename T32, typename T33, typename T34, typename T35,
  6999. typename T36, typename T37, typename T38, typename T39, typename T40,
  7000. typename T41, typename T42, typename T43, typename T44, typename T45,
  7001. typename T46, typename T47, typename T48, typename T49, typename T50>
  7002. struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  7003. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  7004. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  7005. T44, T45, T46, T47, T48, T49, T50> > {
  7006. typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  7007. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  7008. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  7009. T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
  7010. };
  7011. #endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  7012. } // namespace internal
  7013. } // namespace testing
  7014. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
  7015. // Due to C++ preprocessor weirdness, we need double indirection to
  7016. // concatenate two tokens when one of them is __LINE__. Writing
  7017. //
  7018. // foo ## __LINE__
  7019. //
  7020. // will result in the token foo__LINE__, instead of foo followed by
  7021. // the current line number. For more details, see
  7022. // http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
  7023. #define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
  7024. #define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
  7025. class ProtocolMessage;
  7026. namespace proto2 { class Message; }
  7027. namespace testing {
  7028. // Forward declarations.
  7029. class AssertionResult; // Result of an assertion.
  7030. class Message; // Represents a failure message.
  7031. class Test; // Represents a test.
  7032. class TestInfo; // Information about a test.
  7033. class TestPartResult; // Result of a test part.
  7034. class UnitTest; // A collection of test cases.
  7035. template <typename T>
  7036. ::std::string PrintToString(const T& value);
  7037. namespace internal {
  7038. struct TraceInfo; // Information about a trace point.
  7039. class ScopedTrace; // Implements scoped trace.
  7040. class TestInfoImpl; // Opaque implementation of TestInfo
  7041. class UnitTestImpl; // Opaque implementation of UnitTest
  7042. // The text used in failure messages to indicate the start of the
  7043. // stack trace.
  7044. GTEST_API_ extern const char kStackTraceMarker[];
  7045. // Two overloaded helpers for checking at compile time whether an
  7046. // expression is a null pointer literal (i.e. NULL or any 0-valued
  7047. // compile-time integral constant). Their return values have
  7048. // different sizes, so we can use sizeof() to test which version is
  7049. // picked by the compiler. These helpers have no implementations, as
  7050. // we only need their signatures.
  7051. //
  7052. // Given IsNullLiteralHelper(x), the compiler will pick the first
  7053. // version if x can be implicitly converted to Secret*, and pick the
  7054. // second version otherwise. Since Secret is a secret and incomplete
  7055. // type, the only expression a user can write that has type Secret* is
  7056. // a null pointer literal. Therefore, we know that x is a null
  7057. // pointer literal if and only if the first version is picked by the
  7058. // compiler.
  7059. char IsNullLiteralHelper(Secret* p);
  7060. char (&IsNullLiteralHelper(...))[2]; // NOLINT
  7061. // A compile-time bool constant that is true if and only if x is a
  7062. // null pointer literal (i.e. NULL or any 0-valued compile-time
  7063. // integral constant).
  7064. #ifdef GTEST_ELLIPSIS_NEEDS_POD_
  7065. // We lose support for NULL detection where the compiler doesn't like
  7066. // passing non-POD classes through ellipsis (...).
  7067. # define GTEST_IS_NULL_LITERAL_(x) false
  7068. #else
  7069. # define GTEST_IS_NULL_LITERAL_(x) \
  7070. (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
  7071. #endif // GTEST_ELLIPSIS_NEEDS_POD_
  7072. // Appends the user-supplied message to the Google-Test-generated message.
  7073. GTEST_API_ std::string AppendUserMessage(
  7074. const std::string& gtest_msg, const Message& user_msg);
  7075. #if GTEST_HAS_EXCEPTIONS
  7076. // This exception is thrown by (and only by) a failed Google Test
  7077. // assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions
  7078. // are enabled). We derive it from std::runtime_error, which is for
  7079. // errors presumably detectable only at run time. Since
  7080. // std::runtime_error inherits from std::exception, many testing
  7081. // frameworks know how to extract and print the message inside it.
  7082. class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {
  7083. public:
  7084. explicit GoogleTestFailureException(const TestPartResult& failure);
  7085. };
  7086. #endif // GTEST_HAS_EXCEPTIONS
  7087. // A helper class for creating scoped traces in user programs.
  7088. class GTEST_API_ ScopedTrace {
  7089. public:
  7090. // The c'tor pushes the given source file location and message onto
  7091. // a trace stack maintained by Google Test.
  7092. ScopedTrace(const char* file, int line, const Message& message);
  7093. // The d'tor pops the info pushed by the c'tor.
  7094. //
  7095. // Note that the d'tor is not virtual in order to be efficient.
  7096. // Don't inherit from ScopedTrace!
  7097. ~ScopedTrace();
  7098. private:
  7099. GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
  7100. } GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its
  7101. // c'tor and d'tor. Therefore it doesn't
  7102. // need to be used otherwise.
  7103. namespace edit_distance {
  7104. // Returns the optimal edits to go from 'left' to 'right'.
  7105. // All edits cost the same, with replace having lower priority than
  7106. // add/remove.
  7107. // Simple implementation of the Wagner–Fischer algorithm.
  7108. // See http://en.wikipedia.org/wiki/Wagner-Fischer_algorithm
  7109. enum EditType { kMatch, kAdd, kRemove, kReplace };
  7110. GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
  7111. const std::vector<size_t>& left, const std::vector<size_t>& right);
  7112. // Same as above, but the input is represented as strings.
  7113. GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
  7114. const std::vector<std::string>& left,
  7115. const std::vector<std::string>& right);
  7116. // Create a diff of the input strings in Unified diff format.
  7117. GTEST_API_ std::string CreateUnifiedDiff(const std::vector<std::string>& left,
  7118. const std::vector<std::string>& right,
  7119. size_t context = 2);
  7120. } // namespace edit_distance
  7121. // Calculate the diff between 'left' and 'right' and return it in unified diff
  7122. // format.
  7123. // If not null, stores in 'total_line_count' the total number of lines found
  7124. // in left + right.
  7125. GTEST_API_ std::string DiffStrings(const std::string& left,
  7126. const std::string& right,
  7127. size_t* total_line_count);
  7128. // Constructs and returns the message for an equality assertion
  7129. // (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
  7130. //
  7131. // The first four parameters are the expressions used in the assertion
  7132. // and their values, as strings. For example, for ASSERT_EQ(foo, bar)
  7133. // where foo is 5 and bar is 6, we have:
  7134. //
  7135. // expected_expression: "foo"
  7136. // actual_expression: "bar"
  7137. // expected_value: "5"
  7138. // actual_value: "6"
  7139. //
  7140. // The ignoring_case parameter is true iff the assertion is a
  7141. // *_STRCASEEQ*. When it's true, the string " (ignoring case)" will
  7142. // be inserted into the message.
  7143. GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
  7144. const char* actual_expression,
  7145. const std::string& expected_value,
  7146. const std::string& actual_value,
  7147. bool ignoring_case);
  7148. // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
  7149. GTEST_API_ std::string GetBoolAssertionFailureMessage(
  7150. const AssertionResult& assertion_result,
  7151. const char* expression_text,
  7152. const char* actual_predicate_value,
  7153. const char* expected_predicate_value);
  7154. // This template class represents an IEEE floating-point number
  7155. // (either single-precision or double-precision, depending on the
  7156. // template parameters).
  7157. //
  7158. // The purpose of this class is to do more sophisticated number
  7159. // comparison. (Due to round-off error, etc, it's very unlikely that
  7160. // two floating-points will be equal exactly. Hence a naive
  7161. // comparison by the == operation often doesn't work.)
  7162. //
  7163. // Format of IEEE floating-point:
  7164. //
  7165. // The most-significant bit being the leftmost, an IEEE
  7166. // floating-point looks like
  7167. //
  7168. // sign_bit exponent_bits fraction_bits
  7169. //
  7170. // Here, sign_bit is a single bit that designates the sign of the
  7171. // number.
  7172. //
  7173. // For float, there are 8 exponent bits and 23 fraction bits.
  7174. //
  7175. // For double, there are 11 exponent bits and 52 fraction bits.
  7176. //
  7177. // More details can be found at
  7178. // http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
  7179. //
  7180. // Template parameter:
  7181. //
  7182. // RawType: the raw floating-point type (either float or double)
  7183. template <typename RawType>
  7184. class FloatingPoint {
  7185. public:
  7186. // Defines the unsigned integer type that has the same size as the
  7187. // floating point number.
  7188. typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
  7189. // Constants.
  7190. // # of bits in a number.
  7191. static const size_t kBitCount = 8*sizeof(RawType);
  7192. // # of fraction bits in a number.
  7193. static const size_t kFractionBitCount =
  7194. std::numeric_limits<RawType>::digits - 1;
  7195. // # of exponent bits in a number.
  7196. static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
  7197. // The mask for the sign bit.
  7198. static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
  7199. // The mask for the fraction bits.
  7200. static const Bits kFractionBitMask =
  7201. ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
  7202. // The mask for the exponent bits.
  7203. static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
  7204. // How many ULP's (Units in the Last Place) we want to tolerate when
  7205. // comparing two numbers. The larger the value, the more error we
  7206. // allow. A 0 value means that two numbers must be exactly the same
  7207. // to be considered equal.
  7208. //
  7209. // The maximum error of a single floating-point operation is 0.5
  7210. // units in the last place. On Intel CPU's, all floating-point
  7211. // calculations are done with 80-bit precision, while double has 64
  7212. // bits. Therefore, 4 should be enough for ordinary use.
  7213. //
  7214. // See the following article for more details on ULP:
  7215. // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
  7216. static const size_t kMaxUlps = 4;
  7217. // Constructs a FloatingPoint from a raw floating-point number.
  7218. //
  7219. // On an Intel CPU, passing a non-normalized NAN (Not a Number)
  7220. // around may change its bits, although the new value is guaranteed
  7221. // to be also a NAN. Therefore, don't expect this constructor to
  7222. // preserve the bits in x when x is a NAN.
  7223. explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
  7224. // Static methods
  7225. // Reinterprets a bit pattern as a floating-point number.
  7226. //
  7227. // This function is needed to test the AlmostEquals() method.
  7228. static RawType ReinterpretBits(const Bits bits) {
  7229. FloatingPoint fp(0);
  7230. fp.u_.bits_ = bits;
  7231. return fp.u_.value_;
  7232. }
  7233. // Returns the floating-point number that represent positive infinity.
  7234. static RawType Infinity() {
  7235. return ReinterpretBits(kExponentBitMask);
  7236. }
  7237. // Returns the maximum representable finite floating-point number.
  7238. static RawType Max();
  7239. // Non-static methods
  7240. // Returns the bits that represents this number.
  7241. const Bits &bits() const { return u_.bits_; }
  7242. // Returns the exponent bits of this number.
  7243. Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
  7244. // Returns the fraction bits of this number.
  7245. Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
  7246. // Returns the sign bit of this number.
  7247. Bits sign_bit() const { return kSignBitMask & u_.bits_; }
  7248. // Returns true iff this is NAN (not a number).
  7249. bool is_nan() const {
  7250. // It's a NAN if the exponent bits are all ones and the fraction
  7251. // bits are not entirely zeros.
  7252. return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
  7253. }
  7254. // Returns true iff this number is at most kMaxUlps ULP's away from
  7255. // rhs. In particular, this function:
  7256. //
  7257. // - returns false if either number is (or both are) NAN.
  7258. // - treats really large numbers as almost equal to infinity.
  7259. // - thinks +0.0 and -0.0 are 0 DLP's apart.
  7260. bool AlmostEquals(const FloatingPoint& rhs) const {
  7261. // The IEEE standard says that any comparison operation involving
  7262. // a NAN must return false.
  7263. if (is_nan() || rhs.is_nan()) return false;
  7264. return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
  7265. <= kMaxUlps;
  7266. }
  7267. private:
  7268. // The data type used to store the actual floating-point number.
  7269. union FloatingPointUnion {
  7270. RawType value_; // The raw floating-point number.
  7271. Bits bits_; // The bits that represent the number.
  7272. };
  7273. // Converts an integer from the sign-and-magnitude representation to
  7274. // the biased representation. More precisely, let N be 2 to the
  7275. // power of (kBitCount - 1), an integer x is represented by the
  7276. // unsigned number x + N.
  7277. //
  7278. // For instance,
  7279. //
  7280. // -N + 1 (the most negative number representable using
  7281. // sign-and-magnitude) is represented by 1;
  7282. // 0 is represented by N; and
  7283. // N - 1 (the biggest number representable using
  7284. // sign-and-magnitude) is represented by 2N - 1.
  7285. //
  7286. // Read http://en.wikipedia.org/wiki/Signed_number_representations
  7287. // for more details on signed number representations.
  7288. static Bits SignAndMagnitudeToBiased(const Bits &sam) {
  7289. if (kSignBitMask & sam) {
  7290. // sam represents a negative number.
  7291. return ~sam + 1;
  7292. } else {
  7293. // sam represents a positive number.
  7294. return kSignBitMask | sam;
  7295. }
  7296. }
  7297. // Given two numbers in the sign-and-magnitude representation,
  7298. // returns the distance between them as an unsigned number.
  7299. static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
  7300. const Bits &sam2) {
  7301. const Bits biased1 = SignAndMagnitudeToBiased(sam1);
  7302. const Bits biased2 = SignAndMagnitudeToBiased(sam2);
  7303. return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
  7304. }
  7305. FloatingPointUnion u_;
  7306. };
  7307. // We cannot use std::numeric_limits<T>::max() as it clashes with the max()
  7308. // macro defined by <windows.h>.
  7309. template <>
  7310. inline float FloatingPoint<float>::Max() { return FLT_MAX; }
  7311. template <>
  7312. inline double FloatingPoint<double>::Max() { return DBL_MAX; }
  7313. // Typedefs the instances of the FloatingPoint template class that we
  7314. // care to use.
  7315. typedef FloatingPoint<float> Float;
  7316. typedef FloatingPoint<double> Double;
  7317. // In order to catch the mistake of putting tests that use different
  7318. // test fixture classes in the same test case, we need to assign
  7319. // unique IDs to fixture classes and compare them. The TypeId type is
  7320. // used to hold such IDs. The user should treat TypeId as an opaque
  7321. // type: the only operation allowed on TypeId values is to compare
  7322. // them for equality using the == operator.
  7323. typedef const void* TypeId;
  7324. template <typename T>
  7325. class TypeIdHelper {
  7326. public:
  7327. // dummy_ must not have a const type. Otherwise an overly eager
  7328. // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
  7329. // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
  7330. static bool dummy_;
  7331. };
  7332. template <typename T>
  7333. bool TypeIdHelper<T>::dummy_ = false;
  7334. // GetTypeId<T>() returns the ID of type T. Different values will be
  7335. // returned for different types. Calling the function twice with the
  7336. // same type argument is guaranteed to return the same ID.
  7337. template <typename T>
  7338. TypeId GetTypeId() {
  7339. // The compiler is required to allocate a different
  7340. // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
  7341. // the template. Therefore, the address of dummy_ is guaranteed to
  7342. // be unique.
  7343. return &(TypeIdHelper<T>::dummy_);
  7344. }
  7345. // Returns the type ID of ::testing::Test. Always call this instead
  7346. // of GetTypeId< ::testing::Test>() to get the type ID of
  7347. // ::testing::Test, as the latter may give the wrong result due to a
  7348. // suspected linker bug when compiling Google Test as a Mac OS X
  7349. // framework.
  7350. GTEST_API_ TypeId GetTestTypeId();
  7351. // Defines the abstract factory interface that creates instances
  7352. // of a Test object.
  7353. class TestFactoryBase {
  7354. public:
  7355. virtual ~TestFactoryBase() {}
  7356. // Creates a test instance to run. The instance is both created and destroyed
  7357. // within TestInfoImpl::Run()
  7358. virtual Test* CreateTest() = 0;
  7359. protected:
  7360. TestFactoryBase() {}
  7361. private:
  7362. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
  7363. };
  7364. // This class provides implementation of TeastFactoryBase interface.
  7365. // It is used in TEST and TEST_F macros.
  7366. template <class TestClass>
  7367. class TestFactoryImpl : public TestFactoryBase {
  7368. public:
  7369. virtual Test* CreateTest() { return new TestClass; }
  7370. };
  7371. #if GTEST_OS_WINDOWS
  7372. // Predicate-formatters for implementing the HRESULT checking macros
  7373. // {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
  7374. // We pass a long instead of HRESULT to avoid causing an
  7375. // include dependency for the HRESULT type.
  7376. GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
  7377. long hr); // NOLINT
  7378. GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
  7379. long hr); // NOLINT
  7380. #endif // GTEST_OS_WINDOWS
  7381. // Types of SetUpTestCase() and TearDownTestCase() functions.
  7382. typedef void (*SetUpTestCaseFunc)();
  7383. typedef void (*TearDownTestCaseFunc)();
  7384. struct CodeLocation {
  7385. CodeLocation(const string& a_file, int a_line) : file(a_file), line(a_line) {}
  7386. string file;
  7387. int line;
  7388. };
  7389. // Creates a new TestInfo object and registers it with Google Test;
  7390. // returns the created object.
  7391. //
  7392. // Arguments:
  7393. //
  7394. // test_case_name: name of the test case
  7395. // name: name of the test
  7396. // type_param the name of the test's type parameter, or NULL if
  7397. // this is not a typed or a type-parameterized test.
  7398. // value_param text representation of the test's value parameter,
  7399. // or NULL if this is not a type-parameterized test.
  7400. // code_location: code location where the test is defined
  7401. // fixture_class_id: ID of the test fixture class
  7402. // set_up_tc: pointer to the function that sets up the test case
  7403. // tear_down_tc: pointer to the function that tears down the test case
  7404. // factory: pointer to the factory that creates a test object.
  7405. // The newly created TestInfo instance will assume
  7406. // ownership of the factory object.
  7407. GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
  7408. const char* test_case_name,
  7409. const char* name,
  7410. const char* type_param,
  7411. const char* value_param,
  7412. CodeLocation code_location,
  7413. TypeId fixture_class_id,
  7414. SetUpTestCaseFunc set_up_tc,
  7415. TearDownTestCaseFunc tear_down_tc,
  7416. TestFactoryBase* factory);
  7417. // If *pstr starts with the given prefix, modifies *pstr to be right
  7418. // past the prefix and returns true; otherwise leaves *pstr unchanged
  7419. // and returns false. None of pstr, *pstr, and prefix can be NULL.
  7420. GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
  7421. #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  7422. // State of the definition of a type-parameterized test case.
  7423. class GTEST_API_ TypedTestCasePState {
  7424. public:
  7425. TypedTestCasePState() : registered_(false) {}
  7426. // Adds the given test name to defined_test_names_ and return true
  7427. // if the test case hasn't been registered; otherwise aborts the
  7428. // program.
  7429. bool AddTestName(const char* file, int line, const char* case_name,
  7430. const char* test_name) {
  7431. if (registered_) {
  7432. fprintf(stderr, "%s Test %s must be defined before "
  7433. "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
  7434. FormatFileLocation(file, line).c_str(), test_name, case_name);
  7435. fflush(stderr);
  7436. posix::Abort();
  7437. }
  7438. registered_tests_.insert(
  7439. ::std::make_pair(test_name, CodeLocation(file, line)));
  7440. return true;
  7441. }
  7442. bool TestExists(const std::string& test_name) const {
  7443. return registered_tests_.count(test_name) > 0;
  7444. }
  7445. const CodeLocation& GetCodeLocation(const std::string& test_name) const {
  7446. RegisteredTestsMap::const_iterator it = registered_tests_.find(test_name);
  7447. GTEST_CHECK_(it != registered_tests_.end());
  7448. return it->second;
  7449. }
  7450. // Verifies that registered_tests match the test names in
  7451. // defined_test_names_; returns registered_tests if successful, or
  7452. // aborts the program otherwise.
  7453. const char* VerifyRegisteredTestNames(
  7454. const char* file, int line, const char* registered_tests);
  7455. private:
  7456. typedef ::std::map<std::string, CodeLocation> RegisteredTestsMap;
  7457. bool registered_;
  7458. RegisteredTestsMap registered_tests_;
  7459. };
  7460. // Skips to the first non-space char after the first comma in 'str';
  7461. // returns NULL if no comma is found in 'str'.
  7462. inline const char* SkipComma(const char* str) {
  7463. const char* comma = strchr(str, ',');
  7464. if (comma == NULL) {
  7465. return NULL;
  7466. }
  7467. while (IsSpace(*(++comma))) {}
  7468. return comma;
  7469. }
  7470. // Returns the prefix of 'str' before the first comma in it; returns
  7471. // the entire string if it contains no comma.
  7472. inline std::string GetPrefixUntilComma(const char* str) {
  7473. const char* comma = strchr(str, ',');
  7474. return comma == NULL ? str : std::string(str, comma);
  7475. }
  7476. // Splits a given string on a given delimiter, populating a given
  7477. // vector with the fields.
  7478. void SplitString(const ::std::string& str, char delimiter,
  7479. ::std::vector< ::std::string>* dest);
  7480. // TypeParameterizedTest<Fixture, TestSel, Types>::Register()
  7481. // registers a list of type-parameterized tests with Google Test. The
  7482. // return value is insignificant - we just need to return something
  7483. // such that we can call this function in a namespace scope.
  7484. //
  7485. // Implementation note: The GTEST_TEMPLATE_ macro declares a template
  7486. // template parameter. It's defined in gtest-type-util.h.
  7487. template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
  7488. class TypeParameterizedTest {
  7489. public:
  7490. // 'index' is the index of the test in the type list 'Types'
  7491. // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
  7492. // Types). Valid values for 'index' are [0, N - 1] where N is the
  7493. // length of Types.
  7494. static bool Register(const char* prefix,
  7495. CodeLocation code_location,
  7496. const char* case_name, const char* test_names,
  7497. int index) {
  7498. typedef typename Types::Head Type;
  7499. typedef Fixture<Type> FixtureClass;
  7500. typedef typename GTEST_BIND_(TestSel, Type) TestClass;
  7501. // First, registers the first type-parameterized test in the type
  7502. // list.
  7503. MakeAndRegisterTestInfo(
  7504. (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/"
  7505. + StreamableToString(index)).c_str(),
  7506. StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),
  7507. GetTypeName<Type>().c_str(),
  7508. NULL, // No value parameter.
  7509. code_location,
  7510. GetTypeId<FixtureClass>(),
  7511. TestClass::SetUpTestCase,
  7512. TestClass::TearDownTestCase,
  7513. new TestFactoryImpl<TestClass>);
  7514. // Next, recurses (at compile time) with the tail of the type list.
  7515. return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
  7516. ::Register(prefix, code_location, case_name, test_names, index + 1);
  7517. }
  7518. };
  7519. // The base case for the compile time recursion.
  7520. template <GTEST_TEMPLATE_ Fixture, class TestSel>
  7521. class TypeParameterizedTest<Fixture, TestSel, Types0> {
  7522. public:
  7523. static bool Register(const char* /*prefix*/, CodeLocation,
  7524. const char* /*case_name*/, const char* /*test_names*/,
  7525. int /*index*/) {
  7526. return true;
  7527. }
  7528. };
  7529. // TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
  7530. // registers *all combinations* of 'Tests' and 'Types' with Google
  7531. // Test. The return value is insignificant - we just need to return
  7532. // something such that we can call this function in a namespace scope.
  7533. template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
  7534. class TypeParameterizedTestCase {
  7535. public:
  7536. static bool Register(const char* prefix, CodeLocation code_location,
  7537. const TypedTestCasePState* state,
  7538. const char* case_name, const char* test_names) {
  7539. std::string test_name = StripTrailingSpaces(
  7540. GetPrefixUntilComma(test_names));
  7541. if (!state->TestExists(test_name)) {
  7542. fprintf(stderr, "Failed to get code location for test %s.%s at %s.",
  7543. case_name, test_name.c_str(),
  7544. FormatFileLocation(code_location.file.c_str(),
  7545. code_location.line).c_str());
  7546. fflush(stderr);
  7547. posix::Abort();
  7548. }
  7549. const CodeLocation& test_location = state->GetCodeLocation(test_name);
  7550. typedef typename Tests::Head Head;
  7551. // First, register the first test in 'Test' for each type in 'Types'.
  7552. TypeParameterizedTest<Fixture, Head, Types>::Register(
  7553. prefix, test_location, case_name, test_names, 0);
  7554. // Next, recurses (at compile time) with the tail of the test list.
  7555. return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
  7556. ::Register(prefix, code_location, state,
  7557. case_name, SkipComma(test_names));
  7558. }
  7559. };
  7560. // The base case for the compile time recursion.
  7561. template <GTEST_TEMPLATE_ Fixture, typename Types>
  7562. class TypeParameterizedTestCase<Fixture, Templates0, Types> {
  7563. public:
  7564. static bool Register(const char* /*prefix*/, CodeLocation,
  7565. const TypedTestCasePState* /*state*/,
  7566. const char* /*case_name*/, const char* /*test_names*/) {
  7567. return true;
  7568. }
  7569. };
  7570. #endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  7571. // Returns the current OS stack trace as an std::string.
  7572. //
  7573. // The maximum number of stack frames to be included is specified by
  7574. // the gtest_stack_trace_depth flag. The skip_count parameter
  7575. // specifies the number of top frames to be skipped, which doesn't
  7576. // count against the number of frames to be included.
  7577. //
  7578. // For example, if Foo() calls Bar(), which in turn calls
  7579. // GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
  7580. // the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
  7581. GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(
  7582. UnitTest* unit_test, int skip_count);
  7583. // Helpers for suppressing warnings on unreachable code or constant
  7584. // condition.
  7585. // Always returns true.
  7586. GTEST_API_ bool AlwaysTrue();
  7587. // Always returns false.
  7588. inline bool AlwaysFalse() { return !AlwaysTrue(); }
  7589. // Helper for suppressing false warning from Clang on a const char*
  7590. // variable declared in a conditional expression always being NULL in
  7591. // the else branch.
  7592. struct GTEST_API_ ConstCharPtr {
  7593. ConstCharPtr(const char* str) : value(str) {}
  7594. operator bool() const { return true; }
  7595. const char* value;
  7596. };
  7597. // A simple Linear Congruential Generator for generating random
  7598. // numbers with a uniform distribution. Unlike rand() and srand(), it
  7599. // doesn't use global state (and therefore can't interfere with user
  7600. // code). Unlike rand_r(), it's portable. An LCG isn't very random,
  7601. // but it's good enough for our purposes.
  7602. class GTEST_API_ Random {
  7603. public:
  7604. static const UInt32 kMaxRange = 1u << 31;
  7605. explicit Random(UInt32 seed) : state_(seed) {}
  7606. void Reseed(UInt32 seed) { state_ = seed; }
  7607. // Generates a random number from [0, range). Crashes if 'range' is
  7608. // 0 or greater than kMaxRange.
  7609. UInt32 Generate(UInt32 range);
  7610. private:
  7611. UInt32 state_;
  7612. GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
  7613. };
  7614. // Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
  7615. // compiler error iff T1 and T2 are different types.
  7616. template <typename T1, typename T2>
  7617. struct CompileAssertTypesEqual;
  7618. template <typename T>
  7619. struct CompileAssertTypesEqual<T, T> {
  7620. };
  7621. // Removes the reference from a type if it is a reference type,
  7622. // otherwise leaves it unchanged. This is the same as
  7623. // tr1::remove_reference, which is not widely available yet.
  7624. template <typename T>
  7625. struct RemoveReference { typedef T type; }; // NOLINT
  7626. template <typename T>
  7627. struct RemoveReference<T&> { typedef T type; }; // NOLINT
  7628. // A handy wrapper around RemoveReference that works when the argument
  7629. // T depends on template parameters.
  7630. #define GTEST_REMOVE_REFERENCE_(T) \
  7631. typename ::testing::internal::RemoveReference<T>::type
  7632. // Removes const from a type if it is a const type, otherwise leaves
  7633. // it unchanged. This is the same as tr1::remove_const, which is not
  7634. // widely available yet.
  7635. template <typename T>
  7636. struct RemoveConst { typedef T type; }; // NOLINT
  7637. template <typename T>
  7638. struct RemoveConst<const T> { typedef T type; }; // NOLINT
  7639. // MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
  7640. // definition to fail to remove the const in 'const int[3]' and 'const
  7641. // char[3][4]'. The following specialization works around the bug.
  7642. template <typename T, size_t N>
  7643. struct RemoveConst<const T[N]> {
  7644. typedef typename RemoveConst<T>::type type[N];
  7645. };
  7646. #if defined(_MSC_VER) && _MSC_VER < 1400
  7647. // This is the only specialization that allows VC++ 7.1 to remove const in
  7648. // 'const int[3] and 'const int[3][4]'. However, it causes trouble with GCC
  7649. // and thus needs to be conditionally compiled.
  7650. template <typename T, size_t N>
  7651. struct RemoveConst<T[N]> {
  7652. typedef typename RemoveConst<T>::type type[N];
  7653. };
  7654. #endif
  7655. // A handy wrapper around RemoveConst that works when the argument
  7656. // T depends on template parameters.
  7657. #define GTEST_REMOVE_CONST_(T) \
  7658. typename ::testing::internal::RemoveConst<T>::type
  7659. // Turns const U&, U&, const U, and U all into U.
  7660. #define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
  7661. GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
  7662. // Adds reference to a type if it is not a reference type,
  7663. // otherwise leaves it unchanged. This is the same as
  7664. // tr1::add_reference, which is not widely available yet.
  7665. template <typename T>
  7666. struct AddReference { typedef T& type; }; // NOLINT
  7667. template <typename T>
  7668. struct AddReference<T&> { typedef T& type; }; // NOLINT
  7669. // A handy wrapper around AddReference that works when the argument T
  7670. // depends on template parameters.
  7671. #define GTEST_ADD_REFERENCE_(T) \
  7672. typename ::testing::internal::AddReference<T>::type
  7673. // Adds a reference to const on top of T as necessary. For example,
  7674. // it transforms
  7675. //
  7676. // char ==> const char&
  7677. // const char ==> const char&
  7678. // char& ==> const char&
  7679. // const char& ==> const char&
  7680. //
  7681. // The argument T must depend on some template parameters.
  7682. #define GTEST_REFERENCE_TO_CONST_(T) \
  7683. GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T))
  7684. // ImplicitlyConvertible<From, To>::value is a compile-time bool
  7685. // constant that's true iff type From can be implicitly converted to
  7686. // type To.
  7687. template <typename From, typename To>
  7688. class ImplicitlyConvertible {
  7689. private:
  7690. // We need the following helper functions only for their types.
  7691. // They have no implementations.
  7692. // MakeFrom() is an expression whose type is From. We cannot simply
  7693. // use From(), as the type From may not have a public default
  7694. // constructor.
  7695. static typename AddReference<From>::type MakeFrom();
  7696. // These two functions are overloaded. Given an expression
  7697. // Helper(x), the compiler will pick the first version if x can be
  7698. // implicitly converted to type To; otherwise it will pick the
  7699. // second version.
  7700. //
  7701. // The first version returns a value of size 1, and the second
  7702. // version returns a value of size 2. Therefore, by checking the
  7703. // size of Helper(x), which can be done at compile time, we can tell
  7704. // which version of Helper() is used, and hence whether x can be
  7705. // implicitly converted to type To.
  7706. static char Helper(To);
  7707. static char (&Helper(...))[2]; // NOLINT
  7708. // We have to put the 'public' section after the 'private' section,
  7709. // or MSVC refuses to compile the code.
  7710. public:
  7711. #if defined(__BORLANDC__)
  7712. // C++Builder cannot use member overload resolution during template
  7713. // instantiation. The simplest workaround is to use its C++0x type traits
  7714. // functions (C++Builder 2009 and above only).
  7715. static const bool value = __is_convertible(From, To);
  7716. #else
  7717. // MSVC warns about implicitly converting from double to int for
  7718. // possible loss of data, so we need to temporarily disable the
  7719. // warning.
  7720. GTEST_DISABLE_MSC_WARNINGS_PUSH_(4244)
  7721. static const bool value =
  7722. sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
  7723. GTEST_DISABLE_MSC_WARNINGS_POP_()
  7724. #endif // __BORLANDC__
  7725. };
  7726. template <typename From, typename To>
  7727. const bool ImplicitlyConvertible<From, To>::value;
  7728. // IsAProtocolMessage<T>::value is a compile-time bool constant that's
  7729. // true iff T is type ProtocolMessage, proto2::Message, or a subclass
  7730. // of those.
  7731. template <typename T>
  7732. struct IsAProtocolMessage
  7733. : public bool_constant<
  7734. ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
  7735. ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
  7736. };
  7737. // When the compiler sees expression IsContainerTest<C>(0), if C is an
  7738. // STL-style container class, the first overload of IsContainerTest
  7739. // will be viable (since both C::iterator* and C::const_iterator* are
  7740. // valid types and NULL can be implicitly converted to them). It will
  7741. // be picked over the second overload as 'int' is a perfect match for
  7742. // the type of argument 0. If C::iterator or C::const_iterator is not
  7743. // a valid type, the first overload is not viable, and the second
  7744. // overload will be picked. Therefore, we can determine whether C is
  7745. // a container class by checking the type of IsContainerTest<C>(0).
  7746. // The value of the expression is insignificant.
  7747. //
  7748. // Note that we look for both C::iterator and C::const_iterator. The
  7749. // reason is that C++ injects the name of a class as a member of the
  7750. // class itself (e.g. you can refer to class iterator as either
  7751. // 'iterator' or 'iterator::iterator'). If we look for C::iterator
  7752. // only, for example, we would mistakenly think that a class named
  7753. // iterator is an STL container.
  7754. //
  7755. // Also note that the simpler approach of overloading
  7756. // IsContainerTest(typename C::const_iterator*) and
  7757. // IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
  7758. typedef int IsContainer;
  7759. template <class C>
  7760. IsContainer IsContainerTest(int /* dummy */,
  7761. typename C::iterator* /* it */ = NULL,
  7762. typename C::const_iterator* /* const_it */ = NULL) {
  7763. return 0;
  7764. }
  7765. typedef char IsNotContainer;
  7766. template <class C>
  7767. IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
  7768. // EnableIf<condition>::type is void when 'Cond' is true, and
  7769. // undefined when 'Cond' is false. To use SFINAE to make a function
  7770. // overload only apply when a particular expression is true, add
  7771. // "typename EnableIf<expression>::type* = 0" as the last parameter.
  7772. template<bool> struct EnableIf;
  7773. template<> struct EnableIf<true> { typedef void type; }; // NOLINT
  7774. // Utilities for native arrays.
  7775. // ArrayEq() compares two k-dimensional native arrays using the
  7776. // elements' operator==, where k can be any integer >= 0. When k is
  7777. // 0, ArrayEq() degenerates into comparing a single pair of values.
  7778. template <typename T, typename U>
  7779. bool ArrayEq(const T* lhs, size_t size, const U* rhs);
  7780. // This generic version is used when k is 0.
  7781. template <typename T, typename U>
  7782. inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
  7783. // This overload is used when k >= 1.
  7784. template <typename T, typename U, size_t N>
  7785. inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
  7786. return internal::ArrayEq(lhs, N, rhs);
  7787. }
  7788. // This helper reduces code bloat. If we instead put its logic inside
  7789. // the previous ArrayEq() function, arrays with different sizes would
  7790. // lead to different copies of the template code.
  7791. template <typename T, typename U>
  7792. bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
  7793. for (size_t i = 0; i != size; i++) {
  7794. if (!internal::ArrayEq(lhs[i], rhs[i]))
  7795. return false;
  7796. }
  7797. return true;
  7798. }
  7799. // Finds the first element in the iterator range [begin, end) that
  7800. // equals elem. Element may be a native array type itself.
  7801. template <typename Iter, typename Element>
  7802. Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
  7803. for (Iter it = begin; it != end; ++it) {
  7804. if (internal::ArrayEq(*it, elem))
  7805. return it;
  7806. }
  7807. return end;
  7808. }
  7809. // CopyArray() copies a k-dimensional native array using the elements'
  7810. // operator=, where k can be any integer >= 0. When k is 0,
  7811. // CopyArray() degenerates into copying a single value.
  7812. template <typename T, typename U>
  7813. void CopyArray(const T* from, size_t size, U* to);
  7814. // This generic version is used when k is 0.
  7815. template <typename T, typename U>
  7816. inline void CopyArray(const T& from, U* to) { *to = from; }
  7817. // This overload is used when k >= 1.
  7818. template <typename T, typename U, size_t N>
  7819. inline void CopyArray(const T(&from)[N], U(*to)[N]) {
  7820. internal::CopyArray(from, N, *to);
  7821. }
  7822. // This helper reduces code bloat. If we instead put its logic inside
  7823. // the previous CopyArray() function, arrays with different sizes
  7824. // would lead to different copies of the template code.
  7825. template <typename T, typename U>
  7826. void CopyArray(const T* from, size_t size, U* to) {
  7827. for (size_t i = 0; i != size; i++) {
  7828. internal::CopyArray(from[i], to + i);
  7829. }
  7830. }
  7831. // The relation between an NativeArray object (see below) and the
  7832. // native array it represents.
  7833. // We use 2 different structs to allow non-copyable types to be used, as long
  7834. // as RelationToSourceReference() is passed.
  7835. struct RelationToSourceReference {};
  7836. struct RelationToSourceCopy {};
  7837. // Adapts a native array to a read-only STL-style container. Instead
  7838. // of the complete STL container concept, this adaptor only implements
  7839. // members useful for Google Mock's container matchers. New members
  7840. // should be added as needed. To simplify the implementation, we only
  7841. // support Element being a raw type (i.e. having no top-level const or
  7842. // reference modifier). It's the client's responsibility to satisfy
  7843. // this requirement. Element can be an array type itself (hence
  7844. // multi-dimensional arrays are supported).
  7845. template <typename Element>
  7846. class NativeArray {
  7847. public:
  7848. // STL-style container typedefs.
  7849. typedef Element value_type;
  7850. typedef Element* iterator;
  7851. typedef const Element* const_iterator;
  7852. // Constructs from a native array. References the source.
  7853. NativeArray(const Element* array, size_t count, RelationToSourceReference) {
  7854. InitRef(array, count);
  7855. }
  7856. // Constructs from a native array. Copies the source.
  7857. NativeArray(const Element* array, size_t count, RelationToSourceCopy) {
  7858. InitCopy(array, count);
  7859. }
  7860. // Copy constructor.
  7861. NativeArray(const NativeArray& rhs) {
  7862. (this->*rhs.clone_)(rhs.array_, rhs.size_);
  7863. }
  7864. ~NativeArray() {
  7865. if (clone_ != &NativeArray::InitRef)
  7866. delete[] array_;
  7867. }
  7868. // STL-style container methods.
  7869. size_t size() const { return size_; }
  7870. const_iterator begin() const { return array_; }
  7871. const_iterator end() const { return array_ + size_; }
  7872. bool operator==(const NativeArray& rhs) const {
  7873. return size() == rhs.size() &&
  7874. ArrayEq(begin(), size(), rhs.begin());
  7875. }
  7876. private:
  7877. enum {
  7878. kCheckTypeIsNotConstOrAReference = StaticAssertTypeEqHelper<
  7879. Element, GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>::value,
  7880. };
  7881. // Initializes this object with a copy of the input.
  7882. void InitCopy(const Element* array, size_t a_size) {
  7883. Element* const copy = new Element[a_size];
  7884. CopyArray(array, a_size, copy);
  7885. array_ = copy;
  7886. size_ = a_size;
  7887. clone_ = &NativeArray::InitCopy;
  7888. }
  7889. // Initializes this object with a reference of the input.
  7890. void InitRef(const Element* array, size_t a_size) {
  7891. array_ = array;
  7892. size_ = a_size;
  7893. clone_ = &NativeArray::InitRef;
  7894. }
  7895. const Element* array_;
  7896. size_t size_;
  7897. void (NativeArray::*clone_)(const Element*, size_t);
  7898. GTEST_DISALLOW_ASSIGN_(NativeArray);
  7899. };
  7900. } // namespace internal
  7901. } // namespace testing
  7902. #define GTEST_MESSAGE_AT_(file, line, message, result_type) \
  7903. ::testing::internal::AssertHelper(result_type, file, line, message) \
  7904. = ::testing::Message()
  7905. #define GTEST_MESSAGE_(message, result_type) \
  7906. GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
  7907. #define GTEST_FATAL_FAILURE_(message) \
  7908. return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
  7909. #define GTEST_NONFATAL_FAILURE_(message) \
  7910. GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
  7911. #define GTEST_SUCCESS_(message) \
  7912. GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
  7913. // Suppresses MSVC warnings 4072 (unreachable code) for the code following
  7914. // statement if it returns or throws (or doesn't return or throw in some
  7915. // situations).
  7916. #define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
  7917. if (::testing::internal::AlwaysTrue()) { statement; }
  7918. #define GTEST_TEST_THROW_(statement, expected_exception, fail) \
  7919. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7920. if (::testing::internal::ConstCharPtr gtest_msg = "") { \
  7921. bool gtest_caught_expected = false; \
  7922. try { \
  7923. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7924. } \
  7925. catch (expected_exception const&) { \
  7926. gtest_caught_expected = true; \
  7927. } \
  7928. catch (...) { \
  7929. gtest_msg.value = \
  7930. "Expected: " #statement " throws an exception of type " \
  7931. #expected_exception ".\n Actual: it throws a different type."; \
  7932. goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
  7933. } \
  7934. if (!gtest_caught_expected) { \
  7935. gtest_msg.value = \
  7936. "Expected: " #statement " throws an exception of type " \
  7937. #expected_exception ".\n Actual: it throws nothing."; \
  7938. goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
  7939. } \
  7940. } else \
  7941. GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
  7942. fail(gtest_msg.value)
  7943. #define GTEST_TEST_NO_THROW_(statement, fail) \
  7944. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7945. if (::testing::internal::AlwaysTrue()) { \
  7946. try { \
  7947. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7948. } \
  7949. catch (...) { \
  7950. goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
  7951. } \
  7952. } else \
  7953. GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
  7954. fail("Expected: " #statement " doesn't throw an exception.\n" \
  7955. " Actual: it throws.")
  7956. #define GTEST_TEST_ANY_THROW_(statement, fail) \
  7957. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7958. if (::testing::internal::AlwaysTrue()) { \
  7959. bool gtest_caught_any = false; \
  7960. try { \
  7961. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7962. } \
  7963. catch (...) { \
  7964. gtest_caught_any = true; \
  7965. } \
  7966. if (!gtest_caught_any) { \
  7967. goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
  7968. } \
  7969. } else \
  7970. GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
  7971. fail("Expected: " #statement " throws an exception.\n" \
  7972. " Actual: it doesn't.")
  7973. // Implements Boolean test assertions such as EXPECT_TRUE. expression can be
  7974. // either a boolean expression or an AssertionResult. text is a textual
  7975. // represenation of expression as it was passed into the EXPECT_TRUE.
  7976. #define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
  7977. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7978. if (const ::testing::AssertionResult gtest_ar_ = \
  7979. ::testing::AssertionResult(expression)) \
  7980. ; \
  7981. else \
  7982. fail(::testing::internal::GetBoolAssertionFailureMessage(\
  7983. gtest_ar_, text, #actual, #expected).c_str())
  7984. #define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
  7985. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7986. if (::testing::internal::AlwaysTrue()) { \
  7987. ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
  7988. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7989. if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
  7990. goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
  7991. } \
  7992. } else \
  7993. GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
  7994. fail("Expected: " #statement " doesn't generate new fatal " \
  7995. "failures in the current thread.\n" \
  7996. " Actual: it does.")
  7997. // Expands to the name of the class that implements the given test.
  7998. #define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
  7999. test_case_name##_##test_name##_Test
  8000. // Helper macro for defining tests.
  8001. #define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
  8002. class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
  8003. public:\
  8004. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
  8005. private:\
  8006. virtual void TestBody();\
  8007. static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
  8008. GTEST_DISALLOW_COPY_AND_ASSIGN_(\
  8009. GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
  8010. };\
  8011. \
  8012. ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
  8013. ::test_info_ =\
  8014. ::testing::internal::MakeAndRegisterTestInfo(\
  8015. #test_case_name, #test_name, NULL, NULL, \
  8016. ::testing::internal::CodeLocation(__FILE__, __LINE__), \
  8017. (parent_id), \
  8018. parent_class::SetUpTestCase, \
  8019. parent_class::TearDownTestCase, \
  8020. new ::testing::internal::TestFactoryImpl<\
  8021. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
  8022. void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
  8023. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
  8024. // Copyright 2005, Google Inc.
  8025. // All rights reserved.
  8026. //
  8027. // Redistribution and use in source and binary forms, with or without
  8028. // modification, are permitted provided that the following conditions are
  8029. // met:
  8030. //
  8031. // * Redistributions of source code must retain the above copyright
  8032. // notice, this list of conditions and the following disclaimer.
  8033. // * Redistributions in binary form must reproduce the above
  8034. // copyright notice, this list of conditions and the following disclaimer
  8035. // in the documentation and/or other materials provided with the
  8036. // distribution.
  8037. // * Neither the name of Google Inc. nor the names of its
  8038. // contributors may be used to endorse or promote products derived from
  8039. // this software without specific prior written permission.
  8040. //
  8041. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8042. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  8043. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8044. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  8045. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8046. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  8047. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  8048. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  8049. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  8050. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  8051. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8052. //
  8053. // Author: wan@google.com (Zhanyong Wan)
  8054. //
  8055. // The Google C++ Testing Framework (Google Test)
  8056. //
  8057. // This header file defines the public API for death tests. It is
  8058. // #included by gtest.h so a user doesn't need to include this
  8059. // directly.
  8060. #ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
  8061. #define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
  8062. // Copyright 2005, Google Inc.
  8063. // All rights reserved.
  8064. //
  8065. // Redistribution and use in source and binary forms, with or without
  8066. // modification, are permitted provided that the following conditions are
  8067. // met:
  8068. //
  8069. // * Redistributions of source code must retain the above copyright
  8070. // notice, this list of conditions and the following disclaimer.
  8071. // * Redistributions in binary form must reproduce the above
  8072. // copyright notice, this list of conditions and the following disclaimer
  8073. // in the documentation and/or other materials provided with the
  8074. // distribution.
  8075. // * Neither the name of Google Inc. nor the names of its
  8076. // contributors may be used to endorse or promote products derived from
  8077. // this software without specific prior written permission.
  8078. //
  8079. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8080. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  8081. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8082. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  8083. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8084. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  8085. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  8086. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  8087. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  8088. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  8089. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8090. //
  8091. // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
  8092. //
  8093. // The Google C++ Testing Framework (Google Test)
  8094. //
  8095. // This header file defines internal utilities needed for implementing
  8096. // death tests. They are subject to change without notice.
  8097. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
  8098. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
  8099. #include <stdio.h>
  8100. namespace testing {
  8101. namespace internal {
  8102. GTEST_DECLARE_string_(internal_run_death_test);
  8103. // Names of the flags (needed for parsing Google Test flags).
  8104. const char kDeathTestStyleFlag[] = "death_test_style";
  8105. const char kDeathTestUseFork[] = "death_test_use_fork";
  8106. const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
  8107. #if GTEST_HAS_DEATH_TEST
  8108. // DeathTest is a class that hides much of the complexity of the
  8109. // GTEST_DEATH_TEST_ macro. It is abstract; its static Create method
  8110. // returns a concrete class that depends on the prevailing death test
  8111. // style, as defined by the --gtest_death_test_style and/or
  8112. // --gtest_internal_run_death_test flags.
  8113. // In describing the results of death tests, these terms are used with
  8114. // the corresponding definitions:
  8115. //
  8116. // exit status: The integer exit information in the format specified
  8117. // by wait(2)
  8118. // exit code: The integer code passed to exit(3), _exit(2), or
  8119. // returned from main()
  8120. class GTEST_API_ DeathTest {
  8121. public:
  8122. // Create returns false if there was an error determining the
  8123. // appropriate action to take for the current death test; for example,
  8124. // if the gtest_death_test_style flag is set to an invalid value.
  8125. // The LastMessage method will return a more detailed message in that
  8126. // case. Otherwise, the DeathTest pointer pointed to by the "test"
  8127. // argument is set. If the death test should be skipped, the pointer
  8128. // is set to NULL; otherwise, it is set to the address of a new concrete
  8129. // DeathTest object that controls the execution of the current test.
  8130. static bool Create(const char* statement, const RE* regex,
  8131. const char* file, int line, DeathTest** test);
  8132. DeathTest();
  8133. virtual ~DeathTest() { }
  8134. // A helper class that aborts a death test when it's deleted.
  8135. class ReturnSentinel {
  8136. public:
  8137. explicit ReturnSentinel(DeathTest* test) : test_(test) { }
  8138. ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
  8139. private:
  8140. DeathTest* const test_;
  8141. GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
  8142. } GTEST_ATTRIBUTE_UNUSED_;
  8143. // An enumeration of possible roles that may be taken when a death
  8144. // test is encountered. EXECUTE means that the death test logic should
  8145. // be executed immediately. OVERSEE means that the program should prepare
  8146. // the appropriate environment for a child process to execute the death
  8147. // test, then wait for it to complete.
  8148. enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
  8149. // An enumeration of the three reasons that a test might be aborted.
  8150. enum AbortReason {
  8151. TEST_ENCOUNTERED_RETURN_STATEMENT,
  8152. TEST_THREW_EXCEPTION,
  8153. TEST_DID_NOT_DIE
  8154. };
  8155. // Assumes one of the above roles.
  8156. virtual TestRole AssumeRole() = 0;
  8157. // Waits for the death test to finish and returns its status.
  8158. virtual int Wait() = 0;
  8159. // Returns true if the death test passed; that is, the test process
  8160. // exited during the test, its exit status matches a user-supplied
  8161. // predicate, and its stderr output matches a user-supplied regular
  8162. // expression.
  8163. // The user-supplied predicate may be a macro expression rather
  8164. // than a function pointer or functor, or else Wait and Passed could
  8165. // be combined.
  8166. virtual bool Passed(bool exit_status_ok) = 0;
  8167. // Signals that the death test did not die as expected.
  8168. virtual void Abort(AbortReason reason) = 0;
  8169. // Returns a human-readable outcome message regarding the outcome of
  8170. // the last death test.
  8171. static const char* LastMessage();
  8172. static void set_last_death_test_message(const std::string& message);
  8173. private:
  8174. // A string containing a description of the outcome of the last death test.
  8175. static std::string last_death_test_message_;
  8176. GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
  8177. };
  8178. // Factory interface for death tests. May be mocked out for testing.
  8179. class DeathTestFactory {
  8180. public:
  8181. virtual ~DeathTestFactory() { }
  8182. virtual bool Create(const char* statement, const RE* regex,
  8183. const char* file, int line, DeathTest** test) = 0;
  8184. };
  8185. // A concrete DeathTestFactory implementation for normal use.
  8186. class DefaultDeathTestFactory : public DeathTestFactory {
  8187. public:
  8188. virtual bool Create(const char* statement, const RE* regex,
  8189. const char* file, int line, DeathTest** test);
  8190. };
  8191. // Returns true if exit_status describes a process that was terminated
  8192. // by a signal, or exited normally with a nonzero exit code.
  8193. GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
  8194. // Traps C++ exceptions escaping statement and reports them as test
  8195. // failures. Note that trapping SEH exceptions is not implemented here.
  8196. # if GTEST_HAS_EXCEPTIONS
  8197. # define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
  8198. try { \
  8199. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  8200. } catch (const ::std::exception& gtest_exception) { \
  8201. fprintf(\
  8202. stderr, \
  8203. "\n%s: Caught std::exception-derived exception escaping the " \
  8204. "death test statement. Exception message: %s\n", \
  8205. ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
  8206. gtest_exception.what()); \
  8207. fflush(stderr); \
  8208. death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
  8209. } catch (...) { \
  8210. death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
  8211. }
  8212. # else
  8213. # define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
  8214. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
  8215. # endif
  8216. // This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
  8217. // ASSERT_EXIT*, and EXPECT_EXIT*.
  8218. # define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
  8219. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  8220. if (::testing::internal::AlwaysTrue()) { \
  8221. const ::testing::internal::RE& gtest_regex = (regex); \
  8222. ::testing::internal::DeathTest* gtest_dt; \
  8223. if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \
  8224. __FILE__, __LINE__, &gtest_dt)) { \
  8225. goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
  8226. } \
  8227. if (gtest_dt != NULL) { \
  8228. ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
  8229. gtest_dt_ptr(gtest_dt); \
  8230. switch (gtest_dt->AssumeRole()) { \
  8231. case ::testing::internal::DeathTest::OVERSEE_TEST: \
  8232. if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
  8233. goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
  8234. } \
  8235. break; \
  8236. case ::testing::internal::DeathTest::EXECUTE_TEST: { \
  8237. ::testing::internal::DeathTest::ReturnSentinel \
  8238. gtest_sentinel(gtest_dt); \
  8239. GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
  8240. gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
  8241. break; \
  8242. } \
  8243. default: \
  8244. break; \
  8245. } \
  8246. } \
  8247. } else \
  8248. GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
  8249. fail(::testing::internal::DeathTest::LastMessage())
  8250. // The symbol "fail" here expands to something into which a message
  8251. // can be streamed.
  8252. // This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in
  8253. // NDEBUG mode. In this case we need the statements to be executed, the regex is
  8254. // ignored, and the macro must accept a streamed message even though the message
  8255. // is never printed.
  8256. # define GTEST_EXECUTE_STATEMENT_(statement, regex) \
  8257. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  8258. if (::testing::internal::AlwaysTrue()) { \
  8259. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  8260. } else \
  8261. ::testing::Message()
  8262. // A class representing the parsed contents of the
  8263. // --gtest_internal_run_death_test flag, as it existed when
  8264. // RUN_ALL_TESTS was called.
  8265. class InternalRunDeathTestFlag {
  8266. public:
  8267. InternalRunDeathTestFlag(const std::string& a_file,
  8268. int a_line,
  8269. int an_index,
  8270. int a_write_fd)
  8271. : file_(a_file), line_(a_line), index_(an_index),
  8272. write_fd_(a_write_fd) {}
  8273. ~InternalRunDeathTestFlag() {
  8274. if (write_fd_ >= 0)
  8275. posix::Close(write_fd_);
  8276. }
  8277. const std::string& file() const { return file_; }
  8278. int line() const { return line_; }
  8279. int index() const { return index_; }
  8280. int write_fd() const { return write_fd_; }
  8281. private:
  8282. std::string file_;
  8283. int line_;
  8284. int index_;
  8285. int write_fd_;
  8286. GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
  8287. };
  8288. // Returns a newly created InternalRunDeathTestFlag object with fields
  8289. // initialized from the GTEST_FLAG(internal_run_death_test) flag if
  8290. // the flag is specified; otherwise returns NULL.
  8291. InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
  8292. #else // GTEST_HAS_DEATH_TEST
  8293. // This macro is used for implementing macros such as
  8294. // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
  8295. // death tests are not supported. Those macros must compile on such systems
  8296. // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
  8297. // systems that support death tests. This allows one to write such a macro
  8298. // on a system that does not support death tests and be sure that it will
  8299. // compile on a death-test supporting system.
  8300. //
  8301. // Parameters:
  8302. // statement - A statement that a macro such as EXPECT_DEATH would test
  8303. // for program termination. This macro has to make sure this
  8304. // statement is compiled but not executed, to ensure that
  8305. // EXPECT_DEATH_IF_SUPPORTED compiles with a certain
  8306. // parameter iff EXPECT_DEATH compiles with it.
  8307. // regex - A regex that a macro such as EXPECT_DEATH would use to test
  8308. // the output of statement. This parameter has to be
  8309. // compiled but not evaluated by this macro, to ensure that
  8310. // this macro only accepts expressions that a macro such as
  8311. // EXPECT_DEATH would accept.
  8312. // terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
  8313. // and a return statement for ASSERT_DEATH_IF_SUPPORTED.
  8314. // This ensures that ASSERT_DEATH_IF_SUPPORTED will not
  8315. // compile inside functions where ASSERT_DEATH doesn't
  8316. // compile.
  8317. //
  8318. // The branch that has an always false condition is used to ensure that
  8319. // statement and regex are compiled (and thus syntactically correct) but
  8320. // never executed. The unreachable code macro protects the terminator
  8321. // statement from generating an 'unreachable code' warning in case
  8322. // statement unconditionally returns or throws. The Message constructor at
  8323. // the end allows the syntax of streaming additional messages into the
  8324. // macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
  8325. # define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \
  8326. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  8327. if (::testing::internal::AlwaysTrue()) { \
  8328. GTEST_LOG_(WARNING) \
  8329. << "Death tests are not supported on this platform.\n" \
  8330. << "Statement '" #statement "' cannot be verified."; \
  8331. } else if (::testing::internal::AlwaysFalse()) { \
  8332. ::testing::internal::RE::PartialMatch(".*", (regex)); \
  8333. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  8334. terminator; \
  8335. } else \
  8336. ::testing::Message()
  8337. #endif // GTEST_HAS_DEATH_TEST
  8338. } // namespace internal
  8339. } // namespace testing
  8340. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
  8341. namespace testing {
  8342. // This flag controls the style of death tests. Valid values are "threadsafe",
  8343. // meaning that the death test child process will re-execute the test binary
  8344. // from the start, running only a single death test, or "fast",
  8345. // meaning that the child process will execute the test logic immediately
  8346. // after forking.
  8347. GTEST_DECLARE_string_(death_test_style);
  8348. #if GTEST_HAS_DEATH_TEST
  8349. namespace internal {
  8350. // Returns a Boolean value indicating whether the caller is currently
  8351. // executing in the context of the death test child process. Tools such as
  8352. // Valgrind heap checkers may need this to modify their behavior in death
  8353. // tests. IMPORTANT: This is an internal utility. Using it may break the
  8354. // implementation of death tests. User code MUST NOT use it.
  8355. GTEST_API_ bool InDeathTestChild();
  8356. } // namespace internal
  8357. // The following macros are useful for writing death tests.
  8358. // Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
  8359. // executed:
  8360. //
  8361. // 1. It generates a warning if there is more than one active
  8362. // thread. This is because it's safe to fork() or clone() only
  8363. // when there is a single thread.
  8364. //
  8365. // 2. The parent process clone()s a sub-process and runs the death
  8366. // test in it; the sub-process exits with code 0 at the end of the
  8367. // death test, if it hasn't exited already.
  8368. //
  8369. // 3. The parent process waits for the sub-process to terminate.
  8370. //
  8371. // 4. The parent process checks the exit code and error message of
  8372. // the sub-process.
  8373. //
  8374. // Examples:
  8375. //
  8376. // ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
  8377. // for (int i = 0; i < 5; i++) {
  8378. // EXPECT_DEATH(server.ProcessRequest(i),
  8379. // "Invalid request .* in ProcessRequest()")
  8380. // << "Failed to die on request " << i;
  8381. // }
  8382. //
  8383. // ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
  8384. //
  8385. // bool KilledBySIGHUP(int exit_code) {
  8386. // return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
  8387. // }
  8388. //
  8389. // ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
  8390. //
  8391. // On the regular expressions used in death tests:
  8392. //
  8393. // On POSIX-compliant systems (*nix), we use the <regex.h> library,
  8394. // which uses the POSIX extended regex syntax.
  8395. //
  8396. // On other platforms (e.g. Windows), we only support a simple regex
  8397. // syntax implemented as part of Google Test. This limited
  8398. // implementation should be enough most of the time when writing
  8399. // death tests; though it lacks many features you can find in PCRE
  8400. // or POSIX extended regex syntax. For example, we don't support
  8401. // union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
  8402. // repetition count ("x{5,7}"), among others.
  8403. //
  8404. // Below is the syntax that we do support. We chose it to be a
  8405. // subset of both PCRE and POSIX extended regex, so it's easy to
  8406. // learn wherever you come from. In the following: 'A' denotes a
  8407. // literal character, period (.), or a single \\ escape sequence;
  8408. // 'x' and 'y' denote regular expressions; 'm' and 'n' are for
  8409. // natural numbers.
  8410. //
  8411. // c matches any literal character c
  8412. // \\d matches any decimal digit
  8413. // \\D matches any character that's not a decimal digit
  8414. // \\f matches \f
  8415. // \\n matches \n
  8416. // \\r matches \r
  8417. // \\s matches any ASCII whitespace, including \n
  8418. // \\S matches any character that's not a whitespace
  8419. // \\t matches \t
  8420. // \\v matches \v
  8421. // \\w matches any letter, _, or decimal digit
  8422. // \\W matches any character that \\w doesn't match
  8423. // \\c matches any literal character c, which must be a punctuation
  8424. // . matches any single character except \n
  8425. // A? matches 0 or 1 occurrences of A
  8426. // A* matches 0 or many occurrences of A
  8427. // A+ matches 1 or many occurrences of A
  8428. // ^ matches the beginning of a string (not that of each line)
  8429. // $ matches the end of a string (not that of each line)
  8430. // xy matches x followed by y
  8431. //
  8432. // If you accidentally use PCRE or POSIX extended regex features
  8433. // not implemented by us, you will get a run-time failure. In that
  8434. // case, please try to rewrite your regular expression within the
  8435. // above syntax.
  8436. //
  8437. // This implementation is *not* meant to be as highly tuned or robust
  8438. // as a compiled regex library, but should perform well enough for a
  8439. // death test, which already incurs significant overhead by launching
  8440. // a child process.
  8441. //
  8442. // Known caveats:
  8443. //
  8444. // A "threadsafe" style death test obtains the path to the test
  8445. // program from argv[0] and re-executes it in the sub-process. For
  8446. // simplicity, the current implementation doesn't search the PATH
  8447. // when launching the sub-process. This means that the user must
  8448. // invoke the test program via a path that contains at least one
  8449. // path separator (e.g. path/to/foo_test and
  8450. // /absolute/path/to/bar_test are fine, but foo_test is not). This
  8451. // is rarely a problem as people usually don't put the test binary
  8452. // directory in PATH.
  8453. //
  8454. // TODO(wan@google.com): make thread-safe death tests search the PATH.
  8455. // Asserts that a given statement causes the program to exit, with an
  8456. // integer exit status that satisfies predicate, and emitting error output
  8457. // that matches regex.
  8458. # define ASSERT_EXIT(statement, predicate, regex) \
  8459. GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
  8460. // Like ASSERT_EXIT, but continues on to successive tests in the
  8461. // test case, if any:
  8462. # define EXPECT_EXIT(statement, predicate, regex) \
  8463. GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
  8464. // Asserts that a given statement causes the program to exit, either by
  8465. // explicitly exiting with a nonzero exit code or being killed by a
  8466. // signal, and emitting error output that matches regex.
  8467. # define ASSERT_DEATH(statement, regex) \
  8468. ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
  8469. // Like ASSERT_DEATH, but continues on to successive tests in the
  8470. // test case, if any:
  8471. # define EXPECT_DEATH(statement, regex) \
  8472. EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
  8473. // Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
  8474. // Tests that an exit code describes a normal exit with a given exit code.
  8475. class GTEST_API_ ExitedWithCode {
  8476. public:
  8477. explicit ExitedWithCode(int exit_code);
  8478. bool operator()(int exit_status) const;
  8479. private:
  8480. // No implementation - assignment is unsupported.
  8481. void operator=(const ExitedWithCode& other);
  8482. const int exit_code_;
  8483. };
  8484. # if !GTEST_OS_WINDOWS
  8485. // Tests that an exit code describes an exit due to termination by a
  8486. // given signal.
  8487. class GTEST_API_ KilledBySignal {
  8488. public:
  8489. explicit KilledBySignal(int signum);
  8490. bool operator()(int exit_status) const;
  8491. private:
  8492. const int signum_;
  8493. };
  8494. # endif // !GTEST_OS_WINDOWS
  8495. // EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
  8496. // The death testing framework causes this to have interesting semantics,
  8497. // since the sideeffects of the call are only visible in opt mode, and not
  8498. // in debug mode.
  8499. //
  8500. // In practice, this can be used to test functions that utilize the
  8501. // LOG(DFATAL) macro using the following style:
  8502. //
  8503. // int DieInDebugOr12(int* sideeffect) {
  8504. // if (sideeffect) {
  8505. // *sideeffect = 12;
  8506. // }
  8507. // LOG(DFATAL) << "death";
  8508. // return 12;
  8509. // }
  8510. //
  8511. // TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
  8512. // int sideeffect = 0;
  8513. // // Only asserts in dbg.
  8514. // EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
  8515. //
  8516. // #ifdef NDEBUG
  8517. // // opt-mode has sideeffect visible.
  8518. // EXPECT_EQ(12, sideeffect);
  8519. // #else
  8520. // // dbg-mode no visible sideeffect.
  8521. // EXPECT_EQ(0, sideeffect);
  8522. // #endif
  8523. // }
  8524. //
  8525. // This will assert that DieInDebugReturn12InOpt() crashes in debug
  8526. // mode, usually due to a DCHECK or LOG(DFATAL), but returns the
  8527. // appropriate fallback value (12 in this case) in opt mode. If you
  8528. // need to test that a function has appropriate side-effects in opt
  8529. // mode, include assertions against the side-effects. A general
  8530. // pattern for this is:
  8531. //
  8532. // EXPECT_DEBUG_DEATH({
  8533. // // Side-effects here will have an effect after this statement in
  8534. // // opt mode, but none in debug mode.
  8535. // EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
  8536. // }, "death");
  8537. //
  8538. # ifdef NDEBUG
  8539. # define EXPECT_DEBUG_DEATH(statement, regex) \
  8540. GTEST_EXECUTE_STATEMENT_(statement, regex)
  8541. # define ASSERT_DEBUG_DEATH(statement, regex) \
  8542. GTEST_EXECUTE_STATEMENT_(statement, regex)
  8543. # else
  8544. # define EXPECT_DEBUG_DEATH(statement, regex) \
  8545. EXPECT_DEATH(statement, regex)
  8546. # define ASSERT_DEBUG_DEATH(statement, regex) \
  8547. ASSERT_DEATH(statement, regex)
  8548. # endif // NDEBUG for EXPECT_DEBUG_DEATH
  8549. #endif // GTEST_HAS_DEATH_TEST
  8550. // EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
  8551. // ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
  8552. // death tests are supported; otherwise they just issue a warning. This is
  8553. // useful when you are combining death test assertions with normal test
  8554. // assertions in one test.
  8555. #if GTEST_HAS_DEATH_TEST
  8556. # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
  8557. EXPECT_DEATH(statement, regex)
  8558. # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
  8559. ASSERT_DEATH(statement, regex)
  8560. #else
  8561. # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
  8562. GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
  8563. # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
  8564. GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)
  8565. #endif
  8566. } // namespace testing
  8567. #endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
  8568. // This file was GENERATED by command:
  8569. // pump.py gtest-param-test.h.pump
  8570. // DO NOT EDIT BY HAND!!!
  8571. // Copyright 2008, Google Inc.
  8572. // All rights reserved.
  8573. //
  8574. // Redistribution and use in source and binary forms, with or without
  8575. // modification, are permitted provided that the following conditions are
  8576. // met:
  8577. //
  8578. // * Redistributions of source code must retain the above copyright
  8579. // notice, this list of conditions and the following disclaimer.
  8580. // * Redistributions in binary form must reproduce the above
  8581. // copyright notice, this list of conditions and the following disclaimer
  8582. // in the documentation and/or other materials provided with the
  8583. // distribution.
  8584. // * Neither the name of Google Inc. nor the names of its
  8585. // contributors may be used to endorse or promote products derived from
  8586. // this software without specific prior written permission.
  8587. //
  8588. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8589. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  8590. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8591. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  8592. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8593. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  8594. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  8595. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  8596. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  8597. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  8598. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8599. //
  8600. // Authors: vladl@google.com (Vlad Losev)
  8601. //
  8602. // Macros and functions for implementing parameterized tests
  8603. // in Google C++ Testing Framework (Google Test)
  8604. //
  8605. // This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
  8606. //
  8607. #ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
  8608. #define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
  8609. // Value-parameterized tests allow you to test your code with different
  8610. // parameters without writing multiple copies of the same test.
  8611. //
  8612. // Here is how you use value-parameterized tests:
  8613. #if 0
  8614. // To write value-parameterized tests, first you should define a fixture
  8615. // class. It is usually derived from testing::TestWithParam<T> (see below for
  8616. // another inheritance scheme that's sometimes useful in more complicated
  8617. // class hierarchies), where the type of your parameter values.
  8618. // TestWithParam<T> is itself derived from testing::Test. T can be any
  8619. // copyable type. If it's a raw pointer, you are responsible for managing the
  8620. // lifespan of the pointed values.
  8621. class FooTest : public ::testing::TestWithParam<const char*> {
  8622. // You can implement all the usual class fixture members here.
  8623. };
  8624. // Then, use the TEST_P macro to define as many parameterized tests
  8625. // for this fixture as you want. The _P suffix is for "parameterized"
  8626. // or "pattern", whichever you prefer to think.
  8627. TEST_P(FooTest, DoesBlah) {
  8628. // Inside a test, access the test parameter with the GetParam() method
  8629. // of the TestWithParam<T> class:
  8630. EXPECT_TRUE(foo.Blah(GetParam()));
  8631. ...
  8632. }
  8633. TEST_P(FooTest, HasBlahBlah) {
  8634. ...
  8635. }
  8636. // Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
  8637. // case with any set of parameters you want. Google Test defines a number
  8638. // of functions for generating test parameters. They return what we call
  8639. // (surprise!) parameter generators. Here is a summary of them, which
  8640. // are all in the testing namespace:
  8641. //
  8642. //
  8643. // Range(begin, end [, step]) - Yields values {begin, begin+step,
  8644. // begin+step+step, ...}. The values do not
  8645. // include end. step defaults to 1.
  8646. // Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}.
  8647. // ValuesIn(container) - Yields values from a C-style array, an STL
  8648. // ValuesIn(begin,end) container, or an iterator range [begin, end).
  8649. // Bool() - Yields sequence {false, true}.
  8650. // Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product
  8651. // for the math savvy) of the values generated
  8652. // by the N generators.
  8653. //
  8654. // For more details, see comments at the definitions of these functions below
  8655. // in this file.
  8656. //
  8657. // The following statement will instantiate tests from the FooTest test case
  8658. // each with parameter values "meeny", "miny", and "moe".
  8659. INSTANTIATE_TEST_CASE_P(InstantiationName,
  8660. FooTest,
  8661. Values("meeny", "miny", "moe"));
  8662. // To distinguish different instances of the pattern, (yes, you
  8663. // can instantiate it more then once) the first argument to the
  8664. // INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
  8665. // actual test case name. Remember to pick unique prefixes for different
  8666. // instantiations. The tests from the instantiation above will have
  8667. // these names:
  8668. //
  8669. // * InstantiationName/FooTest.DoesBlah/0 for "meeny"
  8670. // * InstantiationName/FooTest.DoesBlah/1 for "miny"
  8671. // * InstantiationName/FooTest.DoesBlah/2 for "moe"
  8672. // * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
  8673. // * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
  8674. // * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
  8675. //
  8676. // You can use these names in --gtest_filter.
  8677. //
  8678. // This statement will instantiate all tests from FooTest again, each
  8679. // with parameter values "cat" and "dog":
  8680. const char* pets[] = {"cat", "dog"};
  8681. INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
  8682. // The tests from the instantiation above will have these names:
  8683. //
  8684. // * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
  8685. // * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
  8686. // * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
  8687. // * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
  8688. //
  8689. // Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
  8690. // in the given test case, whether their definitions come before or
  8691. // AFTER the INSTANTIATE_TEST_CASE_P statement.
  8692. //
  8693. // Please also note that generator expressions (including parameters to the
  8694. // generators) are evaluated in InitGoogleTest(), after main() has started.
  8695. // This allows the user on one hand, to adjust generator parameters in order
  8696. // to dynamically determine a set of tests to run and on the other hand,
  8697. // give the user a chance to inspect the generated tests with Google Test
  8698. // reflection API before RUN_ALL_TESTS() is executed.
  8699. //
  8700. // You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
  8701. // for more examples.
  8702. //
  8703. // In the future, we plan to publish the API for defining new parameter
  8704. // generators. But for now this interface remains part of the internal
  8705. // implementation and is subject to change.
  8706. //
  8707. //
  8708. // A parameterized test fixture must be derived from testing::Test and from
  8709. // testing::WithParamInterface<T>, where T is the type of the parameter
  8710. // values. Inheriting from TestWithParam<T> satisfies that requirement because
  8711. // TestWithParam<T> inherits from both Test and WithParamInterface. In more
  8712. // complicated hierarchies, however, it is occasionally useful to inherit
  8713. // separately from Test and WithParamInterface. For example:
  8714. class BaseTest : public ::testing::Test {
  8715. // You can inherit all the usual members for a non-parameterized test
  8716. // fixture here.
  8717. };
  8718. class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
  8719. // The usual test fixture members go here too.
  8720. };
  8721. TEST_F(BaseTest, HasFoo) {
  8722. // This is an ordinary non-parameterized test.
  8723. }
  8724. TEST_P(DerivedTest, DoesBlah) {
  8725. // GetParam works just the same here as if you inherit from TestWithParam.
  8726. EXPECT_TRUE(foo.Blah(GetParam()));
  8727. }
  8728. #endif // 0
  8729. #if !GTEST_OS_SYMBIAN
  8730. # include <utility>
  8731. #endif
  8732. // scripts/fuse_gtest.py depends on gtest's own header being #included
  8733. // *unconditionally*. Therefore these #includes cannot be moved
  8734. // inside #if GTEST_HAS_PARAM_TEST.
  8735. // Copyright 2008 Google Inc.
  8736. // All Rights Reserved.
  8737. //
  8738. // Redistribution and use in source and binary forms, with or without
  8739. // modification, are permitted provided that the following conditions are
  8740. // met:
  8741. //
  8742. // * Redistributions of source code must retain the above copyright
  8743. // notice, this list of conditions and the following disclaimer.
  8744. // * Redistributions in binary form must reproduce the above
  8745. // copyright notice, this list of conditions and the following disclaimer
  8746. // in the documentation and/or other materials provided with the
  8747. // distribution.
  8748. // * Neither the name of Google Inc. nor the names of its
  8749. // contributors may be used to endorse or promote products derived from
  8750. // this software without specific prior written permission.
  8751. //
  8752. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8753. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  8754. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8755. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  8756. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8757. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  8758. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  8759. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  8760. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  8761. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  8762. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8763. //
  8764. // Author: vladl@google.com (Vlad Losev)
  8765. // Type and function utilities for implementing parameterized tests.
  8766. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
  8767. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
  8768. #include <ctype.h>
  8769. #include <iterator>
  8770. #include <set>
  8771. #include <utility>
  8772. #include <vector>
  8773. // scripts/fuse_gtest.py depends on gtest's own header being #included
  8774. // *unconditionally*. Therefore these #includes cannot be moved
  8775. // inside #if GTEST_HAS_PARAM_TEST.
  8776. // Copyright 2003 Google Inc.
  8777. // All rights reserved.
  8778. //
  8779. // Redistribution and use in source and binary forms, with or without
  8780. // modification, are permitted provided that the following conditions are
  8781. // met:
  8782. //
  8783. // * Redistributions of source code must retain the above copyright
  8784. // notice, this list of conditions and the following disclaimer.
  8785. // * Redistributions in binary form must reproduce the above
  8786. // copyright notice, this list of conditions and the following disclaimer
  8787. // in the documentation and/or other materials provided with the
  8788. // distribution.
  8789. // * Neither the name of Google Inc. nor the names of its
  8790. // contributors may be used to endorse or promote products derived from
  8791. // this software without specific prior written permission.
  8792. //
  8793. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8794. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  8795. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8796. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  8797. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8798. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  8799. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  8800. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  8801. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  8802. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  8803. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8804. //
  8805. // Authors: Dan Egnor (egnor@google.com)
  8806. //
  8807. // A "smart" pointer type with reference tracking. Every pointer to a
  8808. // particular object is kept on a circular linked list. When the last pointer
  8809. // to an object is destroyed or reassigned, the object is deleted.
  8810. //
  8811. // Used properly, this deletes the object when the last reference goes away.
  8812. // There are several caveats:
  8813. // - Like all reference counting schemes, cycles lead to leaks.
  8814. // - Each smart pointer is actually two pointers (8 bytes instead of 4).
  8815. // - Every time a pointer is assigned, the entire list of pointers to that
  8816. // object is traversed. This class is therefore NOT SUITABLE when there
  8817. // will often be more than two or three pointers to a particular object.
  8818. // - References are only tracked as long as linked_ptr<> objects are copied.
  8819. // If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
  8820. // will happen (double deletion).
  8821. //
  8822. // A good use of this class is storing object references in STL containers.
  8823. // You can safely put linked_ptr<> in a vector<>.
  8824. // Other uses may not be as good.
  8825. //
  8826. // Note: If you use an incomplete type with linked_ptr<>, the class
  8827. // *containing* linked_ptr<> must have a constructor and destructor (even
  8828. // if they do nothing!).
  8829. //
  8830. // Bill Gibbons suggested we use something like this.
  8831. //
  8832. // Thread Safety:
  8833. // Unlike other linked_ptr implementations, in this implementation
  8834. // a linked_ptr object is thread-safe in the sense that:
  8835. // - it's safe to copy linked_ptr objects concurrently,
  8836. // - it's safe to copy *from* a linked_ptr and read its underlying
  8837. // raw pointer (e.g. via get()) concurrently, and
  8838. // - it's safe to write to two linked_ptrs that point to the same
  8839. // shared object concurrently.
  8840. // TODO(wan@google.com): rename this to safe_linked_ptr to avoid
  8841. // confusion with normal linked_ptr.
  8842. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
  8843. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
  8844. #include <stdlib.h>
  8845. #include <assert.h>
  8846. namespace testing {
  8847. namespace internal {
  8848. // Protects copying of all linked_ptr objects.
  8849. GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
  8850. // This is used internally by all instances of linked_ptr<>. It needs to be
  8851. // a non-template class because different types of linked_ptr<> can refer to
  8852. // the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
  8853. // So, it needs to be possible for different types of linked_ptr to participate
  8854. // in the same circular linked list, so we need a single class type here.
  8855. //
  8856. // DO NOT USE THIS CLASS DIRECTLY YOURSELF. Use linked_ptr<T>.
  8857. class linked_ptr_internal {
  8858. public:
  8859. // Create a new circle that includes only this instance.
  8860. void join_new() {
  8861. next_ = this;
  8862. }
  8863. // Many linked_ptr operations may change p.link_ for some linked_ptr
  8864. // variable p in the same circle as this object. Therefore we need
  8865. // to prevent two such operations from occurring concurrently.
  8866. //
  8867. // Note that different types of linked_ptr objects can coexist in a
  8868. // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
  8869. // linked_ptr<Derived2>). Therefore we must use a single mutex to
  8870. // protect all linked_ptr objects. This can create serious
  8871. // contention in production code, but is acceptable in a testing
  8872. // framework.
  8873. // Join an existing circle.
  8874. void join(linked_ptr_internal const* ptr)
  8875. GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
  8876. MutexLock lock(&g_linked_ptr_mutex);
  8877. linked_ptr_internal const* p = ptr;
  8878. while (p->next_ != ptr) {
  8879. assert(p->next_ != this &&
  8880. "Trying to join() a linked ring we are already in. "
  8881. "Is GMock thread safety enabled?");
  8882. p = p->next_;
  8883. }
  8884. p->next_ = this;
  8885. next_ = ptr;
  8886. }
  8887. // Leave whatever circle we're part of. Returns true if we were the
  8888. // last member of the circle. Once this is done, you can join() another.
  8889. bool depart()
  8890. GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
  8891. MutexLock lock(&g_linked_ptr_mutex);
  8892. if (next_ == this) return true;
  8893. linked_ptr_internal const* p = next_;
  8894. while (p->next_ != this) {
  8895. assert(p->next_ != next_ &&
  8896. "Trying to depart() a linked ring we are not in. "
  8897. "Is GMock thread safety enabled?");
  8898. p = p->next_;
  8899. }
  8900. p->next_ = next_;
  8901. return false;
  8902. }
  8903. private:
  8904. mutable linked_ptr_internal const* next_;
  8905. };
  8906. template <typename T>
  8907. class linked_ptr {
  8908. public:
  8909. typedef T element_type;
  8910. // Take over ownership of a raw pointer. This should happen as soon as
  8911. // possible after the object is created.
  8912. explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
  8913. ~linked_ptr() { depart(); }
  8914. // Copy an existing linked_ptr<>, adding ourselves to the list of references.
  8915. template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
  8916. linked_ptr(linked_ptr const& ptr) { // NOLINT
  8917. assert(&ptr != this);
  8918. copy(&ptr);
  8919. }
  8920. // Assignment releases the old value and acquires the new.
  8921. template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
  8922. depart();
  8923. copy(&ptr);
  8924. return *this;
  8925. }
  8926. linked_ptr& operator=(linked_ptr const& ptr) {
  8927. if (&ptr != this) {
  8928. depart();
  8929. copy(&ptr);
  8930. }
  8931. return *this;
  8932. }
  8933. // Smart pointer members.
  8934. void reset(T* ptr = NULL) {
  8935. depart();
  8936. capture(ptr);
  8937. }
  8938. T* get() const { return value_; }
  8939. T* operator->() const { return value_; }
  8940. T& operator*() const { return *value_; }
  8941. bool operator==(T* p) const { return value_ == p; }
  8942. bool operator!=(T* p) const { return value_ != p; }
  8943. template <typename U>
  8944. bool operator==(linked_ptr<U> const& ptr) const {
  8945. return value_ == ptr.get();
  8946. }
  8947. template <typename U>
  8948. bool operator!=(linked_ptr<U> const& ptr) const {
  8949. return value_ != ptr.get();
  8950. }
  8951. private:
  8952. template <typename U>
  8953. friend class linked_ptr;
  8954. T* value_;
  8955. linked_ptr_internal link_;
  8956. void depart() {
  8957. if (link_.depart()) delete value_;
  8958. }
  8959. void capture(T* ptr) {
  8960. value_ = ptr;
  8961. link_.join_new();
  8962. }
  8963. template <typename U> void copy(linked_ptr<U> const* ptr) {
  8964. value_ = ptr->get();
  8965. if (value_)
  8966. link_.join(&ptr->link_);
  8967. else
  8968. link_.join_new();
  8969. }
  8970. };
  8971. template<typename T> inline
  8972. bool operator==(T* ptr, const linked_ptr<T>& x) {
  8973. return ptr == x.get();
  8974. }
  8975. template<typename T> inline
  8976. bool operator!=(T* ptr, const linked_ptr<T>& x) {
  8977. return ptr != x.get();
  8978. }
  8979. // A function to convert T* into linked_ptr<T>
  8980. // Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
  8981. // for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
  8982. template <typename T>
  8983. linked_ptr<T> make_linked_ptr(T* ptr) {
  8984. return linked_ptr<T>(ptr);
  8985. }
  8986. } // namespace internal
  8987. } // namespace testing
  8988. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
  8989. // Copyright 2007, Google Inc.
  8990. // All rights reserved.
  8991. //
  8992. // Redistribution and use in source and binary forms, with or without
  8993. // modification, are permitted provided that the following conditions are
  8994. // met:
  8995. //
  8996. // * Redistributions of source code must retain the above copyright
  8997. // notice, this list of conditions and the following disclaimer.
  8998. // * Redistributions in binary form must reproduce the above
  8999. // copyright notice, this list of conditions and the following disclaimer
  9000. // in the documentation and/or other materials provided with the
  9001. // distribution.
  9002. // * Neither the name of Google Inc. nor the names of its
  9003. // contributors may be used to endorse or promote products derived from
  9004. // this software without specific prior written permission.
  9005. //
  9006. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  9007. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  9008. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  9009. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  9010. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  9011. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  9012. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  9013. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  9014. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  9015. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  9016. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  9017. //
  9018. // Author: wan@google.com (Zhanyong Wan)
  9019. // Google Test - The Google C++ Testing Framework
  9020. //
  9021. // This file implements a universal value printer that can print a
  9022. // value of any type T:
  9023. //
  9024. // void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
  9025. //
  9026. // A user can teach this function how to print a class type T by
  9027. // defining either operator<<() or PrintTo() in the namespace that
  9028. // defines T. More specifically, the FIRST defined function in the
  9029. // following list will be used (assuming T is defined in namespace
  9030. // foo):
  9031. //
  9032. // 1. foo::PrintTo(const T&, ostream*)
  9033. // 2. operator<<(ostream&, const T&) defined in either foo or the
  9034. // global namespace.
  9035. //
  9036. // If none of the above is defined, it will print the debug string of
  9037. // the value if it is a protocol buffer, or print the raw bytes in the
  9038. // value otherwise.
  9039. //
  9040. // To aid debugging: when T is a reference type, the address of the
  9041. // value is also printed; when T is a (const) char pointer, both the
  9042. // pointer value and the NUL-terminated string it points to are
  9043. // printed.
  9044. //
  9045. // We also provide some convenient wrappers:
  9046. //
  9047. // // Prints a value to a string. For a (const or not) char
  9048. // // pointer, the NUL-terminated string (but not the pointer) is
  9049. // // printed.
  9050. // std::string ::testing::PrintToString(const T& value);
  9051. //
  9052. // // Prints a value tersely: for a reference type, the referenced
  9053. // // value (but not the address) is printed; for a (const or not) char
  9054. // // pointer, the NUL-terminated string (but not the pointer) is
  9055. // // printed.
  9056. // void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
  9057. //
  9058. // // Prints value using the type inferred by the compiler. The difference
  9059. // // from UniversalTersePrint() is that this function prints both the
  9060. // // pointer and the NUL-terminated string for a (const or not) char pointer.
  9061. // void ::testing::internal::UniversalPrint(const T& value, ostream*);
  9062. //
  9063. // // Prints the fields of a tuple tersely to a string vector, one
  9064. // // element for each field. Tuple support must be enabled in
  9065. // // gtest-port.h.
  9066. // std::vector<string> UniversalTersePrintTupleFieldsToStrings(
  9067. // const Tuple& value);
  9068. //
  9069. // Known limitation:
  9070. //
  9071. // The print primitives print the elements of an STL-style container
  9072. // using the compiler-inferred type of *iter where iter is a
  9073. // const_iterator of the container. When const_iterator is an input
  9074. // iterator but not a forward iterator, this inferred type may not
  9075. // match value_type, and the print output may be incorrect. In
  9076. // practice, this is rarely a problem as for most containers
  9077. // const_iterator is a forward iterator. We'll fix this if there's an
  9078. // actual need for it. Note that this fix cannot rely on value_type
  9079. // being defined as many user-defined container types don't have
  9080. // value_type.
  9081. #ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
  9082. #define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
  9083. #include <ostream> // NOLINT
  9084. #include <sstream>
  9085. #include <string>
  9086. #include <utility>
  9087. #include <vector>
  9088. #if GTEST_HAS_STD_TUPLE_
  9089. # include <tuple>
  9090. #endif
  9091. namespace testing {
  9092. // Definitions in the 'internal' and 'internal2' name spaces are
  9093. // subject to change without notice. DO NOT USE THEM IN USER CODE!
  9094. namespace internal2 {
  9095. // Prints the given number of bytes in the given object to the given
  9096. // ostream.
  9097. GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
  9098. size_t count,
  9099. ::std::ostream* os);
  9100. // For selecting which printer to use when a given type has neither <<
  9101. // nor PrintTo().
  9102. enum TypeKind {
  9103. kProtobuf, // a protobuf type
  9104. kConvertibleToInteger, // a type implicitly convertible to BiggestInt
  9105. // (e.g. a named or unnamed enum type)
  9106. kOtherType // anything else
  9107. };
  9108. // TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
  9109. // by the universal printer to print a value of type T when neither
  9110. // operator<< nor PrintTo() is defined for T, where kTypeKind is the
  9111. // "kind" of T as defined by enum TypeKind.
  9112. template <typename T, TypeKind kTypeKind>
  9113. class TypeWithoutFormatter {
  9114. public:
  9115. // This default version is called when kTypeKind is kOtherType.
  9116. static void PrintValue(const T& value, ::std::ostream* os) {
  9117. PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value),
  9118. sizeof(value), os);
  9119. }
  9120. };
  9121. // We print a protobuf using its ShortDebugString() when the string
  9122. // doesn't exceed this many characters; otherwise we print it using
  9123. // DebugString() for better readability.
  9124. const size_t kProtobufOneLinerMaxLength = 50;
  9125. template <typename T>
  9126. class TypeWithoutFormatter<T, kProtobuf> {
  9127. public:
  9128. static void PrintValue(const T& value, ::std::ostream* os) {
  9129. const ::testing::internal::string short_str = value.ShortDebugString();
  9130. const ::testing::internal::string pretty_str =
  9131. short_str.length() <= kProtobufOneLinerMaxLength ?
  9132. short_str : ("\n" + value.DebugString());
  9133. *os << ("<" + pretty_str + ">");
  9134. }
  9135. };
  9136. template <typename T>
  9137. class TypeWithoutFormatter<T, kConvertibleToInteger> {
  9138. public:
  9139. // Since T has no << operator or PrintTo() but can be implicitly
  9140. // converted to BiggestInt, we print it as a BiggestInt.
  9141. //
  9142. // Most likely T is an enum type (either named or unnamed), in which
  9143. // case printing it as an integer is the desired behavior. In case
  9144. // T is not an enum, printing it as an integer is the best we can do
  9145. // given that it has no user-defined printer.
  9146. static void PrintValue(const T& value, ::std::ostream* os) {
  9147. const internal::BiggestInt kBigInt = value;
  9148. *os << kBigInt;
  9149. }
  9150. };
  9151. // Prints the given value to the given ostream. If the value is a
  9152. // protocol message, its debug string is printed; if it's an enum or
  9153. // of a type implicitly convertible to BiggestInt, it's printed as an
  9154. // integer; otherwise the bytes in the value are printed. This is
  9155. // what UniversalPrinter<T>::Print() does when it knows nothing about
  9156. // type T and T has neither << operator nor PrintTo().
  9157. //
  9158. // A user can override this behavior for a class type Foo by defining
  9159. // a << operator in the namespace where Foo is defined.
  9160. //
  9161. // We put this operator in namespace 'internal2' instead of 'internal'
  9162. // to simplify the implementation, as much code in 'internal' needs to
  9163. // use << in STL, which would conflict with our own << were it defined
  9164. // in 'internal'.
  9165. //
  9166. // Note that this operator<< takes a generic std::basic_ostream<Char,
  9167. // CharTraits> type instead of the more restricted std::ostream. If
  9168. // we define it to take an std::ostream instead, we'll get an
  9169. // "ambiguous overloads" compiler error when trying to print a type
  9170. // Foo that supports streaming to std::basic_ostream<Char,
  9171. // CharTraits>, as the compiler cannot tell whether
  9172. // operator<<(std::ostream&, const T&) or
  9173. // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
  9174. // specific.
  9175. template <typename Char, typename CharTraits, typename T>
  9176. ::std::basic_ostream<Char, CharTraits>& operator<<(
  9177. ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
  9178. TypeWithoutFormatter<T,
  9179. (internal::IsAProtocolMessage<T>::value ? kProtobuf :
  9180. internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ?
  9181. kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
  9182. return os;
  9183. }
  9184. } // namespace internal2
  9185. } // namespace testing
  9186. // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
  9187. // magic needed for implementing UniversalPrinter won't work.
  9188. namespace testing_internal {
  9189. // Used to print a value that is not an STL-style container when the
  9190. // user doesn't define PrintTo() for it.
  9191. template <typename T>
  9192. void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
  9193. // With the following statement, during unqualified name lookup,
  9194. // testing::internal2::operator<< appears as if it was declared in
  9195. // the nearest enclosing namespace that contains both
  9196. // ::testing_internal and ::testing::internal2, i.e. the global
  9197. // namespace. For more details, refer to the C++ Standard section
  9198. // 7.3.4-1 [namespace.udir]. This allows us to fall back onto
  9199. // testing::internal2::operator<< in case T doesn't come with a <<
  9200. // operator.
  9201. //
  9202. // We cannot write 'using ::testing::internal2::operator<<;', which
  9203. // gcc 3.3 fails to compile due to a compiler bug.
  9204. using namespace ::testing::internal2; // NOLINT
  9205. // Assuming T is defined in namespace foo, in the next statement,
  9206. // the compiler will consider all of:
  9207. //
  9208. // 1. foo::operator<< (thanks to Koenig look-up),
  9209. // 2. ::operator<< (as the current namespace is enclosed in ::),
  9210. // 3. testing::internal2::operator<< (thanks to the using statement above).
  9211. //
  9212. // The operator<< whose type matches T best will be picked.
  9213. //
  9214. // We deliberately allow #2 to be a candidate, as sometimes it's
  9215. // impossible to define #1 (e.g. when foo is ::std, defining
  9216. // anything in it is undefined behavior unless you are a compiler
  9217. // vendor.).
  9218. *os << value;
  9219. }
  9220. } // namespace testing_internal
  9221. namespace testing {
  9222. namespace internal {
  9223. // FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a
  9224. // value of type ToPrint that is an operand of a comparison assertion
  9225. // (e.g. ASSERT_EQ). OtherOperand is the type of the other operand in
  9226. // the comparison, and is used to help determine the best way to
  9227. // format the value. In particular, when the value is a C string
  9228. // (char pointer) and the other operand is an STL string object, we
  9229. // want to format the C string as a string, since we know it is
  9230. // compared by value with the string object. If the value is a char
  9231. // pointer but the other operand is not an STL string object, we don't
  9232. // know whether the pointer is supposed to point to a NUL-terminated
  9233. // string, and thus want to print it as a pointer to be safe.
  9234. //
  9235. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  9236. // The default case.
  9237. template <typename ToPrint, typename OtherOperand>
  9238. class FormatForComparison {
  9239. public:
  9240. static ::std::string Format(const ToPrint& value) {
  9241. return ::testing::PrintToString(value);
  9242. }
  9243. };
  9244. // Array.
  9245. template <typename ToPrint, size_t N, typename OtherOperand>
  9246. class FormatForComparison<ToPrint[N], OtherOperand> {
  9247. public:
  9248. static ::std::string Format(const ToPrint* value) {
  9249. return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);
  9250. }
  9251. };
  9252. // By default, print C string as pointers to be safe, as we don't know
  9253. // whether they actually point to a NUL-terminated string.
  9254. #define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType) \
  9255. template <typename OtherOperand> \
  9256. class FormatForComparison<CharType*, OtherOperand> { \
  9257. public: \
  9258. static ::std::string Format(CharType* value) { \
  9259. return ::testing::PrintToString(static_cast<const void*>(value)); \
  9260. } \
  9261. }
  9262. GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);
  9263. GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);
  9264. GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);
  9265. GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);
  9266. #undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
  9267. // If a C string is compared with an STL string object, we know it's meant
  9268. // to point to a NUL-terminated string, and thus can print it as a string.
  9269. #define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
  9270. template <> \
  9271. class FormatForComparison<CharType*, OtherStringType> { \
  9272. public: \
  9273. static ::std::string Format(CharType* value) { \
  9274. return ::testing::PrintToString(value); \
  9275. } \
  9276. }
  9277. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
  9278. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
  9279. #if GTEST_HAS_GLOBAL_STRING
  9280. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
  9281. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
  9282. #endif
  9283. #if GTEST_HAS_GLOBAL_WSTRING
  9284. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);
  9285. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);
  9286. #endif
  9287. #if GTEST_HAS_STD_WSTRING
  9288. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
  9289. GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);
  9290. #endif
  9291. #undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
  9292. // Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
  9293. // operand to be used in a failure message. The type (but not value)
  9294. // of the other operand may affect the format. This allows us to
  9295. // print a char* as a raw pointer when it is compared against another
  9296. // char* or void*, and print it as a C string when it is compared
  9297. // against an std::string object, for example.
  9298. //
  9299. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  9300. template <typename T1, typename T2>
  9301. std::string FormatForComparisonFailureMessage(
  9302. const T1& value, const T2& /* other_operand */) {
  9303. return FormatForComparison<T1, T2>::Format(value);
  9304. }
  9305. // UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
  9306. // value to the given ostream. The caller must ensure that
  9307. // 'ostream_ptr' is not NULL, or the behavior is undefined.
  9308. //
  9309. // We define UniversalPrinter as a class template (as opposed to a
  9310. // function template), as we need to partially specialize it for
  9311. // reference types, which cannot be done with function templates.
  9312. template <typename T>
  9313. class UniversalPrinter;
  9314. template <typename T>
  9315. void UniversalPrint(const T& value, ::std::ostream* os);
  9316. // Used to print an STL-style container when the user doesn't define
  9317. // a PrintTo() for it.
  9318. template <typename C>
  9319. void DefaultPrintTo(IsContainer /* dummy */,
  9320. false_type /* is not a pointer */,
  9321. const C& container, ::std::ostream* os) {
  9322. const size_t kMaxCount = 32; // The maximum number of elements to print.
  9323. *os << '{';
  9324. size_t count = 0;
  9325. for (typename C::const_iterator it = container.begin();
  9326. it != container.end(); ++it, ++count) {
  9327. if (count > 0) {
  9328. *os << ',';
  9329. if (count == kMaxCount) { // Enough has been printed.
  9330. *os << " ...";
  9331. break;
  9332. }
  9333. }
  9334. *os << ' ';
  9335. // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
  9336. // handle *it being a native array.
  9337. internal::UniversalPrint(*it, os);
  9338. }
  9339. if (count > 0) {
  9340. *os << ' ';
  9341. }
  9342. *os << '}';
  9343. }
  9344. // Used to print a pointer that is neither a char pointer nor a member
  9345. // pointer, when the user doesn't define PrintTo() for it. (A member
  9346. // variable pointer or member function pointer doesn't really point to
  9347. // a location in the address space. Their representation is
  9348. // implementation-defined. Therefore they will be printed as raw
  9349. // bytes.)
  9350. template <typename T>
  9351. void DefaultPrintTo(IsNotContainer /* dummy */,
  9352. true_type /* is a pointer */,
  9353. T* p, ::std::ostream* os) {
  9354. if (p == NULL) {
  9355. *os << "NULL";
  9356. } else {
  9357. // C++ doesn't allow casting from a function pointer to any object
  9358. // pointer.
  9359. //
  9360. // IsTrue() silences warnings: "Condition is always true",
  9361. // "unreachable code".
  9362. if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {
  9363. // T is not a function type. We just call << to print p,
  9364. // relying on ADL to pick up user-defined << for their pointer
  9365. // types, if any.
  9366. *os << p;
  9367. } else {
  9368. // T is a function type, so '*os << p' doesn't do what we want
  9369. // (it just prints p as bool). We want to print p as a const
  9370. // void*. However, we cannot cast it to const void* directly,
  9371. // even using reinterpret_cast, as earlier versions of gcc
  9372. // (e.g. 3.4.5) cannot compile the cast when p is a function
  9373. // pointer. Casting to UInt64 first solves the problem.
  9374. *os << reinterpret_cast<const void*>(
  9375. reinterpret_cast<internal::UInt64>(p));
  9376. }
  9377. }
  9378. }
  9379. // Used to print a non-container, non-pointer value when the user
  9380. // doesn't define PrintTo() for it.
  9381. template <typename T>
  9382. void DefaultPrintTo(IsNotContainer /* dummy */,
  9383. false_type /* is not a pointer */,
  9384. const T& value, ::std::ostream* os) {
  9385. ::testing_internal::DefaultPrintNonContainerTo(value, os);
  9386. }
  9387. // Prints the given value using the << operator if it has one;
  9388. // otherwise prints the bytes in it. This is what
  9389. // UniversalPrinter<T>::Print() does when PrintTo() is not specialized
  9390. // or overloaded for type T.
  9391. //
  9392. // A user can override this behavior for a class type Foo by defining
  9393. // an overload of PrintTo() in the namespace where Foo is defined. We
  9394. // give the user this option as sometimes defining a << operator for
  9395. // Foo is not desirable (e.g. the coding style may prevent doing it,
  9396. // or there is already a << operator but it doesn't do what the user
  9397. // wants).
  9398. template <typename T>
  9399. void PrintTo(const T& value, ::std::ostream* os) {
  9400. // DefaultPrintTo() is overloaded. The type of its first two
  9401. // arguments determine which version will be picked. If T is an
  9402. // STL-style container, the version for container will be called; if
  9403. // T is a pointer, the pointer version will be called; otherwise the
  9404. // generic version will be called.
  9405. //
  9406. // Note that we check for container types here, prior to we check
  9407. // for protocol message types in our operator<<. The rationale is:
  9408. //
  9409. // For protocol messages, we want to give people a chance to
  9410. // override Google Mock's format by defining a PrintTo() or
  9411. // operator<<. For STL containers, other formats can be
  9412. // incompatible with Google Mock's format for the container
  9413. // elements; therefore we check for container types here to ensure
  9414. // that our format is used.
  9415. //
  9416. // The second argument of DefaultPrintTo() is needed to bypass a bug
  9417. // in Symbian's C++ compiler that prevents it from picking the right
  9418. // overload between:
  9419. //
  9420. // PrintTo(const T& x, ...);
  9421. // PrintTo(T* x, ...);
  9422. DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);
  9423. }
  9424. // The following list of PrintTo() overloads tells
  9425. // UniversalPrinter<T>::Print() how to print standard types (built-in
  9426. // types, strings, plain arrays, and pointers).
  9427. // Overloads for various char types.
  9428. GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
  9429. GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
  9430. inline void PrintTo(char c, ::std::ostream* os) {
  9431. // When printing a plain char, we always treat it as unsigned. This
  9432. // way, the output won't be affected by whether the compiler thinks
  9433. // char is signed or not.
  9434. PrintTo(static_cast<unsigned char>(c), os);
  9435. }
  9436. // Overloads for other simple built-in types.
  9437. inline void PrintTo(bool x, ::std::ostream* os) {
  9438. *os << (x ? "true" : "false");
  9439. }
  9440. // Overload for wchar_t type.
  9441. // Prints a wchar_t as a symbol if it is printable or as its internal
  9442. // code otherwise and also as its decimal code (except for L'\0').
  9443. // The L'\0' char is printed as "L'\\0'". The decimal code is printed
  9444. // as signed integer when wchar_t is implemented by the compiler
  9445. // as a signed type and is printed as an unsigned integer when wchar_t
  9446. // is implemented as an unsigned type.
  9447. GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
  9448. // Overloads for C strings.
  9449. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
  9450. inline void PrintTo(char* s, ::std::ostream* os) {
  9451. PrintTo(ImplicitCast_<const char*>(s), os);
  9452. }
  9453. // signed/unsigned char is often used for representing binary data, so
  9454. // we print pointers to it as void* to be safe.
  9455. inline void PrintTo(const signed char* s, ::std::ostream* os) {
  9456. PrintTo(ImplicitCast_<const void*>(s), os);
  9457. }
  9458. inline void PrintTo(signed char* s, ::std::ostream* os) {
  9459. PrintTo(ImplicitCast_<const void*>(s), os);
  9460. }
  9461. inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
  9462. PrintTo(ImplicitCast_<const void*>(s), os);
  9463. }
  9464. inline void PrintTo(unsigned char* s, ::std::ostream* os) {
  9465. PrintTo(ImplicitCast_<const void*>(s), os);
  9466. }
  9467. // MSVC can be configured to define wchar_t as a typedef of unsigned
  9468. // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
  9469. // type. When wchar_t is a typedef, defining an overload for const
  9470. // wchar_t* would cause unsigned short* be printed as a wide string,
  9471. // possibly causing invalid memory accesses.
  9472. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
  9473. // Overloads for wide C strings
  9474. GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
  9475. inline void PrintTo(wchar_t* s, ::std::ostream* os) {
  9476. PrintTo(ImplicitCast_<const wchar_t*>(s), os);
  9477. }
  9478. #endif
  9479. // Overload for C arrays. Multi-dimensional arrays are printed
  9480. // properly.
  9481. // Prints the given number of elements in an array, without printing
  9482. // the curly braces.
  9483. template <typename T>
  9484. void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
  9485. UniversalPrint(a[0], os);
  9486. for (size_t i = 1; i != count; i++) {
  9487. *os << ", ";
  9488. UniversalPrint(a[i], os);
  9489. }
  9490. }
  9491. // Overloads for ::string and ::std::string.
  9492. #if GTEST_HAS_GLOBAL_STRING
  9493. GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
  9494. inline void PrintTo(const ::string& s, ::std::ostream* os) {
  9495. PrintStringTo(s, os);
  9496. }
  9497. #endif // GTEST_HAS_GLOBAL_STRING
  9498. GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
  9499. inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
  9500. PrintStringTo(s, os);
  9501. }
  9502. // Overloads for ::wstring and ::std::wstring.
  9503. #if GTEST_HAS_GLOBAL_WSTRING
  9504. GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
  9505. inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
  9506. PrintWideStringTo(s, os);
  9507. }
  9508. #endif // GTEST_HAS_GLOBAL_WSTRING
  9509. #if GTEST_HAS_STD_WSTRING
  9510. GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
  9511. inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
  9512. PrintWideStringTo(s, os);
  9513. }
  9514. #endif // GTEST_HAS_STD_WSTRING
  9515. #if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
  9516. // Helper function for printing a tuple. T must be instantiated with
  9517. // a tuple type.
  9518. template <typename T>
  9519. void PrintTupleTo(const T& t, ::std::ostream* os);
  9520. #endif // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
  9521. #if GTEST_HAS_TR1_TUPLE
  9522. // Overload for ::std::tr1::tuple. Needed for printing function arguments,
  9523. // which are packed as tuples.
  9524. // Overloaded PrintTo() for tuples of various arities. We support
  9525. // tuples of up-to 10 fields. The following implementation works
  9526. // regardless of whether tr1::tuple is implemented using the
  9527. // non-standard variadic template feature or not.
  9528. inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
  9529. PrintTupleTo(t, os);
  9530. }
  9531. template <typename T1>
  9532. void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
  9533. PrintTupleTo(t, os);
  9534. }
  9535. template <typename T1, typename T2>
  9536. void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
  9537. PrintTupleTo(t, os);
  9538. }
  9539. template <typename T1, typename T2, typename T3>
  9540. void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
  9541. PrintTupleTo(t, os);
  9542. }
  9543. template <typename T1, typename T2, typename T3, typename T4>
  9544. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
  9545. PrintTupleTo(t, os);
  9546. }
  9547. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  9548. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
  9549. ::std::ostream* os) {
  9550. PrintTupleTo(t, os);
  9551. }
  9552. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9553. typename T6>
  9554. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
  9555. ::std::ostream* os) {
  9556. PrintTupleTo(t, os);
  9557. }
  9558. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9559. typename T6, typename T7>
  9560. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
  9561. ::std::ostream* os) {
  9562. PrintTupleTo(t, os);
  9563. }
  9564. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9565. typename T6, typename T7, typename T8>
  9566. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
  9567. ::std::ostream* os) {
  9568. PrintTupleTo(t, os);
  9569. }
  9570. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9571. typename T6, typename T7, typename T8, typename T9>
  9572. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
  9573. ::std::ostream* os) {
  9574. PrintTupleTo(t, os);
  9575. }
  9576. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9577. typename T6, typename T7, typename T8, typename T9, typename T10>
  9578. void PrintTo(
  9579. const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
  9580. ::std::ostream* os) {
  9581. PrintTupleTo(t, os);
  9582. }
  9583. #endif // GTEST_HAS_TR1_TUPLE
  9584. #if GTEST_HAS_STD_TUPLE_
  9585. template <typename... Types>
  9586. void PrintTo(const ::std::tuple<Types...>& t, ::std::ostream* os) {
  9587. PrintTupleTo(t, os);
  9588. }
  9589. #endif // GTEST_HAS_STD_TUPLE_
  9590. // Overload for std::pair.
  9591. template <typename T1, typename T2>
  9592. void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
  9593. *os << '(';
  9594. // We cannot use UniversalPrint(value.first, os) here, as T1 may be
  9595. // a reference type. The same for printing value.second.
  9596. UniversalPrinter<T1>::Print(value.first, os);
  9597. *os << ", ";
  9598. UniversalPrinter<T2>::Print(value.second, os);
  9599. *os << ')';
  9600. }
  9601. // Implements printing a non-reference type T by letting the compiler
  9602. // pick the right overload of PrintTo() for T.
  9603. template <typename T>
  9604. class UniversalPrinter {
  9605. public:
  9606. // MSVC warns about adding const to a function type, so we want to
  9607. // disable the warning.
  9608. GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
  9609. // Note: we deliberately don't call this PrintTo(), as that name
  9610. // conflicts with ::testing::internal::PrintTo in the body of the
  9611. // function.
  9612. static void Print(const T& value, ::std::ostream* os) {
  9613. // By default, ::testing::internal::PrintTo() is used for printing
  9614. // the value.
  9615. //
  9616. // Thanks to Koenig look-up, if T is a class and has its own
  9617. // PrintTo() function defined in its namespace, that function will
  9618. // be visible here. Since it is more specific than the generic ones
  9619. // in ::testing::internal, it will be picked by the compiler in the
  9620. // following statement - exactly what we want.
  9621. PrintTo(value, os);
  9622. }
  9623. GTEST_DISABLE_MSC_WARNINGS_POP_()
  9624. };
  9625. // UniversalPrintArray(begin, len, os) prints an array of 'len'
  9626. // elements, starting at address 'begin'.
  9627. template <typename T>
  9628. void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
  9629. if (len == 0) {
  9630. *os << "{}";
  9631. } else {
  9632. *os << "{ ";
  9633. const size_t kThreshold = 18;
  9634. const size_t kChunkSize = 8;
  9635. // If the array has more than kThreshold elements, we'll have to
  9636. // omit some details by printing only the first and the last
  9637. // kChunkSize elements.
  9638. // TODO(wan@google.com): let the user control the threshold using a flag.
  9639. if (len <= kThreshold) {
  9640. PrintRawArrayTo(begin, len, os);
  9641. } else {
  9642. PrintRawArrayTo(begin, kChunkSize, os);
  9643. *os << ", ..., ";
  9644. PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
  9645. }
  9646. *os << " }";
  9647. }
  9648. }
  9649. // This overload prints a (const) char array compactly.
  9650. GTEST_API_ void UniversalPrintArray(
  9651. const char* begin, size_t len, ::std::ostream* os);
  9652. // This overload prints a (const) wchar_t array compactly.
  9653. GTEST_API_ void UniversalPrintArray(
  9654. const wchar_t* begin, size_t len, ::std::ostream* os);
  9655. // Implements printing an array type T[N].
  9656. template <typename T, size_t N>
  9657. class UniversalPrinter<T[N]> {
  9658. public:
  9659. // Prints the given array, omitting some elements when there are too
  9660. // many.
  9661. static void Print(const T (&a)[N], ::std::ostream* os) {
  9662. UniversalPrintArray(a, N, os);
  9663. }
  9664. };
  9665. // Implements printing a reference type T&.
  9666. template <typename T>
  9667. class UniversalPrinter<T&> {
  9668. public:
  9669. // MSVC warns about adding const to a function type, so we want to
  9670. // disable the warning.
  9671. GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
  9672. static void Print(const T& value, ::std::ostream* os) {
  9673. // Prints the address of the value. We use reinterpret_cast here
  9674. // as static_cast doesn't compile when T is a function type.
  9675. *os << "@" << reinterpret_cast<const void*>(&value) << " ";
  9676. // Then prints the value itself.
  9677. UniversalPrint(value, os);
  9678. }
  9679. GTEST_DISABLE_MSC_WARNINGS_POP_()
  9680. };
  9681. // Prints a value tersely: for a reference type, the referenced value
  9682. // (but not the address) is printed; for a (const) char pointer, the
  9683. // NUL-terminated string (but not the pointer) is printed.
  9684. template <typename T>
  9685. class UniversalTersePrinter {
  9686. public:
  9687. static void Print(const T& value, ::std::ostream* os) {
  9688. UniversalPrint(value, os);
  9689. }
  9690. };
  9691. template <typename T>
  9692. class UniversalTersePrinter<T&> {
  9693. public:
  9694. static void Print(const T& value, ::std::ostream* os) {
  9695. UniversalPrint(value, os);
  9696. }
  9697. };
  9698. template <typename T, size_t N>
  9699. class UniversalTersePrinter<T[N]> {
  9700. public:
  9701. static void Print(const T (&value)[N], ::std::ostream* os) {
  9702. UniversalPrinter<T[N]>::Print(value, os);
  9703. }
  9704. };
  9705. template <>
  9706. class UniversalTersePrinter<const char*> {
  9707. public:
  9708. static void Print(const char* str, ::std::ostream* os) {
  9709. if (str == NULL) {
  9710. *os << "NULL";
  9711. } else {
  9712. UniversalPrint(string(str), os);
  9713. }
  9714. }
  9715. };
  9716. template <>
  9717. class UniversalTersePrinter<char*> {
  9718. public:
  9719. static void Print(char* str, ::std::ostream* os) {
  9720. UniversalTersePrinter<const char*>::Print(str, os);
  9721. }
  9722. };
  9723. #if GTEST_HAS_STD_WSTRING
  9724. template <>
  9725. class UniversalTersePrinter<const wchar_t*> {
  9726. public:
  9727. static void Print(const wchar_t* str, ::std::ostream* os) {
  9728. if (str == NULL) {
  9729. *os << "NULL";
  9730. } else {
  9731. UniversalPrint(::std::wstring(str), os);
  9732. }
  9733. }
  9734. };
  9735. #endif
  9736. template <>
  9737. class UniversalTersePrinter<wchar_t*> {
  9738. public:
  9739. static void Print(wchar_t* str, ::std::ostream* os) {
  9740. UniversalTersePrinter<const wchar_t*>::Print(str, os);
  9741. }
  9742. };
  9743. template <typename T>
  9744. void UniversalTersePrint(const T& value, ::std::ostream* os) {
  9745. UniversalTersePrinter<T>::Print(value, os);
  9746. }
  9747. // Prints a value using the type inferred by the compiler. The
  9748. // difference between this and UniversalTersePrint() is that for a
  9749. // (const) char pointer, this prints both the pointer and the
  9750. // NUL-terminated string.
  9751. template <typename T>
  9752. void UniversalPrint(const T& value, ::std::ostream* os) {
  9753. // A workarond for the bug in VC++ 7.1 that prevents us from instantiating
  9754. // UniversalPrinter with T directly.
  9755. typedef T T1;
  9756. UniversalPrinter<T1>::Print(value, os);
  9757. }
  9758. typedef ::std::vector<string> Strings;
  9759. // TuplePolicy<TupleT> must provide:
  9760. // - tuple_size
  9761. // size of tuple TupleT.
  9762. // - get<size_t I>(const TupleT& t)
  9763. // static function extracting element I of tuple TupleT.
  9764. // - tuple_element<size_t I>::type
  9765. // type of element I of tuple TupleT.
  9766. template <typename TupleT>
  9767. struct TuplePolicy;
  9768. #if GTEST_HAS_TR1_TUPLE
  9769. template <typename TupleT>
  9770. struct TuplePolicy {
  9771. typedef TupleT Tuple;
  9772. static const size_t tuple_size = ::std::tr1::tuple_size<Tuple>::value;
  9773. template <size_t I>
  9774. struct tuple_element : ::std::tr1::tuple_element<I, Tuple> {};
  9775. template <size_t I>
  9776. static typename AddReference<
  9777. const typename ::std::tr1::tuple_element<I, Tuple>::type>::type get(
  9778. const Tuple& tuple) {
  9779. return ::std::tr1::get<I>(tuple);
  9780. }
  9781. };
  9782. template <typename TupleT>
  9783. const size_t TuplePolicy<TupleT>::tuple_size;
  9784. #endif // GTEST_HAS_TR1_TUPLE
  9785. #if GTEST_HAS_STD_TUPLE_
  9786. template <typename... Types>
  9787. struct TuplePolicy< ::std::tuple<Types...> > {
  9788. typedef ::std::tuple<Types...> Tuple;
  9789. static const size_t tuple_size = ::std::tuple_size<Tuple>::value;
  9790. template <size_t I>
  9791. struct tuple_element : ::std::tuple_element<I, Tuple> {};
  9792. template <size_t I>
  9793. static const typename ::std::tuple_element<I, Tuple>::type& get(
  9794. const Tuple& tuple) {
  9795. return ::std::get<I>(tuple);
  9796. }
  9797. };
  9798. template <typename... Types>
  9799. const size_t TuplePolicy< ::std::tuple<Types...> >::tuple_size;
  9800. #endif // GTEST_HAS_STD_TUPLE_
  9801. #if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
  9802. // This helper template allows PrintTo() for tuples and
  9803. // UniversalTersePrintTupleFieldsToStrings() to be defined by
  9804. // induction on the number of tuple fields. The idea is that
  9805. // TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
  9806. // fields in tuple t, and can be defined in terms of
  9807. // TuplePrefixPrinter<N - 1>.
  9808. //
  9809. // The inductive case.
  9810. template <size_t N>
  9811. struct TuplePrefixPrinter {
  9812. // Prints the first N fields of a tuple.
  9813. template <typename Tuple>
  9814. static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
  9815. TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
  9816. GTEST_INTENTIONAL_CONST_COND_PUSH_()
  9817. if (N > 1) {
  9818. GTEST_INTENTIONAL_CONST_COND_POP_()
  9819. *os << ", ";
  9820. }
  9821. UniversalPrinter<
  9822. typename TuplePolicy<Tuple>::template tuple_element<N - 1>::type>
  9823. ::Print(TuplePolicy<Tuple>::template get<N - 1>(t), os);
  9824. }
  9825. // Tersely prints the first N fields of a tuple to a string vector,
  9826. // one element for each field.
  9827. template <typename Tuple>
  9828. static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
  9829. TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
  9830. ::std::stringstream ss;
  9831. UniversalTersePrint(TuplePolicy<Tuple>::template get<N - 1>(t), &ss);
  9832. strings->push_back(ss.str());
  9833. }
  9834. };
  9835. // Base case.
  9836. template <>
  9837. struct TuplePrefixPrinter<0> {
  9838. template <typename Tuple>
  9839. static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
  9840. template <typename Tuple>
  9841. static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
  9842. };
  9843. // Helper function for printing a tuple.
  9844. // Tuple must be either std::tr1::tuple or std::tuple type.
  9845. template <typename Tuple>
  9846. void PrintTupleTo(const Tuple& t, ::std::ostream* os) {
  9847. *os << "(";
  9848. TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::PrintPrefixTo(t, os);
  9849. *os << ")";
  9850. }
  9851. // Prints the fields of a tuple tersely to a string vector, one
  9852. // element for each field. See the comment before
  9853. // UniversalTersePrint() for how we define "tersely".
  9854. template <typename Tuple>
  9855. Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
  9856. Strings result;
  9857. TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::
  9858. TersePrintPrefixToStrings(value, &result);
  9859. return result;
  9860. }
  9861. #endif // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
  9862. } // namespace internal
  9863. template <typename T>
  9864. ::std::string PrintToString(const T& value) {
  9865. ::std::stringstream ss;
  9866. internal::UniversalTersePrinter<T>::Print(value, &ss);
  9867. return ss.str();
  9868. }
  9869. } // namespace testing
  9870. // Include any custom printer added by the local installation.
  9871. // We must include this header at the end to make sure it can use the
  9872. // declarations from this file.
  9873. // Copyright 2015, Google Inc.
  9874. // All rights reserved.
  9875. //
  9876. // Redistribution and use in source and binary forms, with or without
  9877. // modification, are permitted provided that the following conditions are
  9878. // met:
  9879. //
  9880. // * Redistributions of source code must retain the above copyright
  9881. // notice, this list of conditions and the following disclaimer.
  9882. // * Redistributions in binary form must reproduce the above
  9883. // copyright notice, this list of conditions and the following disclaimer
  9884. // in the documentation and/or other materials provided with the
  9885. // distribution.
  9886. // * Neither the name of Google Inc. nor the names of its
  9887. // contributors may be used to endorse or promote products derived from
  9888. // this software without specific prior written permission.
  9889. //
  9890. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  9891. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  9892. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  9893. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  9894. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  9895. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  9896. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  9897. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  9898. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  9899. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  9900. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  9901. //
  9902. // This file provides an injection point for custom printers in a local
  9903. // installation of gTest.
  9904. // It will be included from gtest-printers.h and the overrides in this file
  9905. // will be visible to everyone.
  9906. // See documentation at gtest/gtest-printers.h for details on how to define a
  9907. // custom printer.
  9908. //
  9909. // ** Custom implementation starts here **
  9910. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
  9911. #define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
  9912. #endif // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
  9913. #endif // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
  9914. #if GTEST_HAS_PARAM_TEST
  9915. namespace testing {
  9916. // Input to a parameterized test name generator, describing a test parameter.
  9917. // Consists of the parameter value and the integer parameter index.
  9918. template <class ParamType>
  9919. struct TestParamInfo {
  9920. TestParamInfo(const ParamType& a_param, size_t an_index) :
  9921. param(a_param),
  9922. index(an_index) {}
  9923. ParamType param;
  9924. size_t index;
  9925. };
  9926. // A builtin parameterized test name generator which returns the result of
  9927. // testing::PrintToString.
  9928. struct PrintToStringParamName {
  9929. template <class ParamType>
  9930. std::string operator()(const TestParamInfo<ParamType>& info) const {
  9931. return PrintToString(info.param);
  9932. }
  9933. };
  9934. namespace internal {
  9935. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9936. //
  9937. // Outputs a message explaining invalid registration of different
  9938. // fixture class for the same test case. This may happen when
  9939. // TEST_P macro is used to define two tests with the same name
  9940. // but in different namespaces.
  9941. GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
  9942. CodeLocation code_location);
  9943. template <typename> class ParamGeneratorInterface;
  9944. template <typename> class ParamGenerator;
  9945. // Interface for iterating over elements provided by an implementation
  9946. // of ParamGeneratorInterface<T>.
  9947. template <typename T>
  9948. class ParamIteratorInterface {
  9949. public:
  9950. virtual ~ParamIteratorInterface() {}
  9951. // A pointer to the base generator instance.
  9952. // Used only for the purposes of iterator comparison
  9953. // to make sure that two iterators belong to the same generator.
  9954. virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
  9955. // Advances iterator to point to the next element
  9956. // provided by the generator. The caller is responsible
  9957. // for not calling Advance() on an iterator equal to
  9958. // BaseGenerator()->End().
  9959. virtual void Advance() = 0;
  9960. // Clones the iterator object. Used for implementing copy semantics
  9961. // of ParamIterator<T>.
  9962. virtual ParamIteratorInterface* Clone() const = 0;
  9963. // Dereferences the current iterator and provides (read-only) access
  9964. // to the pointed value. It is the caller's responsibility not to call
  9965. // Current() on an iterator equal to BaseGenerator()->End().
  9966. // Used for implementing ParamGenerator<T>::operator*().
  9967. virtual const T* Current() const = 0;
  9968. // Determines whether the given iterator and other point to the same
  9969. // element in the sequence generated by the generator.
  9970. // Used for implementing ParamGenerator<T>::operator==().
  9971. virtual bool Equals(const ParamIteratorInterface& other) const = 0;
  9972. };
  9973. // Class iterating over elements provided by an implementation of
  9974. // ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
  9975. // and implements the const forward iterator concept.
  9976. template <typename T>
  9977. class ParamIterator {
  9978. public:
  9979. typedef T value_type;
  9980. typedef const T& reference;
  9981. typedef ptrdiff_t difference_type;
  9982. // ParamIterator assumes ownership of the impl_ pointer.
  9983. ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
  9984. ParamIterator& operator=(const ParamIterator& other) {
  9985. if (this != &other)
  9986. impl_.reset(other.impl_->Clone());
  9987. return *this;
  9988. }
  9989. const T& operator*() const { return *impl_->Current(); }
  9990. const T* operator->() const { return impl_->Current(); }
  9991. // Prefix version of operator++.
  9992. ParamIterator& operator++() {
  9993. impl_->Advance();
  9994. return *this;
  9995. }
  9996. // Postfix version of operator++.
  9997. ParamIterator operator++(int /*unused*/) {
  9998. ParamIteratorInterface<T>* clone = impl_->Clone();
  9999. impl_->Advance();
  10000. return ParamIterator(clone);
  10001. }
  10002. bool operator==(const ParamIterator& other) const {
  10003. return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
  10004. }
  10005. bool operator!=(const ParamIterator& other) const {
  10006. return !(*this == other);
  10007. }
  10008. private:
  10009. friend class ParamGenerator<T>;
  10010. explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
  10011. scoped_ptr<ParamIteratorInterface<T> > impl_;
  10012. };
  10013. // ParamGeneratorInterface<T> is the binary interface to access generators
  10014. // defined in other translation units.
  10015. template <typename T>
  10016. class ParamGeneratorInterface {
  10017. public:
  10018. typedef T ParamType;
  10019. virtual ~ParamGeneratorInterface() {}
  10020. // Generator interface definition
  10021. virtual ParamIteratorInterface<T>* Begin() const = 0;
  10022. virtual ParamIteratorInterface<T>* End() const = 0;
  10023. };
  10024. // Wraps ParamGeneratorInterface<T> and provides general generator syntax
  10025. // compatible with the STL Container concept.
  10026. // This class implements copy initialization semantics and the contained
  10027. // ParamGeneratorInterface<T> instance is shared among all copies
  10028. // of the original object. This is possible because that instance is immutable.
  10029. template<typename T>
  10030. class ParamGenerator {
  10031. public:
  10032. typedef ParamIterator<T> iterator;
  10033. explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
  10034. ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
  10035. ParamGenerator& operator=(const ParamGenerator& other) {
  10036. impl_ = other.impl_;
  10037. return *this;
  10038. }
  10039. iterator begin() const { return iterator(impl_->Begin()); }
  10040. iterator end() const { return iterator(impl_->End()); }
  10041. private:
  10042. linked_ptr<const ParamGeneratorInterface<T> > impl_;
  10043. };
  10044. // Generates values from a range of two comparable values. Can be used to
  10045. // generate sequences of user-defined types that implement operator+() and
  10046. // operator<().
  10047. // This class is used in the Range() function.
  10048. template <typename T, typename IncrementT>
  10049. class RangeGenerator : public ParamGeneratorInterface<T> {
  10050. public:
  10051. RangeGenerator(T begin, T end, IncrementT step)
  10052. : begin_(begin), end_(end),
  10053. step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
  10054. virtual ~RangeGenerator() {}
  10055. virtual ParamIteratorInterface<T>* Begin() const {
  10056. return new Iterator(this, begin_, 0, step_);
  10057. }
  10058. virtual ParamIteratorInterface<T>* End() const {
  10059. return new Iterator(this, end_, end_index_, step_);
  10060. }
  10061. private:
  10062. class Iterator : public ParamIteratorInterface<T> {
  10063. public:
  10064. Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
  10065. IncrementT step)
  10066. : base_(base), value_(value), index_(index), step_(step) {}
  10067. virtual ~Iterator() {}
  10068. virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
  10069. return base_;
  10070. }
  10071. virtual void Advance() {
  10072. value_ = static_cast<T>(value_ + step_);
  10073. index_++;
  10074. }
  10075. virtual ParamIteratorInterface<T>* Clone() const {
  10076. return new Iterator(*this);
  10077. }
  10078. virtual const T* Current() const { return &value_; }
  10079. virtual bool Equals(const ParamIteratorInterface<T>& other) const {
  10080. // Having the same base generator guarantees that the other
  10081. // iterator is of the same type and we can downcast.
  10082. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  10083. << "The program attempted to compare iterators "
  10084. << "from different generators." << std::endl;
  10085. const int other_index =
  10086. CheckedDowncastToActualType<const Iterator>(&other)->index_;
  10087. return index_ == other_index;
  10088. }
  10089. private:
  10090. Iterator(const Iterator& other)
  10091. : ParamIteratorInterface<T>(),
  10092. base_(other.base_), value_(other.value_), index_(other.index_),
  10093. step_(other.step_) {}
  10094. // No implementation - assignment is unsupported.
  10095. void operator=(const Iterator& other);
  10096. const ParamGeneratorInterface<T>* const base_;
  10097. T value_;
  10098. int index_;
  10099. const IncrementT step_;
  10100. }; // class RangeGenerator::Iterator
  10101. static int CalculateEndIndex(const T& begin,
  10102. const T& end,
  10103. const IncrementT& step) {
  10104. int end_index = 0;
  10105. for (T i = begin; i < end; i = static_cast<T>(i + step))
  10106. end_index++;
  10107. return end_index;
  10108. }
  10109. // No implementation - assignment is unsupported.
  10110. void operator=(const RangeGenerator& other);
  10111. const T begin_;
  10112. const T end_;
  10113. const IncrementT step_;
  10114. // The index for the end() iterator. All the elements in the generated
  10115. // sequence are indexed (0-based) to aid iterator comparison.
  10116. const int end_index_;
  10117. }; // class RangeGenerator
  10118. // Generates values from a pair of STL-style iterators. Used in the
  10119. // ValuesIn() function. The elements are copied from the source range
  10120. // since the source can be located on the stack, and the generator
  10121. // is likely to persist beyond that stack frame.
  10122. template <typename T>
  10123. class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
  10124. public:
  10125. template <typename ForwardIterator>
  10126. ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
  10127. : container_(begin, end) {}
  10128. virtual ~ValuesInIteratorRangeGenerator() {}
  10129. virtual ParamIteratorInterface<T>* Begin() const {
  10130. return new Iterator(this, container_.begin());
  10131. }
  10132. virtual ParamIteratorInterface<T>* End() const {
  10133. return new Iterator(this, container_.end());
  10134. }
  10135. private:
  10136. typedef typename ::std::vector<T> ContainerType;
  10137. class Iterator : public ParamIteratorInterface<T> {
  10138. public:
  10139. Iterator(const ParamGeneratorInterface<T>* base,
  10140. typename ContainerType::const_iterator iterator)
  10141. : base_(base), iterator_(iterator) {}
  10142. virtual ~Iterator() {}
  10143. virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
  10144. return base_;
  10145. }
  10146. virtual void Advance() {
  10147. ++iterator_;
  10148. value_.reset();
  10149. }
  10150. virtual ParamIteratorInterface<T>* Clone() const {
  10151. return new Iterator(*this);
  10152. }
  10153. // We need to use cached value referenced by iterator_ because *iterator_
  10154. // can return a temporary object (and of type other then T), so just
  10155. // having "return &*iterator_;" doesn't work.
  10156. // value_ is updated here and not in Advance() because Advance()
  10157. // can advance iterator_ beyond the end of the range, and we cannot
  10158. // detect that fact. The client code, on the other hand, is
  10159. // responsible for not calling Current() on an out-of-range iterator.
  10160. virtual const T* Current() const {
  10161. if (value_.get() == NULL)
  10162. value_.reset(new T(*iterator_));
  10163. return value_.get();
  10164. }
  10165. virtual bool Equals(const ParamIteratorInterface<T>& other) const {
  10166. // Having the same base generator guarantees that the other
  10167. // iterator is of the same type and we can downcast.
  10168. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  10169. << "The program attempted to compare iterators "
  10170. << "from different generators." << std::endl;
  10171. return iterator_ ==
  10172. CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
  10173. }
  10174. private:
  10175. Iterator(const Iterator& other)
  10176. // The explicit constructor call suppresses a false warning
  10177. // emitted by gcc when supplied with the -Wextra option.
  10178. : ParamIteratorInterface<T>(),
  10179. base_(other.base_),
  10180. iterator_(other.iterator_) {}
  10181. const ParamGeneratorInterface<T>* const base_;
  10182. typename ContainerType::const_iterator iterator_;
  10183. // A cached value of *iterator_. We keep it here to allow access by
  10184. // pointer in the wrapping iterator's operator->().
  10185. // value_ needs to be mutable to be accessed in Current().
  10186. // Use of scoped_ptr helps manage cached value's lifetime,
  10187. // which is bound by the lifespan of the iterator itself.
  10188. mutable scoped_ptr<const T> value_;
  10189. }; // class ValuesInIteratorRangeGenerator::Iterator
  10190. // No implementation - assignment is unsupported.
  10191. void operator=(const ValuesInIteratorRangeGenerator& other);
  10192. const ContainerType container_;
  10193. }; // class ValuesInIteratorRangeGenerator
  10194. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  10195. //
  10196. // Default parameterized test name generator, returns a string containing the
  10197. // integer test parameter index.
  10198. template <class ParamType>
  10199. std::string DefaultParamName(const TestParamInfo<ParamType>& info) {
  10200. Message name_stream;
  10201. name_stream << info.index;
  10202. return name_stream.GetString();
  10203. }
  10204. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  10205. //
  10206. // Parameterized test name overload helpers, which help the
  10207. // INSTANTIATE_TEST_CASE_P macro choose between the default parameterized
  10208. // test name generator and user param name generator.
  10209. template <class ParamType, class ParamNameGenFunctor>
  10210. ParamNameGenFunctor GetParamNameGen(ParamNameGenFunctor func) {
  10211. return func;
  10212. }
  10213. template <class ParamType>
  10214. struct ParamNameGenFunc {
  10215. typedef std::string Type(const TestParamInfo<ParamType>&);
  10216. };
  10217. template <class ParamType>
  10218. typename ParamNameGenFunc<ParamType>::Type *GetParamNameGen() {
  10219. return DefaultParamName;
  10220. }
  10221. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  10222. //
  10223. // Stores a parameter value and later creates tests parameterized with that
  10224. // value.
  10225. template <class TestClass>
  10226. class ParameterizedTestFactory : public TestFactoryBase {
  10227. public:
  10228. typedef typename TestClass::ParamType ParamType;
  10229. explicit ParameterizedTestFactory(ParamType parameter) :
  10230. parameter_(parameter) {}
  10231. virtual Test* CreateTest() {
  10232. TestClass::SetParam(&parameter_);
  10233. return new TestClass();
  10234. }
  10235. private:
  10236. const ParamType parameter_;
  10237. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
  10238. };
  10239. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  10240. //
  10241. // TestMetaFactoryBase is a base class for meta-factories that create
  10242. // test factories for passing into MakeAndRegisterTestInfo function.
  10243. template <class ParamType>
  10244. class TestMetaFactoryBase {
  10245. public:
  10246. virtual ~TestMetaFactoryBase() {}
  10247. virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
  10248. };
  10249. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  10250. //
  10251. // TestMetaFactory creates test factories for passing into
  10252. // MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
  10253. // ownership of test factory pointer, same factory object cannot be passed
  10254. // into that method twice. But ParameterizedTestCaseInfo is going to call
  10255. // it for each Test/Parameter value combination. Thus it needs meta factory
  10256. // creator class.
  10257. template <class TestCase>
  10258. class TestMetaFactory
  10259. : public TestMetaFactoryBase<typename TestCase::ParamType> {
  10260. public:
  10261. typedef typename TestCase::ParamType ParamType;
  10262. TestMetaFactory() {}
  10263. virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
  10264. return new ParameterizedTestFactory<TestCase>(parameter);
  10265. }
  10266. private:
  10267. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
  10268. };
  10269. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  10270. //
  10271. // ParameterizedTestCaseInfoBase is a generic interface
  10272. // to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
  10273. // accumulates test information provided by TEST_P macro invocations
  10274. // and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
  10275. // and uses that information to register all resulting test instances
  10276. // in RegisterTests method. The ParameterizeTestCaseRegistry class holds
  10277. // a collection of pointers to the ParameterizedTestCaseInfo objects
  10278. // and calls RegisterTests() on each of them when asked.
  10279. class ParameterizedTestCaseInfoBase {
  10280. public:
  10281. virtual ~ParameterizedTestCaseInfoBase() {}
  10282. // Base part of test case name for display purposes.
  10283. virtual const string& GetTestCaseName() const = 0;
  10284. // Test case id to verify identity.
  10285. virtual TypeId GetTestCaseTypeId() const = 0;
  10286. // UnitTest class invokes this method to register tests in this
  10287. // test case right before running them in RUN_ALL_TESTS macro.
  10288. // This method should not be called more then once on any single
  10289. // instance of a ParameterizedTestCaseInfoBase derived class.
  10290. virtual void RegisterTests() = 0;
  10291. protected:
  10292. ParameterizedTestCaseInfoBase() {}
  10293. private:
  10294. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
  10295. };
  10296. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  10297. //
  10298. // ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
  10299. // macro invocations for a particular test case and generators
  10300. // obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
  10301. // test case. It registers tests with all values generated by all
  10302. // generators when asked.
  10303. template <class TestCase>
  10304. class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
  10305. public:
  10306. // ParamType and GeneratorCreationFunc are private types but are required
  10307. // for declarations of public methods AddTestPattern() and
  10308. // AddTestCaseInstantiation().
  10309. typedef typename TestCase::ParamType ParamType;
  10310. // A function that returns an instance of appropriate generator type.
  10311. typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
  10312. typedef typename ParamNameGenFunc<ParamType>::Type ParamNameGeneratorFunc;
  10313. explicit ParameterizedTestCaseInfo(
  10314. const char* name, CodeLocation code_location)
  10315. : test_case_name_(name), code_location_(code_location) {}
  10316. // Test case base name for display purposes.
  10317. virtual const string& GetTestCaseName() const { return test_case_name_; }
  10318. // Test case id to verify identity.
  10319. virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
  10320. // TEST_P macro uses AddTestPattern() to record information
  10321. // about a single test in a LocalTestInfo structure.
  10322. // test_case_name is the base name of the test case (without invocation
  10323. // prefix). test_base_name is the name of an individual test without
  10324. // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
  10325. // test case base name and DoBar is test base name.
  10326. void AddTestPattern(const char* test_case_name,
  10327. const char* test_base_name,
  10328. TestMetaFactoryBase<ParamType>* meta_factory) {
  10329. tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
  10330. test_base_name,
  10331. meta_factory)));
  10332. }
  10333. // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
  10334. // about a generator.
  10335. int AddTestCaseInstantiation(const string& instantiation_name,
  10336. GeneratorCreationFunc* func,
  10337. ParamNameGeneratorFunc* name_func,
  10338. const char* file,
  10339. int line) {
  10340. instantiations_.push_back(
  10341. InstantiationInfo(instantiation_name, func, name_func, file, line));
  10342. return 0; // Return value used only to run this method in namespace scope.
  10343. }
  10344. // UnitTest class invokes this method to register tests in this test case
  10345. // test cases right before running tests in RUN_ALL_TESTS macro.
  10346. // This method should not be called more then once on any single
  10347. // instance of a ParameterizedTestCaseInfoBase derived class.
  10348. // UnitTest has a guard to prevent from calling this method more then once.
  10349. virtual void RegisterTests() {
  10350. for (typename TestInfoContainer::iterator test_it = tests_.begin();
  10351. test_it != tests_.end(); ++test_it) {
  10352. linked_ptr<TestInfo> test_info = *test_it;
  10353. for (typename InstantiationContainer::iterator gen_it =
  10354. instantiations_.begin(); gen_it != instantiations_.end();
  10355. ++gen_it) {
  10356. const string& instantiation_name = gen_it->name;
  10357. ParamGenerator<ParamType> generator((*gen_it->generator)());
  10358. ParamNameGeneratorFunc* name_func = gen_it->name_func;
  10359. const char* file = gen_it->file;
  10360. int line = gen_it->line;
  10361. string test_case_name;
  10362. if ( !instantiation_name.empty() )
  10363. test_case_name = instantiation_name + "/";
  10364. test_case_name += test_info->test_case_base_name;
  10365. size_t i = 0;
  10366. std::set<std::string> test_param_names;
  10367. for (typename ParamGenerator<ParamType>::iterator param_it =
  10368. generator.begin();
  10369. param_it != generator.end(); ++param_it, ++i) {
  10370. Message test_name_stream;
  10371. std::string param_name = name_func(
  10372. TestParamInfo<ParamType>(*param_it, i));
  10373. GTEST_CHECK_(IsValidParamName(param_name))
  10374. << "Parameterized test name '" << param_name
  10375. << "' is invalid, in " << file
  10376. << " line " << line << std::endl;
  10377. GTEST_CHECK_(test_param_names.count(param_name) == 0)
  10378. << "Duplicate parameterized test name '" << param_name
  10379. << "', in " << file << " line " << line << std::endl;
  10380. test_param_names.insert(param_name);
  10381. test_name_stream << test_info->test_base_name << "/" << param_name;
  10382. MakeAndRegisterTestInfo(
  10383. test_case_name.c_str(),
  10384. test_name_stream.GetString().c_str(),
  10385. NULL, // No type parameter.
  10386. PrintToString(*param_it).c_str(),
  10387. code_location_,
  10388. GetTestCaseTypeId(),
  10389. TestCase::SetUpTestCase,
  10390. TestCase::TearDownTestCase,
  10391. test_info->test_meta_factory->CreateTestFactory(*param_it));
  10392. } // for param_it
  10393. } // for gen_it
  10394. } // for test_it
  10395. } // RegisterTests
  10396. private:
  10397. // LocalTestInfo structure keeps information about a single test registered
  10398. // with TEST_P macro.
  10399. struct TestInfo {
  10400. TestInfo(const char* a_test_case_base_name,
  10401. const char* a_test_base_name,
  10402. TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
  10403. test_case_base_name(a_test_case_base_name),
  10404. test_base_name(a_test_base_name),
  10405. test_meta_factory(a_test_meta_factory) {}
  10406. const string test_case_base_name;
  10407. const string test_base_name;
  10408. const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
  10409. };
  10410. typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
  10411. // Records data received from INSTANTIATE_TEST_CASE_P macros:
  10412. // <Instantiation name, Sequence generator creation function,
  10413. // Name generator function, Source file, Source line>
  10414. struct InstantiationInfo {
  10415. InstantiationInfo(const std::string &name_in,
  10416. GeneratorCreationFunc* generator_in,
  10417. ParamNameGeneratorFunc* name_func_in,
  10418. const char* file_in,
  10419. int line_in)
  10420. : name(name_in),
  10421. generator(generator_in),
  10422. name_func(name_func_in),
  10423. file(file_in),
  10424. line(line_in) {}
  10425. std::string name;
  10426. GeneratorCreationFunc* generator;
  10427. ParamNameGeneratorFunc* name_func;
  10428. const char* file;
  10429. int line;
  10430. };
  10431. typedef ::std::vector<InstantiationInfo> InstantiationContainer;
  10432. static bool IsValidParamName(const std::string& name) {
  10433. // Check for empty string
  10434. if (name.empty())
  10435. return false;
  10436. // Check for invalid characters
  10437. for (std::string::size_type index = 0; index < name.size(); ++index) {
  10438. if (!isalnum(name[index]) && name[index] != '_')
  10439. return false;
  10440. }
  10441. return true;
  10442. }
  10443. const string test_case_name_;
  10444. CodeLocation code_location_;
  10445. TestInfoContainer tests_;
  10446. InstantiationContainer instantiations_;
  10447. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
  10448. }; // class ParameterizedTestCaseInfo
  10449. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  10450. //
  10451. // ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
  10452. // classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
  10453. // macros use it to locate their corresponding ParameterizedTestCaseInfo
  10454. // descriptors.
  10455. class ParameterizedTestCaseRegistry {
  10456. public:
  10457. ParameterizedTestCaseRegistry() {}
  10458. ~ParameterizedTestCaseRegistry() {
  10459. for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
  10460. it != test_case_infos_.end(); ++it) {
  10461. delete *it;
  10462. }
  10463. }
  10464. // Looks up or creates and returns a structure containing information about
  10465. // tests and instantiations of a particular test case.
  10466. template <class TestCase>
  10467. ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
  10468. const char* test_case_name,
  10469. CodeLocation code_location) {
  10470. ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
  10471. for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
  10472. it != test_case_infos_.end(); ++it) {
  10473. if ((*it)->GetTestCaseName() == test_case_name) {
  10474. if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
  10475. // Complain about incorrect usage of Google Test facilities
  10476. // and terminate the program since we cannot guaranty correct
  10477. // test case setup and tear-down in this case.
  10478. ReportInvalidTestCaseType(test_case_name, code_location);
  10479. posix::Abort();
  10480. } else {
  10481. // At this point we are sure that the object we found is of the same
  10482. // type we are looking for, so we downcast it to that type
  10483. // without further checks.
  10484. typed_test_info = CheckedDowncastToActualType<
  10485. ParameterizedTestCaseInfo<TestCase> >(*it);
  10486. }
  10487. break;
  10488. }
  10489. }
  10490. if (typed_test_info == NULL) {
  10491. typed_test_info = new ParameterizedTestCaseInfo<TestCase>(
  10492. test_case_name, code_location);
  10493. test_case_infos_.push_back(typed_test_info);
  10494. }
  10495. return typed_test_info;
  10496. }
  10497. void RegisterTests() {
  10498. for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
  10499. it != test_case_infos_.end(); ++it) {
  10500. (*it)->RegisterTests();
  10501. }
  10502. }
  10503. private:
  10504. typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
  10505. TestCaseInfoContainer test_case_infos_;
  10506. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
  10507. };
  10508. } // namespace internal
  10509. } // namespace testing
  10510. #endif // GTEST_HAS_PARAM_TEST
  10511. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
  10512. // This file was GENERATED by command:
  10513. // pump.py gtest-param-util-generated.h.pump
  10514. // DO NOT EDIT BY HAND!!!
  10515. // Copyright 2008 Google Inc.
  10516. // All Rights Reserved.
  10517. //
  10518. // Redistribution and use in source and binary forms, with or without
  10519. // modification, are permitted provided that the following conditions are
  10520. // met:
  10521. //
  10522. // * Redistributions of source code must retain the above copyright
  10523. // notice, this list of conditions and the following disclaimer.
  10524. // * Redistributions in binary form must reproduce the above
  10525. // copyright notice, this list of conditions and the following disclaimer
  10526. // in the documentation and/or other materials provided with the
  10527. // distribution.
  10528. // * Neither the name of Google Inc. nor the names of its
  10529. // contributors may be used to endorse or promote products derived from
  10530. // this software without specific prior written permission.
  10531. //
  10532. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  10533. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  10534. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  10535. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  10536. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  10537. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  10538. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  10539. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  10540. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  10541. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  10542. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  10543. //
  10544. // Author: vladl@google.com (Vlad Losev)
  10545. // Type and function utilities for implementing parameterized tests.
  10546. // This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
  10547. //
  10548. // Currently Google Test supports at most 50 arguments in Values,
  10549. // and at most 10 arguments in Combine. Please contact
  10550. // googletestframework@googlegroups.com if you need more.
  10551. // Please note that the number of arguments to Combine is limited
  10552. // by the maximum arity of the implementation of tuple which is
  10553. // currently set at 10.
  10554. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
  10555. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
  10556. // scripts/fuse_gtest.py depends on gtest's own header being #included
  10557. // *unconditionally*. Therefore these #includes cannot be moved
  10558. // inside #if GTEST_HAS_PARAM_TEST.
  10559. #if GTEST_HAS_PARAM_TEST
  10560. namespace testing {
  10561. // Forward declarations of ValuesIn(), which is implemented in
  10562. // include/gtest/gtest-param-test.h.
  10563. template <typename ForwardIterator>
  10564. internal::ParamGenerator<
  10565. typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
  10566. ValuesIn(ForwardIterator begin, ForwardIterator end);
  10567. template <typename T, size_t N>
  10568. internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
  10569. template <class Container>
  10570. internal::ParamGenerator<typename Container::value_type> ValuesIn(
  10571. const Container& container);
  10572. namespace internal {
  10573. // Used in the Values() function to provide polymorphic capabilities.
  10574. template <typename T1>
  10575. class ValueArray1 {
  10576. public:
  10577. explicit ValueArray1(T1 v1) : v1_(v1) {}
  10578. template <typename T>
  10579. operator ParamGenerator<T>() const {
  10580. const T array[] = {static_cast<T>(v1_)};
  10581. return ValuesIn(array);
  10582. }
  10583. private:
  10584. // No implementation - assignment is unsupported.
  10585. void operator=(const ValueArray1& other);
  10586. const T1 v1_;
  10587. };
  10588. template <typename T1, typename T2>
  10589. class ValueArray2 {
  10590. public:
  10591. ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
  10592. template <typename T>
  10593. operator ParamGenerator<T>() const {
  10594. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_)};
  10595. return ValuesIn(array);
  10596. }
  10597. private:
  10598. // No implementation - assignment is unsupported.
  10599. void operator=(const ValueArray2& other);
  10600. const T1 v1_;
  10601. const T2 v2_;
  10602. };
  10603. template <typename T1, typename T2, typename T3>
  10604. class ValueArray3 {
  10605. public:
  10606. ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
  10607. template <typename T>
  10608. operator ParamGenerator<T>() const {
  10609. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10610. static_cast<T>(v3_)};
  10611. return ValuesIn(array);
  10612. }
  10613. private:
  10614. // No implementation - assignment is unsupported.
  10615. void operator=(const ValueArray3& other);
  10616. const T1 v1_;
  10617. const T2 v2_;
  10618. const T3 v3_;
  10619. };
  10620. template <typename T1, typename T2, typename T3, typename T4>
  10621. class ValueArray4 {
  10622. public:
  10623. ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
  10624. v4_(v4) {}
  10625. template <typename T>
  10626. operator ParamGenerator<T>() const {
  10627. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10628. static_cast<T>(v3_), static_cast<T>(v4_)};
  10629. return ValuesIn(array);
  10630. }
  10631. private:
  10632. // No implementation - assignment is unsupported.
  10633. void operator=(const ValueArray4& other);
  10634. const T1 v1_;
  10635. const T2 v2_;
  10636. const T3 v3_;
  10637. const T4 v4_;
  10638. };
  10639. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  10640. class ValueArray5 {
  10641. public:
  10642. ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
  10643. v4_(v4), v5_(v5) {}
  10644. template <typename T>
  10645. operator ParamGenerator<T>() const {
  10646. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10647. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_)};
  10648. return ValuesIn(array);
  10649. }
  10650. private:
  10651. // No implementation - assignment is unsupported.
  10652. void operator=(const ValueArray5& other);
  10653. const T1 v1_;
  10654. const T2 v2_;
  10655. const T3 v3_;
  10656. const T4 v4_;
  10657. const T5 v5_;
  10658. };
  10659. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10660. typename T6>
  10661. class ValueArray6 {
  10662. public:
  10663. ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
  10664. v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
  10665. template <typename T>
  10666. operator ParamGenerator<T>() const {
  10667. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10668. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10669. static_cast<T>(v6_)};
  10670. return ValuesIn(array);
  10671. }
  10672. private:
  10673. // No implementation - assignment is unsupported.
  10674. void operator=(const ValueArray6& other);
  10675. const T1 v1_;
  10676. const T2 v2_;
  10677. const T3 v3_;
  10678. const T4 v4_;
  10679. const T5 v5_;
  10680. const T6 v6_;
  10681. };
  10682. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10683. typename T6, typename T7>
  10684. class ValueArray7 {
  10685. public:
  10686. ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
  10687. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
  10688. template <typename T>
  10689. operator ParamGenerator<T>() const {
  10690. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10691. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10692. static_cast<T>(v6_), static_cast<T>(v7_)};
  10693. return ValuesIn(array);
  10694. }
  10695. private:
  10696. // No implementation - assignment is unsupported.
  10697. void operator=(const ValueArray7& other);
  10698. const T1 v1_;
  10699. const T2 v2_;
  10700. const T3 v3_;
  10701. const T4 v4_;
  10702. const T5 v5_;
  10703. const T6 v6_;
  10704. const T7 v7_;
  10705. };
  10706. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10707. typename T6, typename T7, typename T8>
  10708. class ValueArray8 {
  10709. public:
  10710. ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  10711. T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  10712. v8_(v8) {}
  10713. template <typename T>
  10714. operator ParamGenerator<T>() const {
  10715. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10716. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10717. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_)};
  10718. return ValuesIn(array);
  10719. }
  10720. private:
  10721. // No implementation - assignment is unsupported.
  10722. void operator=(const ValueArray8& other);
  10723. const T1 v1_;
  10724. const T2 v2_;
  10725. const T3 v3_;
  10726. const T4 v4_;
  10727. const T5 v5_;
  10728. const T6 v6_;
  10729. const T7 v7_;
  10730. const T8 v8_;
  10731. };
  10732. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10733. typename T6, typename T7, typename T8, typename T9>
  10734. class ValueArray9 {
  10735. public:
  10736. ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  10737. T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  10738. v8_(v8), v9_(v9) {}
  10739. template <typename T>
  10740. operator ParamGenerator<T>() const {
  10741. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10742. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10743. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10744. static_cast<T>(v9_)};
  10745. return ValuesIn(array);
  10746. }
  10747. private:
  10748. // No implementation - assignment is unsupported.
  10749. void operator=(const ValueArray9& other);
  10750. const T1 v1_;
  10751. const T2 v2_;
  10752. const T3 v3_;
  10753. const T4 v4_;
  10754. const T5 v5_;
  10755. const T6 v6_;
  10756. const T7 v7_;
  10757. const T8 v8_;
  10758. const T9 v9_;
  10759. };
  10760. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10761. typename T6, typename T7, typename T8, typename T9, typename T10>
  10762. class ValueArray10 {
  10763. public:
  10764. ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10765. T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  10766. v8_(v8), v9_(v9), v10_(v10) {}
  10767. template <typename T>
  10768. operator ParamGenerator<T>() const {
  10769. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10770. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10771. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10772. static_cast<T>(v9_), static_cast<T>(v10_)};
  10773. return ValuesIn(array);
  10774. }
  10775. private:
  10776. // No implementation - assignment is unsupported.
  10777. void operator=(const ValueArray10& other);
  10778. const T1 v1_;
  10779. const T2 v2_;
  10780. const T3 v3_;
  10781. const T4 v4_;
  10782. const T5 v5_;
  10783. const T6 v6_;
  10784. const T7 v7_;
  10785. const T8 v8_;
  10786. const T9 v9_;
  10787. const T10 v10_;
  10788. };
  10789. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10790. typename T6, typename T7, typename T8, typename T9, typename T10,
  10791. typename T11>
  10792. class ValueArray11 {
  10793. public:
  10794. ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10795. T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  10796. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
  10797. template <typename T>
  10798. operator ParamGenerator<T>() const {
  10799. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10800. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10801. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10802. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_)};
  10803. return ValuesIn(array);
  10804. }
  10805. private:
  10806. // No implementation - assignment is unsupported.
  10807. void operator=(const ValueArray11& other);
  10808. const T1 v1_;
  10809. const T2 v2_;
  10810. const T3 v3_;
  10811. const T4 v4_;
  10812. const T5 v5_;
  10813. const T6 v6_;
  10814. const T7 v7_;
  10815. const T8 v8_;
  10816. const T9 v9_;
  10817. const T10 v10_;
  10818. const T11 v11_;
  10819. };
  10820. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10821. typename T6, typename T7, typename T8, typename T9, typename T10,
  10822. typename T11, typename T12>
  10823. class ValueArray12 {
  10824. public:
  10825. ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10826. T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  10827. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
  10828. template <typename T>
  10829. operator ParamGenerator<T>() const {
  10830. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10831. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10832. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10833. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10834. static_cast<T>(v12_)};
  10835. return ValuesIn(array);
  10836. }
  10837. private:
  10838. // No implementation - assignment is unsupported.
  10839. void operator=(const ValueArray12& other);
  10840. const T1 v1_;
  10841. const T2 v2_;
  10842. const T3 v3_;
  10843. const T4 v4_;
  10844. const T5 v5_;
  10845. const T6 v6_;
  10846. const T7 v7_;
  10847. const T8 v8_;
  10848. const T9 v9_;
  10849. const T10 v10_;
  10850. const T11 v11_;
  10851. const T12 v12_;
  10852. };
  10853. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10854. typename T6, typename T7, typename T8, typename T9, typename T10,
  10855. typename T11, typename T12, typename T13>
  10856. class ValueArray13 {
  10857. public:
  10858. ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10859. T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  10860. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  10861. v12_(v12), v13_(v13) {}
  10862. template <typename T>
  10863. operator ParamGenerator<T>() const {
  10864. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10865. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10866. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10867. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10868. static_cast<T>(v12_), static_cast<T>(v13_)};
  10869. return ValuesIn(array);
  10870. }
  10871. private:
  10872. // No implementation - assignment is unsupported.
  10873. void operator=(const ValueArray13& other);
  10874. const T1 v1_;
  10875. const T2 v2_;
  10876. const T3 v3_;
  10877. const T4 v4_;
  10878. const T5 v5_;
  10879. const T6 v6_;
  10880. const T7 v7_;
  10881. const T8 v8_;
  10882. const T9 v9_;
  10883. const T10 v10_;
  10884. const T11 v11_;
  10885. const T12 v12_;
  10886. const T13 v13_;
  10887. };
  10888. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10889. typename T6, typename T7, typename T8, typename T9, typename T10,
  10890. typename T11, typename T12, typename T13, typename T14>
  10891. class ValueArray14 {
  10892. public:
  10893. ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10894. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
  10895. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  10896. v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
  10897. template <typename T>
  10898. operator ParamGenerator<T>() const {
  10899. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10900. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10901. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10902. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10903. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_)};
  10904. return ValuesIn(array);
  10905. }
  10906. private:
  10907. // No implementation - assignment is unsupported.
  10908. void operator=(const ValueArray14& other);
  10909. const T1 v1_;
  10910. const T2 v2_;
  10911. const T3 v3_;
  10912. const T4 v4_;
  10913. const T5 v5_;
  10914. const T6 v6_;
  10915. const T7 v7_;
  10916. const T8 v8_;
  10917. const T9 v9_;
  10918. const T10 v10_;
  10919. const T11 v11_;
  10920. const T12 v12_;
  10921. const T13 v13_;
  10922. const T14 v14_;
  10923. };
  10924. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10925. typename T6, typename T7, typename T8, typename T9, typename T10,
  10926. typename T11, typename T12, typename T13, typename T14, typename T15>
  10927. class ValueArray15 {
  10928. public:
  10929. ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10930. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
  10931. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  10932. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
  10933. template <typename T>
  10934. operator ParamGenerator<T>() const {
  10935. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10936. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10937. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10938. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10939. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  10940. static_cast<T>(v15_)};
  10941. return ValuesIn(array);
  10942. }
  10943. private:
  10944. // No implementation - assignment is unsupported.
  10945. void operator=(const ValueArray15& other);
  10946. const T1 v1_;
  10947. const T2 v2_;
  10948. const T3 v3_;
  10949. const T4 v4_;
  10950. const T5 v5_;
  10951. const T6 v6_;
  10952. const T7 v7_;
  10953. const T8 v8_;
  10954. const T9 v9_;
  10955. const T10 v10_;
  10956. const T11 v11_;
  10957. const T12 v12_;
  10958. const T13 v13_;
  10959. const T14 v14_;
  10960. const T15 v15_;
  10961. };
  10962. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10963. typename T6, typename T7, typename T8, typename T9, typename T10,
  10964. typename T11, typename T12, typename T13, typename T14, typename T15,
  10965. typename T16>
  10966. class ValueArray16 {
  10967. public:
  10968. ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10969. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
  10970. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  10971. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  10972. v16_(v16) {}
  10973. template <typename T>
  10974. operator ParamGenerator<T>() const {
  10975. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  10976. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  10977. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  10978. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  10979. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  10980. static_cast<T>(v15_), static_cast<T>(v16_)};
  10981. return ValuesIn(array);
  10982. }
  10983. private:
  10984. // No implementation - assignment is unsupported.
  10985. void operator=(const ValueArray16& other);
  10986. const T1 v1_;
  10987. const T2 v2_;
  10988. const T3 v3_;
  10989. const T4 v4_;
  10990. const T5 v5_;
  10991. const T6 v6_;
  10992. const T7 v7_;
  10993. const T8 v8_;
  10994. const T9 v9_;
  10995. const T10 v10_;
  10996. const T11 v11_;
  10997. const T12 v12_;
  10998. const T13 v13_;
  10999. const T14 v14_;
  11000. const T15 v15_;
  11001. const T16 v16_;
  11002. };
  11003. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11004. typename T6, typename T7, typename T8, typename T9, typename T10,
  11005. typename T11, typename T12, typename T13, typename T14, typename T15,
  11006. typename T16, typename T17>
  11007. class ValueArray17 {
  11008. public:
  11009. ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11010. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
  11011. T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11012. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11013. v15_(v15), v16_(v16), v17_(v17) {}
  11014. template <typename T>
  11015. operator ParamGenerator<T>() const {
  11016. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11017. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11018. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11019. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11020. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11021. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_)};
  11022. return ValuesIn(array);
  11023. }
  11024. private:
  11025. // No implementation - assignment is unsupported.
  11026. void operator=(const ValueArray17& other);
  11027. const T1 v1_;
  11028. const T2 v2_;
  11029. const T3 v3_;
  11030. const T4 v4_;
  11031. const T5 v5_;
  11032. const T6 v6_;
  11033. const T7 v7_;
  11034. const T8 v8_;
  11035. const T9 v9_;
  11036. const T10 v10_;
  11037. const T11 v11_;
  11038. const T12 v12_;
  11039. const T13 v13_;
  11040. const T14 v14_;
  11041. const T15 v15_;
  11042. const T16 v16_;
  11043. const T17 v17_;
  11044. };
  11045. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11046. typename T6, typename T7, typename T8, typename T9, typename T10,
  11047. typename T11, typename T12, typename T13, typename T14, typename T15,
  11048. typename T16, typename T17, typename T18>
  11049. class ValueArray18 {
  11050. public:
  11051. ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11052. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11053. T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11054. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11055. v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
  11056. template <typename T>
  11057. operator ParamGenerator<T>() const {
  11058. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11059. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11060. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11061. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11062. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11063. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11064. static_cast<T>(v18_)};
  11065. return ValuesIn(array);
  11066. }
  11067. private:
  11068. // No implementation - assignment is unsupported.
  11069. void operator=(const ValueArray18& other);
  11070. const T1 v1_;
  11071. const T2 v2_;
  11072. const T3 v3_;
  11073. const T4 v4_;
  11074. const T5 v5_;
  11075. const T6 v6_;
  11076. const T7 v7_;
  11077. const T8 v8_;
  11078. const T9 v9_;
  11079. const T10 v10_;
  11080. const T11 v11_;
  11081. const T12 v12_;
  11082. const T13 v13_;
  11083. const T14 v14_;
  11084. const T15 v15_;
  11085. const T16 v16_;
  11086. const T17 v17_;
  11087. const T18 v18_;
  11088. };
  11089. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11090. typename T6, typename T7, typename T8, typename T9, typename T10,
  11091. typename T11, typename T12, typename T13, typename T14, typename T15,
  11092. typename T16, typename T17, typename T18, typename T19>
  11093. class ValueArray19 {
  11094. public:
  11095. ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11096. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11097. T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  11098. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  11099. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
  11100. template <typename T>
  11101. operator ParamGenerator<T>() const {
  11102. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11103. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11104. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11105. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11106. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11107. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11108. static_cast<T>(v18_), static_cast<T>(v19_)};
  11109. return ValuesIn(array);
  11110. }
  11111. private:
  11112. // No implementation - assignment is unsupported.
  11113. void operator=(const ValueArray19& other);
  11114. const T1 v1_;
  11115. const T2 v2_;
  11116. const T3 v3_;
  11117. const T4 v4_;
  11118. const T5 v5_;
  11119. const T6 v6_;
  11120. const T7 v7_;
  11121. const T8 v8_;
  11122. const T9 v9_;
  11123. const T10 v10_;
  11124. const T11 v11_;
  11125. const T12 v12_;
  11126. const T13 v13_;
  11127. const T14 v14_;
  11128. const T15 v15_;
  11129. const T16 v16_;
  11130. const T17 v17_;
  11131. const T18 v18_;
  11132. const T19 v19_;
  11133. };
  11134. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11135. typename T6, typename T7, typename T8, typename T9, typename T10,
  11136. typename T11, typename T12, typename T13, typename T14, typename T15,
  11137. typename T16, typename T17, typename T18, typename T19, typename T20>
  11138. class ValueArray20 {
  11139. public:
  11140. ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11141. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11142. T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  11143. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  11144. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  11145. v19_(v19), v20_(v20) {}
  11146. template <typename T>
  11147. operator ParamGenerator<T>() const {
  11148. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11149. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11150. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11151. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11152. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11153. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11154. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_)};
  11155. return ValuesIn(array);
  11156. }
  11157. private:
  11158. // No implementation - assignment is unsupported.
  11159. void operator=(const ValueArray20& other);
  11160. const T1 v1_;
  11161. const T2 v2_;
  11162. const T3 v3_;
  11163. const T4 v4_;
  11164. const T5 v5_;
  11165. const T6 v6_;
  11166. const T7 v7_;
  11167. const T8 v8_;
  11168. const T9 v9_;
  11169. const T10 v10_;
  11170. const T11 v11_;
  11171. const T12 v12_;
  11172. const T13 v13_;
  11173. const T14 v14_;
  11174. const T15 v15_;
  11175. const T16 v16_;
  11176. const T17 v17_;
  11177. const T18 v18_;
  11178. const T19 v19_;
  11179. const T20 v20_;
  11180. };
  11181. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11182. typename T6, typename T7, typename T8, typename T9, typename T10,
  11183. typename T11, typename T12, typename T13, typename T14, typename T15,
  11184. typename T16, typename T17, typename T18, typename T19, typename T20,
  11185. typename T21>
  11186. class ValueArray21 {
  11187. public:
  11188. ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11189. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11190. T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  11191. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  11192. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  11193. v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
  11194. template <typename T>
  11195. operator ParamGenerator<T>() const {
  11196. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11197. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11198. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11199. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11200. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11201. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11202. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11203. static_cast<T>(v21_)};
  11204. return ValuesIn(array);
  11205. }
  11206. private:
  11207. // No implementation - assignment is unsupported.
  11208. void operator=(const ValueArray21& other);
  11209. const T1 v1_;
  11210. const T2 v2_;
  11211. const T3 v3_;
  11212. const T4 v4_;
  11213. const T5 v5_;
  11214. const T6 v6_;
  11215. const T7 v7_;
  11216. const T8 v8_;
  11217. const T9 v9_;
  11218. const T10 v10_;
  11219. const T11 v11_;
  11220. const T12 v12_;
  11221. const T13 v13_;
  11222. const T14 v14_;
  11223. const T15 v15_;
  11224. const T16 v16_;
  11225. const T17 v17_;
  11226. const T18 v18_;
  11227. const T19 v19_;
  11228. const T20 v20_;
  11229. const T21 v21_;
  11230. };
  11231. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11232. typename T6, typename T7, typename T8, typename T9, typename T10,
  11233. typename T11, typename T12, typename T13, typename T14, typename T15,
  11234. typename T16, typename T17, typename T18, typename T19, typename T20,
  11235. typename T21, typename T22>
  11236. class ValueArray22 {
  11237. public:
  11238. ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11239. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11240. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
  11241. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11242. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  11243. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
  11244. template <typename T>
  11245. operator ParamGenerator<T>() const {
  11246. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11247. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11248. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11249. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11250. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11251. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11252. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11253. static_cast<T>(v21_), static_cast<T>(v22_)};
  11254. return ValuesIn(array);
  11255. }
  11256. private:
  11257. // No implementation - assignment is unsupported.
  11258. void operator=(const ValueArray22& other);
  11259. const T1 v1_;
  11260. const T2 v2_;
  11261. const T3 v3_;
  11262. const T4 v4_;
  11263. const T5 v5_;
  11264. const T6 v6_;
  11265. const T7 v7_;
  11266. const T8 v8_;
  11267. const T9 v9_;
  11268. const T10 v10_;
  11269. const T11 v11_;
  11270. const T12 v12_;
  11271. const T13 v13_;
  11272. const T14 v14_;
  11273. const T15 v15_;
  11274. const T16 v16_;
  11275. const T17 v17_;
  11276. const T18 v18_;
  11277. const T19 v19_;
  11278. const T20 v20_;
  11279. const T21 v21_;
  11280. const T22 v22_;
  11281. };
  11282. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11283. typename T6, typename T7, typename T8, typename T9, typename T10,
  11284. typename T11, typename T12, typename T13, typename T14, typename T15,
  11285. typename T16, typename T17, typename T18, typename T19, typename T20,
  11286. typename T21, typename T22, typename T23>
  11287. class ValueArray23 {
  11288. public:
  11289. ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11290. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11291. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
  11292. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11293. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  11294. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  11295. v23_(v23) {}
  11296. template <typename T>
  11297. operator ParamGenerator<T>() const {
  11298. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11299. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11300. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11301. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11302. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11303. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11304. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11305. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_)};
  11306. return ValuesIn(array);
  11307. }
  11308. private:
  11309. // No implementation - assignment is unsupported.
  11310. void operator=(const ValueArray23& 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. };
  11335. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11336. typename T6, typename T7, typename T8, typename T9, typename T10,
  11337. typename T11, typename T12, typename T13, typename T14, typename T15,
  11338. typename T16, typename T17, typename T18, typename T19, typename T20,
  11339. typename T21, typename T22, typename T23, typename T24>
  11340. class ValueArray24 {
  11341. public:
  11342. ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11343. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11344. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
  11345. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  11346. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  11347. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  11348. v22_(v22), v23_(v23), v24_(v24) {}
  11349. template <typename T>
  11350. operator ParamGenerator<T>() const {
  11351. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11352. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11353. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11354. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11355. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11356. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11357. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11358. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11359. static_cast<T>(v24_)};
  11360. return ValuesIn(array);
  11361. }
  11362. private:
  11363. // No implementation - assignment is unsupported.
  11364. void operator=(const ValueArray24& other);
  11365. const T1 v1_;
  11366. const T2 v2_;
  11367. const T3 v3_;
  11368. const T4 v4_;
  11369. const T5 v5_;
  11370. const T6 v6_;
  11371. const T7 v7_;
  11372. const T8 v8_;
  11373. const T9 v9_;
  11374. const T10 v10_;
  11375. const T11 v11_;
  11376. const T12 v12_;
  11377. const T13 v13_;
  11378. const T14 v14_;
  11379. const T15 v15_;
  11380. const T16 v16_;
  11381. const T17 v17_;
  11382. const T18 v18_;
  11383. const T19 v19_;
  11384. const T20 v20_;
  11385. const T21 v21_;
  11386. const T22 v22_;
  11387. const T23 v23_;
  11388. const T24 v24_;
  11389. };
  11390. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11391. typename T6, typename T7, typename T8, typename T9, typename T10,
  11392. typename T11, typename T12, typename T13, typename T14, typename T15,
  11393. typename T16, typename T17, typename T18, typename T19, typename T20,
  11394. typename T21, typename T22, typename T23, typename T24, typename T25>
  11395. class ValueArray25 {
  11396. public:
  11397. ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11398. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11399. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
  11400. T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11401. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11402. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  11403. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
  11404. template <typename T>
  11405. operator ParamGenerator<T>() const {
  11406. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11407. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11408. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11409. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11410. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11411. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11412. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11413. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11414. static_cast<T>(v24_), static_cast<T>(v25_)};
  11415. return ValuesIn(array);
  11416. }
  11417. private:
  11418. // No implementation - assignment is unsupported.
  11419. void operator=(const ValueArray25& other);
  11420. const T1 v1_;
  11421. const T2 v2_;
  11422. const T3 v3_;
  11423. const T4 v4_;
  11424. const T5 v5_;
  11425. const T6 v6_;
  11426. const T7 v7_;
  11427. const T8 v8_;
  11428. const T9 v9_;
  11429. const T10 v10_;
  11430. const T11 v11_;
  11431. const T12 v12_;
  11432. const T13 v13_;
  11433. const T14 v14_;
  11434. const T15 v15_;
  11435. const T16 v16_;
  11436. const T17 v17_;
  11437. const T18 v18_;
  11438. const T19 v19_;
  11439. const T20 v20_;
  11440. const T21 v21_;
  11441. const T22 v22_;
  11442. const T23 v23_;
  11443. const T24 v24_;
  11444. const T25 v25_;
  11445. };
  11446. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11447. typename T6, typename T7, typename T8, typename T9, typename T10,
  11448. typename T11, typename T12, typename T13, typename T14, typename T15,
  11449. typename T16, typename T17, typename T18, typename T19, typename T20,
  11450. typename T21, typename T22, typename T23, typename T24, typename T25,
  11451. typename T26>
  11452. class ValueArray26 {
  11453. public:
  11454. ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11455. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11456. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11457. T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11458. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11459. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  11460. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
  11461. template <typename T>
  11462. operator ParamGenerator<T>() const {
  11463. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11464. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11465. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11466. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11467. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11468. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11469. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11470. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11471. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_)};
  11472. return ValuesIn(array);
  11473. }
  11474. private:
  11475. // No implementation - assignment is unsupported.
  11476. void operator=(const ValueArray26& other);
  11477. const T1 v1_;
  11478. const T2 v2_;
  11479. const T3 v3_;
  11480. const T4 v4_;
  11481. const T5 v5_;
  11482. const T6 v6_;
  11483. const T7 v7_;
  11484. const T8 v8_;
  11485. const T9 v9_;
  11486. const T10 v10_;
  11487. const T11 v11_;
  11488. const T12 v12_;
  11489. const T13 v13_;
  11490. const T14 v14_;
  11491. const T15 v15_;
  11492. const T16 v16_;
  11493. const T17 v17_;
  11494. const T18 v18_;
  11495. const T19 v19_;
  11496. const T20 v20_;
  11497. const T21 v21_;
  11498. const T22 v22_;
  11499. const T23 v23_;
  11500. const T24 v24_;
  11501. const T25 v25_;
  11502. const T26 v26_;
  11503. };
  11504. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11505. typename T6, typename T7, typename T8, typename T9, typename T10,
  11506. typename T11, typename T12, typename T13, typename T14, typename T15,
  11507. typename T16, typename T17, typename T18, typename T19, typename T20,
  11508. typename T21, typename T22, typename T23, typename T24, typename T25,
  11509. typename T26, typename T27>
  11510. class ValueArray27 {
  11511. public:
  11512. ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11513. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11514. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11515. T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  11516. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  11517. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
  11518. v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
  11519. v26_(v26), v27_(v27) {}
  11520. template <typename T>
  11521. operator ParamGenerator<T>() const {
  11522. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11523. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11524. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11525. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11526. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11527. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11528. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11529. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11530. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  11531. static_cast<T>(v27_)};
  11532. return ValuesIn(array);
  11533. }
  11534. private:
  11535. // No implementation - assignment is unsupported.
  11536. void operator=(const ValueArray27& other);
  11537. const T1 v1_;
  11538. const T2 v2_;
  11539. const T3 v3_;
  11540. const T4 v4_;
  11541. const T5 v5_;
  11542. const T6 v6_;
  11543. const T7 v7_;
  11544. const T8 v8_;
  11545. const T9 v9_;
  11546. const T10 v10_;
  11547. const T11 v11_;
  11548. const T12 v12_;
  11549. const T13 v13_;
  11550. const T14 v14_;
  11551. const T15 v15_;
  11552. const T16 v16_;
  11553. const T17 v17_;
  11554. const T18 v18_;
  11555. const T19 v19_;
  11556. const T20 v20_;
  11557. const T21 v21_;
  11558. const T22 v22_;
  11559. const T23 v23_;
  11560. const T24 v24_;
  11561. const T25 v25_;
  11562. const T26 v26_;
  11563. const T27 v27_;
  11564. };
  11565. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11566. typename T6, typename T7, typename T8, typename T9, typename T10,
  11567. typename T11, typename T12, typename T13, typename T14, typename T15,
  11568. typename T16, typename T17, typename T18, typename T19, typename T20,
  11569. typename T21, typename T22, typename T23, typename T24, typename T25,
  11570. typename T26, typename T27, typename T28>
  11571. class ValueArray28 {
  11572. public:
  11573. ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11574. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11575. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11576. T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  11577. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  11578. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  11579. v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
  11580. v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
  11581. template <typename T>
  11582. operator ParamGenerator<T>() const {
  11583. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11584. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11585. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11586. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11587. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11588. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11589. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11590. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11591. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  11592. static_cast<T>(v27_), static_cast<T>(v28_)};
  11593. return ValuesIn(array);
  11594. }
  11595. private:
  11596. // No implementation - assignment is unsupported.
  11597. void operator=(const ValueArray28& other);
  11598. const T1 v1_;
  11599. const T2 v2_;
  11600. const T3 v3_;
  11601. const T4 v4_;
  11602. const T5 v5_;
  11603. const T6 v6_;
  11604. const T7 v7_;
  11605. const T8 v8_;
  11606. const T9 v9_;
  11607. const T10 v10_;
  11608. const T11 v11_;
  11609. const T12 v12_;
  11610. const T13 v13_;
  11611. const T14 v14_;
  11612. const T15 v15_;
  11613. const T16 v16_;
  11614. const T17 v17_;
  11615. const T18 v18_;
  11616. const T19 v19_;
  11617. const T20 v20_;
  11618. const T21 v21_;
  11619. const T22 v22_;
  11620. const T23 v23_;
  11621. const T24 v24_;
  11622. const T25 v25_;
  11623. const T26 v26_;
  11624. const T27 v27_;
  11625. const T28 v28_;
  11626. };
  11627. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11628. typename T6, typename T7, typename T8, typename T9, typename T10,
  11629. typename T11, typename T12, typename T13, typename T14, typename T15,
  11630. typename T16, typename T17, typename T18, typename T19, typename T20,
  11631. typename T21, typename T22, typename T23, typename T24, typename T25,
  11632. typename T26, typename T27, typename T28, typename T29>
  11633. class ValueArray29 {
  11634. public:
  11635. ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11636. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11637. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11638. T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  11639. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  11640. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  11641. v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
  11642. v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
  11643. template <typename T>
  11644. operator ParamGenerator<T>() const {
  11645. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11646. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11647. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11648. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11649. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11650. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11651. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11652. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11653. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  11654. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_)};
  11655. return ValuesIn(array);
  11656. }
  11657. private:
  11658. // No implementation - assignment is unsupported.
  11659. void operator=(const ValueArray29& other);
  11660. const T1 v1_;
  11661. const T2 v2_;
  11662. const T3 v3_;
  11663. const T4 v4_;
  11664. const T5 v5_;
  11665. const T6 v6_;
  11666. const T7 v7_;
  11667. const T8 v8_;
  11668. const T9 v9_;
  11669. const T10 v10_;
  11670. const T11 v11_;
  11671. const T12 v12_;
  11672. const T13 v13_;
  11673. const T14 v14_;
  11674. const T15 v15_;
  11675. const T16 v16_;
  11676. const T17 v17_;
  11677. const T18 v18_;
  11678. const T19 v19_;
  11679. const T20 v20_;
  11680. const T21 v21_;
  11681. const T22 v22_;
  11682. const T23 v23_;
  11683. const T24 v24_;
  11684. const T25 v25_;
  11685. const T26 v26_;
  11686. const T27 v27_;
  11687. const T28 v28_;
  11688. const T29 v29_;
  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. class ValueArray30 {
  11697. public:
  11698. ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11699. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11700. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11701. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
  11702. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11703. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  11704. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  11705. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  11706. v29_(v29), v30_(v30) {}
  11707. template <typename T>
  11708. operator ParamGenerator<T>() const {
  11709. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11710. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11711. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11712. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11713. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11714. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11715. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11716. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11717. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  11718. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  11719. static_cast<T>(v30_)};
  11720. return ValuesIn(array);
  11721. }
  11722. private:
  11723. // No implementation - assignment is unsupported.
  11724. void operator=(const ValueArray30& other);
  11725. const T1 v1_;
  11726. const T2 v2_;
  11727. const T3 v3_;
  11728. const T4 v4_;
  11729. const T5 v5_;
  11730. const T6 v6_;
  11731. const T7 v7_;
  11732. const T8 v8_;
  11733. const T9 v9_;
  11734. const T10 v10_;
  11735. const T11 v11_;
  11736. const T12 v12_;
  11737. const T13 v13_;
  11738. const T14 v14_;
  11739. const T15 v15_;
  11740. const T16 v16_;
  11741. const T17 v17_;
  11742. const T18 v18_;
  11743. const T19 v19_;
  11744. const T20 v20_;
  11745. const T21 v21_;
  11746. const T22 v22_;
  11747. const T23 v23_;
  11748. const T24 v24_;
  11749. const T25 v25_;
  11750. const T26 v26_;
  11751. const T27 v27_;
  11752. const T28 v28_;
  11753. const T29 v29_;
  11754. const T30 v30_;
  11755. };
  11756. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11757. typename T6, typename T7, typename T8, typename T9, typename T10,
  11758. typename T11, typename T12, typename T13, typename T14, typename T15,
  11759. typename T16, typename T17, typename T18, typename T19, typename T20,
  11760. typename T21, typename T22, typename T23, typename T24, typename T25,
  11761. typename T26, typename T27, typename T28, typename T29, typename T30,
  11762. typename T31>
  11763. class ValueArray31 {
  11764. public:
  11765. ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11766. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11767. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11768. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
  11769. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11770. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  11771. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  11772. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  11773. v29_(v29), v30_(v30), v31_(v31) {}
  11774. template <typename T>
  11775. operator ParamGenerator<T>() const {
  11776. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11777. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11778. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11779. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11780. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11781. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11782. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11783. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11784. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  11785. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  11786. static_cast<T>(v30_), static_cast<T>(v31_)};
  11787. return ValuesIn(array);
  11788. }
  11789. private:
  11790. // No implementation - assignment is unsupported.
  11791. void operator=(const ValueArray31& other);
  11792. const T1 v1_;
  11793. const T2 v2_;
  11794. const T3 v3_;
  11795. const T4 v4_;
  11796. const T5 v5_;
  11797. const T6 v6_;
  11798. const T7 v7_;
  11799. const T8 v8_;
  11800. const T9 v9_;
  11801. const T10 v10_;
  11802. const T11 v11_;
  11803. const T12 v12_;
  11804. const T13 v13_;
  11805. const T14 v14_;
  11806. const T15 v15_;
  11807. const T16 v16_;
  11808. const T17 v17_;
  11809. const T18 v18_;
  11810. const T19 v19_;
  11811. const T20 v20_;
  11812. const T21 v21_;
  11813. const T22 v22_;
  11814. const T23 v23_;
  11815. const T24 v24_;
  11816. const T25 v25_;
  11817. const T26 v26_;
  11818. const T27 v27_;
  11819. const T28 v28_;
  11820. const T29 v29_;
  11821. const T30 v30_;
  11822. const T31 v31_;
  11823. };
  11824. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11825. typename T6, typename T7, typename T8, typename T9, typename T10,
  11826. typename T11, typename T12, typename T13, typename T14, typename T15,
  11827. typename T16, typename T17, typename T18, typename T19, typename T20,
  11828. typename T21, typename T22, typename T23, typename T24, typename T25,
  11829. typename T26, typename T27, typename T28, typename T29, typename T30,
  11830. typename T31, typename T32>
  11831. class ValueArray32 {
  11832. public:
  11833. ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11834. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11835. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11836. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
  11837. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  11838. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  11839. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  11840. v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
  11841. v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
  11842. template <typename T>
  11843. operator ParamGenerator<T>() const {
  11844. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11845. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11846. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11847. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11848. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11849. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11850. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11851. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11852. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  11853. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  11854. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_)};
  11855. return ValuesIn(array);
  11856. }
  11857. private:
  11858. // No implementation - assignment is unsupported.
  11859. void operator=(const ValueArray32& other);
  11860. const T1 v1_;
  11861. const T2 v2_;
  11862. const T3 v3_;
  11863. const T4 v4_;
  11864. const T5 v5_;
  11865. const T6 v6_;
  11866. const T7 v7_;
  11867. const T8 v8_;
  11868. const T9 v9_;
  11869. const T10 v10_;
  11870. const T11 v11_;
  11871. const T12 v12_;
  11872. const T13 v13_;
  11873. const T14 v14_;
  11874. const T15 v15_;
  11875. const T16 v16_;
  11876. const T17 v17_;
  11877. const T18 v18_;
  11878. const T19 v19_;
  11879. const T20 v20_;
  11880. const T21 v21_;
  11881. const T22 v22_;
  11882. const T23 v23_;
  11883. const T24 v24_;
  11884. const T25 v25_;
  11885. const T26 v26_;
  11886. const T27 v27_;
  11887. const T28 v28_;
  11888. const T29 v29_;
  11889. const T30 v30_;
  11890. const T31 v31_;
  11891. const T32 v32_;
  11892. };
  11893. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11894. typename T6, typename T7, typename T8, typename T9, typename T10,
  11895. typename T11, typename T12, typename T13, typename T14, typename T15,
  11896. typename T16, typename T17, typename T18, typename T19, typename T20,
  11897. typename T21, typename T22, typename T23, typename T24, typename T25,
  11898. typename T26, typename T27, typename T28, typename T29, typename T30,
  11899. typename T31, typename T32, typename T33>
  11900. class ValueArray33 {
  11901. public:
  11902. ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11903. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11904. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11905. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
  11906. T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11907. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11908. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  11909. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  11910. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  11911. v33_(v33) {}
  11912. template <typename T>
  11913. operator ParamGenerator<T>() const {
  11914. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11915. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11916. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11917. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11918. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11919. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11920. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11921. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11922. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  11923. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  11924. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  11925. static_cast<T>(v33_)};
  11926. return ValuesIn(array);
  11927. }
  11928. private:
  11929. // No implementation - assignment is unsupported.
  11930. void operator=(const ValueArray33& other);
  11931. const T1 v1_;
  11932. const T2 v2_;
  11933. const T3 v3_;
  11934. const T4 v4_;
  11935. const T5 v5_;
  11936. const T6 v6_;
  11937. const T7 v7_;
  11938. const T8 v8_;
  11939. const T9 v9_;
  11940. const T10 v10_;
  11941. const T11 v11_;
  11942. const T12 v12_;
  11943. const T13 v13_;
  11944. const T14 v14_;
  11945. const T15 v15_;
  11946. const T16 v16_;
  11947. const T17 v17_;
  11948. const T18 v18_;
  11949. const T19 v19_;
  11950. const T20 v20_;
  11951. const T21 v21_;
  11952. const T22 v22_;
  11953. const T23 v23_;
  11954. const T24 v24_;
  11955. const T25 v25_;
  11956. const T26 v26_;
  11957. const T27 v27_;
  11958. const T28 v28_;
  11959. const T29 v29_;
  11960. const T30 v30_;
  11961. const T31 v31_;
  11962. const T32 v32_;
  11963. const T33 v33_;
  11964. };
  11965. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11966. typename T6, typename T7, typename T8, typename T9, typename T10,
  11967. typename T11, typename T12, typename T13, typename T14, typename T15,
  11968. typename T16, typename T17, typename T18, typename T19, typename T20,
  11969. typename T21, typename T22, typename T23, typename T24, typename T25,
  11970. typename T26, typename T27, typename T28, typename T29, typename T30,
  11971. typename T31, typename T32, typename T33, typename T34>
  11972. class ValueArray34 {
  11973. public:
  11974. ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11975. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11976. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11977. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11978. T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11979. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11980. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  11981. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  11982. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  11983. v33_(v33), v34_(v34) {}
  11984. template <typename T>
  11985. operator ParamGenerator<T>() const {
  11986. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  11987. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  11988. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  11989. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  11990. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  11991. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  11992. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  11993. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  11994. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  11995. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  11996. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  11997. static_cast<T>(v33_), static_cast<T>(v34_)};
  11998. return ValuesIn(array);
  11999. }
  12000. private:
  12001. // No implementation - assignment is unsupported.
  12002. void operator=(const ValueArray34& other);
  12003. const T1 v1_;
  12004. const T2 v2_;
  12005. const T3 v3_;
  12006. const T4 v4_;
  12007. const T5 v5_;
  12008. const T6 v6_;
  12009. const T7 v7_;
  12010. const T8 v8_;
  12011. const T9 v9_;
  12012. const T10 v10_;
  12013. const T11 v11_;
  12014. const T12 v12_;
  12015. const T13 v13_;
  12016. const T14 v14_;
  12017. const T15 v15_;
  12018. const T16 v16_;
  12019. const T17 v17_;
  12020. const T18 v18_;
  12021. const T19 v19_;
  12022. const T20 v20_;
  12023. const T21 v21_;
  12024. const T22 v22_;
  12025. const T23 v23_;
  12026. const T24 v24_;
  12027. const T25 v25_;
  12028. const T26 v26_;
  12029. const T27 v27_;
  12030. const T28 v28_;
  12031. const T29 v29_;
  12032. const T30 v30_;
  12033. const T31 v31_;
  12034. const T32 v32_;
  12035. const T33 v33_;
  12036. const T34 v34_;
  12037. };
  12038. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12039. typename T6, typename T7, typename T8, typename T9, typename T10,
  12040. typename T11, typename T12, typename T13, typename T14, typename T15,
  12041. typename T16, typename T17, typename T18, typename T19, typename T20,
  12042. typename T21, typename T22, typename T23, typename T24, typename T25,
  12043. typename T26, typename T27, typename T28, typename T29, typename T30,
  12044. typename T31, typename T32, typename T33, typename T34, typename T35>
  12045. class ValueArray35 {
  12046. public:
  12047. ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12048. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12049. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12050. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12051. T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  12052. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  12053. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
  12054. v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
  12055. v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
  12056. v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
  12057. template <typename T>
  12058. operator ParamGenerator<T>() const {
  12059. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12060. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12061. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12062. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12063. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12064. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12065. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12066. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12067. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12068. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12069. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12070. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_)};
  12071. return ValuesIn(array);
  12072. }
  12073. private:
  12074. // No implementation - assignment is unsupported.
  12075. void operator=(const ValueArray35& other);
  12076. const T1 v1_;
  12077. const T2 v2_;
  12078. const T3 v3_;
  12079. const T4 v4_;
  12080. const T5 v5_;
  12081. const T6 v6_;
  12082. const T7 v7_;
  12083. const T8 v8_;
  12084. const T9 v9_;
  12085. const T10 v10_;
  12086. const T11 v11_;
  12087. const T12 v12_;
  12088. const T13 v13_;
  12089. const T14 v14_;
  12090. const T15 v15_;
  12091. const T16 v16_;
  12092. const T17 v17_;
  12093. const T18 v18_;
  12094. const T19 v19_;
  12095. const T20 v20_;
  12096. const T21 v21_;
  12097. const T22 v22_;
  12098. const T23 v23_;
  12099. const T24 v24_;
  12100. const T25 v25_;
  12101. const T26 v26_;
  12102. const T27 v27_;
  12103. const T28 v28_;
  12104. const T29 v29_;
  12105. const T30 v30_;
  12106. const T31 v31_;
  12107. const T32 v32_;
  12108. const T33 v33_;
  12109. const T34 v34_;
  12110. const T35 v35_;
  12111. };
  12112. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12113. typename T6, typename T7, typename T8, typename T9, typename T10,
  12114. typename T11, typename T12, typename T13, typename T14, typename T15,
  12115. typename T16, typename T17, typename T18, typename T19, typename T20,
  12116. typename T21, typename T22, typename T23, typename T24, typename T25,
  12117. typename T26, typename T27, typename T28, typename T29, typename T30,
  12118. typename T31, typename T32, typename T33, typename T34, typename T35,
  12119. typename T36>
  12120. class ValueArray36 {
  12121. public:
  12122. ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12123. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12124. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12125. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12126. T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  12127. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  12128. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  12129. v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
  12130. v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
  12131. v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
  12132. template <typename T>
  12133. operator ParamGenerator<T>() const {
  12134. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12135. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12136. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12137. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12138. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12139. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12140. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12141. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12142. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12143. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12144. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12145. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  12146. static_cast<T>(v36_)};
  12147. return ValuesIn(array);
  12148. }
  12149. private:
  12150. // No implementation - assignment is unsupported.
  12151. void operator=(const ValueArray36& other);
  12152. const T1 v1_;
  12153. const T2 v2_;
  12154. const T3 v3_;
  12155. const T4 v4_;
  12156. const T5 v5_;
  12157. const T6 v6_;
  12158. const T7 v7_;
  12159. const T8 v8_;
  12160. const T9 v9_;
  12161. const T10 v10_;
  12162. const T11 v11_;
  12163. const T12 v12_;
  12164. const T13 v13_;
  12165. const T14 v14_;
  12166. const T15 v15_;
  12167. const T16 v16_;
  12168. const T17 v17_;
  12169. const T18 v18_;
  12170. const T19 v19_;
  12171. const T20 v20_;
  12172. const T21 v21_;
  12173. const T22 v22_;
  12174. const T23 v23_;
  12175. const T24 v24_;
  12176. const T25 v25_;
  12177. const T26 v26_;
  12178. const T27 v27_;
  12179. const T28 v28_;
  12180. const T29 v29_;
  12181. const T30 v30_;
  12182. const T31 v31_;
  12183. const T32 v32_;
  12184. const T33 v33_;
  12185. const T34 v34_;
  12186. const T35 v35_;
  12187. const T36 v36_;
  12188. };
  12189. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12190. typename T6, typename T7, typename T8, typename T9, typename T10,
  12191. typename T11, typename T12, typename T13, typename T14, typename T15,
  12192. typename T16, typename T17, typename T18, typename T19, typename T20,
  12193. typename T21, typename T22, typename T23, typename T24, typename T25,
  12194. typename T26, typename T27, typename T28, typename T29, typename T30,
  12195. typename T31, typename T32, typename T33, typename T34, typename T35,
  12196. typename T36, typename T37>
  12197. class ValueArray37 {
  12198. public:
  12199. ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12200. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12201. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12202. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12203. T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  12204. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  12205. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  12206. v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
  12207. v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
  12208. v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
  12209. v36_(v36), v37_(v37) {}
  12210. template <typename T>
  12211. operator ParamGenerator<T>() const {
  12212. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12213. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12214. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12215. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12216. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12217. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12218. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12219. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12220. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12221. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12222. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12223. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  12224. static_cast<T>(v36_), static_cast<T>(v37_)};
  12225. return ValuesIn(array);
  12226. }
  12227. private:
  12228. // No implementation - assignment is unsupported.
  12229. void operator=(const ValueArray37& other);
  12230. const T1 v1_;
  12231. const T2 v2_;
  12232. const T3 v3_;
  12233. const T4 v4_;
  12234. const T5 v5_;
  12235. const T6 v6_;
  12236. const T7 v7_;
  12237. const T8 v8_;
  12238. const T9 v9_;
  12239. const T10 v10_;
  12240. const T11 v11_;
  12241. const T12 v12_;
  12242. const T13 v13_;
  12243. const T14 v14_;
  12244. const T15 v15_;
  12245. const T16 v16_;
  12246. const T17 v17_;
  12247. const T18 v18_;
  12248. const T19 v19_;
  12249. const T20 v20_;
  12250. const T21 v21_;
  12251. const T22 v22_;
  12252. const T23 v23_;
  12253. const T24 v24_;
  12254. const T25 v25_;
  12255. const T26 v26_;
  12256. const T27 v27_;
  12257. const T28 v28_;
  12258. const T29 v29_;
  12259. const T30 v30_;
  12260. const T31 v31_;
  12261. const T32 v32_;
  12262. const T33 v33_;
  12263. const T34 v34_;
  12264. const T35 v35_;
  12265. const T36 v36_;
  12266. const T37 v37_;
  12267. };
  12268. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12269. typename T6, typename T7, typename T8, typename T9, typename T10,
  12270. typename T11, typename T12, typename T13, typename T14, typename T15,
  12271. typename T16, typename T17, typename T18, typename T19, typename T20,
  12272. typename T21, typename T22, typename T23, typename T24, typename T25,
  12273. typename T26, typename T27, typename T28, typename T29, typename T30,
  12274. typename T31, typename T32, typename T33, typename T34, typename T35,
  12275. typename T36, typename T37, typename T38>
  12276. class ValueArray38 {
  12277. public:
  12278. ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12279. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12280. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12281. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12282. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
  12283. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  12284. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  12285. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  12286. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  12287. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  12288. v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
  12289. template <typename T>
  12290. operator ParamGenerator<T>() const {
  12291. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12292. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12293. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12294. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12295. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12296. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12297. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12298. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12299. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12300. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12301. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12302. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  12303. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_)};
  12304. return ValuesIn(array);
  12305. }
  12306. private:
  12307. // No implementation - assignment is unsupported.
  12308. void operator=(const ValueArray38& other);
  12309. const T1 v1_;
  12310. const T2 v2_;
  12311. const T3 v3_;
  12312. const T4 v4_;
  12313. const T5 v5_;
  12314. const T6 v6_;
  12315. const T7 v7_;
  12316. const T8 v8_;
  12317. const T9 v9_;
  12318. const T10 v10_;
  12319. const T11 v11_;
  12320. const T12 v12_;
  12321. const T13 v13_;
  12322. const T14 v14_;
  12323. const T15 v15_;
  12324. const T16 v16_;
  12325. const T17 v17_;
  12326. const T18 v18_;
  12327. const T19 v19_;
  12328. const T20 v20_;
  12329. const T21 v21_;
  12330. const T22 v22_;
  12331. const T23 v23_;
  12332. const T24 v24_;
  12333. const T25 v25_;
  12334. const T26 v26_;
  12335. const T27 v27_;
  12336. const T28 v28_;
  12337. const T29 v29_;
  12338. const T30 v30_;
  12339. const T31 v31_;
  12340. const T32 v32_;
  12341. const T33 v33_;
  12342. const T34 v34_;
  12343. const T35 v35_;
  12344. const T36 v36_;
  12345. const T37 v37_;
  12346. const T38 v38_;
  12347. };
  12348. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12349. typename T6, typename T7, typename T8, typename T9, typename T10,
  12350. typename T11, typename T12, typename T13, typename T14, typename T15,
  12351. typename T16, typename T17, typename T18, typename T19, typename T20,
  12352. typename T21, typename T22, typename T23, typename T24, typename T25,
  12353. typename T26, typename T27, typename T28, typename T29, typename T30,
  12354. typename T31, typename T32, typename T33, typename T34, typename T35,
  12355. typename T36, typename T37, typename T38, typename T39>
  12356. class ValueArray39 {
  12357. public:
  12358. ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12359. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12360. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12361. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12362. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
  12363. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  12364. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  12365. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  12366. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  12367. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  12368. v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
  12369. template <typename T>
  12370. operator ParamGenerator<T>() const {
  12371. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12372. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12373. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12374. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12375. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12376. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12377. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12378. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12379. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12380. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12381. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12382. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  12383. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  12384. static_cast<T>(v39_)};
  12385. return ValuesIn(array);
  12386. }
  12387. private:
  12388. // No implementation - assignment is unsupported.
  12389. void operator=(const ValueArray39& other);
  12390. const T1 v1_;
  12391. const T2 v2_;
  12392. const T3 v3_;
  12393. const T4 v4_;
  12394. const T5 v5_;
  12395. const T6 v6_;
  12396. const T7 v7_;
  12397. const T8 v8_;
  12398. const T9 v9_;
  12399. const T10 v10_;
  12400. const T11 v11_;
  12401. const T12 v12_;
  12402. const T13 v13_;
  12403. const T14 v14_;
  12404. const T15 v15_;
  12405. const T16 v16_;
  12406. const T17 v17_;
  12407. const T18 v18_;
  12408. const T19 v19_;
  12409. const T20 v20_;
  12410. const T21 v21_;
  12411. const T22 v22_;
  12412. const T23 v23_;
  12413. const T24 v24_;
  12414. const T25 v25_;
  12415. const T26 v26_;
  12416. const T27 v27_;
  12417. const T28 v28_;
  12418. const T29 v29_;
  12419. const T30 v30_;
  12420. const T31 v31_;
  12421. const T32 v32_;
  12422. const T33 v33_;
  12423. const T34 v34_;
  12424. const T35 v35_;
  12425. const T36 v36_;
  12426. const T37 v37_;
  12427. const T38 v38_;
  12428. const T39 v39_;
  12429. };
  12430. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12431. typename T6, typename T7, typename T8, typename T9, typename T10,
  12432. typename T11, typename T12, typename T13, typename T14, typename T15,
  12433. typename T16, typename T17, typename T18, typename T19, typename T20,
  12434. typename T21, typename T22, typename T23, typename T24, typename T25,
  12435. typename T26, typename T27, typename T28, typename T29, typename T30,
  12436. typename T31, typename T32, typename T33, typename T34, typename T35,
  12437. typename T36, typename T37, typename T38, typename T39, typename T40>
  12438. class ValueArray40 {
  12439. public:
  12440. ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12441. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12442. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12443. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12444. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
  12445. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  12446. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  12447. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  12448. v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
  12449. v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
  12450. v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
  12451. v40_(v40) {}
  12452. template <typename T>
  12453. operator ParamGenerator<T>() const {
  12454. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12455. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12456. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12457. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12458. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12459. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12460. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12461. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12462. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12463. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12464. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12465. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  12466. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  12467. static_cast<T>(v39_), static_cast<T>(v40_)};
  12468. return ValuesIn(array);
  12469. }
  12470. private:
  12471. // No implementation - assignment is unsupported.
  12472. void operator=(const ValueArray40& other);
  12473. const T1 v1_;
  12474. const T2 v2_;
  12475. const T3 v3_;
  12476. const T4 v4_;
  12477. const T5 v5_;
  12478. const T6 v6_;
  12479. const T7 v7_;
  12480. const T8 v8_;
  12481. const T9 v9_;
  12482. const T10 v10_;
  12483. const T11 v11_;
  12484. const T12 v12_;
  12485. const T13 v13_;
  12486. const T14 v14_;
  12487. const T15 v15_;
  12488. const T16 v16_;
  12489. const T17 v17_;
  12490. const T18 v18_;
  12491. const T19 v19_;
  12492. const T20 v20_;
  12493. const T21 v21_;
  12494. const T22 v22_;
  12495. const T23 v23_;
  12496. const T24 v24_;
  12497. const T25 v25_;
  12498. const T26 v26_;
  12499. const T27 v27_;
  12500. const T28 v28_;
  12501. const T29 v29_;
  12502. const T30 v30_;
  12503. const T31 v31_;
  12504. const T32 v32_;
  12505. const T33 v33_;
  12506. const T34 v34_;
  12507. const T35 v35_;
  12508. const T36 v36_;
  12509. const T37 v37_;
  12510. const T38 v38_;
  12511. const T39 v39_;
  12512. const T40 v40_;
  12513. };
  12514. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12515. typename T6, typename T7, typename T8, typename T9, typename T10,
  12516. typename T11, typename T12, typename T13, typename T14, typename T15,
  12517. typename T16, typename T17, typename T18, typename T19, typename T20,
  12518. typename T21, typename T22, typename T23, typename T24, typename T25,
  12519. typename T26, typename T27, typename T28, typename T29, typename T30,
  12520. typename T31, typename T32, typename T33, typename T34, typename T35,
  12521. typename T36, typename T37, typename T38, typename T39, typename T40,
  12522. typename T41>
  12523. class ValueArray41 {
  12524. public:
  12525. ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12526. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12527. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12528. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12529. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
  12530. T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  12531. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  12532. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  12533. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  12534. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  12535. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  12536. v39_(v39), v40_(v40), v41_(v41) {}
  12537. template <typename T>
  12538. operator ParamGenerator<T>() const {
  12539. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12540. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12541. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12542. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12543. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12544. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12545. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12546. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12547. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12548. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12549. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12550. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  12551. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  12552. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_)};
  12553. return ValuesIn(array);
  12554. }
  12555. private:
  12556. // No implementation - assignment is unsupported.
  12557. void operator=(const ValueArray41& other);
  12558. const T1 v1_;
  12559. const T2 v2_;
  12560. const T3 v3_;
  12561. const T4 v4_;
  12562. const T5 v5_;
  12563. const T6 v6_;
  12564. const T7 v7_;
  12565. const T8 v8_;
  12566. const T9 v9_;
  12567. const T10 v10_;
  12568. const T11 v11_;
  12569. const T12 v12_;
  12570. const T13 v13_;
  12571. const T14 v14_;
  12572. const T15 v15_;
  12573. const T16 v16_;
  12574. const T17 v17_;
  12575. const T18 v18_;
  12576. const T19 v19_;
  12577. const T20 v20_;
  12578. const T21 v21_;
  12579. const T22 v22_;
  12580. const T23 v23_;
  12581. const T24 v24_;
  12582. const T25 v25_;
  12583. const T26 v26_;
  12584. const T27 v27_;
  12585. const T28 v28_;
  12586. const T29 v29_;
  12587. const T30 v30_;
  12588. const T31 v31_;
  12589. const T32 v32_;
  12590. const T33 v33_;
  12591. const T34 v34_;
  12592. const T35 v35_;
  12593. const T36 v36_;
  12594. const T37 v37_;
  12595. const T38 v38_;
  12596. const T39 v39_;
  12597. const T40 v40_;
  12598. const T41 v41_;
  12599. };
  12600. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12601. typename T6, typename T7, typename T8, typename T9, typename T10,
  12602. typename T11, typename T12, typename T13, typename T14, typename T15,
  12603. typename T16, typename T17, typename T18, typename T19, typename T20,
  12604. typename T21, typename T22, typename T23, typename T24, typename T25,
  12605. typename T26, typename T27, typename T28, typename T29, typename T30,
  12606. typename T31, typename T32, typename T33, typename T34, typename T35,
  12607. typename T36, typename T37, typename T38, typename T39, typename T40,
  12608. typename T41, typename T42>
  12609. class ValueArray42 {
  12610. public:
  12611. ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12612. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12613. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12614. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12615. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  12616. T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  12617. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  12618. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  12619. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  12620. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  12621. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  12622. v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
  12623. template <typename T>
  12624. operator ParamGenerator<T>() const {
  12625. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12626. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12627. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12628. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12629. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12630. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12631. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12632. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12633. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12634. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12635. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12636. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  12637. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  12638. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  12639. static_cast<T>(v42_)};
  12640. return ValuesIn(array);
  12641. }
  12642. private:
  12643. // No implementation - assignment is unsupported.
  12644. void operator=(const ValueArray42& other);
  12645. const T1 v1_;
  12646. const T2 v2_;
  12647. const T3 v3_;
  12648. const T4 v4_;
  12649. const T5 v5_;
  12650. const T6 v6_;
  12651. const T7 v7_;
  12652. const T8 v8_;
  12653. const T9 v9_;
  12654. const T10 v10_;
  12655. const T11 v11_;
  12656. const T12 v12_;
  12657. const T13 v13_;
  12658. const T14 v14_;
  12659. const T15 v15_;
  12660. const T16 v16_;
  12661. const T17 v17_;
  12662. const T18 v18_;
  12663. const T19 v19_;
  12664. const T20 v20_;
  12665. const T21 v21_;
  12666. const T22 v22_;
  12667. const T23 v23_;
  12668. const T24 v24_;
  12669. const T25 v25_;
  12670. const T26 v26_;
  12671. const T27 v27_;
  12672. const T28 v28_;
  12673. const T29 v29_;
  12674. const T30 v30_;
  12675. const T31 v31_;
  12676. const T32 v32_;
  12677. const T33 v33_;
  12678. const T34 v34_;
  12679. const T35 v35_;
  12680. const T36 v36_;
  12681. const T37 v37_;
  12682. const T38 v38_;
  12683. const T39 v39_;
  12684. const T40 v40_;
  12685. const T41 v41_;
  12686. const T42 v42_;
  12687. };
  12688. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12689. typename T6, typename T7, typename T8, typename T9, typename T10,
  12690. typename T11, typename T12, typename T13, typename T14, typename T15,
  12691. typename T16, typename T17, typename T18, typename T19, typename T20,
  12692. typename T21, typename T22, typename T23, typename T24, typename T25,
  12693. typename T26, typename T27, typename T28, typename T29, typename T30,
  12694. typename T31, typename T32, typename T33, typename T34, typename T35,
  12695. typename T36, typename T37, typename T38, typename T39, typename T40,
  12696. typename T41, typename T42, typename T43>
  12697. class ValueArray43 {
  12698. public:
  12699. ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12700. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12701. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12702. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12703. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  12704. T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  12705. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  12706. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
  12707. v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
  12708. v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
  12709. v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
  12710. v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
  12711. template <typename T>
  12712. operator ParamGenerator<T>() const {
  12713. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12714. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12715. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12716. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12717. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12718. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12719. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12720. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12721. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12722. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12723. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12724. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  12725. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  12726. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  12727. static_cast<T>(v42_), static_cast<T>(v43_)};
  12728. return ValuesIn(array);
  12729. }
  12730. private:
  12731. // No implementation - assignment is unsupported.
  12732. void operator=(const ValueArray43& other);
  12733. const T1 v1_;
  12734. const T2 v2_;
  12735. const T3 v3_;
  12736. const T4 v4_;
  12737. const T5 v5_;
  12738. const T6 v6_;
  12739. const T7 v7_;
  12740. const T8 v8_;
  12741. const T9 v9_;
  12742. const T10 v10_;
  12743. const T11 v11_;
  12744. const T12 v12_;
  12745. const T13 v13_;
  12746. const T14 v14_;
  12747. const T15 v15_;
  12748. const T16 v16_;
  12749. const T17 v17_;
  12750. const T18 v18_;
  12751. const T19 v19_;
  12752. const T20 v20_;
  12753. const T21 v21_;
  12754. const T22 v22_;
  12755. const T23 v23_;
  12756. const T24 v24_;
  12757. const T25 v25_;
  12758. const T26 v26_;
  12759. const T27 v27_;
  12760. const T28 v28_;
  12761. const T29 v29_;
  12762. const T30 v30_;
  12763. const T31 v31_;
  12764. const T32 v32_;
  12765. const T33 v33_;
  12766. const T34 v34_;
  12767. const T35 v35_;
  12768. const T36 v36_;
  12769. const T37 v37_;
  12770. const T38 v38_;
  12771. const T39 v39_;
  12772. const T40 v40_;
  12773. const T41 v41_;
  12774. const T42 v42_;
  12775. const T43 v43_;
  12776. };
  12777. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12778. typename T6, typename T7, typename T8, typename T9, typename T10,
  12779. typename T11, typename T12, typename T13, typename T14, typename T15,
  12780. typename T16, typename T17, typename T18, typename T19, typename T20,
  12781. typename T21, typename T22, typename T23, typename T24, typename T25,
  12782. typename T26, typename T27, typename T28, typename T29, typename T30,
  12783. typename T31, typename T32, typename T33, typename T34, typename T35,
  12784. typename T36, typename T37, typename T38, typename T39, typename T40,
  12785. typename T41, typename T42, typename T43, typename T44>
  12786. class ValueArray44 {
  12787. public:
  12788. ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12789. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12790. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12791. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12792. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  12793. T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  12794. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  12795. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  12796. v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
  12797. v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
  12798. v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
  12799. v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
  12800. v43_(v43), v44_(v44) {}
  12801. template <typename T>
  12802. operator ParamGenerator<T>() const {
  12803. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12804. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12805. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12806. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12807. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12808. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12809. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12810. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12811. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12812. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12813. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12814. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  12815. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  12816. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  12817. static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_)};
  12818. return ValuesIn(array);
  12819. }
  12820. private:
  12821. // No implementation - assignment is unsupported.
  12822. void operator=(const ValueArray44& other);
  12823. const T1 v1_;
  12824. const T2 v2_;
  12825. const T3 v3_;
  12826. const T4 v4_;
  12827. const T5 v5_;
  12828. const T6 v6_;
  12829. const T7 v7_;
  12830. const T8 v8_;
  12831. const T9 v9_;
  12832. const T10 v10_;
  12833. const T11 v11_;
  12834. const T12 v12_;
  12835. const T13 v13_;
  12836. const T14 v14_;
  12837. const T15 v15_;
  12838. const T16 v16_;
  12839. const T17 v17_;
  12840. const T18 v18_;
  12841. const T19 v19_;
  12842. const T20 v20_;
  12843. const T21 v21_;
  12844. const T22 v22_;
  12845. const T23 v23_;
  12846. const T24 v24_;
  12847. const T25 v25_;
  12848. const T26 v26_;
  12849. const T27 v27_;
  12850. const T28 v28_;
  12851. const T29 v29_;
  12852. const T30 v30_;
  12853. const T31 v31_;
  12854. const T32 v32_;
  12855. const T33 v33_;
  12856. const T34 v34_;
  12857. const T35 v35_;
  12858. const T36 v36_;
  12859. const T37 v37_;
  12860. const T38 v38_;
  12861. const T39 v39_;
  12862. const T40 v40_;
  12863. const T41 v41_;
  12864. const T42 v42_;
  12865. const T43 v43_;
  12866. const T44 v44_;
  12867. };
  12868. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12869. typename T6, typename T7, typename T8, typename T9, typename T10,
  12870. typename T11, typename T12, typename T13, typename T14, typename T15,
  12871. typename T16, typename T17, typename T18, typename T19, typename T20,
  12872. typename T21, typename T22, typename T23, typename T24, typename T25,
  12873. typename T26, typename T27, typename T28, typename T29, typename T30,
  12874. typename T31, typename T32, typename T33, typename T34, typename T35,
  12875. typename T36, typename T37, typename T38, typename T39, typename T40,
  12876. typename T41, typename T42, typename T43, typename T44, typename T45>
  12877. class ValueArray45 {
  12878. public:
  12879. ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12880. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12881. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12882. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12883. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  12884. T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  12885. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  12886. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  12887. v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
  12888. v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
  12889. v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
  12890. v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
  12891. v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
  12892. template <typename T>
  12893. operator ParamGenerator<T>() const {
  12894. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12895. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12896. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12897. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12898. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12899. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12900. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12901. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12902. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12903. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12904. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12905. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  12906. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  12907. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  12908. static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
  12909. static_cast<T>(v45_)};
  12910. return ValuesIn(array);
  12911. }
  12912. private:
  12913. // No implementation - assignment is unsupported.
  12914. void operator=(const ValueArray45& other);
  12915. const T1 v1_;
  12916. const T2 v2_;
  12917. const T3 v3_;
  12918. const T4 v4_;
  12919. const T5 v5_;
  12920. const T6 v6_;
  12921. const T7 v7_;
  12922. const T8 v8_;
  12923. const T9 v9_;
  12924. const T10 v10_;
  12925. const T11 v11_;
  12926. const T12 v12_;
  12927. const T13 v13_;
  12928. const T14 v14_;
  12929. const T15 v15_;
  12930. const T16 v16_;
  12931. const T17 v17_;
  12932. const T18 v18_;
  12933. const T19 v19_;
  12934. const T20 v20_;
  12935. const T21 v21_;
  12936. const T22 v22_;
  12937. const T23 v23_;
  12938. const T24 v24_;
  12939. const T25 v25_;
  12940. const T26 v26_;
  12941. const T27 v27_;
  12942. const T28 v28_;
  12943. const T29 v29_;
  12944. const T30 v30_;
  12945. const T31 v31_;
  12946. const T32 v32_;
  12947. const T33 v33_;
  12948. const T34 v34_;
  12949. const T35 v35_;
  12950. const T36 v36_;
  12951. const T37 v37_;
  12952. const T38 v38_;
  12953. const T39 v39_;
  12954. const T40 v40_;
  12955. const T41 v41_;
  12956. const T42 v42_;
  12957. const T43 v43_;
  12958. const T44 v44_;
  12959. const T45 v45_;
  12960. };
  12961. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12962. typename T6, typename T7, typename T8, typename T9, typename T10,
  12963. typename T11, typename T12, typename T13, typename T14, typename T15,
  12964. typename T16, typename T17, typename T18, typename T19, typename T20,
  12965. typename T21, typename T22, typename T23, typename T24, typename T25,
  12966. typename T26, typename T27, typename T28, typename T29, typename T30,
  12967. typename T31, typename T32, typename T33, typename T34, typename T35,
  12968. typename T36, typename T37, typename T38, typename T39, typename T40,
  12969. typename T41, typename T42, typename T43, typename T44, typename T45,
  12970. typename T46>
  12971. class ValueArray46 {
  12972. public:
  12973. ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  12974. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  12975. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  12976. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  12977. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  12978. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
  12979. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  12980. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  12981. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  12982. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  12983. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  12984. v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
  12985. v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
  12986. template <typename T>
  12987. operator ParamGenerator<T>() const {
  12988. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  12989. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  12990. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  12991. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  12992. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  12993. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  12994. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  12995. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  12996. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  12997. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  12998. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  12999. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  13000. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  13001. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  13002. static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
  13003. static_cast<T>(v45_), static_cast<T>(v46_)};
  13004. return ValuesIn(array);
  13005. }
  13006. private:
  13007. // No implementation - assignment is unsupported.
  13008. void operator=(const ValueArray46& other);
  13009. const T1 v1_;
  13010. const T2 v2_;
  13011. const T3 v3_;
  13012. const T4 v4_;
  13013. const T5 v5_;
  13014. const T6 v6_;
  13015. const T7 v7_;
  13016. const T8 v8_;
  13017. const T9 v9_;
  13018. const T10 v10_;
  13019. const T11 v11_;
  13020. const T12 v12_;
  13021. const T13 v13_;
  13022. const T14 v14_;
  13023. const T15 v15_;
  13024. const T16 v16_;
  13025. const T17 v17_;
  13026. const T18 v18_;
  13027. const T19 v19_;
  13028. const T20 v20_;
  13029. const T21 v21_;
  13030. const T22 v22_;
  13031. const T23 v23_;
  13032. const T24 v24_;
  13033. const T25 v25_;
  13034. const T26 v26_;
  13035. const T27 v27_;
  13036. const T28 v28_;
  13037. const T29 v29_;
  13038. const T30 v30_;
  13039. const T31 v31_;
  13040. const T32 v32_;
  13041. const T33 v33_;
  13042. const T34 v34_;
  13043. const T35 v35_;
  13044. const T36 v36_;
  13045. const T37 v37_;
  13046. const T38 v38_;
  13047. const T39 v39_;
  13048. const T40 v40_;
  13049. const T41 v41_;
  13050. const T42 v42_;
  13051. const T43 v43_;
  13052. const T44 v44_;
  13053. const T45 v45_;
  13054. const T46 v46_;
  13055. };
  13056. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13057. typename T6, typename T7, typename T8, typename T9, typename T10,
  13058. typename T11, typename T12, typename T13, typename T14, typename T15,
  13059. typename T16, typename T17, typename T18, typename T19, typename T20,
  13060. typename T21, typename T22, typename T23, typename T24, typename T25,
  13061. typename T26, typename T27, typename T28, typename T29, typename T30,
  13062. typename T31, typename T32, typename T33, typename T34, typename T35,
  13063. typename T36, typename T37, typename T38, typename T39, typename T40,
  13064. typename T41, typename T42, typename T43, typename T44, typename T45,
  13065. typename T46, typename T47>
  13066. class ValueArray47 {
  13067. public:
  13068. ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  13069. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  13070. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  13071. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  13072. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  13073. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
  13074. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  13075. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  13076. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  13077. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  13078. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  13079. v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
  13080. v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
  13081. v47_(v47) {}
  13082. template <typename T>
  13083. operator ParamGenerator<T>() const {
  13084. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  13085. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  13086. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  13087. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  13088. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  13089. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  13090. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  13091. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  13092. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  13093. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  13094. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  13095. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  13096. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  13097. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  13098. static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
  13099. static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_)};
  13100. return ValuesIn(array);
  13101. }
  13102. private:
  13103. // No implementation - assignment is unsupported.
  13104. void operator=(const ValueArray47& other);
  13105. const T1 v1_;
  13106. const T2 v2_;
  13107. const T3 v3_;
  13108. const T4 v4_;
  13109. const T5 v5_;
  13110. const T6 v6_;
  13111. const T7 v7_;
  13112. const T8 v8_;
  13113. const T9 v9_;
  13114. const T10 v10_;
  13115. const T11 v11_;
  13116. const T12 v12_;
  13117. const T13 v13_;
  13118. const T14 v14_;
  13119. const T15 v15_;
  13120. const T16 v16_;
  13121. const T17 v17_;
  13122. const T18 v18_;
  13123. const T19 v19_;
  13124. const T20 v20_;
  13125. const T21 v21_;
  13126. const T22 v22_;
  13127. const T23 v23_;
  13128. const T24 v24_;
  13129. const T25 v25_;
  13130. const T26 v26_;
  13131. const T27 v27_;
  13132. const T28 v28_;
  13133. const T29 v29_;
  13134. const T30 v30_;
  13135. const T31 v31_;
  13136. const T32 v32_;
  13137. const T33 v33_;
  13138. const T34 v34_;
  13139. const T35 v35_;
  13140. const T36 v36_;
  13141. const T37 v37_;
  13142. const T38 v38_;
  13143. const T39 v39_;
  13144. const T40 v40_;
  13145. const T41 v41_;
  13146. const T42 v42_;
  13147. const T43 v43_;
  13148. const T44 v44_;
  13149. const T45 v45_;
  13150. const T46 v46_;
  13151. const T47 v47_;
  13152. };
  13153. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13154. typename T6, typename T7, typename T8, typename T9, typename T10,
  13155. typename T11, typename T12, typename T13, typename T14, typename T15,
  13156. typename T16, typename T17, typename T18, typename T19, typename T20,
  13157. typename T21, typename T22, typename T23, typename T24, typename T25,
  13158. typename T26, typename T27, typename T28, typename T29, typename T30,
  13159. typename T31, typename T32, typename T33, typename T34, typename T35,
  13160. typename T36, typename T37, typename T38, typename T39, typename T40,
  13161. typename T41, typename T42, typename T43, typename T44, typename T45,
  13162. typename T46, typename T47, typename T48>
  13163. class ValueArray48 {
  13164. public:
  13165. ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  13166. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  13167. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  13168. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  13169. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  13170. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
  13171. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  13172. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  13173. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  13174. v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
  13175. v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
  13176. v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
  13177. v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
  13178. v46_(v46), v47_(v47), v48_(v48) {}
  13179. template <typename T>
  13180. operator ParamGenerator<T>() const {
  13181. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  13182. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  13183. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  13184. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  13185. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  13186. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  13187. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  13188. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  13189. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  13190. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  13191. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  13192. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  13193. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  13194. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  13195. static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
  13196. static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
  13197. static_cast<T>(v48_)};
  13198. return ValuesIn(array);
  13199. }
  13200. private:
  13201. // No implementation - assignment is unsupported.
  13202. void operator=(const ValueArray48& other);
  13203. const T1 v1_;
  13204. const T2 v2_;
  13205. const T3 v3_;
  13206. const T4 v4_;
  13207. const T5 v5_;
  13208. const T6 v6_;
  13209. const T7 v7_;
  13210. const T8 v8_;
  13211. const T9 v9_;
  13212. const T10 v10_;
  13213. const T11 v11_;
  13214. const T12 v12_;
  13215. const T13 v13_;
  13216. const T14 v14_;
  13217. const T15 v15_;
  13218. const T16 v16_;
  13219. const T17 v17_;
  13220. const T18 v18_;
  13221. const T19 v19_;
  13222. const T20 v20_;
  13223. const T21 v21_;
  13224. const T22 v22_;
  13225. const T23 v23_;
  13226. const T24 v24_;
  13227. const T25 v25_;
  13228. const T26 v26_;
  13229. const T27 v27_;
  13230. const T28 v28_;
  13231. const T29 v29_;
  13232. const T30 v30_;
  13233. const T31 v31_;
  13234. const T32 v32_;
  13235. const T33 v33_;
  13236. const T34 v34_;
  13237. const T35 v35_;
  13238. const T36 v36_;
  13239. const T37 v37_;
  13240. const T38 v38_;
  13241. const T39 v39_;
  13242. const T40 v40_;
  13243. const T41 v41_;
  13244. const T42 v42_;
  13245. const T43 v43_;
  13246. const T44 v44_;
  13247. const T45 v45_;
  13248. const T46 v46_;
  13249. const T47 v47_;
  13250. const T48 v48_;
  13251. };
  13252. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13253. typename T6, typename T7, typename T8, typename T9, typename T10,
  13254. typename T11, typename T12, typename T13, typename T14, typename T15,
  13255. typename T16, typename T17, typename T18, typename T19, typename T20,
  13256. typename T21, typename T22, typename T23, typename T24, typename T25,
  13257. typename T26, typename T27, typename T28, typename T29, typename T30,
  13258. typename T31, typename T32, typename T33, typename T34, typename T35,
  13259. typename T36, typename T37, typename T38, typename T39, typename T40,
  13260. typename T41, typename T42, typename T43, typename T44, typename T45,
  13261. typename T46, typename T47, typename T48, typename T49>
  13262. class ValueArray49 {
  13263. public:
  13264. ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  13265. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  13266. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  13267. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  13268. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  13269. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
  13270. T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  13271. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  13272. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  13273. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  13274. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  13275. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  13276. v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
  13277. v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
  13278. template <typename T>
  13279. operator ParamGenerator<T>() const {
  13280. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  13281. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  13282. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  13283. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  13284. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  13285. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  13286. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  13287. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  13288. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  13289. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  13290. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  13291. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  13292. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  13293. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  13294. static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
  13295. static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
  13296. static_cast<T>(v48_), static_cast<T>(v49_)};
  13297. return ValuesIn(array);
  13298. }
  13299. private:
  13300. // No implementation - assignment is unsupported.
  13301. void operator=(const ValueArray49& other);
  13302. const T1 v1_;
  13303. const T2 v2_;
  13304. const T3 v3_;
  13305. const T4 v4_;
  13306. const T5 v5_;
  13307. const T6 v6_;
  13308. const T7 v7_;
  13309. const T8 v8_;
  13310. const T9 v9_;
  13311. const T10 v10_;
  13312. const T11 v11_;
  13313. const T12 v12_;
  13314. const T13 v13_;
  13315. const T14 v14_;
  13316. const T15 v15_;
  13317. const T16 v16_;
  13318. const T17 v17_;
  13319. const T18 v18_;
  13320. const T19 v19_;
  13321. const T20 v20_;
  13322. const T21 v21_;
  13323. const T22 v22_;
  13324. const T23 v23_;
  13325. const T24 v24_;
  13326. const T25 v25_;
  13327. const T26 v26_;
  13328. const T27 v27_;
  13329. const T28 v28_;
  13330. const T29 v29_;
  13331. const T30 v30_;
  13332. const T31 v31_;
  13333. const T32 v32_;
  13334. const T33 v33_;
  13335. const T34 v34_;
  13336. const T35 v35_;
  13337. const T36 v36_;
  13338. const T37 v37_;
  13339. const T38 v38_;
  13340. const T39 v39_;
  13341. const T40 v40_;
  13342. const T41 v41_;
  13343. const T42 v42_;
  13344. const T43 v43_;
  13345. const T44 v44_;
  13346. const T45 v45_;
  13347. const T46 v46_;
  13348. const T47 v47_;
  13349. const T48 v48_;
  13350. const T49 v49_;
  13351. };
  13352. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13353. typename T6, typename T7, typename T8, typename T9, typename T10,
  13354. typename T11, typename T12, typename T13, typename T14, typename T15,
  13355. typename T16, typename T17, typename T18, typename T19, typename T20,
  13356. typename T21, typename T22, typename T23, typename T24, typename T25,
  13357. typename T26, typename T27, typename T28, typename T29, typename T30,
  13358. typename T31, typename T32, typename T33, typename T34, typename T35,
  13359. typename T36, typename T37, typename T38, typename T39, typename T40,
  13360. typename T41, typename T42, typename T43, typename T44, typename T45,
  13361. typename T46, typename T47, typename T48, typename T49, typename T50>
  13362. class ValueArray50 {
  13363. public:
  13364. ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  13365. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  13366. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  13367. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  13368. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  13369. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
  13370. T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  13371. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  13372. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  13373. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  13374. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  13375. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  13376. v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
  13377. v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
  13378. template <typename T>
  13379. operator ParamGenerator<T>() const {
  13380. const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
  13381. static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
  13382. static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
  13383. static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
  13384. static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
  13385. static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
  13386. static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
  13387. static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
  13388. static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
  13389. static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
  13390. static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
  13391. static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
  13392. static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
  13393. static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
  13394. static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
  13395. static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
  13396. static_cast<T>(v48_), static_cast<T>(v49_), static_cast<T>(v50_)};
  13397. return ValuesIn(array);
  13398. }
  13399. private:
  13400. // No implementation - assignment is unsupported.
  13401. void operator=(const ValueArray50& other);
  13402. const T1 v1_;
  13403. const T2 v2_;
  13404. const T3 v3_;
  13405. const T4 v4_;
  13406. const T5 v5_;
  13407. const T6 v6_;
  13408. const T7 v7_;
  13409. const T8 v8_;
  13410. const T9 v9_;
  13411. const T10 v10_;
  13412. const T11 v11_;
  13413. const T12 v12_;
  13414. const T13 v13_;
  13415. const T14 v14_;
  13416. const T15 v15_;
  13417. const T16 v16_;
  13418. const T17 v17_;
  13419. const T18 v18_;
  13420. const T19 v19_;
  13421. const T20 v20_;
  13422. const T21 v21_;
  13423. const T22 v22_;
  13424. const T23 v23_;
  13425. const T24 v24_;
  13426. const T25 v25_;
  13427. const T26 v26_;
  13428. const T27 v27_;
  13429. const T28 v28_;
  13430. const T29 v29_;
  13431. const T30 v30_;
  13432. const T31 v31_;
  13433. const T32 v32_;
  13434. const T33 v33_;
  13435. const T34 v34_;
  13436. const T35 v35_;
  13437. const T36 v36_;
  13438. const T37 v37_;
  13439. const T38 v38_;
  13440. const T39 v39_;
  13441. const T40 v40_;
  13442. const T41 v41_;
  13443. const T42 v42_;
  13444. const T43 v43_;
  13445. const T44 v44_;
  13446. const T45 v45_;
  13447. const T46 v46_;
  13448. const T47 v47_;
  13449. const T48 v48_;
  13450. const T49 v49_;
  13451. const T50 v50_;
  13452. };
  13453. # if GTEST_HAS_COMBINE
  13454. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  13455. //
  13456. // Generates values from the Cartesian product of values produced
  13457. // by the argument generators.
  13458. //
  13459. template <typename T1, typename T2>
  13460. class CartesianProductGenerator2
  13461. : public ParamGeneratorInterface< ::testing::tuple<T1, T2> > {
  13462. public:
  13463. typedef ::testing::tuple<T1, T2> ParamType;
  13464. CartesianProductGenerator2(const ParamGenerator<T1>& g1,
  13465. const ParamGenerator<T2>& g2)
  13466. : g1_(g1), g2_(g2) {}
  13467. virtual ~CartesianProductGenerator2() {}
  13468. virtual ParamIteratorInterface<ParamType>* Begin() const {
  13469. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
  13470. }
  13471. virtual ParamIteratorInterface<ParamType>* End() const {
  13472. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
  13473. }
  13474. private:
  13475. class Iterator : public ParamIteratorInterface<ParamType> {
  13476. public:
  13477. Iterator(const ParamGeneratorInterface<ParamType>* base,
  13478. const ParamGenerator<T1>& g1,
  13479. const typename ParamGenerator<T1>::iterator& current1,
  13480. const ParamGenerator<T2>& g2,
  13481. const typename ParamGenerator<T2>::iterator& current2)
  13482. : base_(base),
  13483. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  13484. begin2_(g2.begin()), end2_(g2.end()), current2_(current2) {
  13485. ComputeCurrentValue();
  13486. }
  13487. virtual ~Iterator() {}
  13488. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  13489. return base_;
  13490. }
  13491. // Advance should not be called on beyond-of-range iterators
  13492. // so no component iterators must be beyond end of range, either.
  13493. virtual void Advance() {
  13494. assert(!AtEnd());
  13495. ++current2_;
  13496. if (current2_ == end2_) {
  13497. current2_ = begin2_;
  13498. ++current1_;
  13499. }
  13500. ComputeCurrentValue();
  13501. }
  13502. virtual ParamIteratorInterface<ParamType>* Clone() const {
  13503. return new Iterator(*this);
  13504. }
  13505. virtual const ParamType* Current() const { return &current_value_; }
  13506. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  13507. // Having the same base generator guarantees that the other
  13508. // iterator is of the same type and we can downcast.
  13509. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  13510. << "The program attempted to compare iterators "
  13511. << "from different generators." << std::endl;
  13512. const Iterator* typed_other =
  13513. CheckedDowncastToActualType<const Iterator>(&other);
  13514. // We must report iterators equal if they both point beyond their
  13515. // respective ranges. That can happen in a variety of fashions,
  13516. // so we have to consult AtEnd().
  13517. return (AtEnd() && typed_other->AtEnd()) ||
  13518. (
  13519. current1_ == typed_other->current1_ &&
  13520. current2_ == typed_other->current2_);
  13521. }
  13522. private:
  13523. Iterator(const Iterator& other)
  13524. : base_(other.base_),
  13525. begin1_(other.begin1_),
  13526. end1_(other.end1_),
  13527. current1_(other.current1_),
  13528. begin2_(other.begin2_),
  13529. end2_(other.end2_),
  13530. current2_(other.current2_) {
  13531. ComputeCurrentValue();
  13532. }
  13533. void ComputeCurrentValue() {
  13534. if (!AtEnd())
  13535. current_value_ = ParamType(*current1_, *current2_);
  13536. }
  13537. bool AtEnd() const {
  13538. // We must report iterator past the end of the range when either of the
  13539. // component iterators has reached the end of its range.
  13540. return
  13541. current1_ == end1_ ||
  13542. current2_ == end2_;
  13543. }
  13544. // No implementation - assignment is unsupported.
  13545. void operator=(const Iterator& other);
  13546. const ParamGeneratorInterface<ParamType>* const base_;
  13547. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  13548. // current[i]_ is the actual traversing iterator.
  13549. const typename ParamGenerator<T1>::iterator begin1_;
  13550. const typename ParamGenerator<T1>::iterator end1_;
  13551. typename ParamGenerator<T1>::iterator current1_;
  13552. const typename ParamGenerator<T2>::iterator begin2_;
  13553. const typename ParamGenerator<T2>::iterator end2_;
  13554. typename ParamGenerator<T2>::iterator current2_;
  13555. ParamType current_value_;
  13556. }; // class CartesianProductGenerator2::Iterator
  13557. // No implementation - assignment is unsupported.
  13558. void operator=(const CartesianProductGenerator2& other);
  13559. const ParamGenerator<T1> g1_;
  13560. const ParamGenerator<T2> g2_;
  13561. }; // class CartesianProductGenerator2
  13562. template <typename T1, typename T2, typename T3>
  13563. class CartesianProductGenerator3
  13564. : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3> > {
  13565. public:
  13566. typedef ::testing::tuple<T1, T2, T3> ParamType;
  13567. CartesianProductGenerator3(const ParamGenerator<T1>& g1,
  13568. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
  13569. : g1_(g1), g2_(g2), g3_(g3) {}
  13570. virtual ~CartesianProductGenerator3() {}
  13571. virtual ParamIteratorInterface<ParamType>* Begin() const {
  13572. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  13573. g3_.begin());
  13574. }
  13575. virtual ParamIteratorInterface<ParamType>* End() const {
  13576. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.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. : base_(base),
  13589. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  13590. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  13591. begin3_(g3.begin()), end3_(g3.end()), current3_(current3) {
  13592. ComputeCurrentValue();
  13593. }
  13594. virtual ~Iterator() {}
  13595. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  13596. return base_;
  13597. }
  13598. // Advance should not be called on beyond-of-range iterators
  13599. // so no component iterators must be beyond end of range, either.
  13600. virtual void Advance() {
  13601. assert(!AtEnd());
  13602. ++current3_;
  13603. if (current3_ == end3_) {
  13604. current3_ = begin3_;
  13605. ++current2_;
  13606. }
  13607. if (current2_ == end2_) {
  13608. current2_ = begin2_;
  13609. ++current1_;
  13610. }
  13611. ComputeCurrentValue();
  13612. }
  13613. virtual ParamIteratorInterface<ParamType>* Clone() const {
  13614. return new Iterator(*this);
  13615. }
  13616. virtual const ParamType* Current() const { return &current_value_; }
  13617. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  13618. // Having the same base generator guarantees that the other
  13619. // iterator is of the same type and we can downcast.
  13620. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  13621. << "The program attempted to compare iterators "
  13622. << "from different generators." << std::endl;
  13623. const Iterator* typed_other =
  13624. CheckedDowncastToActualType<const Iterator>(&other);
  13625. // We must report iterators equal if they both point beyond their
  13626. // respective ranges. That can happen in a variety of fashions,
  13627. // so we have to consult AtEnd().
  13628. return (AtEnd() && typed_other->AtEnd()) ||
  13629. (
  13630. current1_ == typed_other->current1_ &&
  13631. current2_ == typed_other->current2_ &&
  13632. current3_ == typed_other->current3_);
  13633. }
  13634. private:
  13635. Iterator(const Iterator& other)
  13636. : base_(other.base_),
  13637. begin1_(other.begin1_),
  13638. end1_(other.end1_),
  13639. current1_(other.current1_),
  13640. begin2_(other.begin2_),
  13641. end2_(other.end2_),
  13642. current2_(other.current2_),
  13643. begin3_(other.begin3_),
  13644. end3_(other.end3_),
  13645. current3_(other.current3_) {
  13646. ComputeCurrentValue();
  13647. }
  13648. void ComputeCurrentValue() {
  13649. if (!AtEnd())
  13650. current_value_ = ParamType(*current1_, *current2_, *current3_);
  13651. }
  13652. bool AtEnd() const {
  13653. // We must report iterator past the end of the range when either of the
  13654. // component iterators has reached the end of its range.
  13655. return
  13656. current1_ == end1_ ||
  13657. current2_ == end2_ ||
  13658. current3_ == end3_;
  13659. }
  13660. // No implementation - assignment is unsupported.
  13661. void operator=(const Iterator& other);
  13662. const ParamGeneratorInterface<ParamType>* const base_;
  13663. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  13664. // current[i]_ is the actual traversing iterator.
  13665. const typename ParamGenerator<T1>::iterator begin1_;
  13666. const typename ParamGenerator<T1>::iterator end1_;
  13667. typename ParamGenerator<T1>::iterator current1_;
  13668. const typename ParamGenerator<T2>::iterator begin2_;
  13669. const typename ParamGenerator<T2>::iterator end2_;
  13670. typename ParamGenerator<T2>::iterator current2_;
  13671. const typename ParamGenerator<T3>::iterator begin3_;
  13672. const typename ParamGenerator<T3>::iterator end3_;
  13673. typename ParamGenerator<T3>::iterator current3_;
  13674. ParamType current_value_;
  13675. }; // class CartesianProductGenerator3::Iterator
  13676. // No implementation - assignment is unsupported.
  13677. void operator=(const CartesianProductGenerator3& other);
  13678. const ParamGenerator<T1> g1_;
  13679. const ParamGenerator<T2> g2_;
  13680. const ParamGenerator<T3> g3_;
  13681. }; // class CartesianProductGenerator3
  13682. template <typename T1, typename T2, typename T3, typename T4>
  13683. class CartesianProductGenerator4
  13684. : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4> > {
  13685. public:
  13686. typedef ::testing::tuple<T1, T2, T3, T4> ParamType;
  13687. CartesianProductGenerator4(const ParamGenerator<T1>& g1,
  13688. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  13689. const ParamGenerator<T4>& g4)
  13690. : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
  13691. virtual ~CartesianProductGenerator4() {}
  13692. virtual ParamIteratorInterface<ParamType>* Begin() const {
  13693. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  13694. g3_.begin(), g4_, g4_.begin());
  13695. }
  13696. virtual ParamIteratorInterface<ParamType>* End() const {
  13697. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  13698. g4_, g4_.end());
  13699. }
  13700. private:
  13701. class Iterator : public ParamIteratorInterface<ParamType> {
  13702. public:
  13703. Iterator(const ParamGeneratorInterface<ParamType>* base,
  13704. const ParamGenerator<T1>& g1,
  13705. const typename ParamGenerator<T1>::iterator& current1,
  13706. const ParamGenerator<T2>& g2,
  13707. const typename ParamGenerator<T2>::iterator& current2,
  13708. const ParamGenerator<T3>& g3,
  13709. const typename ParamGenerator<T3>::iterator& current3,
  13710. const ParamGenerator<T4>& g4,
  13711. const typename ParamGenerator<T4>::iterator& current4)
  13712. : base_(base),
  13713. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  13714. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  13715. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  13716. begin4_(g4.begin()), end4_(g4.end()), current4_(current4) {
  13717. ComputeCurrentValue();
  13718. }
  13719. virtual ~Iterator() {}
  13720. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  13721. return base_;
  13722. }
  13723. // Advance should not be called on beyond-of-range iterators
  13724. // so no component iterators must be beyond end of range, either.
  13725. virtual void Advance() {
  13726. assert(!AtEnd());
  13727. ++current4_;
  13728. if (current4_ == end4_) {
  13729. current4_ = begin4_;
  13730. ++current3_;
  13731. }
  13732. if (current3_ == end3_) {
  13733. current3_ = begin3_;
  13734. ++current2_;
  13735. }
  13736. if (current2_ == end2_) {
  13737. current2_ = begin2_;
  13738. ++current1_;
  13739. }
  13740. ComputeCurrentValue();
  13741. }
  13742. virtual ParamIteratorInterface<ParamType>* Clone() const {
  13743. return new Iterator(*this);
  13744. }
  13745. virtual const ParamType* Current() const { return &current_value_; }
  13746. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  13747. // Having the same base generator guarantees that the other
  13748. // iterator is of the same type and we can downcast.
  13749. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  13750. << "The program attempted to compare iterators "
  13751. << "from different generators." << std::endl;
  13752. const Iterator* typed_other =
  13753. CheckedDowncastToActualType<const Iterator>(&other);
  13754. // We must report iterators equal if they both point beyond their
  13755. // respective ranges. That can happen in a variety of fashions,
  13756. // so we have to consult AtEnd().
  13757. return (AtEnd() && typed_other->AtEnd()) ||
  13758. (
  13759. current1_ == typed_other->current1_ &&
  13760. current2_ == typed_other->current2_ &&
  13761. current3_ == typed_other->current3_ &&
  13762. current4_ == typed_other->current4_);
  13763. }
  13764. private:
  13765. Iterator(const Iterator& other)
  13766. : base_(other.base_),
  13767. begin1_(other.begin1_),
  13768. end1_(other.end1_),
  13769. current1_(other.current1_),
  13770. begin2_(other.begin2_),
  13771. end2_(other.end2_),
  13772. current2_(other.current2_),
  13773. begin3_(other.begin3_),
  13774. end3_(other.end3_),
  13775. current3_(other.current3_),
  13776. begin4_(other.begin4_),
  13777. end4_(other.end4_),
  13778. current4_(other.current4_) {
  13779. ComputeCurrentValue();
  13780. }
  13781. void ComputeCurrentValue() {
  13782. if (!AtEnd())
  13783. current_value_ = ParamType(*current1_, *current2_, *current3_,
  13784. *current4_);
  13785. }
  13786. bool AtEnd() const {
  13787. // We must report iterator past the end of the range when either of the
  13788. // component iterators has reached the end of its range.
  13789. return
  13790. current1_ == end1_ ||
  13791. current2_ == end2_ ||
  13792. current3_ == end3_ ||
  13793. current4_ == end4_;
  13794. }
  13795. // No implementation - assignment is unsupported.
  13796. void operator=(const Iterator& other);
  13797. const ParamGeneratorInterface<ParamType>* const base_;
  13798. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  13799. // current[i]_ is the actual traversing iterator.
  13800. const typename ParamGenerator<T1>::iterator begin1_;
  13801. const typename ParamGenerator<T1>::iterator end1_;
  13802. typename ParamGenerator<T1>::iterator current1_;
  13803. const typename ParamGenerator<T2>::iterator begin2_;
  13804. const typename ParamGenerator<T2>::iterator end2_;
  13805. typename ParamGenerator<T2>::iterator current2_;
  13806. const typename ParamGenerator<T3>::iterator begin3_;
  13807. const typename ParamGenerator<T3>::iterator end3_;
  13808. typename ParamGenerator<T3>::iterator current3_;
  13809. const typename ParamGenerator<T4>::iterator begin4_;
  13810. const typename ParamGenerator<T4>::iterator end4_;
  13811. typename ParamGenerator<T4>::iterator current4_;
  13812. ParamType current_value_;
  13813. }; // class CartesianProductGenerator4::Iterator
  13814. // No implementation - assignment is unsupported.
  13815. void operator=(const CartesianProductGenerator4& other);
  13816. const ParamGenerator<T1> g1_;
  13817. const ParamGenerator<T2> g2_;
  13818. const ParamGenerator<T3> g3_;
  13819. const ParamGenerator<T4> g4_;
  13820. }; // class CartesianProductGenerator4
  13821. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  13822. class CartesianProductGenerator5
  13823. : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5> > {
  13824. public:
  13825. typedef ::testing::tuple<T1, T2, T3, T4, T5> ParamType;
  13826. CartesianProductGenerator5(const ParamGenerator<T1>& g1,
  13827. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  13828. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
  13829. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
  13830. virtual ~CartesianProductGenerator5() {}
  13831. virtual ParamIteratorInterface<ParamType>* Begin() const {
  13832. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  13833. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
  13834. }
  13835. virtual ParamIteratorInterface<ParamType>* End() const {
  13836. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  13837. g4_, g4_.end(), g5_, g5_.end());
  13838. }
  13839. private:
  13840. class Iterator : public ParamIteratorInterface<ParamType> {
  13841. public:
  13842. Iterator(const ParamGeneratorInterface<ParamType>* base,
  13843. const ParamGenerator<T1>& g1,
  13844. const typename ParamGenerator<T1>::iterator& current1,
  13845. const ParamGenerator<T2>& g2,
  13846. const typename ParamGenerator<T2>::iterator& current2,
  13847. const ParamGenerator<T3>& g3,
  13848. const typename ParamGenerator<T3>::iterator& current3,
  13849. const ParamGenerator<T4>& g4,
  13850. const typename ParamGenerator<T4>::iterator& current4,
  13851. const ParamGenerator<T5>& g5,
  13852. const typename ParamGenerator<T5>::iterator& current5)
  13853. : base_(base),
  13854. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  13855. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  13856. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  13857. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  13858. begin5_(g5.begin()), end5_(g5.end()), current5_(current5) {
  13859. ComputeCurrentValue();
  13860. }
  13861. virtual ~Iterator() {}
  13862. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  13863. return base_;
  13864. }
  13865. // Advance should not be called on beyond-of-range iterators
  13866. // so no component iterators must be beyond end of range, either.
  13867. virtual void Advance() {
  13868. assert(!AtEnd());
  13869. ++current5_;
  13870. if (current5_ == end5_) {
  13871. current5_ = begin5_;
  13872. ++current4_;
  13873. }
  13874. if (current4_ == end4_) {
  13875. current4_ = begin4_;
  13876. ++current3_;
  13877. }
  13878. if (current3_ == end3_) {
  13879. current3_ = begin3_;
  13880. ++current2_;
  13881. }
  13882. if (current2_ == end2_) {
  13883. current2_ = begin2_;
  13884. ++current1_;
  13885. }
  13886. ComputeCurrentValue();
  13887. }
  13888. virtual ParamIteratorInterface<ParamType>* Clone() const {
  13889. return new Iterator(*this);
  13890. }
  13891. virtual const ParamType* Current() const { return &current_value_; }
  13892. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  13893. // Having the same base generator guarantees that the other
  13894. // iterator is of the same type and we can downcast.
  13895. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  13896. << "The program attempted to compare iterators "
  13897. << "from different generators." << std::endl;
  13898. const Iterator* typed_other =
  13899. CheckedDowncastToActualType<const Iterator>(&other);
  13900. // We must report iterators equal if they both point beyond their
  13901. // respective ranges. That can happen in a variety of fashions,
  13902. // so we have to consult AtEnd().
  13903. return (AtEnd() && typed_other->AtEnd()) ||
  13904. (
  13905. current1_ == typed_other->current1_ &&
  13906. current2_ == typed_other->current2_ &&
  13907. current3_ == typed_other->current3_ &&
  13908. current4_ == typed_other->current4_ &&
  13909. current5_ == typed_other->current5_);
  13910. }
  13911. private:
  13912. Iterator(const Iterator& other)
  13913. : base_(other.base_),
  13914. begin1_(other.begin1_),
  13915. end1_(other.end1_),
  13916. current1_(other.current1_),
  13917. begin2_(other.begin2_),
  13918. end2_(other.end2_),
  13919. current2_(other.current2_),
  13920. begin3_(other.begin3_),
  13921. end3_(other.end3_),
  13922. current3_(other.current3_),
  13923. begin4_(other.begin4_),
  13924. end4_(other.end4_),
  13925. current4_(other.current4_),
  13926. begin5_(other.begin5_),
  13927. end5_(other.end5_),
  13928. current5_(other.current5_) {
  13929. ComputeCurrentValue();
  13930. }
  13931. void ComputeCurrentValue() {
  13932. if (!AtEnd())
  13933. current_value_ = ParamType(*current1_, *current2_, *current3_,
  13934. *current4_, *current5_);
  13935. }
  13936. bool AtEnd() const {
  13937. // We must report iterator past the end of the range when either of the
  13938. // component iterators has reached the end of its range.
  13939. return
  13940. current1_ == end1_ ||
  13941. current2_ == end2_ ||
  13942. current3_ == end3_ ||
  13943. current4_ == end4_ ||
  13944. current5_ == end5_;
  13945. }
  13946. // No implementation - assignment is unsupported.
  13947. void operator=(const Iterator& other);
  13948. const ParamGeneratorInterface<ParamType>* const base_;
  13949. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  13950. // current[i]_ is the actual traversing iterator.
  13951. const typename ParamGenerator<T1>::iterator begin1_;
  13952. const typename ParamGenerator<T1>::iterator end1_;
  13953. typename ParamGenerator<T1>::iterator current1_;
  13954. const typename ParamGenerator<T2>::iterator begin2_;
  13955. const typename ParamGenerator<T2>::iterator end2_;
  13956. typename ParamGenerator<T2>::iterator current2_;
  13957. const typename ParamGenerator<T3>::iterator begin3_;
  13958. const typename ParamGenerator<T3>::iterator end3_;
  13959. typename ParamGenerator<T3>::iterator current3_;
  13960. const typename ParamGenerator<T4>::iterator begin4_;
  13961. const typename ParamGenerator<T4>::iterator end4_;
  13962. typename ParamGenerator<T4>::iterator current4_;
  13963. const typename ParamGenerator<T5>::iterator begin5_;
  13964. const typename ParamGenerator<T5>::iterator end5_;
  13965. typename ParamGenerator<T5>::iterator current5_;
  13966. ParamType current_value_;
  13967. }; // class CartesianProductGenerator5::Iterator
  13968. // No implementation - assignment is unsupported.
  13969. void operator=(const CartesianProductGenerator5& other);
  13970. const ParamGenerator<T1> g1_;
  13971. const ParamGenerator<T2> g2_;
  13972. const ParamGenerator<T3> g3_;
  13973. const ParamGenerator<T4> g4_;
  13974. const ParamGenerator<T5> g5_;
  13975. }; // class CartesianProductGenerator5
  13976. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13977. typename T6>
  13978. class CartesianProductGenerator6
  13979. : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5,
  13980. T6> > {
  13981. public:
  13982. typedef ::testing::tuple<T1, T2, T3, T4, T5, T6> ParamType;
  13983. CartesianProductGenerator6(const ParamGenerator<T1>& g1,
  13984. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  13985. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  13986. const ParamGenerator<T6>& g6)
  13987. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
  13988. virtual ~CartesianProductGenerator6() {}
  13989. virtual ParamIteratorInterface<ParamType>* Begin() const {
  13990. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  13991. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
  13992. }
  13993. virtual ParamIteratorInterface<ParamType>* End() const {
  13994. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  13995. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
  13996. }
  13997. private:
  13998. class Iterator : public ParamIteratorInterface<ParamType> {
  13999. public:
  14000. Iterator(const ParamGeneratorInterface<ParamType>* base,
  14001. const ParamGenerator<T1>& g1,
  14002. const typename ParamGenerator<T1>::iterator& current1,
  14003. const ParamGenerator<T2>& g2,
  14004. const typename ParamGenerator<T2>::iterator& current2,
  14005. const ParamGenerator<T3>& g3,
  14006. const typename ParamGenerator<T3>::iterator& current3,
  14007. const ParamGenerator<T4>& g4,
  14008. const typename ParamGenerator<T4>::iterator& current4,
  14009. const ParamGenerator<T5>& g5,
  14010. const typename ParamGenerator<T5>::iterator& current5,
  14011. const ParamGenerator<T6>& g6,
  14012. const typename ParamGenerator<T6>::iterator& current6)
  14013. : base_(base),
  14014. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  14015. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  14016. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  14017. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  14018. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  14019. begin6_(g6.begin()), end6_(g6.end()), current6_(current6) {
  14020. ComputeCurrentValue();
  14021. }
  14022. virtual ~Iterator() {}
  14023. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  14024. return base_;
  14025. }
  14026. // Advance should not be called on beyond-of-range iterators
  14027. // so no component iterators must be beyond end of range, either.
  14028. virtual void Advance() {
  14029. assert(!AtEnd());
  14030. ++current6_;
  14031. if (current6_ == end6_) {
  14032. current6_ = begin6_;
  14033. ++current5_;
  14034. }
  14035. if (current5_ == end5_) {
  14036. current5_ = begin5_;
  14037. ++current4_;
  14038. }
  14039. if (current4_ == end4_) {
  14040. current4_ = begin4_;
  14041. ++current3_;
  14042. }
  14043. if (current3_ == end3_) {
  14044. current3_ = begin3_;
  14045. ++current2_;
  14046. }
  14047. if (current2_ == end2_) {
  14048. current2_ = begin2_;
  14049. ++current1_;
  14050. }
  14051. ComputeCurrentValue();
  14052. }
  14053. virtual ParamIteratorInterface<ParamType>* Clone() const {
  14054. return new Iterator(*this);
  14055. }
  14056. virtual const ParamType* Current() const { return &current_value_; }
  14057. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  14058. // Having the same base generator guarantees that the other
  14059. // iterator is of the same type and we can downcast.
  14060. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  14061. << "The program attempted to compare iterators "
  14062. << "from different generators." << std::endl;
  14063. const Iterator* typed_other =
  14064. CheckedDowncastToActualType<const Iterator>(&other);
  14065. // We must report iterators equal if they both point beyond their
  14066. // respective ranges. That can happen in a variety of fashions,
  14067. // so we have to consult AtEnd().
  14068. return (AtEnd() && typed_other->AtEnd()) ||
  14069. (
  14070. current1_ == typed_other->current1_ &&
  14071. current2_ == typed_other->current2_ &&
  14072. current3_ == typed_other->current3_ &&
  14073. current4_ == typed_other->current4_ &&
  14074. current5_ == typed_other->current5_ &&
  14075. current6_ == typed_other->current6_);
  14076. }
  14077. private:
  14078. Iterator(const Iterator& other)
  14079. : base_(other.base_),
  14080. begin1_(other.begin1_),
  14081. end1_(other.end1_),
  14082. current1_(other.current1_),
  14083. begin2_(other.begin2_),
  14084. end2_(other.end2_),
  14085. current2_(other.current2_),
  14086. begin3_(other.begin3_),
  14087. end3_(other.end3_),
  14088. current3_(other.current3_),
  14089. begin4_(other.begin4_),
  14090. end4_(other.end4_),
  14091. current4_(other.current4_),
  14092. begin5_(other.begin5_),
  14093. end5_(other.end5_),
  14094. current5_(other.current5_),
  14095. begin6_(other.begin6_),
  14096. end6_(other.end6_),
  14097. current6_(other.current6_) {
  14098. ComputeCurrentValue();
  14099. }
  14100. void ComputeCurrentValue() {
  14101. if (!AtEnd())
  14102. current_value_ = ParamType(*current1_, *current2_, *current3_,
  14103. *current4_, *current5_, *current6_);
  14104. }
  14105. bool AtEnd() const {
  14106. // We must report iterator past the end of the range when either of the
  14107. // component iterators has reached the end of its range.
  14108. return
  14109. current1_ == end1_ ||
  14110. current2_ == end2_ ||
  14111. current3_ == end3_ ||
  14112. current4_ == end4_ ||
  14113. current5_ == end5_ ||
  14114. current6_ == end6_;
  14115. }
  14116. // No implementation - assignment is unsupported.
  14117. void operator=(const Iterator& other);
  14118. const ParamGeneratorInterface<ParamType>* const base_;
  14119. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  14120. // current[i]_ is the actual traversing iterator.
  14121. const typename ParamGenerator<T1>::iterator begin1_;
  14122. const typename ParamGenerator<T1>::iterator end1_;
  14123. typename ParamGenerator<T1>::iterator current1_;
  14124. const typename ParamGenerator<T2>::iterator begin2_;
  14125. const typename ParamGenerator<T2>::iterator end2_;
  14126. typename ParamGenerator<T2>::iterator current2_;
  14127. const typename ParamGenerator<T3>::iterator begin3_;
  14128. const typename ParamGenerator<T3>::iterator end3_;
  14129. typename ParamGenerator<T3>::iterator current3_;
  14130. const typename ParamGenerator<T4>::iterator begin4_;
  14131. const typename ParamGenerator<T4>::iterator end4_;
  14132. typename ParamGenerator<T4>::iterator current4_;
  14133. const typename ParamGenerator<T5>::iterator begin5_;
  14134. const typename ParamGenerator<T5>::iterator end5_;
  14135. typename ParamGenerator<T5>::iterator current5_;
  14136. const typename ParamGenerator<T6>::iterator begin6_;
  14137. const typename ParamGenerator<T6>::iterator end6_;
  14138. typename ParamGenerator<T6>::iterator current6_;
  14139. ParamType current_value_;
  14140. }; // class CartesianProductGenerator6::Iterator
  14141. // No implementation - assignment is unsupported.
  14142. void operator=(const CartesianProductGenerator6& other);
  14143. const ParamGenerator<T1> g1_;
  14144. const ParamGenerator<T2> g2_;
  14145. const ParamGenerator<T3> g3_;
  14146. const ParamGenerator<T4> g4_;
  14147. const ParamGenerator<T5> g5_;
  14148. const ParamGenerator<T6> g6_;
  14149. }; // class CartesianProductGenerator6
  14150. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14151. typename T6, typename T7>
  14152. class CartesianProductGenerator7
  14153. : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
  14154. T7> > {
  14155. public:
  14156. typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
  14157. CartesianProductGenerator7(const ParamGenerator<T1>& g1,
  14158. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  14159. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  14160. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
  14161. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
  14162. virtual ~CartesianProductGenerator7() {}
  14163. virtual ParamIteratorInterface<ParamType>* Begin() const {
  14164. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  14165. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  14166. g7_.begin());
  14167. }
  14168. virtual ParamIteratorInterface<ParamType>* End() const {
  14169. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  14170. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
  14171. }
  14172. private:
  14173. class Iterator : public ParamIteratorInterface<ParamType> {
  14174. public:
  14175. Iterator(const ParamGeneratorInterface<ParamType>* base,
  14176. const ParamGenerator<T1>& g1,
  14177. const typename ParamGenerator<T1>::iterator& current1,
  14178. const ParamGenerator<T2>& g2,
  14179. const typename ParamGenerator<T2>::iterator& current2,
  14180. const ParamGenerator<T3>& g3,
  14181. const typename ParamGenerator<T3>::iterator& current3,
  14182. const ParamGenerator<T4>& g4,
  14183. const typename ParamGenerator<T4>::iterator& current4,
  14184. const ParamGenerator<T5>& g5,
  14185. const typename ParamGenerator<T5>::iterator& current5,
  14186. const ParamGenerator<T6>& g6,
  14187. const typename ParamGenerator<T6>::iterator& current6,
  14188. const ParamGenerator<T7>& g7,
  14189. const typename ParamGenerator<T7>::iterator& current7)
  14190. : base_(base),
  14191. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  14192. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  14193. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  14194. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  14195. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  14196. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  14197. begin7_(g7.begin()), end7_(g7.end()), current7_(current7) {
  14198. ComputeCurrentValue();
  14199. }
  14200. virtual ~Iterator() {}
  14201. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  14202. return base_;
  14203. }
  14204. // Advance should not be called on beyond-of-range iterators
  14205. // so no component iterators must be beyond end of range, either.
  14206. virtual void Advance() {
  14207. assert(!AtEnd());
  14208. ++current7_;
  14209. if (current7_ == end7_) {
  14210. current7_ = begin7_;
  14211. ++current6_;
  14212. }
  14213. if (current6_ == end6_) {
  14214. current6_ = begin6_;
  14215. ++current5_;
  14216. }
  14217. if (current5_ == end5_) {
  14218. current5_ = begin5_;
  14219. ++current4_;
  14220. }
  14221. if (current4_ == end4_) {
  14222. current4_ = begin4_;
  14223. ++current3_;
  14224. }
  14225. if (current3_ == end3_) {
  14226. current3_ = begin3_;
  14227. ++current2_;
  14228. }
  14229. if (current2_ == end2_) {
  14230. current2_ = begin2_;
  14231. ++current1_;
  14232. }
  14233. ComputeCurrentValue();
  14234. }
  14235. virtual ParamIteratorInterface<ParamType>* Clone() const {
  14236. return new Iterator(*this);
  14237. }
  14238. virtual const ParamType* Current() const { return &current_value_; }
  14239. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  14240. // Having the same base generator guarantees that the other
  14241. // iterator is of the same type and we can downcast.
  14242. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  14243. << "The program attempted to compare iterators "
  14244. << "from different generators." << std::endl;
  14245. const Iterator* typed_other =
  14246. CheckedDowncastToActualType<const Iterator>(&other);
  14247. // We must report iterators equal if they both point beyond their
  14248. // respective ranges. That can happen in a variety of fashions,
  14249. // so we have to consult AtEnd().
  14250. return (AtEnd() && typed_other->AtEnd()) ||
  14251. (
  14252. current1_ == typed_other->current1_ &&
  14253. current2_ == typed_other->current2_ &&
  14254. current3_ == typed_other->current3_ &&
  14255. current4_ == typed_other->current4_ &&
  14256. current5_ == typed_other->current5_ &&
  14257. current6_ == typed_other->current6_ &&
  14258. current7_ == typed_other->current7_);
  14259. }
  14260. private:
  14261. Iterator(const Iterator& other)
  14262. : base_(other.base_),
  14263. begin1_(other.begin1_),
  14264. end1_(other.end1_),
  14265. current1_(other.current1_),
  14266. begin2_(other.begin2_),
  14267. end2_(other.end2_),
  14268. current2_(other.current2_),
  14269. begin3_(other.begin3_),
  14270. end3_(other.end3_),
  14271. current3_(other.current3_),
  14272. begin4_(other.begin4_),
  14273. end4_(other.end4_),
  14274. current4_(other.current4_),
  14275. begin5_(other.begin5_),
  14276. end5_(other.end5_),
  14277. current5_(other.current5_),
  14278. begin6_(other.begin6_),
  14279. end6_(other.end6_),
  14280. current6_(other.current6_),
  14281. begin7_(other.begin7_),
  14282. end7_(other.end7_),
  14283. current7_(other.current7_) {
  14284. ComputeCurrentValue();
  14285. }
  14286. void ComputeCurrentValue() {
  14287. if (!AtEnd())
  14288. current_value_ = ParamType(*current1_, *current2_, *current3_,
  14289. *current4_, *current5_, *current6_, *current7_);
  14290. }
  14291. bool AtEnd() const {
  14292. // We must report iterator past the end of the range when either of the
  14293. // component iterators has reached the end of its range.
  14294. return
  14295. current1_ == end1_ ||
  14296. current2_ == end2_ ||
  14297. current3_ == end3_ ||
  14298. current4_ == end4_ ||
  14299. current5_ == end5_ ||
  14300. current6_ == end6_ ||
  14301. current7_ == end7_;
  14302. }
  14303. // No implementation - assignment is unsupported.
  14304. void operator=(const Iterator& other);
  14305. const ParamGeneratorInterface<ParamType>* const base_;
  14306. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  14307. // current[i]_ is the actual traversing iterator.
  14308. const typename ParamGenerator<T1>::iterator begin1_;
  14309. const typename ParamGenerator<T1>::iterator end1_;
  14310. typename ParamGenerator<T1>::iterator current1_;
  14311. const typename ParamGenerator<T2>::iterator begin2_;
  14312. const typename ParamGenerator<T2>::iterator end2_;
  14313. typename ParamGenerator<T2>::iterator current2_;
  14314. const typename ParamGenerator<T3>::iterator begin3_;
  14315. const typename ParamGenerator<T3>::iterator end3_;
  14316. typename ParamGenerator<T3>::iterator current3_;
  14317. const typename ParamGenerator<T4>::iterator begin4_;
  14318. const typename ParamGenerator<T4>::iterator end4_;
  14319. typename ParamGenerator<T4>::iterator current4_;
  14320. const typename ParamGenerator<T5>::iterator begin5_;
  14321. const typename ParamGenerator<T5>::iterator end5_;
  14322. typename ParamGenerator<T5>::iterator current5_;
  14323. const typename ParamGenerator<T6>::iterator begin6_;
  14324. const typename ParamGenerator<T6>::iterator end6_;
  14325. typename ParamGenerator<T6>::iterator current6_;
  14326. const typename ParamGenerator<T7>::iterator begin7_;
  14327. const typename ParamGenerator<T7>::iterator end7_;
  14328. typename ParamGenerator<T7>::iterator current7_;
  14329. ParamType current_value_;
  14330. }; // class CartesianProductGenerator7::Iterator
  14331. // No implementation - assignment is unsupported.
  14332. void operator=(const CartesianProductGenerator7& other);
  14333. const ParamGenerator<T1> g1_;
  14334. const ParamGenerator<T2> g2_;
  14335. const ParamGenerator<T3> g3_;
  14336. const ParamGenerator<T4> g4_;
  14337. const ParamGenerator<T5> g5_;
  14338. const ParamGenerator<T6> g6_;
  14339. const ParamGenerator<T7> g7_;
  14340. }; // class CartesianProductGenerator7
  14341. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14342. typename T6, typename T7, typename T8>
  14343. class CartesianProductGenerator8
  14344. : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
  14345. T7, T8> > {
  14346. public:
  14347. typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
  14348. CartesianProductGenerator8(const ParamGenerator<T1>& g1,
  14349. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  14350. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  14351. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
  14352. const ParamGenerator<T8>& g8)
  14353. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
  14354. g8_(g8) {}
  14355. virtual ~CartesianProductGenerator8() {}
  14356. virtual ParamIteratorInterface<ParamType>* Begin() const {
  14357. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  14358. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  14359. g7_.begin(), g8_, g8_.begin());
  14360. }
  14361. virtual ParamIteratorInterface<ParamType>* End() const {
  14362. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  14363. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
  14364. g8_.end());
  14365. }
  14366. private:
  14367. class Iterator : public ParamIteratorInterface<ParamType> {
  14368. public:
  14369. Iterator(const ParamGeneratorInterface<ParamType>* base,
  14370. const ParamGenerator<T1>& g1,
  14371. const typename ParamGenerator<T1>::iterator& current1,
  14372. const ParamGenerator<T2>& g2,
  14373. const typename ParamGenerator<T2>::iterator& current2,
  14374. const ParamGenerator<T3>& g3,
  14375. const typename ParamGenerator<T3>::iterator& current3,
  14376. const ParamGenerator<T4>& g4,
  14377. const typename ParamGenerator<T4>::iterator& current4,
  14378. const ParamGenerator<T5>& g5,
  14379. const typename ParamGenerator<T5>::iterator& current5,
  14380. const ParamGenerator<T6>& g6,
  14381. const typename ParamGenerator<T6>::iterator& current6,
  14382. const ParamGenerator<T7>& g7,
  14383. const typename ParamGenerator<T7>::iterator& current7,
  14384. const ParamGenerator<T8>& g8,
  14385. const typename ParamGenerator<T8>::iterator& current8)
  14386. : base_(base),
  14387. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  14388. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  14389. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  14390. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  14391. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  14392. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  14393. begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
  14394. begin8_(g8.begin()), end8_(g8.end()), current8_(current8) {
  14395. ComputeCurrentValue();
  14396. }
  14397. virtual ~Iterator() {}
  14398. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  14399. return base_;
  14400. }
  14401. // Advance should not be called on beyond-of-range iterators
  14402. // so no component iterators must be beyond end of range, either.
  14403. virtual void Advance() {
  14404. assert(!AtEnd());
  14405. ++current8_;
  14406. if (current8_ == end8_) {
  14407. current8_ = begin8_;
  14408. ++current7_;
  14409. }
  14410. if (current7_ == end7_) {
  14411. current7_ = begin7_;
  14412. ++current6_;
  14413. }
  14414. if (current6_ == end6_) {
  14415. current6_ = begin6_;
  14416. ++current5_;
  14417. }
  14418. if (current5_ == end5_) {
  14419. current5_ = begin5_;
  14420. ++current4_;
  14421. }
  14422. if (current4_ == end4_) {
  14423. current4_ = begin4_;
  14424. ++current3_;
  14425. }
  14426. if (current3_ == end3_) {
  14427. current3_ = begin3_;
  14428. ++current2_;
  14429. }
  14430. if (current2_ == end2_) {
  14431. current2_ = begin2_;
  14432. ++current1_;
  14433. }
  14434. ComputeCurrentValue();
  14435. }
  14436. virtual ParamIteratorInterface<ParamType>* Clone() const {
  14437. return new Iterator(*this);
  14438. }
  14439. virtual const ParamType* Current() const { return &current_value_; }
  14440. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  14441. // Having the same base generator guarantees that the other
  14442. // iterator is of the same type and we can downcast.
  14443. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  14444. << "The program attempted to compare iterators "
  14445. << "from different generators." << std::endl;
  14446. const Iterator* typed_other =
  14447. CheckedDowncastToActualType<const Iterator>(&other);
  14448. // We must report iterators equal if they both point beyond their
  14449. // respective ranges. That can happen in a variety of fashions,
  14450. // so we have to consult AtEnd().
  14451. return (AtEnd() && typed_other->AtEnd()) ||
  14452. (
  14453. current1_ == typed_other->current1_ &&
  14454. current2_ == typed_other->current2_ &&
  14455. current3_ == typed_other->current3_ &&
  14456. current4_ == typed_other->current4_ &&
  14457. current5_ == typed_other->current5_ &&
  14458. current6_ == typed_other->current6_ &&
  14459. current7_ == typed_other->current7_ &&
  14460. current8_ == typed_other->current8_);
  14461. }
  14462. private:
  14463. Iterator(const Iterator& other)
  14464. : base_(other.base_),
  14465. begin1_(other.begin1_),
  14466. end1_(other.end1_),
  14467. current1_(other.current1_),
  14468. begin2_(other.begin2_),
  14469. end2_(other.end2_),
  14470. current2_(other.current2_),
  14471. begin3_(other.begin3_),
  14472. end3_(other.end3_),
  14473. current3_(other.current3_),
  14474. begin4_(other.begin4_),
  14475. end4_(other.end4_),
  14476. current4_(other.current4_),
  14477. begin5_(other.begin5_),
  14478. end5_(other.end5_),
  14479. current5_(other.current5_),
  14480. begin6_(other.begin6_),
  14481. end6_(other.end6_),
  14482. current6_(other.current6_),
  14483. begin7_(other.begin7_),
  14484. end7_(other.end7_),
  14485. current7_(other.current7_),
  14486. begin8_(other.begin8_),
  14487. end8_(other.end8_),
  14488. current8_(other.current8_) {
  14489. ComputeCurrentValue();
  14490. }
  14491. void ComputeCurrentValue() {
  14492. if (!AtEnd())
  14493. current_value_ = ParamType(*current1_, *current2_, *current3_,
  14494. *current4_, *current5_, *current6_, *current7_, *current8_);
  14495. }
  14496. bool AtEnd() const {
  14497. // We must report iterator past the end of the range when either of the
  14498. // component iterators has reached the end of its range.
  14499. return
  14500. current1_ == end1_ ||
  14501. current2_ == end2_ ||
  14502. current3_ == end3_ ||
  14503. current4_ == end4_ ||
  14504. current5_ == end5_ ||
  14505. current6_ == end6_ ||
  14506. current7_ == end7_ ||
  14507. current8_ == end8_;
  14508. }
  14509. // No implementation - assignment is unsupported.
  14510. void operator=(const Iterator& other);
  14511. const ParamGeneratorInterface<ParamType>* const base_;
  14512. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  14513. // current[i]_ is the actual traversing iterator.
  14514. const typename ParamGenerator<T1>::iterator begin1_;
  14515. const typename ParamGenerator<T1>::iterator end1_;
  14516. typename ParamGenerator<T1>::iterator current1_;
  14517. const typename ParamGenerator<T2>::iterator begin2_;
  14518. const typename ParamGenerator<T2>::iterator end2_;
  14519. typename ParamGenerator<T2>::iterator current2_;
  14520. const typename ParamGenerator<T3>::iterator begin3_;
  14521. const typename ParamGenerator<T3>::iterator end3_;
  14522. typename ParamGenerator<T3>::iterator current3_;
  14523. const typename ParamGenerator<T4>::iterator begin4_;
  14524. const typename ParamGenerator<T4>::iterator end4_;
  14525. typename ParamGenerator<T4>::iterator current4_;
  14526. const typename ParamGenerator<T5>::iterator begin5_;
  14527. const typename ParamGenerator<T5>::iterator end5_;
  14528. typename ParamGenerator<T5>::iterator current5_;
  14529. const typename ParamGenerator<T6>::iterator begin6_;
  14530. const typename ParamGenerator<T6>::iterator end6_;
  14531. typename ParamGenerator<T6>::iterator current6_;
  14532. const typename ParamGenerator<T7>::iterator begin7_;
  14533. const typename ParamGenerator<T7>::iterator end7_;
  14534. typename ParamGenerator<T7>::iterator current7_;
  14535. const typename ParamGenerator<T8>::iterator begin8_;
  14536. const typename ParamGenerator<T8>::iterator end8_;
  14537. typename ParamGenerator<T8>::iterator current8_;
  14538. ParamType current_value_;
  14539. }; // class CartesianProductGenerator8::Iterator
  14540. // No implementation - assignment is unsupported.
  14541. void operator=(const CartesianProductGenerator8& other);
  14542. const ParamGenerator<T1> g1_;
  14543. const ParamGenerator<T2> g2_;
  14544. const ParamGenerator<T3> g3_;
  14545. const ParamGenerator<T4> g4_;
  14546. const ParamGenerator<T5> g5_;
  14547. const ParamGenerator<T6> g6_;
  14548. const ParamGenerator<T7> g7_;
  14549. const ParamGenerator<T8> g8_;
  14550. }; // class CartesianProductGenerator8
  14551. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14552. typename T6, typename T7, typename T8, typename T9>
  14553. class CartesianProductGenerator9
  14554. : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
  14555. T7, T8, T9> > {
  14556. public:
  14557. typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
  14558. CartesianProductGenerator9(const ParamGenerator<T1>& g1,
  14559. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  14560. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  14561. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
  14562. const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
  14563. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  14564. g9_(g9) {}
  14565. virtual ~CartesianProductGenerator9() {}
  14566. virtual ParamIteratorInterface<ParamType>* Begin() const {
  14567. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  14568. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  14569. g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
  14570. }
  14571. virtual ParamIteratorInterface<ParamType>* End() const {
  14572. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  14573. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
  14574. g8_.end(), g9_, g9_.end());
  14575. }
  14576. private:
  14577. class Iterator : public ParamIteratorInterface<ParamType> {
  14578. public:
  14579. Iterator(const ParamGeneratorInterface<ParamType>* base,
  14580. const ParamGenerator<T1>& g1,
  14581. const typename ParamGenerator<T1>::iterator& current1,
  14582. const ParamGenerator<T2>& g2,
  14583. const typename ParamGenerator<T2>::iterator& current2,
  14584. const ParamGenerator<T3>& g3,
  14585. const typename ParamGenerator<T3>::iterator& current3,
  14586. const ParamGenerator<T4>& g4,
  14587. const typename ParamGenerator<T4>::iterator& current4,
  14588. const ParamGenerator<T5>& g5,
  14589. const typename ParamGenerator<T5>::iterator& current5,
  14590. const ParamGenerator<T6>& g6,
  14591. const typename ParamGenerator<T6>::iterator& current6,
  14592. const ParamGenerator<T7>& g7,
  14593. const typename ParamGenerator<T7>::iterator& current7,
  14594. const ParamGenerator<T8>& g8,
  14595. const typename ParamGenerator<T8>::iterator& current8,
  14596. const ParamGenerator<T9>& g9,
  14597. const typename ParamGenerator<T9>::iterator& current9)
  14598. : base_(base),
  14599. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  14600. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  14601. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  14602. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  14603. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  14604. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  14605. begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
  14606. begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
  14607. begin9_(g9.begin()), end9_(g9.end()), current9_(current9) {
  14608. ComputeCurrentValue();
  14609. }
  14610. virtual ~Iterator() {}
  14611. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  14612. return base_;
  14613. }
  14614. // Advance should not be called on beyond-of-range iterators
  14615. // so no component iterators must be beyond end of range, either.
  14616. virtual void Advance() {
  14617. assert(!AtEnd());
  14618. ++current9_;
  14619. if (current9_ == end9_) {
  14620. current9_ = begin9_;
  14621. ++current8_;
  14622. }
  14623. if (current8_ == end8_) {
  14624. current8_ = begin8_;
  14625. ++current7_;
  14626. }
  14627. if (current7_ == end7_) {
  14628. current7_ = begin7_;
  14629. ++current6_;
  14630. }
  14631. if (current6_ == end6_) {
  14632. current6_ = begin6_;
  14633. ++current5_;
  14634. }
  14635. if (current5_ == end5_) {
  14636. current5_ = begin5_;
  14637. ++current4_;
  14638. }
  14639. if (current4_ == end4_) {
  14640. current4_ = begin4_;
  14641. ++current3_;
  14642. }
  14643. if (current3_ == end3_) {
  14644. current3_ = begin3_;
  14645. ++current2_;
  14646. }
  14647. if (current2_ == end2_) {
  14648. current2_ = begin2_;
  14649. ++current1_;
  14650. }
  14651. ComputeCurrentValue();
  14652. }
  14653. virtual ParamIteratorInterface<ParamType>* Clone() const {
  14654. return new Iterator(*this);
  14655. }
  14656. virtual const ParamType* Current() const { return &current_value_; }
  14657. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  14658. // Having the same base generator guarantees that the other
  14659. // iterator is of the same type and we can downcast.
  14660. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  14661. << "The program attempted to compare iterators "
  14662. << "from different generators." << std::endl;
  14663. const Iterator* typed_other =
  14664. CheckedDowncastToActualType<const Iterator>(&other);
  14665. // We must report iterators equal if they both point beyond their
  14666. // respective ranges. That can happen in a variety of fashions,
  14667. // so we have to consult AtEnd().
  14668. return (AtEnd() && typed_other->AtEnd()) ||
  14669. (
  14670. current1_ == typed_other->current1_ &&
  14671. current2_ == typed_other->current2_ &&
  14672. current3_ == typed_other->current3_ &&
  14673. current4_ == typed_other->current4_ &&
  14674. current5_ == typed_other->current5_ &&
  14675. current6_ == typed_other->current6_ &&
  14676. current7_ == typed_other->current7_ &&
  14677. current8_ == typed_other->current8_ &&
  14678. current9_ == typed_other->current9_);
  14679. }
  14680. private:
  14681. Iterator(const Iterator& other)
  14682. : base_(other.base_),
  14683. begin1_(other.begin1_),
  14684. end1_(other.end1_),
  14685. current1_(other.current1_),
  14686. begin2_(other.begin2_),
  14687. end2_(other.end2_),
  14688. current2_(other.current2_),
  14689. begin3_(other.begin3_),
  14690. end3_(other.end3_),
  14691. current3_(other.current3_),
  14692. begin4_(other.begin4_),
  14693. end4_(other.end4_),
  14694. current4_(other.current4_),
  14695. begin5_(other.begin5_),
  14696. end5_(other.end5_),
  14697. current5_(other.current5_),
  14698. begin6_(other.begin6_),
  14699. end6_(other.end6_),
  14700. current6_(other.current6_),
  14701. begin7_(other.begin7_),
  14702. end7_(other.end7_),
  14703. current7_(other.current7_),
  14704. begin8_(other.begin8_),
  14705. end8_(other.end8_),
  14706. current8_(other.current8_),
  14707. begin9_(other.begin9_),
  14708. end9_(other.end9_),
  14709. current9_(other.current9_) {
  14710. ComputeCurrentValue();
  14711. }
  14712. void ComputeCurrentValue() {
  14713. if (!AtEnd())
  14714. current_value_ = ParamType(*current1_, *current2_, *current3_,
  14715. *current4_, *current5_, *current6_, *current7_, *current8_,
  14716. *current9_);
  14717. }
  14718. bool AtEnd() const {
  14719. // We must report iterator past the end of the range when either of the
  14720. // component iterators has reached the end of its range.
  14721. return
  14722. current1_ == end1_ ||
  14723. current2_ == end2_ ||
  14724. current3_ == end3_ ||
  14725. current4_ == end4_ ||
  14726. current5_ == end5_ ||
  14727. current6_ == end6_ ||
  14728. current7_ == end7_ ||
  14729. current8_ == end8_ ||
  14730. current9_ == end9_;
  14731. }
  14732. // No implementation - assignment is unsupported.
  14733. void operator=(const Iterator& other);
  14734. const ParamGeneratorInterface<ParamType>* const base_;
  14735. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  14736. // current[i]_ is the actual traversing iterator.
  14737. const typename ParamGenerator<T1>::iterator begin1_;
  14738. const typename ParamGenerator<T1>::iterator end1_;
  14739. typename ParamGenerator<T1>::iterator current1_;
  14740. const typename ParamGenerator<T2>::iterator begin2_;
  14741. const typename ParamGenerator<T2>::iterator end2_;
  14742. typename ParamGenerator<T2>::iterator current2_;
  14743. const typename ParamGenerator<T3>::iterator begin3_;
  14744. const typename ParamGenerator<T3>::iterator end3_;
  14745. typename ParamGenerator<T3>::iterator current3_;
  14746. const typename ParamGenerator<T4>::iterator begin4_;
  14747. const typename ParamGenerator<T4>::iterator end4_;
  14748. typename ParamGenerator<T4>::iterator current4_;
  14749. const typename ParamGenerator<T5>::iterator begin5_;
  14750. const typename ParamGenerator<T5>::iterator end5_;
  14751. typename ParamGenerator<T5>::iterator current5_;
  14752. const typename ParamGenerator<T6>::iterator begin6_;
  14753. const typename ParamGenerator<T6>::iterator end6_;
  14754. typename ParamGenerator<T6>::iterator current6_;
  14755. const typename ParamGenerator<T7>::iterator begin7_;
  14756. const typename ParamGenerator<T7>::iterator end7_;
  14757. typename ParamGenerator<T7>::iterator current7_;
  14758. const typename ParamGenerator<T8>::iterator begin8_;
  14759. const typename ParamGenerator<T8>::iterator end8_;
  14760. typename ParamGenerator<T8>::iterator current8_;
  14761. const typename ParamGenerator<T9>::iterator begin9_;
  14762. const typename ParamGenerator<T9>::iterator end9_;
  14763. typename ParamGenerator<T9>::iterator current9_;
  14764. ParamType current_value_;
  14765. }; // class CartesianProductGenerator9::Iterator
  14766. // No implementation - assignment is unsupported.
  14767. void operator=(const CartesianProductGenerator9& other);
  14768. const ParamGenerator<T1> g1_;
  14769. const ParamGenerator<T2> g2_;
  14770. const ParamGenerator<T3> g3_;
  14771. const ParamGenerator<T4> g4_;
  14772. const ParamGenerator<T5> g5_;
  14773. const ParamGenerator<T6> g6_;
  14774. const ParamGenerator<T7> g7_;
  14775. const ParamGenerator<T8> g8_;
  14776. const ParamGenerator<T9> g9_;
  14777. }; // class CartesianProductGenerator9
  14778. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14779. typename T6, typename T7, typename T8, typename T9, typename T10>
  14780. class CartesianProductGenerator10
  14781. : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
  14782. T7, T8, T9, T10> > {
  14783. public:
  14784. typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
  14785. CartesianProductGenerator10(const ParamGenerator<T1>& g1,
  14786. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  14787. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  14788. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
  14789. const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
  14790. const ParamGenerator<T10>& g10)
  14791. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  14792. g9_(g9), g10_(g10) {}
  14793. virtual ~CartesianProductGenerator10() {}
  14794. virtual ParamIteratorInterface<ParamType>* Begin() const {
  14795. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  14796. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  14797. g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
  14798. }
  14799. virtual ParamIteratorInterface<ParamType>* End() const {
  14800. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  14801. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
  14802. g8_.end(), g9_, g9_.end(), g10_, g10_.end());
  14803. }
  14804. private:
  14805. class Iterator : public ParamIteratorInterface<ParamType> {
  14806. public:
  14807. Iterator(const ParamGeneratorInterface<ParamType>* base,
  14808. const ParamGenerator<T1>& g1,
  14809. const typename ParamGenerator<T1>::iterator& current1,
  14810. const ParamGenerator<T2>& g2,
  14811. const typename ParamGenerator<T2>::iterator& current2,
  14812. const ParamGenerator<T3>& g3,
  14813. const typename ParamGenerator<T3>::iterator& current3,
  14814. const ParamGenerator<T4>& g4,
  14815. const typename ParamGenerator<T4>::iterator& current4,
  14816. const ParamGenerator<T5>& g5,
  14817. const typename ParamGenerator<T5>::iterator& current5,
  14818. const ParamGenerator<T6>& g6,
  14819. const typename ParamGenerator<T6>::iterator& current6,
  14820. const ParamGenerator<T7>& g7,
  14821. const typename ParamGenerator<T7>::iterator& current7,
  14822. const ParamGenerator<T8>& g8,
  14823. const typename ParamGenerator<T8>::iterator& current8,
  14824. const ParamGenerator<T9>& g9,
  14825. const typename ParamGenerator<T9>::iterator& current9,
  14826. const ParamGenerator<T10>& g10,
  14827. const typename ParamGenerator<T10>::iterator& current10)
  14828. : base_(base),
  14829. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  14830. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  14831. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  14832. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  14833. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  14834. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  14835. begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
  14836. begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
  14837. begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
  14838. begin10_(g10.begin()), end10_(g10.end()), current10_(current10) {
  14839. ComputeCurrentValue();
  14840. }
  14841. virtual ~Iterator() {}
  14842. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  14843. return base_;
  14844. }
  14845. // Advance should not be called on beyond-of-range iterators
  14846. // so no component iterators must be beyond end of range, either.
  14847. virtual void Advance() {
  14848. assert(!AtEnd());
  14849. ++current10_;
  14850. if (current10_ == end10_) {
  14851. current10_ = begin10_;
  14852. ++current9_;
  14853. }
  14854. if (current9_ == end9_) {
  14855. current9_ = begin9_;
  14856. ++current8_;
  14857. }
  14858. if (current8_ == end8_) {
  14859. current8_ = begin8_;
  14860. ++current7_;
  14861. }
  14862. if (current7_ == end7_) {
  14863. current7_ = begin7_;
  14864. ++current6_;
  14865. }
  14866. if (current6_ == end6_) {
  14867. current6_ = begin6_;
  14868. ++current5_;
  14869. }
  14870. if (current5_ == end5_) {
  14871. current5_ = begin5_;
  14872. ++current4_;
  14873. }
  14874. if (current4_ == end4_) {
  14875. current4_ = begin4_;
  14876. ++current3_;
  14877. }
  14878. if (current3_ == end3_) {
  14879. current3_ = begin3_;
  14880. ++current2_;
  14881. }
  14882. if (current2_ == end2_) {
  14883. current2_ = begin2_;
  14884. ++current1_;
  14885. }
  14886. ComputeCurrentValue();
  14887. }
  14888. virtual ParamIteratorInterface<ParamType>* Clone() const {
  14889. return new Iterator(*this);
  14890. }
  14891. virtual const ParamType* Current() const { return &current_value_; }
  14892. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  14893. // Having the same base generator guarantees that the other
  14894. // iterator is of the same type and we can downcast.
  14895. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  14896. << "The program attempted to compare iterators "
  14897. << "from different generators." << std::endl;
  14898. const Iterator* typed_other =
  14899. CheckedDowncastToActualType<const Iterator>(&other);
  14900. // We must report iterators equal if they both point beyond their
  14901. // respective ranges. That can happen in a variety of fashions,
  14902. // so we have to consult AtEnd().
  14903. return (AtEnd() && typed_other->AtEnd()) ||
  14904. (
  14905. current1_ == typed_other->current1_ &&
  14906. current2_ == typed_other->current2_ &&
  14907. current3_ == typed_other->current3_ &&
  14908. current4_ == typed_other->current4_ &&
  14909. current5_ == typed_other->current5_ &&
  14910. current6_ == typed_other->current6_ &&
  14911. current7_ == typed_other->current7_ &&
  14912. current8_ == typed_other->current8_ &&
  14913. current9_ == typed_other->current9_ &&
  14914. current10_ == typed_other->current10_);
  14915. }
  14916. private:
  14917. Iterator(const Iterator& other)
  14918. : base_(other.base_),
  14919. begin1_(other.begin1_),
  14920. end1_(other.end1_),
  14921. current1_(other.current1_),
  14922. begin2_(other.begin2_),
  14923. end2_(other.end2_),
  14924. current2_(other.current2_),
  14925. begin3_(other.begin3_),
  14926. end3_(other.end3_),
  14927. current3_(other.current3_),
  14928. begin4_(other.begin4_),
  14929. end4_(other.end4_),
  14930. current4_(other.current4_),
  14931. begin5_(other.begin5_),
  14932. end5_(other.end5_),
  14933. current5_(other.current5_),
  14934. begin6_(other.begin6_),
  14935. end6_(other.end6_),
  14936. current6_(other.current6_),
  14937. begin7_(other.begin7_),
  14938. end7_(other.end7_),
  14939. current7_(other.current7_),
  14940. begin8_(other.begin8_),
  14941. end8_(other.end8_),
  14942. current8_(other.current8_),
  14943. begin9_(other.begin9_),
  14944. end9_(other.end9_),
  14945. current9_(other.current9_),
  14946. begin10_(other.begin10_),
  14947. end10_(other.end10_),
  14948. current10_(other.current10_) {
  14949. ComputeCurrentValue();
  14950. }
  14951. void ComputeCurrentValue() {
  14952. if (!AtEnd())
  14953. current_value_ = ParamType(*current1_, *current2_, *current3_,
  14954. *current4_, *current5_, *current6_, *current7_, *current8_,
  14955. *current9_, *current10_);
  14956. }
  14957. bool AtEnd() const {
  14958. // We must report iterator past the end of the range when either of the
  14959. // component iterators has reached the end of its range.
  14960. return
  14961. current1_ == end1_ ||
  14962. current2_ == end2_ ||
  14963. current3_ == end3_ ||
  14964. current4_ == end4_ ||
  14965. current5_ == end5_ ||
  14966. current6_ == end6_ ||
  14967. current7_ == end7_ ||
  14968. current8_ == end8_ ||
  14969. current9_ == end9_ ||
  14970. current10_ == end10_;
  14971. }
  14972. // No implementation - assignment is unsupported.
  14973. void operator=(const Iterator& other);
  14974. const ParamGeneratorInterface<ParamType>* const base_;
  14975. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  14976. // current[i]_ is the actual traversing iterator.
  14977. const typename ParamGenerator<T1>::iterator begin1_;
  14978. const typename ParamGenerator<T1>::iterator end1_;
  14979. typename ParamGenerator<T1>::iterator current1_;
  14980. const typename ParamGenerator<T2>::iterator begin2_;
  14981. const typename ParamGenerator<T2>::iterator end2_;
  14982. typename ParamGenerator<T2>::iterator current2_;
  14983. const typename ParamGenerator<T3>::iterator begin3_;
  14984. const typename ParamGenerator<T3>::iterator end3_;
  14985. typename ParamGenerator<T3>::iterator current3_;
  14986. const typename ParamGenerator<T4>::iterator begin4_;
  14987. const typename ParamGenerator<T4>::iterator end4_;
  14988. typename ParamGenerator<T4>::iterator current4_;
  14989. const typename ParamGenerator<T5>::iterator begin5_;
  14990. const typename ParamGenerator<T5>::iterator end5_;
  14991. typename ParamGenerator<T5>::iterator current5_;
  14992. const typename ParamGenerator<T6>::iterator begin6_;
  14993. const typename ParamGenerator<T6>::iterator end6_;
  14994. typename ParamGenerator<T6>::iterator current6_;
  14995. const typename ParamGenerator<T7>::iterator begin7_;
  14996. const typename ParamGenerator<T7>::iterator end7_;
  14997. typename ParamGenerator<T7>::iterator current7_;
  14998. const typename ParamGenerator<T8>::iterator begin8_;
  14999. const typename ParamGenerator<T8>::iterator end8_;
  15000. typename ParamGenerator<T8>::iterator current8_;
  15001. const typename ParamGenerator<T9>::iterator begin9_;
  15002. const typename ParamGenerator<T9>::iterator end9_;
  15003. typename ParamGenerator<T9>::iterator current9_;
  15004. const typename ParamGenerator<T10>::iterator begin10_;
  15005. const typename ParamGenerator<T10>::iterator end10_;
  15006. typename ParamGenerator<T10>::iterator current10_;
  15007. ParamType current_value_;
  15008. }; // class CartesianProductGenerator10::Iterator
  15009. // No implementation - assignment is unsupported.
  15010. void operator=(const CartesianProductGenerator10& other);
  15011. const ParamGenerator<T1> g1_;
  15012. const ParamGenerator<T2> g2_;
  15013. const ParamGenerator<T3> g3_;
  15014. const ParamGenerator<T4> g4_;
  15015. const ParamGenerator<T5> g5_;
  15016. const ParamGenerator<T6> g6_;
  15017. const ParamGenerator<T7> g7_;
  15018. const ParamGenerator<T8> g8_;
  15019. const ParamGenerator<T9> g9_;
  15020. const ParamGenerator<T10> g10_;
  15021. }; // class CartesianProductGenerator10
  15022. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  15023. //
  15024. // Helper classes providing Combine() with polymorphic features. They allow
  15025. // casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
  15026. // convertible to U.
  15027. //
  15028. template <class Generator1, class Generator2>
  15029. class CartesianProductHolder2 {
  15030. public:
  15031. CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
  15032. : g1_(g1), g2_(g2) {}
  15033. template <typename T1, typename T2>
  15034. operator ParamGenerator< ::testing::tuple<T1, T2> >() const {
  15035. return ParamGenerator< ::testing::tuple<T1, T2> >(
  15036. new CartesianProductGenerator2<T1, T2>(
  15037. static_cast<ParamGenerator<T1> >(g1_),
  15038. static_cast<ParamGenerator<T2> >(g2_)));
  15039. }
  15040. private:
  15041. // No implementation - assignment is unsupported.
  15042. void operator=(const CartesianProductHolder2& other);
  15043. const Generator1 g1_;
  15044. const Generator2 g2_;
  15045. }; // class CartesianProductHolder2
  15046. template <class Generator1, class Generator2, class Generator3>
  15047. class CartesianProductHolder3 {
  15048. public:
  15049. CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
  15050. const Generator3& g3)
  15051. : g1_(g1), g2_(g2), g3_(g3) {}
  15052. template <typename T1, typename T2, typename T3>
  15053. operator ParamGenerator< ::testing::tuple<T1, T2, T3> >() const {
  15054. return ParamGenerator< ::testing::tuple<T1, T2, T3> >(
  15055. new CartesianProductGenerator3<T1, T2, T3>(
  15056. static_cast<ParamGenerator<T1> >(g1_),
  15057. static_cast<ParamGenerator<T2> >(g2_),
  15058. static_cast<ParamGenerator<T3> >(g3_)));
  15059. }
  15060. private:
  15061. // No implementation - assignment is unsupported.
  15062. void operator=(const CartesianProductHolder3& other);
  15063. const Generator1 g1_;
  15064. const Generator2 g2_;
  15065. const Generator3 g3_;
  15066. }; // class CartesianProductHolder3
  15067. template <class Generator1, class Generator2, class Generator3,
  15068. class Generator4>
  15069. class CartesianProductHolder4 {
  15070. public:
  15071. CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
  15072. const Generator3& g3, const Generator4& g4)
  15073. : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
  15074. template <typename T1, typename T2, typename T3, typename T4>
  15075. operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4> >() const {
  15076. return ParamGenerator< ::testing::tuple<T1, T2, T3, T4> >(
  15077. new CartesianProductGenerator4<T1, T2, T3, T4>(
  15078. static_cast<ParamGenerator<T1> >(g1_),
  15079. static_cast<ParamGenerator<T2> >(g2_),
  15080. static_cast<ParamGenerator<T3> >(g3_),
  15081. static_cast<ParamGenerator<T4> >(g4_)));
  15082. }
  15083. private:
  15084. // No implementation - assignment is unsupported.
  15085. void operator=(const CartesianProductHolder4& other);
  15086. const Generator1 g1_;
  15087. const Generator2 g2_;
  15088. const Generator3 g3_;
  15089. const Generator4 g4_;
  15090. }; // class CartesianProductHolder4
  15091. template <class Generator1, class Generator2, class Generator3,
  15092. class Generator4, class Generator5>
  15093. class CartesianProductHolder5 {
  15094. public:
  15095. CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
  15096. const Generator3& g3, const Generator4& g4, const Generator5& g5)
  15097. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
  15098. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  15099. operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5> >() const {
  15100. return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5> >(
  15101. new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
  15102. static_cast<ParamGenerator<T1> >(g1_),
  15103. static_cast<ParamGenerator<T2> >(g2_),
  15104. static_cast<ParamGenerator<T3> >(g3_),
  15105. static_cast<ParamGenerator<T4> >(g4_),
  15106. static_cast<ParamGenerator<T5> >(g5_)));
  15107. }
  15108. private:
  15109. // No implementation - assignment is unsupported.
  15110. void operator=(const CartesianProductHolder5& other);
  15111. const Generator1 g1_;
  15112. const Generator2 g2_;
  15113. const Generator3 g3_;
  15114. const Generator4 g4_;
  15115. const Generator5 g5_;
  15116. }; // class CartesianProductHolder5
  15117. template <class Generator1, class Generator2, class Generator3,
  15118. class Generator4, class Generator5, class Generator6>
  15119. class CartesianProductHolder6 {
  15120. public:
  15121. CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
  15122. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  15123. const Generator6& g6)
  15124. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
  15125. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15126. typename T6>
  15127. operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6> >() const {
  15128. return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6> >(
  15129. new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
  15130. static_cast<ParamGenerator<T1> >(g1_),
  15131. static_cast<ParamGenerator<T2> >(g2_),
  15132. static_cast<ParamGenerator<T3> >(g3_),
  15133. static_cast<ParamGenerator<T4> >(g4_),
  15134. static_cast<ParamGenerator<T5> >(g5_),
  15135. static_cast<ParamGenerator<T6> >(g6_)));
  15136. }
  15137. private:
  15138. // No implementation - assignment is unsupported.
  15139. void operator=(const CartesianProductHolder6& other);
  15140. const Generator1 g1_;
  15141. const Generator2 g2_;
  15142. const Generator3 g3_;
  15143. const Generator4 g4_;
  15144. const Generator5 g5_;
  15145. const Generator6 g6_;
  15146. }; // class CartesianProductHolder6
  15147. template <class Generator1, class Generator2, class Generator3,
  15148. class Generator4, class Generator5, class Generator6, class Generator7>
  15149. class CartesianProductHolder7 {
  15150. public:
  15151. CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
  15152. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  15153. const Generator6& g6, const Generator7& g7)
  15154. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
  15155. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15156. typename T6, typename T7>
  15157. operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6,
  15158. T7> >() const {
  15159. return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7> >(
  15160. new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
  15161. static_cast<ParamGenerator<T1> >(g1_),
  15162. static_cast<ParamGenerator<T2> >(g2_),
  15163. static_cast<ParamGenerator<T3> >(g3_),
  15164. static_cast<ParamGenerator<T4> >(g4_),
  15165. static_cast<ParamGenerator<T5> >(g5_),
  15166. static_cast<ParamGenerator<T6> >(g6_),
  15167. static_cast<ParamGenerator<T7> >(g7_)));
  15168. }
  15169. private:
  15170. // No implementation - assignment is unsupported.
  15171. void operator=(const CartesianProductHolder7& other);
  15172. const Generator1 g1_;
  15173. const Generator2 g2_;
  15174. const Generator3 g3_;
  15175. const Generator4 g4_;
  15176. const Generator5 g5_;
  15177. const Generator6 g6_;
  15178. const Generator7 g7_;
  15179. }; // class CartesianProductHolder7
  15180. template <class Generator1, class Generator2, class Generator3,
  15181. class Generator4, class Generator5, class Generator6, class Generator7,
  15182. class Generator8>
  15183. class CartesianProductHolder8 {
  15184. public:
  15185. CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
  15186. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  15187. const Generator6& g6, const Generator7& g7, const Generator8& g8)
  15188. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
  15189. g8_(g8) {}
  15190. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15191. typename T6, typename T7, typename T8>
  15192. operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7,
  15193. T8> >() const {
  15194. return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
  15195. new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
  15196. static_cast<ParamGenerator<T1> >(g1_),
  15197. static_cast<ParamGenerator<T2> >(g2_),
  15198. static_cast<ParamGenerator<T3> >(g3_),
  15199. static_cast<ParamGenerator<T4> >(g4_),
  15200. static_cast<ParamGenerator<T5> >(g5_),
  15201. static_cast<ParamGenerator<T6> >(g6_),
  15202. static_cast<ParamGenerator<T7> >(g7_),
  15203. static_cast<ParamGenerator<T8> >(g8_)));
  15204. }
  15205. private:
  15206. // No implementation - assignment is unsupported.
  15207. void operator=(const CartesianProductHolder8& other);
  15208. const Generator1 g1_;
  15209. const Generator2 g2_;
  15210. const Generator3 g3_;
  15211. const Generator4 g4_;
  15212. const Generator5 g5_;
  15213. const Generator6 g6_;
  15214. const Generator7 g7_;
  15215. const Generator8 g8_;
  15216. }; // class CartesianProductHolder8
  15217. template <class Generator1, class Generator2, class Generator3,
  15218. class Generator4, class Generator5, class Generator6, class Generator7,
  15219. class Generator8, class Generator9>
  15220. class CartesianProductHolder9 {
  15221. public:
  15222. CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
  15223. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  15224. const Generator6& g6, const Generator7& g7, const Generator8& g8,
  15225. const Generator9& g9)
  15226. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  15227. g9_(g9) {}
  15228. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15229. typename T6, typename T7, typename T8, typename T9>
  15230. operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
  15231. T9> >() const {
  15232. return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
  15233. T9> >(
  15234. new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
  15235. static_cast<ParamGenerator<T1> >(g1_),
  15236. static_cast<ParamGenerator<T2> >(g2_),
  15237. static_cast<ParamGenerator<T3> >(g3_),
  15238. static_cast<ParamGenerator<T4> >(g4_),
  15239. static_cast<ParamGenerator<T5> >(g5_),
  15240. static_cast<ParamGenerator<T6> >(g6_),
  15241. static_cast<ParamGenerator<T7> >(g7_),
  15242. static_cast<ParamGenerator<T8> >(g8_),
  15243. static_cast<ParamGenerator<T9> >(g9_)));
  15244. }
  15245. private:
  15246. // No implementation - assignment is unsupported.
  15247. void operator=(const CartesianProductHolder9& other);
  15248. const Generator1 g1_;
  15249. const Generator2 g2_;
  15250. const Generator3 g3_;
  15251. const Generator4 g4_;
  15252. const Generator5 g5_;
  15253. const Generator6 g6_;
  15254. const Generator7 g7_;
  15255. const Generator8 g8_;
  15256. const Generator9 g9_;
  15257. }; // class CartesianProductHolder9
  15258. template <class Generator1, class Generator2, class Generator3,
  15259. class Generator4, class Generator5, class Generator6, class Generator7,
  15260. class Generator8, class Generator9, class Generator10>
  15261. class CartesianProductHolder10 {
  15262. public:
  15263. CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
  15264. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  15265. const Generator6& g6, const Generator7& g7, const Generator8& g8,
  15266. const Generator9& g9, const Generator10& g10)
  15267. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  15268. g9_(g9), g10_(g10) {}
  15269. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15270. typename T6, typename T7, typename T8, typename T9, typename T10>
  15271. operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9,
  15272. T10> >() const {
  15273. return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9,
  15274. T10> >(
  15275. new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
  15276. T10>(
  15277. static_cast<ParamGenerator<T1> >(g1_),
  15278. static_cast<ParamGenerator<T2> >(g2_),
  15279. static_cast<ParamGenerator<T3> >(g3_),
  15280. static_cast<ParamGenerator<T4> >(g4_),
  15281. static_cast<ParamGenerator<T5> >(g5_),
  15282. static_cast<ParamGenerator<T6> >(g6_),
  15283. static_cast<ParamGenerator<T7> >(g7_),
  15284. static_cast<ParamGenerator<T8> >(g8_),
  15285. static_cast<ParamGenerator<T9> >(g9_),
  15286. static_cast<ParamGenerator<T10> >(g10_)));
  15287. }
  15288. private:
  15289. // No implementation - assignment is unsupported.
  15290. void operator=(const CartesianProductHolder10& other);
  15291. const Generator1 g1_;
  15292. const Generator2 g2_;
  15293. const Generator3 g3_;
  15294. const Generator4 g4_;
  15295. const Generator5 g5_;
  15296. const Generator6 g6_;
  15297. const Generator7 g7_;
  15298. const Generator8 g8_;
  15299. const Generator9 g9_;
  15300. const Generator10 g10_;
  15301. }; // class CartesianProductHolder10
  15302. # endif // GTEST_HAS_COMBINE
  15303. } // namespace internal
  15304. } // namespace testing
  15305. #endif // GTEST_HAS_PARAM_TEST
  15306. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
  15307. #if GTEST_HAS_PARAM_TEST
  15308. namespace testing {
  15309. // Functions producing parameter generators.
  15310. //
  15311. // Google Test uses these generators to produce parameters for value-
  15312. // parameterized tests. When a parameterized test case is instantiated
  15313. // with a particular generator, Google Test creates and runs tests
  15314. // for each element in the sequence produced by the generator.
  15315. //
  15316. // In the following sample, tests from test case FooTest are instantiated
  15317. // each three times with parameter values 3, 5, and 8:
  15318. //
  15319. // class FooTest : public TestWithParam<int> { ... };
  15320. //
  15321. // TEST_P(FooTest, TestThis) {
  15322. // }
  15323. // TEST_P(FooTest, TestThat) {
  15324. // }
  15325. // INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
  15326. //
  15327. // Range() returns generators providing sequences of values in a range.
  15328. //
  15329. // Synopsis:
  15330. // Range(start, end)
  15331. // - returns a generator producing a sequence of values {start, start+1,
  15332. // start+2, ..., }.
  15333. // Range(start, end, step)
  15334. // - returns a generator producing a sequence of values {start, start+step,
  15335. // start+step+step, ..., }.
  15336. // Notes:
  15337. // * The generated sequences never include end. For example, Range(1, 5)
  15338. // returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
  15339. // returns a generator producing {1, 3, 5, 7}.
  15340. // * start and end must have the same type. That type may be any integral or
  15341. // floating-point type or a user defined type satisfying these conditions:
  15342. // * It must be assignable (have operator=() defined).
  15343. // * It must have operator+() (operator+(int-compatible type) for
  15344. // two-operand version).
  15345. // * It must have operator<() defined.
  15346. // Elements in the resulting sequences will also have that type.
  15347. // * Condition start < end must be satisfied in order for resulting sequences
  15348. // to contain any elements.
  15349. //
  15350. template <typename T, typename IncrementT>
  15351. internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
  15352. return internal::ParamGenerator<T>(
  15353. new internal::RangeGenerator<T, IncrementT>(start, end, step));
  15354. }
  15355. template <typename T>
  15356. internal::ParamGenerator<T> Range(T start, T end) {
  15357. return Range(start, end, 1);
  15358. }
  15359. // ValuesIn() function allows generation of tests with parameters coming from
  15360. // a container.
  15361. //
  15362. // Synopsis:
  15363. // ValuesIn(const T (&array)[N])
  15364. // - returns a generator producing sequences with elements from
  15365. // a C-style array.
  15366. // ValuesIn(const Container& container)
  15367. // - returns a generator producing sequences with elements from
  15368. // an STL-style container.
  15369. // ValuesIn(Iterator begin, Iterator end)
  15370. // - returns a generator producing sequences with elements from
  15371. // a range [begin, end) defined by a pair of STL-style iterators. These
  15372. // iterators can also be plain C pointers.
  15373. //
  15374. // Please note that ValuesIn copies the values from the containers
  15375. // passed in and keeps them to generate tests in RUN_ALL_TESTS().
  15376. //
  15377. // Examples:
  15378. //
  15379. // This instantiates tests from test case StringTest
  15380. // each with C-string values of "foo", "bar", and "baz":
  15381. //
  15382. // const char* strings[] = {"foo", "bar", "baz"};
  15383. // INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
  15384. //
  15385. // This instantiates tests from test case StlStringTest
  15386. // each with STL strings with values "a" and "b":
  15387. //
  15388. // ::std::vector< ::std::string> GetParameterStrings() {
  15389. // ::std::vector< ::std::string> v;
  15390. // v.push_back("a");
  15391. // v.push_back("b");
  15392. // return v;
  15393. // }
  15394. //
  15395. // INSTANTIATE_TEST_CASE_P(CharSequence,
  15396. // StlStringTest,
  15397. // ValuesIn(GetParameterStrings()));
  15398. //
  15399. //
  15400. // This will also instantiate tests from CharTest
  15401. // each with parameter values 'a' and 'b':
  15402. //
  15403. // ::std::list<char> GetParameterChars() {
  15404. // ::std::list<char> list;
  15405. // list.push_back('a');
  15406. // list.push_back('b');
  15407. // return list;
  15408. // }
  15409. // ::std::list<char> l = GetParameterChars();
  15410. // INSTANTIATE_TEST_CASE_P(CharSequence2,
  15411. // CharTest,
  15412. // ValuesIn(l.begin(), l.end()));
  15413. //
  15414. template <typename ForwardIterator>
  15415. internal::ParamGenerator<
  15416. typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
  15417. ValuesIn(ForwardIterator begin, ForwardIterator end) {
  15418. typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
  15419. ::value_type ParamType;
  15420. return internal::ParamGenerator<ParamType>(
  15421. new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
  15422. }
  15423. template <typename T, size_t N>
  15424. internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
  15425. return ValuesIn(array, array + N);
  15426. }
  15427. template <class Container>
  15428. internal::ParamGenerator<typename Container::value_type> ValuesIn(
  15429. const Container& container) {
  15430. return ValuesIn(container.begin(), container.end());
  15431. }
  15432. // Values() allows generating tests from explicitly specified list of
  15433. // parameters.
  15434. //
  15435. // Synopsis:
  15436. // Values(T v1, T v2, ..., T vN)
  15437. // - returns a generator producing sequences with elements v1, v2, ..., vN.
  15438. //
  15439. // For example, this instantiates tests from test case BarTest each
  15440. // with values "one", "two", and "three":
  15441. //
  15442. // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
  15443. //
  15444. // This instantiates tests from test case BazTest each with values 1, 2, 3.5.
  15445. // The exact type of values will depend on the type of parameter in BazTest.
  15446. //
  15447. // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
  15448. //
  15449. // Currently, Values() supports from 1 to 50 parameters.
  15450. //
  15451. template <typename T1>
  15452. internal::ValueArray1<T1> Values(T1 v1) {
  15453. return internal::ValueArray1<T1>(v1);
  15454. }
  15455. template <typename T1, typename T2>
  15456. internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
  15457. return internal::ValueArray2<T1, T2>(v1, v2);
  15458. }
  15459. template <typename T1, typename T2, typename T3>
  15460. internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
  15461. return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
  15462. }
  15463. template <typename T1, typename T2, typename T3, typename T4>
  15464. internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
  15465. return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
  15466. }
  15467. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  15468. internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  15469. T5 v5) {
  15470. return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
  15471. }
  15472. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15473. typename T6>
  15474. internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
  15475. T4 v4, T5 v5, T6 v6) {
  15476. return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
  15477. }
  15478. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15479. typename T6, typename T7>
  15480. internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
  15481. T4 v4, T5 v5, T6 v6, T7 v7) {
  15482. return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
  15483. v6, v7);
  15484. }
  15485. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15486. typename T6, typename T7, typename T8>
  15487. internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
  15488. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
  15489. return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
  15490. v5, v6, v7, v8);
  15491. }
  15492. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15493. typename T6, typename T7, typename T8, typename T9>
  15494. internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
  15495. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
  15496. return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
  15497. v4, v5, v6, v7, v8, v9);
  15498. }
  15499. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15500. typename T6, typename T7, typename T8, typename T9, typename T10>
  15501. internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
  15502. T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
  15503. return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
  15504. v2, v3, v4, v5, v6, v7, v8, v9, v10);
  15505. }
  15506. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15507. typename T6, typename T7, typename T8, typename T9, typename T10,
  15508. typename T11>
  15509. internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
  15510. T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  15511. T10 v10, T11 v11) {
  15512. return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
  15513. T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
  15514. }
  15515. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15516. typename T6, typename T7, typename T8, typename T9, typename T10,
  15517. typename T11, typename T12>
  15518. internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15519. T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  15520. T10 v10, T11 v11, T12 v12) {
  15521. return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15522. T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
  15523. }
  15524. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15525. typename T6, typename T7, typename T8, typename T9, typename T10,
  15526. typename T11, typename T12, typename T13>
  15527. internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  15528. T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  15529. T10 v10, T11 v11, T12 v12, T13 v13) {
  15530. return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15531. T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
  15532. }
  15533. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15534. typename T6, typename T7, typename T8, typename T9, typename T10,
  15535. typename T11, typename T12, typename T13, typename T14>
  15536. internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15537. T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  15538. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
  15539. return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15540. T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
  15541. v14);
  15542. }
  15543. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15544. typename T6, typename T7, typename T8, typename T9, typename T10,
  15545. typename T11, typename T12, typename T13, typename T14, typename T15>
  15546. internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15547. T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  15548. T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
  15549. return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15550. T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
  15551. v13, v14, v15);
  15552. }
  15553. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15554. typename T6, typename T7, typename T8, typename T9, typename T10,
  15555. typename T11, typename T12, typename T13, typename T14, typename T15,
  15556. typename T16>
  15557. internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15558. T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  15559. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  15560. T16 v16) {
  15561. return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15562. T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
  15563. v12, v13, v14, v15, v16);
  15564. }
  15565. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15566. typename T6, typename T7, typename T8, typename T9, typename T10,
  15567. typename T11, typename T12, typename T13, typename T14, typename T15,
  15568. typename T16, typename T17>
  15569. internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15570. T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  15571. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  15572. T16 v16, T17 v17) {
  15573. return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15574. T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
  15575. v11, v12, v13, v14, v15, v16, v17);
  15576. }
  15577. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15578. typename T6, typename T7, typename T8, typename T9, typename T10,
  15579. typename T11, typename T12, typename T13, typename T14, typename T15,
  15580. typename T16, typename T17, typename T18>
  15581. internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15582. T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
  15583. T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  15584. T16 v16, T17 v17, T18 v18) {
  15585. return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15586. T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
  15587. v10, v11, v12, v13, v14, v15, v16, v17, v18);
  15588. }
  15589. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15590. typename T6, typename T7, typename T8, typename T9, typename T10,
  15591. typename T11, typename T12, typename T13, typename T14, typename T15,
  15592. typename T16, typename T17, typename T18, typename T19>
  15593. internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15594. T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
  15595. T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
  15596. T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
  15597. return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15598. T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
  15599. v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
  15600. }
  15601. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15602. typename T6, typename T7, typename T8, typename T9, typename T10,
  15603. typename T11, typename T12, typename T13, typename T14, typename T15,
  15604. typename T16, typename T17, typename T18, typename T19, typename T20>
  15605. internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15606. T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  15607. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  15608. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
  15609. return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15610. T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
  15611. v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
  15612. }
  15613. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15614. typename T6, typename T7, typename T8, typename T9, typename T10,
  15615. typename T11, typename T12, typename T13, typename T14, typename T15,
  15616. typename T16, typename T17, typename T18, typename T19, typename T20,
  15617. typename T21>
  15618. internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15619. T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  15620. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  15621. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
  15622. return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15623. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
  15624. v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
  15625. }
  15626. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15627. typename T6, typename T7, typename T8, typename T9, typename T10,
  15628. typename T11, typename T12, typename T13, typename T14, typename T15,
  15629. typename T16, typename T17, typename T18, typename T19, typename T20,
  15630. typename T21, typename T22>
  15631. internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15632. T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
  15633. T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  15634. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  15635. T21 v21, T22 v22) {
  15636. return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15637. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
  15638. v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  15639. v20, v21, v22);
  15640. }
  15641. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15642. typename T6, typename T7, typename T8, typename T9, typename T10,
  15643. typename T11, typename T12, typename T13, typename T14, typename T15,
  15644. typename T16, typename T17, typename T18, typename T19, typename T20,
  15645. typename T21, typename T22, typename T23>
  15646. internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15647. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
  15648. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  15649. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  15650. T21 v21, T22 v22, T23 v23) {
  15651. return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15652. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
  15653. v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  15654. v20, v21, v22, v23);
  15655. }
  15656. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15657. typename T6, typename T7, typename T8, typename T9, typename T10,
  15658. typename T11, typename T12, typename T13, typename T14, typename T15,
  15659. typename T16, typename T17, typename T18, typename T19, typename T20,
  15660. typename T21, typename T22, typename T23, typename T24>
  15661. internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15662. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
  15663. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  15664. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  15665. T21 v21, T22 v22, T23 v23, T24 v24) {
  15666. return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15667. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
  15668. v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
  15669. v19, v20, v21, v22, v23, v24);
  15670. }
  15671. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15672. typename T6, typename T7, typename T8, typename T9, typename T10,
  15673. typename T11, typename T12, typename T13, typename T14, typename T15,
  15674. typename T16, typename T17, typename T18, typename T19, typename T20,
  15675. typename T21, typename T22, typename T23, typename T24, typename T25>
  15676. internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15677. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
  15678. T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
  15679. T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
  15680. T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
  15681. return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15682. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
  15683. v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
  15684. v18, v19, v20, v21, v22, v23, v24, v25);
  15685. }
  15686. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15687. typename T6, typename T7, typename T8, typename T9, typename T10,
  15688. typename T11, typename T12, typename T13, typename T14, typename T15,
  15689. typename T16, typename T17, typename T18, typename T19, typename T20,
  15690. typename T21, typename T22, typename T23, typename T24, typename T25,
  15691. typename T26>
  15692. internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15693. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15694. T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  15695. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  15696. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  15697. T26 v26) {
  15698. return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15699. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15700. T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
  15701. v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
  15702. }
  15703. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15704. typename T6, typename T7, typename T8, typename T9, typename T10,
  15705. typename T11, typename T12, typename T13, typename T14, typename T15,
  15706. typename T16, typename T17, typename T18, typename T19, typename T20,
  15707. typename T21, typename T22, typename T23, typename T24, typename T25,
  15708. typename T26, typename T27>
  15709. internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15710. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  15711. T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  15712. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  15713. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  15714. T26 v26, T27 v27) {
  15715. return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15716. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15717. T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
  15718. v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
  15719. }
  15720. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15721. typename T6, typename T7, typename T8, typename T9, typename T10,
  15722. typename T11, typename T12, typename T13, typename T14, typename T15,
  15723. typename T16, typename T17, typename T18, typename T19, typename T20,
  15724. typename T21, typename T22, typename T23, typename T24, typename T25,
  15725. typename T26, typename T27, typename T28>
  15726. internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15727. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  15728. T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  15729. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  15730. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  15731. T26 v26, T27 v27, T28 v28) {
  15732. return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15733. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15734. T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
  15735. v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
  15736. v28);
  15737. }
  15738. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15739. typename T6, typename T7, typename T8, typename T9, typename T10,
  15740. typename T11, typename T12, typename T13, typename T14, typename T15,
  15741. typename T16, typename T17, typename T18, typename T19, typename T20,
  15742. typename T21, typename T22, typename T23, typename T24, typename T25,
  15743. typename T26, typename T27, typename T28, typename T29>
  15744. internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15745. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15746. T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  15747. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  15748. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  15749. T26 v26, T27 v27, T28 v28, T29 v29) {
  15750. return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15751. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15752. T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
  15753. v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
  15754. v27, v28, v29);
  15755. }
  15756. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15757. typename T6, typename T7, typename T8, typename T9, typename T10,
  15758. typename T11, typename T12, typename T13, typename T14, typename T15,
  15759. typename T16, typename T17, typename T18, typename T19, typename T20,
  15760. typename T21, typename T22, typename T23, typename T24, typename T25,
  15761. typename T26, typename T27, typename T28, typename T29, typename T30>
  15762. internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15763. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15764. T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  15765. T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
  15766. T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
  15767. T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
  15768. return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15769. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15770. T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
  15771. v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
  15772. v26, v27, v28, v29, v30);
  15773. }
  15774. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15775. typename T6, typename T7, typename T8, typename T9, typename T10,
  15776. typename T11, typename T12, typename T13, typename T14, typename T15,
  15777. typename T16, typename T17, typename T18, typename T19, typename T20,
  15778. typename T21, typename T22, typename T23, typename T24, typename T25,
  15779. typename T26, typename T27, typename T28, typename T29, typename T30,
  15780. typename T31>
  15781. internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15782. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15783. T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  15784. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  15785. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  15786. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
  15787. return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15788. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15789. T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
  15790. v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
  15791. v25, v26, v27, v28, v29, v30, v31);
  15792. }
  15793. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15794. typename T6, typename T7, typename T8, typename T9, typename T10,
  15795. typename T11, typename T12, typename T13, typename T14, typename T15,
  15796. typename T16, typename T17, typename T18, typename T19, typename T20,
  15797. typename T21, typename T22, typename T23, typename T24, typename T25,
  15798. typename T26, typename T27, typename T28, typename T29, typename T30,
  15799. typename T31, typename T32>
  15800. internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15801. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15802. T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  15803. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  15804. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  15805. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  15806. T32 v32) {
  15807. return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15808. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15809. T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
  15810. v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  15811. v24, v25, v26, v27, v28, v29, v30, v31, v32);
  15812. }
  15813. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15814. typename T6, typename T7, typename T8, typename T9, typename T10,
  15815. typename T11, typename T12, typename T13, typename T14, typename T15,
  15816. typename T16, typename T17, typename T18, typename T19, typename T20,
  15817. typename T21, typename T22, typename T23, typename T24, typename T25,
  15818. typename T26, typename T27, typename T28, typename T29, typename T30,
  15819. typename T31, typename T32, typename T33>
  15820. internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15821. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15822. T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
  15823. T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  15824. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  15825. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  15826. T32 v32, T33 v33) {
  15827. return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15828. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15829. T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
  15830. v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  15831. v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
  15832. }
  15833. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15834. typename T6, typename T7, typename T8, typename T9, typename T10,
  15835. typename T11, typename T12, typename T13, typename T14, typename T15,
  15836. typename T16, typename T17, typename T18, typename T19, typename T20,
  15837. typename T21, typename T22, typename T23, typename T24, typename T25,
  15838. typename T26, typename T27, typename T28, typename T29, typename T30,
  15839. typename T31, typename T32, typename T33, typename T34>
  15840. internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15841. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15842. T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
  15843. T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
  15844. T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
  15845. T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
  15846. T31 v31, T32 v32, T33 v33, T34 v34) {
  15847. return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15848. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15849. T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
  15850. v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
  15851. v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
  15852. }
  15853. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15854. typename T6, typename T7, typename T8, typename T9, typename T10,
  15855. typename T11, typename T12, typename T13, typename T14, typename T15,
  15856. typename T16, typename T17, typename T18, typename T19, typename T20,
  15857. typename T21, typename T22, typename T23, typename T24, typename T25,
  15858. typename T26, typename T27, typename T28, typename T29, typename T30,
  15859. typename T31, typename T32, typename T33, typename T34, typename T35>
  15860. internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15861. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15862. T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  15863. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  15864. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
  15865. T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
  15866. T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
  15867. return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15868. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15869. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
  15870. v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
  15871. v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
  15872. }
  15873. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15874. typename T6, typename T7, typename T8, typename T9, typename T10,
  15875. typename T11, typename T12, typename T13, typename T14, typename T15,
  15876. typename T16, typename T17, typename T18, typename T19, typename T20,
  15877. typename T21, typename T22, typename T23, typename T24, typename T25,
  15878. typename T26, typename T27, typename T28, typename T29, typename T30,
  15879. typename T31, typename T32, typename T33, typename T34, typename T35,
  15880. typename T36>
  15881. internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15882. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15883. T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  15884. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  15885. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
  15886. T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
  15887. T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
  15888. return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15889. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15890. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
  15891. v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  15892. v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
  15893. v34, v35, v36);
  15894. }
  15895. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15896. typename T6, typename T7, typename T8, typename T9, typename T10,
  15897. typename T11, typename T12, typename T13, typename T14, typename T15,
  15898. typename T16, typename T17, typename T18, typename T19, typename T20,
  15899. typename T21, typename T22, typename T23, typename T24, typename T25,
  15900. typename T26, typename T27, typename T28, typename T29, typename T30,
  15901. typename T31, typename T32, typename T33, typename T34, typename T35,
  15902. typename T36, typename T37>
  15903. internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15904. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15905. T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
  15906. T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  15907. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  15908. T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
  15909. T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
  15910. T37 v37) {
  15911. return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15912. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15913. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
  15914. v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  15915. v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
  15916. v34, v35, v36, v37);
  15917. }
  15918. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15919. typename T6, typename T7, typename T8, typename T9, typename T10,
  15920. typename T11, typename T12, typename T13, typename T14, typename T15,
  15921. typename T16, typename T17, typename T18, typename T19, typename T20,
  15922. typename T21, typename T22, typename T23, typename T24, typename T25,
  15923. typename T26, typename T27, typename T28, typename T29, typename T30,
  15924. typename T31, typename T32, typename T33, typename T34, typename T35,
  15925. typename T36, typename T37, typename T38>
  15926. internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15927. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15928. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
  15929. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  15930. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  15931. T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
  15932. T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
  15933. T37 v37, T38 v38) {
  15934. return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15935. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15936. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
  15937. v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
  15938. v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
  15939. v33, v34, v35, v36, v37, v38);
  15940. }
  15941. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15942. typename T6, typename T7, typename T8, typename T9, typename T10,
  15943. typename T11, typename T12, typename T13, typename T14, typename T15,
  15944. typename T16, typename T17, typename T18, typename T19, typename T20,
  15945. typename T21, typename T22, typename T23, typename T24, typename T25,
  15946. typename T26, typename T27, typename T28, typename T29, typename T30,
  15947. typename T31, typename T32, typename T33, typename T34, typename T35,
  15948. typename T36, typename T37, typename T38, typename T39>
  15949. internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15950. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15951. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
  15952. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  15953. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  15954. T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
  15955. T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
  15956. T37 v37, T38 v38, T39 v39) {
  15957. return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15958. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15959. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
  15960. v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
  15961. v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
  15962. v32, v33, v34, v35, v36, v37, v38, v39);
  15963. }
  15964. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15965. typename T6, typename T7, typename T8, typename T9, typename T10,
  15966. typename T11, typename T12, typename T13, typename T14, typename T15,
  15967. typename T16, typename T17, typename T18, typename T19, typename T20,
  15968. typename T21, typename T22, typename T23, typename T24, typename T25,
  15969. typename T26, typename T27, typename T28, typename T29, typename T30,
  15970. typename T31, typename T32, typename T33, typename T34, typename T35,
  15971. typename T36, typename T37, typename T38, typename T39, typename T40>
  15972. internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15973. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15974. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
  15975. T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
  15976. T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
  15977. T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
  15978. T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
  15979. T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
  15980. return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  15981. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  15982. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  15983. T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
  15984. v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
  15985. v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
  15986. }
  15987. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  15988. typename T6, typename T7, typename T8, typename T9, typename T10,
  15989. typename T11, typename T12, typename T13, typename T14, typename T15,
  15990. typename T16, typename T17, typename T18, typename T19, typename T20,
  15991. typename T21, typename T22, typename T23, typename T24, typename T25,
  15992. typename T26, typename T27, typename T28, typename T29, typename T30,
  15993. typename T31, typename T32, typename T33, typename T34, typename T35,
  15994. typename T36, typename T37, typename T38, typename T39, typename T40,
  15995. typename T41>
  15996. internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  15997. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  15998. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  15999. T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  16000. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  16001. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  16002. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  16003. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
  16004. return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16005. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16006. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  16007. T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
  16008. v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
  16009. v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
  16010. }
  16011. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16012. typename T6, typename T7, typename T8, typename T9, typename T10,
  16013. typename T11, typename T12, typename T13, typename T14, typename T15,
  16014. typename T16, typename T17, typename T18, typename T19, typename T20,
  16015. typename T21, typename T22, typename T23, typename T24, typename T25,
  16016. typename T26, typename T27, typename T28, typename T29, typename T30,
  16017. typename T31, typename T32, typename T33, typename T34, typename T35,
  16018. typename T36, typename T37, typename T38, typename T39, typename T40,
  16019. typename T41, typename T42>
  16020. internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16021. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16022. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  16023. T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  16024. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  16025. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  16026. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  16027. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  16028. T42 v42) {
  16029. return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16030. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16031. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  16032. T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
  16033. v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
  16034. v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
  16035. v42);
  16036. }
  16037. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16038. typename T6, typename T7, typename T8, typename T9, typename T10,
  16039. typename T11, typename T12, typename T13, typename T14, typename T15,
  16040. typename T16, typename T17, typename T18, typename T19, typename T20,
  16041. typename T21, typename T22, typename T23, typename T24, typename T25,
  16042. typename T26, typename T27, typename T28, typename T29, typename T30,
  16043. typename T31, typename T32, typename T33, typename T34, typename T35,
  16044. typename T36, typename T37, typename T38, typename T39, typename T40,
  16045. typename T41, typename T42, typename T43>
  16046. internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16047. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16048. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  16049. T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  16050. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  16051. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  16052. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  16053. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  16054. T42 v42, T43 v43) {
  16055. return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16056. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16057. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  16058. T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
  16059. v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
  16060. v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
  16061. v41, v42, v43);
  16062. }
  16063. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16064. typename T6, typename T7, typename T8, typename T9, typename T10,
  16065. typename T11, typename T12, typename T13, typename T14, typename T15,
  16066. typename T16, typename T17, typename T18, typename T19, typename T20,
  16067. typename T21, typename T22, typename T23, typename T24, typename T25,
  16068. typename T26, typename T27, typename T28, typename T29, typename T30,
  16069. typename T31, typename T32, typename T33, typename T34, typename T35,
  16070. typename T36, typename T37, typename T38, typename T39, typename T40,
  16071. typename T41, typename T42, typename T43, typename T44>
  16072. internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16073. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16074. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  16075. T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  16076. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  16077. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  16078. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  16079. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  16080. T42 v42, T43 v43, T44 v44) {
  16081. return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16082. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16083. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  16084. T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
  16085. v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
  16086. v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
  16087. v40, v41, v42, v43, v44);
  16088. }
  16089. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16090. typename T6, typename T7, typename T8, typename T9, typename T10,
  16091. typename T11, typename T12, typename T13, typename T14, typename T15,
  16092. typename T16, typename T17, typename T18, typename T19, typename T20,
  16093. typename T21, typename T22, typename T23, typename T24, typename T25,
  16094. typename T26, typename T27, typename T28, typename T29, typename T30,
  16095. typename T31, typename T32, typename T33, typename T34, typename T35,
  16096. typename T36, typename T37, typename T38, typename T39, typename T40,
  16097. typename T41, typename T42, typename T43, typename T44, typename T45>
  16098. internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16099. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16100. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  16101. T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  16102. T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
  16103. T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
  16104. T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
  16105. T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
  16106. T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
  16107. return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16108. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16109. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  16110. T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
  16111. v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
  16112. v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
  16113. v39, v40, v41, v42, v43, v44, v45);
  16114. }
  16115. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16116. typename T6, typename T7, typename T8, typename T9, typename T10,
  16117. typename T11, typename T12, typename T13, typename T14, typename T15,
  16118. typename T16, typename T17, typename T18, typename T19, typename T20,
  16119. typename T21, typename T22, typename T23, typename T24, typename T25,
  16120. typename T26, typename T27, typename T28, typename T29, typename T30,
  16121. typename T31, typename T32, typename T33, typename T34, typename T35,
  16122. typename T36, typename T37, typename T38, typename T39, typename T40,
  16123. typename T41, typename T42, typename T43, typename T44, typename T45,
  16124. typename T46>
  16125. internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16126. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16127. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  16128. T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  16129. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  16130. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  16131. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  16132. T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
  16133. T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
  16134. return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16135. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16136. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  16137. T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
  16138. v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  16139. v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
  16140. v38, v39, v40, v41, v42, v43, v44, v45, v46);
  16141. }
  16142. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16143. typename T6, typename T7, typename T8, typename T9, typename T10,
  16144. typename T11, typename T12, typename T13, typename T14, typename T15,
  16145. typename T16, typename T17, typename T18, typename T19, typename T20,
  16146. typename T21, typename T22, typename T23, typename T24, typename T25,
  16147. typename T26, typename T27, typename T28, typename T29, typename T30,
  16148. typename T31, typename T32, typename T33, typename T34, typename T35,
  16149. typename T36, typename T37, typename T38, typename T39, typename T40,
  16150. typename T41, typename T42, typename T43, typename T44, typename T45,
  16151. typename T46, typename T47>
  16152. internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16153. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16154. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  16155. T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  16156. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  16157. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  16158. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  16159. T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
  16160. T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
  16161. return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16162. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16163. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  16164. T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
  16165. v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  16166. v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
  16167. v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
  16168. }
  16169. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16170. typename T6, typename T7, typename T8, typename T9, typename T10,
  16171. typename T11, typename T12, typename T13, typename T14, typename T15,
  16172. typename T16, typename T17, typename T18, typename T19, typename T20,
  16173. typename T21, typename T22, typename T23, typename T24, typename T25,
  16174. typename T26, typename T27, typename T28, typename T29, typename T30,
  16175. typename T31, typename T32, typename T33, typename T34, typename T35,
  16176. typename T36, typename T37, typename T38, typename T39, typename T40,
  16177. typename T41, typename T42, typename T43, typename T44, typename T45,
  16178. typename T46, typename T47, typename T48>
  16179. internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16180. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16181. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  16182. T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
  16183. T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  16184. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  16185. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  16186. T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
  16187. T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
  16188. T48 v48) {
  16189. return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16190. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16191. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  16192. T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
  16193. v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
  16194. v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
  16195. v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
  16196. }
  16197. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16198. typename T6, typename T7, typename T8, typename T9, typename T10,
  16199. typename T11, typename T12, typename T13, typename T14, typename T15,
  16200. typename T16, typename T17, typename T18, typename T19, typename T20,
  16201. typename T21, typename T22, typename T23, typename T24, typename T25,
  16202. typename T26, typename T27, typename T28, typename T29, typename T30,
  16203. typename T31, typename T32, typename T33, typename T34, typename T35,
  16204. typename T36, typename T37, typename T38, typename T39, typename T40,
  16205. typename T41, typename T42, typename T43, typename T44, typename T45,
  16206. typename T46, typename T47, typename T48, typename T49>
  16207. internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16208. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16209. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  16210. T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
  16211. T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
  16212. T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
  16213. T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
  16214. T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
  16215. T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
  16216. T47 v47, T48 v48, T49 v49) {
  16217. return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16218. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16219. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  16220. T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
  16221. v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
  16222. v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
  16223. v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
  16224. }
  16225. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  16226. typename T6, typename T7, typename T8, typename T9, typename T10,
  16227. typename T11, typename T12, typename T13, typename T14, typename T15,
  16228. typename T16, typename T17, typename T18, typename T19, typename T20,
  16229. typename T21, typename T22, typename T23, typename T24, typename T25,
  16230. typename T26, typename T27, typename T28, typename T29, typename T30,
  16231. typename T31, typename T32, typename T33, typename T34, typename T35,
  16232. typename T36, typename T37, typename T38, typename T39, typename T40,
  16233. typename T41, typename T42, typename T43, typename T44, typename T45,
  16234. typename T46, typename T47, typename T48, typename T49, typename T50>
  16235. internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  16236. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  16237. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  16238. T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  16239. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  16240. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
  16241. T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
  16242. T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
  16243. T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
  16244. T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
  16245. return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  16246. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  16247. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  16248. T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
  16249. v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  16250. v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
  16251. v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
  16252. v48, v49, v50);
  16253. }
  16254. // Bool() allows generating tests with parameters in a set of (false, true).
  16255. //
  16256. // Synopsis:
  16257. // Bool()
  16258. // - returns a generator producing sequences with elements {false, true}.
  16259. //
  16260. // It is useful when testing code that depends on Boolean flags. Combinations
  16261. // of multiple flags can be tested when several Bool()'s are combined using
  16262. // Combine() function.
  16263. //
  16264. // In the following example all tests in the test case FlagDependentTest
  16265. // will be instantiated twice with parameters false and true.
  16266. //
  16267. // class FlagDependentTest : public testing::TestWithParam<bool> {
  16268. // virtual void SetUp() {
  16269. // external_flag = GetParam();
  16270. // }
  16271. // }
  16272. // INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
  16273. //
  16274. inline internal::ParamGenerator<bool> Bool() {
  16275. return Values(false, true);
  16276. }
  16277. # if GTEST_HAS_COMBINE
  16278. // Combine() allows the user to combine two or more sequences to produce
  16279. // values of a Cartesian product of those sequences' elements.
  16280. //
  16281. // Synopsis:
  16282. // Combine(gen1, gen2, ..., genN)
  16283. // - returns a generator producing sequences with elements coming from
  16284. // the Cartesian product of elements from the sequences generated by
  16285. // gen1, gen2, ..., genN. The sequence elements will have a type of
  16286. // tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
  16287. // of elements from sequences produces by gen1, gen2, ..., genN.
  16288. //
  16289. // Combine can have up to 10 arguments. This number is currently limited
  16290. // by the maximum number of elements in the tuple implementation used by Google
  16291. // Test.
  16292. //
  16293. // Example:
  16294. //
  16295. // This will instantiate tests in test case AnimalTest each one with
  16296. // the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
  16297. // tuple("dog", BLACK), and tuple("dog", WHITE):
  16298. //
  16299. // enum Color { BLACK, GRAY, WHITE };
  16300. // class AnimalTest
  16301. // : public testing::TestWithParam<tuple<const char*, Color> > {...};
  16302. //
  16303. // TEST_P(AnimalTest, AnimalLooksNice) {...}
  16304. //
  16305. // INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
  16306. // Combine(Values("cat", "dog"),
  16307. // Values(BLACK, WHITE)));
  16308. //
  16309. // This will instantiate tests in FlagDependentTest with all variations of two
  16310. // Boolean flags:
  16311. //
  16312. // class FlagDependentTest
  16313. // : public testing::TestWithParam<tuple<bool, bool> > {
  16314. // virtual void SetUp() {
  16315. // // Assigns external_flag_1 and external_flag_2 values from the tuple.
  16316. // tie(external_flag_1, external_flag_2) = GetParam();
  16317. // }
  16318. // };
  16319. //
  16320. // TEST_P(FlagDependentTest, TestFeature1) {
  16321. // // Test your code using external_flag_1 and external_flag_2 here.
  16322. // }
  16323. // INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
  16324. // Combine(Bool(), Bool()));
  16325. //
  16326. template <typename Generator1, typename Generator2>
  16327. internal::CartesianProductHolder2<Generator1, Generator2> Combine(
  16328. const Generator1& g1, const Generator2& g2) {
  16329. return internal::CartesianProductHolder2<Generator1, Generator2>(
  16330. g1, g2);
  16331. }
  16332. template <typename Generator1, typename Generator2, typename Generator3>
  16333. internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
  16334. const Generator1& g1, const Generator2& g2, const Generator3& g3) {
  16335. return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
  16336. g1, g2, g3);
  16337. }
  16338. template <typename Generator1, typename Generator2, typename Generator3,
  16339. typename Generator4>
  16340. internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
  16341. Generator4> Combine(
  16342. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  16343. const Generator4& g4) {
  16344. return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
  16345. Generator4>(
  16346. g1, g2, g3, g4);
  16347. }
  16348. template <typename Generator1, typename Generator2, typename Generator3,
  16349. typename Generator4, typename Generator5>
  16350. internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
  16351. Generator4, Generator5> Combine(
  16352. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  16353. const Generator4& g4, const Generator5& g5) {
  16354. return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
  16355. Generator4, Generator5>(
  16356. g1, g2, g3, g4, g5);
  16357. }
  16358. template <typename Generator1, typename Generator2, typename Generator3,
  16359. typename Generator4, typename Generator5, typename Generator6>
  16360. internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
  16361. Generator4, Generator5, Generator6> Combine(
  16362. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  16363. const Generator4& g4, const Generator5& g5, const Generator6& g6) {
  16364. return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
  16365. Generator4, Generator5, Generator6>(
  16366. g1, g2, g3, g4, g5, g6);
  16367. }
  16368. template <typename Generator1, typename Generator2, typename Generator3,
  16369. typename Generator4, typename Generator5, typename Generator6,
  16370. typename Generator7>
  16371. internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
  16372. Generator4, Generator5, Generator6, Generator7> Combine(
  16373. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  16374. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  16375. const Generator7& g7) {
  16376. return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
  16377. Generator4, Generator5, Generator6, Generator7>(
  16378. g1, g2, g3, g4, g5, g6, g7);
  16379. }
  16380. template <typename Generator1, typename Generator2, typename Generator3,
  16381. typename Generator4, typename Generator5, typename Generator6,
  16382. typename Generator7, typename Generator8>
  16383. internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
  16384. Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
  16385. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  16386. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  16387. const Generator7& g7, const Generator8& g8) {
  16388. return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
  16389. Generator4, Generator5, Generator6, Generator7, Generator8>(
  16390. g1, g2, g3, g4, g5, g6, g7, g8);
  16391. }
  16392. template <typename Generator1, typename Generator2, typename Generator3,
  16393. typename Generator4, typename Generator5, typename Generator6,
  16394. typename Generator7, typename Generator8, typename Generator9>
  16395. internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
  16396. Generator4, Generator5, Generator6, Generator7, Generator8,
  16397. Generator9> Combine(
  16398. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  16399. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  16400. const Generator7& g7, const Generator8& g8, const Generator9& g9) {
  16401. return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
  16402. Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
  16403. g1, g2, g3, g4, g5, g6, g7, g8, g9);
  16404. }
  16405. template <typename Generator1, typename Generator2, typename Generator3,
  16406. typename Generator4, typename Generator5, typename Generator6,
  16407. typename Generator7, typename Generator8, typename Generator9,
  16408. typename Generator10>
  16409. internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
  16410. Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
  16411. Generator10> Combine(
  16412. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  16413. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  16414. const Generator7& g7, const Generator8& g8, const Generator9& g9,
  16415. const Generator10& g10) {
  16416. return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
  16417. Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
  16418. Generator10>(
  16419. g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
  16420. }
  16421. # endif // GTEST_HAS_COMBINE
  16422. # define TEST_P(test_case_name, test_name) \
  16423. class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
  16424. : public test_case_name { \
  16425. public: \
  16426. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
  16427. virtual void TestBody(); \
  16428. private: \
  16429. static int AddToRegistry() { \
  16430. ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
  16431. GetTestCasePatternHolder<test_case_name>(\
  16432. #test_case_name, \
  16433. ::testing::internal::CodeLocation(\
  16434. __FILE__, __LINE__))->AddTestPattern(\
  16435. #test_case_name, \
  16436. #test_name, \
  16437. new ::testing::internal::TestMetaFactory< \
  16438. GTEST_TEST_CLASS_NAME_(\
  16439. test_case_name, test_name)>()); \
  16440. return 0; \
  16441. } \
  16442. static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \
  16443. GTEST_DISALLOW_COPY_AND_ASSIGN_(\
  16444. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
  16445. }; \
  16446. int GTEST_TEST_CLASS_NAME_(test_case_name, \
  16447. test_name)::gtest_registering_dummy_ = \
  16448. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
  16449. void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
  16450. // The optional last argument to INSTANTIATE_TEST_CASE_P allows the user
  16451. // to specify a function or functor that generates custom test name suffixes
  16452. // based on the test parameters. The function should accept one argument of
  16453. // type testing::TestParamInfo<class ParamType>, and return std::string.
  16454. //
  16455. // testing::PrintToStringParamName is a builtin test suffix generator that
  16456. // returns the value of testing::PrintToString(GetParam()). It does not work
  16457. // for std::string or C strings.
  16458. //
  16459. // Note: test names must be non-empty, unique, and may only contain ASCII
  16460. // alphanumeric characters or underscore.
  16461. # define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \
  16462. ::testing::internal::ParamGenerator<test_case_name::ParamType> \
  16463. gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
  16464. ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \
  16465. const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \
  16466. return ::testing::internal::GetParamNameGen<test_case_name::ParamType> \
  16467. (__VA_ARGS__)(info); \
  16468. } \
  16469. int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
  16470. ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
  16471. GetTestCasePatternHolder<test_case_name>(\
  16472. #test_case_name, \
  16473. ::testing::internal::CodeLocation(\
  16474. __FILE__, __LINE__))->AddTestCaseInstantiation(\
  16475. #prefix, \
  16476. &gtest_##prefix##test_case_name##_EvalGenerator_, \
  16477. &gtest_##prefix##test_case_name##_EvalGenerateName_, \
  16478. __FILE__, __LINE__)
  16479. } // namespace testing
  16480. #endif // GTEST_HAS_PARAM_TEST
  16481. #endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
  16482. // Copyright 2006, Google Inc.
  16483. // All rights reserved.
  16484. //
  16485. // Redistribution and use in source and binary forms, with or without
  16486. // modification, are permitted provided that the following conditions are
  16487. // met:
  16488. //
  16489. // * Redistributions of source code must retain the above copyright
  16490. // notice, this list of conditions and the following disclaimer.
  16491. // * Redistributions in binary form must reproduce the above
  16492. // copyright notice, this list of conditions and the following disclaimer
  16493. // in the documentation and/or other materials provided with the
  16494. // distribution.
  16495. // * Neither the name of Google Inc. nor the names of its
  16496. // contributors may be used to endorse or promote products derived from
  16497. // this software without specific prior written permission.
  16498. //
  16499. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  16500. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  16501. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  16502. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  16503. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16504. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16505. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  16506. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  16507. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  16508. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  16509. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  16510. //
  16511. // Author: wan@google.com (Zhanyong Wan)
  16512. //
  16513. // Google C++ Testing Framework definitions useful in production code.
  16514. #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
  16515. #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
  16516. // When you need to test the private or protected members of a class,
  16517. // use the FRIEND_TEST macro to declare your tests as friends of the
  16518. // class. For example:
  16519. //
  16520. // class MyClass {
  16521. // private:
  16522. // void MyMethod();
  16523. // FRIEND_TEST(MyClassTest, MyMethod);
  16524. // };
  16525. //
  16526. // class MyClassTest : public testing::Test {
  16527. // // ...
  16528. // };
  16529. //
  16530. // TEST_F(MyClassTest, MyMethod) {
  16531. // // Can call MyClass::MyMethod() here.
  16532. // }
  16533. #define FRIEND_TEST(test_case_name, test_name)\
  16534. friend class test_case_name##_##test_name##_Test
  16535. #endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
  16536. // Copyright 2008, Google Inc.
  16537. // All rights reserved.
  16538. //
  16539. // Redistribution and use in source and binary forms, with or without
  16540. // modification, are permitted provided that the following conditions are
  16541. // met:
  16542. //
  16543. // * Redistributions of source code must retain the above copyright
  16544. // notice, this list of conditions and the following disclaimer.
  16545. // * Redistributions in binary form must reproduce the above
  16546. // copyright notice, this list of conditions and the following disclaimer
  16547. // in the documentation and/or other materials provided with the
  16548. // distribution.
  16549. // * Neither the name of Google Inc. nor the names of its
  16550. // contributors may be used to endorse or promote products derived from
  16551. // this software without specific prior written permission.
  16552. //
  16553. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  16554. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  16555. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  16556. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  16557. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16558. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16559. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  16560. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  16561. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  16562. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  16563. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  16564. //
  16565. // Author: mheule@google.com (Markus Heule)
  16566. //
  16567. #ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
  16568. #define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
  16569. #include <iosfwd>
  16570. #include <vector>
  16571. namespace testing {
  16572. // A copyable object representing the result of a test part (i.e. an
  16573. // assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
  16574. //
  16575. // Don't inherit from TestPartResult as its destructor is not virtual.
  16576. class GTEST_API_ TestPartResult {
  16577. public:
  16578. // The possible outcomes of a test part (i.e. an assertion or an
  16579. // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
  16580. enum Type {
  16581. kSuccess, // Succeeded.
  16582. kNonFatalFailure, // Failed but the test can continue.
  16583. kFatalFailure // Failed and the test should be terminated.
  16584. };
  16585. // C'tor. TestPartResult does NOT have a default constructor.
  16586. // Always use this constructor (with parameters) to create a
  16587. // TestPartResult object.
  16588. TestPartResult(Type a_type,
  16589. const char* a_file_name,
  16590. int a_line_number,
  16591. const char* a_message)
  16592. : type_(a_type),
  16593. file_name_(a_file_name == NULL ? "" : a_file_name),
  16594. line_number_(a_line_number),
  16595. summary_(ExtractSummary(a_message)),
  16596. message_(a_message) {
  16597. }
  16598. // Gets the outcome of the test part.
  16599. Type type() const { return type_; }
  16600. // Gets the name of the source file where the test part took place, or
  16601. // NULL if it's unknown.
  16602. const char* file_name() const {
  16603. return file_name_.empty() ? NULL : file_name_.c_str();
  16604. }
  16605. // Gets the line in the source file where the test part took place,
  16606. // or -1 if it's unknown.
  16607. int line_number() const { return line_number_; }
  16608. // Gets the summary of the failure message.
  16609. const char* summary() const { return summary_.c_str(); }
  16610. // Gets the message associated with the test part.
  16611. const char* message() const { return message_.c_str(); }
  16612. // Returns true iff the test part passed.
  16613. bool passed() const { return type_ == kSuccess; }
  16614. // Returns true iff the test part failed.
  16615. bool failed() const { return type_ != kSuccess; }
  16616. // Returns true iff the test part non-fatally failed.
  16617. bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
  16618. // Returns true iff the test part fatally failed.
  16619. bool fatally_failed() const { return type_ == kFatalFailure; }
  16620. private:
  16621. Type type_;
  16622. // Gets the summary of the failure message by omitting the stack
  16623. // trace in it.
  16624. static std::string ExtractSummary(const char* message);
  16625. // The name of the source file where the test part took place, or
  16626. // "" if the source file is unknown.
  16627. std::string file_name_;
  16628. // The line in the source file where the test part took place, or -1
  16629. // if the line number is unknown.
  16630. int line_number_;
  16631. std::string summary_; // The test failure summary.
  16632. std::string message_; // The test failure message.
  16633. };
  16634. // Prints a TestPartResult object.
  16635. std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
  16636. // An array of TestPartResult objects.
  16637. //
  16638. // Don't inherit from TestPartResultArray as its destructor is not
  16639. // virtual.
  16640. class GTEST_API_ TestPartResultArray {
  16641. public:
  16642. TestPartResultArray() {}
  16643. // Appends the given TestPartResult to the array.
  16644. void Append(const TestPartResult& result);
  16645. // Returns the TestPartResult at the given index (0-based).
  16646. const TestPartResult& GetTestPartResult(int index) const;
  16647. // Returns the number of TestPartResult objects in the array.
  16648. int size() const;
  16649. private:
  16650. std::vector<TestPartResult> array_;
  16651. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
  16652. };
  16653. // This interface knows how to report a test part result.
  16654. class TestPartResultReporterInterface {
  16655. public:
  16656. virtual ~TestPartResultReporterInterface() {}
  16657. virtual void ReportTestPartResult(const TestPartResult& result) = 0;
  16658. };
  16659. namespace internal {
  16660. // This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
  16661. // statement generates new fatal failures. To do so it registers itself as the
  16662. // current test part result reporter. Besides checking if fatal failures were
  16663. // reported, it only delegates the reporting to the former result reporter.
  16664. // The original result reporter is restored in the destructor.
  16665. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16666. class GTEST_API_ HasNewFatalFailureHelper
  16667. : public TestPartResultReporterInterface {
  16668. public:
  16669. HasNewFatalFailureHelper();
  16670. virtual ~HasNewFatalFailureHelper();
  16671. virtual void ReportTestPartResult(const TestPartResult& result);
  16672. bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
  16673. private:
  16674. bool has_new_fatal_failure_;
  16675. TestPartResultReporterInterface* original_reporter_;
  16676. GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
  16677. };
  16678. } // namespace internal
  16679. } // namespace testing
  16680. #endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
  16681. // Copyright 2008 Google Inc.
  16682. // All Rights Reserved.
  16683. //
  16684. // Redistribution and use in source and binary forms, with or without
  16685. // modification, are permitted provided that the following conditions are
  16686. // met:
  16687. //
  16688. // * Redistributions of source code must retain the above copyright
  16689. // notice, this list of conditions and the following disclaimer.
  16690. // * Redistributions in binary form must reproduce the above
  16691. // copyright notice, this list of conditions and the following disclaimer
  16692. // in the documentation and/or other materials provided with the
  16693. // distribution.
  16694. // * Neither the name of Google Inc. nor the names of its
  16695. // contributors may be used to endorse or promote products derived from
  16696. // this software without specific prior written permission.
  16697. //
  16698. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  16699. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  16700. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  16701. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  16702. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16703. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16704. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  16705. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  16706. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  16707. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  16708. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  16709. //
  16710. // Author: wan@google.com (Zhanyong Wan)
  16711. #ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
  16712. #define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
  16713. // This header implements typed tests and type-parameterized tests.
  16714. // Typed (aka type-driven) tests repeat the same test for types in a
  16715. // list. You must know which types you want to test with when writing
  16716. // typed tests. Here's how you do it:
  16717. #if 0
  16718. // First, define a fixture class template. It should be parameterized
  16719. // by a type. Remember to derive it from testing::Test.
  16720. template <typename T>
  16721. class FooTest : public testing::Test {
  16722. public:
  16723. ...
  16724. typedef std::list<T> List;
  16725. static T shared_;
  16726. T value_;
  16727. };
  16728. // Next, associate a list of types with the test case, which will be
  16729. // repeated for each type in the list. The typedef is necessary for
  16730. // the macro to parse correctly.
  16731. typedef testing::Types<char, int, unsigned int> MyTypes;
  16732. TYPED_TEST_CASE(FooTest, MyTypes);
  16733. // If the type list contains only one type, you can write that type
  16734. // directly without Types<...>:
  16735. // TYPED_TEST_CASE(FooTest, int);
  16736. // Then, use TYPED_TEST() instead of TEST_F() to define as many typed
  16737. // tests for this test case as you want.
  16738. TYPED_TEST(FooTest, DoesBlah) {
  16739. // Inside a test, refer to TypeParam to get the type parameter.
  16740. // Since we are inside a derived class template, C++ requires use to
  16741. // visit the members of FooTest via 'this'.
  16742. TypeParam n = this->value_;
  16743. // To visit static members of the fixture, add the TestFixture::
  16744. // prefix.
  16745. n += TestFixture::shared_;
  16746. // To refer to typedefs in the fixture, add the "typename
  16747. // TestFixture::" prefix.
  16748. typename TestFixture::List values;
  16749. values.push_back(n);
  16750. ...
  16751. }
  16752. TYPED_TEST(FooTest, HasPropertyA) { ... }
  16753. #endif // 0
  16754. // Type-parameterized tests are abstract test patterns parameterized
  16755. // by a type. Compared with typed tests, type-parameterized tests
  16756. // allow you to define the test pattern without knowing what the type
  16757. // parameters are. The defined pattern can be instantiated with
  16758. // different types any number of times, in any number of translation
  16759. // units.
  16760. //
  16761. // If you are designing an interface or concept, you can define a
  16762. // suite of type-parameterized tests to verify properties that any
  16763. // valid implementation of the interface/concept should have. Then,
  16764. // each implementation can easily instantiate the test suite to verify
  16765. // that it conforms to the requirements, without having to write
  16766. // similar tests repeatedly. Here's an example:
  16767. #if 0
  16768. // First, define a fixture class template. It should be parameterized
  16769. // by a type. Remember to derive it from testing::Test.
  16770. template <typename T>
  16771. class FooTest : public testing::Test {
  16772. ...
  16773. };
  16774. // Next, declare that you will define a type-parameterized test case
  16775. // (the _P suffix is for "parameterized" or "pattern", whichever you
  16776. // prefer):
  16777. TYPED_TEST_CASE_P(FooTest);
  16778. // Then, use TYPED_TEST_P() to define as many type-parameterized tests
  16779. // for this type-parameterized test case as you want.
  16780. TYPED_TEST_P(FooTest, DoesBlah) {
  16781. // Inside a test, refer to TypeParam to get the type parameter.
  16782. TypeParam n = 0;
  16783. ...
  16784. }
  16785. TYPED_TEST_P(FooTest, HasPropertyA) { ... }
  16786. // Now the tricky part: you need to register all test patterns before
  16787. // you can instantiate them. The first argument of the macro is the
  16788. // test case name; the rest are the names of the tests in this test
  16789. // case.
  16790. REGISTER_TYPED_TEST_CASE_P(FooTest,
  16791. DoesBlah, HasPropertyA);
  16792. // Finally, you are free to instantiate the pattern with the types you
  16793. // want. If you put the above code in a header file, you can #include
  16794. // it in multiple C++ source files and instantiate it multiple times.
  16795. //
  16796. // To distinguish different instances of the pattern, the first
  16797. // argument to the INSTANTIATE_* macro is a prefix that will be added
  16798. // to the actual test case name. Remember to pick unique prefixes for
  16799. // different instances.
  16800. typedef testing::Types<char, int, unsigned int> MyTypes;
  16801. INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
  16802. // If the type list contains only one type, you can write that type
  16803. // directly without Types<...>:
  16804. // INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
  16805. #endif // 0
  16806. // Implements typed tests.
  16807. #if GTEST_HAS_TYPED_TEST
  16808. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  16809. //
  16810. // Expands to the name of the typedef for the type parameters of the
  16811. // given test case.
  16812. # define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
  16813. // The 'Types' template argument below must have spaces around it
  16814. // since some compilers may choke on '>>' when passing a template
  16815. // instance (e.g. Types<int>)
  16816. # define TYPED_TEST_CASE(CaseName, Types) \
  16817. typedef ::testing::internal::TypeList< Types >::type \
  16818. GTEST_TYPE_PARAMS_(CaseName)
  16819. # define TYPED_TEST(CaseName, TestName) \
  16820. template <typename gtest_TypeParam_> \
  16821. class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
  16822. : public CaseName<gtest_TypeParam_> { \
  16823. private: \
  16824. typedef CaseName<gtest_TypeParam_> TestFixture; \
  16825. typedef gtest_TypeParam_ TypeParam; \
  16826. virtual void TestBody(); \
  16827. }; \
  16828. bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \
  16829. ::testing::internal::TypeParameterizedTest< \
  16830. CaseName, \
  16831. ::testing::internal::TemplateSel< \
  16832. GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
  16833. GTEST_TYPE_PARAMS_(CaseName)>::Register(\
  16834. "", ::testing::internal::CodeLocation(__FILE__, __LINE__), \
  16835. #CaseName, #TestName, 0); \
  16836. template <typename gtest_TypeParam_> \
  16837. void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
  16838. #endif // GTEST_HAS_TYPED_TEST
  16839. // Implements type-parameterized tests.
  16840. #if GTEST_HAS_TYPED_TEST_P
  16841. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  16842. //
  16843. // Expands to the namespace name that the type-parameterized tests for
  16844. // the given type-parameterized test case are defined in. The exact
  16845. // name of the namespace is subject to change without notice.
  16846. # define GTEST_CASE_NAMESPACE_(TestCaseName) \
  16847. gtest_case_##TestCaseName##_
  16848. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  16849. //
  16850. // Expands to the name of the variable used to remember the names of
  16851. // the defined tests in the given test case.
  16852. # define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
  16853. gtest_typed_test_case_p_state_##TestCaseName##_
  16854. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
  16855. //
  16856. // Expands to the name of the variable used to remember the names of
  16857. // the registered tests in the given test case.
  16858. # define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
  16859. gtest_registered_test_names_##TestCaseName##_
  16860. // The variables defined in the type-parameterized test macros are
  16861. // static as typically these macros are used in a .h file that can be
  16862. // #included in multiple translation units linked together.
  16863. # define TYPED_TEST_CASE_P(CaseName) \
  16864. static ::testing::internal::TypedTestCasePState \
  16865. GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
  16866. # define TYPED_TEST_P(CaseName, TestName) \
  16867. namespace GTEST_CASE_NAMESPACE_(CaseName) { \
  16868. template <typename gtest_TypeParam_> \
  16869. class TestName : public CaseName<gtest_TypeParam_> { \
  16870. private: \
  16871. typedef CaseName<gtest_TypeParam_> TestFixture; \
  16872. typedef gtest_TypeParam_ TypeParam; \
  16873. virtual void TestBody(); \
  16874. }; \
  16875. static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
  16876. GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
  16877. __FILE__, __LINE__, #CaseName, #TestName); \
  16878. } \
  16879. template <typename gtest_TypeParam_> \
  16880. void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
  16881. # define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
  16882. namespace GTEST_CASE_NAMESPACE_(CaseName) { \
  16883. typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
  16884. } \
  16885. static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
  16886. GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
  16887. __FILE__, __LINE__, #__VA_ARGS__)
  16888. // The 'Types' template argument below must have spaces around it
  16889. // since some compilers may choke on '>>' when passing a template
  16890. // instance (e.g. Types<int>)
  16891. # define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \
  16892. bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
  16893. ::testing::internal::TypeParameterizedTestCase<CaseName, \
  16894. GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
  16895. ::testing::internal::TypeList< Types >::type>::Register(\
  16896. #Prefix, \
  16897. ::testing::internal::CodeLocation(__FILE__, __LINE__), \
  16898. &GTEST_TYPED_TEST_CASE_P_STATE_(CaseName), \
  16899. #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
  16900. #endif // GTEST_HAS_TYPED_TEST_P
  16901. #endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
  16902. // Depending on the platform, different string classes are available.
  16903. // On Linux, in addition to ::std::string, Google also makes use of
  16904. // class ::string, which has the same interface as ::std::string, but
  16905. // has a different implementation.
  16906. //
  16907. // You can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
  16908. // ::string is available AND is a distinct type to ::std::string, or
  16909. // define it to 0 to indicate otherwise.
  16910. //
  16911. // If ::std::string and ::string are the same class on your platform
  16912. // due to aliasing, you should define GTEST_HAS_GLOBAL_STRING to 0.
  16913. //
  16914. // If you do not define GTEST_HAS_GLOBAL_STRING, it is defined
  16915. // heuristically.
  16916. namespace testing {
  16917. // Declares the flags.
  16918. // This flag temporary enables the disabled tests.
  16919. GTEST_DECLARE_bool_(also_run_disabled_tests);
  16920. // This flag brings the debugger on an assertion failure.
  16921. GTEST_DECLARE_bool_(break_on_failure);
  16922. // This flag controls whether Google Test catches all test-thrown exceptions
  16923. // and logs them as failures.
  16924. GTEST_DECLARE_bool_(catch_exceptions);
  16925. // This flag enables using colors in terminal output. Available values are
  16926. // "yes" to enable colors, "no" (disable colors), or "auto" (the default)
  16927. // to let Google Test decide.
  16928. GTEST_DECLARE_string_(color);
  16929. // This flag sets up the filter to select by name using a glob pattern
  16930. // the tests to run. If the filter is not given all tests are executed.
  16931. GTEST_DECLARE_string_(filter);
  16932. // This flag causes the Google Test to list tests. None of the tests listed
  16933. // are actually run if the flag is provided.
  16934. GTEST_DECLARE_bool_(list_tests);
  16935. // This flag controls whether Google Test emits a detailed XML report to a file
  16936. // in addition to its normal textual output.
  16937. GTEST_DECLARE_string_(output);
  16938. // This flags control whether Google Test prints the elapsed time for each
  16939. // test.
  16940. GTEST_DECLARE_bool_(print_time);
  16941. // This flag specifies the random number seed.
  16942. GTEST_DECLARE_int32_(random_seed);
  16943. // This flag sets how many times the tests are repeated. The default value
  16944. // is 1. If the value is -1 the tests are repeating forever.
  16945. GTEST_DECLARE_int32_(repeat);
  16946. // This flag controls whether Google Test includes Google Test internal
  16947. // stack frames in failure stack traces.
  16948. GTEST_DECLARE_bool_(show_internal_stack_frames);
  16949. // When this flag is specified, tests' order is randomized on every iteration.
  16950. GTEST_DECLARE_bool_(shuffle);
  16951. // This flag specifies the maximum number of stack frames to be
  16952. // printed in a failure message.
  16953. GTEST_DECLARE_int32_(stack_trace_depth);
  16954. // When this flag is specified, a failed assertion will throw an
  16955. // exception if exceptions are enabled, or exit the program with a
  16956. // non-zero code otherwise.
  16957. GTEST_DECLARE_bool_(throw_on_failure);
  16958. // When this flag is set with a "host:port" string, on supported
  16959. // platforms test results are streamed to the specified port on
  16960. // the specified host machine.
  16961. GTEST_DECLARE_string_(stream_result_to);
  16962. // The upper limit for valid stack trace depths.
  16963. const int kMaxStackTraceDepth = 100;
  16964. namespace internal {
  16965. class AssertHelper;
  16966. class DefaultGlobalTestPartResultReporter;
  16967. class ExecDeathTest;
  16968. class NoExecDeathTest;
  16969. class FinalSuccessChecker;
  16970. class GTestFlagSaver;
  16971. class StreamingListenerTest;
  16972. class TestResultAccessor;
  16973. class TestEventListenersAccessor;
  16974. class TestEventRepeater;
  16975. class UnitTestRecordPropertyTestHelper;
  16976. class WindowsDeathTest;
  16977. class UnitTestImpl* GetUnitTestImpl();
  16978. void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
  16979. const std::string& message);
  16980. } // namespace internal
  16981. // The friend relationship of some of these classes is cyclic.
  16982. // If we don't forward declare them the compiler might confuse the classes
  16983. // in friendship clauses with same named classes on the scope.
  16984. class Test;
  16985. class TestCase;
  16986. class TestInfo;
  16987. class UnitTest;
  16988. // A class for indicating whether an assertion was successful. When
  16989. // the assertion wasn't successful, the AssertionResult object
  16990. // remembers a non-empty message that describes how it failed.
  16991. //
  16992. // To create an instance of this class, use one of the factory functions
  16993. // (AssertionSuccess() and AssertionFailure()).
  16994. //
  16995. // This class is useful for two purposes:
  16996. // 1. Defining predicate functions to be used with Boolean test assertions
  16997. // EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
  16998. // 2. Defining predicate-format functions to be
  16999. // used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
  17000. //
  17001. // For example, if you define IsEven predicate:
  17002. //
  17003. // testing::AssertionResult IsEven(int n) {
  17004. // if ((n % 2) == 0)
  17005. // return testing::AssertionSuccess();
  17006. // else
  17007. // return testing::AssertionFailure() << n << " is odd";
  17008. // }
  17009. //
  17010. // Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
  17011. // will print the message
  17012. //
  17013. // Value of: IsEven(Fib(5))
  17014. // Actual: false (5 is odd)
  17015. // Expected: true
  17016. //
  17017. // instead of a more opaque
  17018. //
  17019. // Value of: IsEven(Fib(5))
  17020. // Actual: false
  17021. // Expected: true
  17022. //
  17023. // in case IsEven is a simple Boolean predicate.
  17024. //
  17025. // If you expect your predicate to be reused and want to support informative
  17026. // messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
  17027. // about half as often as positive ones in our tests), supply messages for
  17028. // both success and failure cases:
  17029. //
  17030. // testing::AssertionResult IsEven(int n) {
  17031. // if ((n % 2) == 0)
  17032. // return testing::AssertionSuccess() << n << " is even";
  17033. // else
  17034. // return testing::AssertionFailure() << n << " is odd";
  17035. // }
  17036. //
  17037. // Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
  17038. //
  17039. // Value of: IsEven(Fib(6))
  17040. // Actual: true (8 is even)
  17041. // Expected: false
  17042. //
  17043. // NB: Predicates that support negative Boolean assertions have reduced
  17044. // performance in positive ones so be careful not to use them in tests
  17045. // that have lots (tens of thousands) of positive Boolean assertions.
  17046. //
  17047. // To use this class with EXPECT_PRED_FORMAT assertions such as:
  17048. //
  17049. // // Verifies that Foo() returns an even number.
  17050. // EXPECT_PRED_FORMAT1(IsEven, Foo());
  17051. //
  17052. // you need to define:
  17053. //
  17054. // testing::AssertionResult IsEven(const char* expr, int n) {
  17055. // if ((n % 2) == 0)
  17056. // return testing::AssertionSuccess();
  17057. // else
  17058. // return testing::AssertionFailure()
  17059. // << "Expected: " << expr << " is even\n Actual: it's " << n;
  17060. // }
  17061. //
  17062. // If Foo() returns 5, you will see the following message:
  17063. //
  17064. // Expected: Foo() is even
  17065. // Actual: it's 5
  17066. //
  17067. class GTEST_API_ AssertionResult {
  17068. public:
  17069. // Copy constructor.
  17070. // Used in EXPECT_TRUE/FALSE(assertion_result).
  17071. AssertionResult(const AssertionResult& other);
  17072. GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 /* forcing value to bool */)
  17073. // Used in the EXPECT_TRUE/FALSE(bool_expression).
  17074. //
  17075. // T must be contextually convertible to bool.
  17076. //
  17077. // The second parameter prevents this overload from being considered if
  17078. // the argument is implicitly convertible to AssertionResult. In that case
  17079. // we want AssertionResult's copy constructor to be used.
  17080. template <typename T>
  17081. explicit AssertionResult(
  17082. const T& success,
  17083. typename internal::EnableIf<
  17084. !internal::ImplicitlyConvertible<T, AssertionResult>::value>::type*
  17085. /*enabler*/ = NULL)
  17086. : success_(success) {}
  17087. GTEST_DISABLE_MSC_WARNINGS_POP_()
  17088. // Assignment operator.
  17089. AssertionResult& operator=(AssertionResult other) {
  17090. swap(other);
  17091. return *this;
  17092. }
  17093. // Returns true iff the assertion succeeded.
  17094. operator bool() const { return success_; } // NOLINT
  17095. // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
  17096. AssertionResult operator!() const;
  17097. // Returns the text streamed into this AssertionResult. Test assertions
  17098. // use it when they fail (i.e., the predicate's outcome doesn't match the
  17099. // assertion's expectation). When nothing has been streamed into the
  17100. // object, returns an empty string.
  17101. const char* message() const {
  17102. return message_.get() != NULL ? message_->c_str() : "";
  17103. }
  17104. // TODO(vladl@google.com): Remove this after making sure no clients use it.
  17105. // Deprecated; please use message() instead.
  17106. const char* failure_message() const { return message(); }
  17107. // Streams a custom failure message into this object.
  17108. template <typename T> AssertionResult& operator<<(const T& value) {
  17109. AppendMessage(Message() << value);
  17110. return *this;
  17111. }
  17112. // Allows streaming basic output manipulators such as endl or flush into
  17113. // this object.
  17114. AssertionResult& operator<<(
  17115. ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
  17116. AppendMessage(Message() << basic_manipulator);
  17117. return *this;
  17118. }
  17119. private:
  17120. // Appends the contents of message to message_.
  17121. void AppendMessage(const Message& a_message) {
  17122. if (message_.get() == NULL)
  17123. message_.reset(new ::std::string);
  17124. message_->append(a_message.GetString().c_str());
  17125. }
  17126. // Swap the contents of this AssertionResult with other.
  17127. void swap(AssertionResult& other);
  17128. // Stores result of the assertion predicate.
  17129. bool success_;
  17130. // Stores the message describing the condition in case the expectation
  17131. // construct is not satisfied with the predicate's outcome.
  17132. // Referenced via a pointer to avoid taking too much stack frame space
  17133. // with test assertions.
  17134. internal::scoped_ptr< ::std::string> message_;
  17135. };
  17136. // Makes a successful assertion result.
  17137. GTEST_API_ AssertionResult AssertionSuccess();
  17138. // Makes a failed assertion result.
  17139. GTEST_API_ AssertionResult AssertionFailure();
  17140. // Makes a failed assertion result with the given failure message.
  17141. // Deprecated; use AssertionFailure() << msg.
  17142. GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
  17143. // The abstract class that all tests inherit from.
  17144. //
  17145. // In Google Test, a unit test program contains one or many TestCases, and
  17146. // each TestCase contains one or many Tests.
  17147. //
  17148. // When you define a test using the TEST macro, you don't need to
  17149. // explicitly derive from Test - the TEST macro automatically does
  17150. // this for you.
  17151. //
  17152. // The only time you derive from Test is when defining a test fixture
  17153. // to be used a TEST_F. For example:
  17154. //
  17155. // class FooTest : public testing::Test {
  17156. // protected:
  17157. // void SetUp() override { ... }
  17158. // void TearDown() override { ... }
  17159. // ...
  17160. // };
  17161. //
  17162. // TEST_F(FooTest, Bar) { ... }
  17163. // TEST_F(FooTest, Baz) { ... }
  17164. //
  17165. // Test is not copyable.
  17166. class GTEST_API_ Test {
  17167. public:
  17168. friend class TestInfo;
  17169. // Defines types for pointers to functions that set up and tear down
  17170. // a test case.
  17171. typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
  17172. typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
  17173. // The d'tor is virtual as we intend to inherit from Test.
  17174. virtual ~Test();
  17175. // Sets up the stuff shared by all tests in this test case.
  17176. //
  17177. // Google Test will call Foo::SetUpTestCase() before running the first
  17178. // test in test case Foo. Hence a sub-class can define its own
  17179. // SetUpTestCase() method to shadow the one defined in the super
  17180. // class.
  17181. static void SetUpTestCase() {}
  17182. // Tears down the stuff shared by all tests in this test case.
  17183. //
  17184. // Google Test will call Foo::TearDownTestCase() after running the last
  17185. // test in test case Foo. Hence a sub-class can define its own
  17186. // TearDownTestCase() method to shadow the one defined in the super
  17187. // class.
  17188. static void TearDownTestCase() {}
  17189. // Returns true iff the current test has a fatal failure.
  17190. static bool HasFatalFailure();
  17191. // Returns true iff the current test has a non-fatal failure.
  17192. static bool HasNonfatalFailure();
  17193. // Returns true iff the current test has a (either fatal or
  17194. // non-fatal) failure.
  17195. static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
  17196. // Logs a property for the current test, test case, or for the entire
  17197. // invocation of the test program when used outside of the context of a
  17198. // test case. Only the last value for a given key is remembered. These
  17199. // are public static so they can be called from utility functions that are
  17200. // not members of the test fixture. Calls to RecordProperty made during
  17201. // lifespan of the test (from the moment its constructor starts to the
  17202. // moment its destructor finishes) will be output in XML as attributes of
  17203. // the <testcase> element. Properties recorded from fixture's
  17204. // SetUpTestCase or TearDownTestCase are logged as attributes of the
  17205. // corresponding <testsuite> element. Calls to RecordProperty made in the
  17206. // global context (before or after invocation of RUN_ALL_TESTS and from
  17207. // SetUp/TearDown method of Environment objects registered with Google
  17208. // Test) will be output as attributes of the <testsuites> element.
  17209. static void RecordProperty(const std::string& key, const std::string& value);
  17210. static void RecordProperty(const std::string& key, int value);
  17211. protected:
  17212. // Creates a Test object.
  17213. Test();
  17214. // Sets up the test fixture.
  17215. virtual void SetUp();
  17216. // Tears down the test fixture.
  17217. virtual void TearDown();
  17218. private:
  17219. // Returns true iff the current test has the same fixture class as
  17220. // the first test in the current test case.
  17221. static bool HasSameFixtureClass();
  17222. // Runs the test after the test fixture has been set up.
  17223. //
  17224. // A sub-class must implement this to define the test logic.
  17225. //
  17226. // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
  17227. // Instead, use the TEST or TEST_F macro.
  17228. virtual void TestBody() = 0;
  17229. // Sets up, executes, and tears down the test.
  17230. void Run();
  17231. // Deletes self. We deliberately pick an unusual name for this
  17232. // internal method to avoid clashing with names used in user TESTs.
  17233. void DeleteSelf_() { delete this; }
  17234. const internal::scoped_ptr< GTEST_FLAG_SAVER_ > gtest_flag_saver_;
  17235. // Often a user misspells SetUp() as Setup() and spends a long time
  17236. // wondering why it is never called by Google Test. The declaration of
  17237. // the following method is solely for catching such an error at
  17238. // compile time:
  17239. //
  17240. // - The return type is deliberately chosen to be not void, so it
  17241. // will be a conflict if void Setup() is declared in the user's
  17242. // test fixture.
  17243. //
  17244. // - This method is private, so it will be another compiler error
  17245. // if the method is called from the user's test fixture.
  17246. //
  17247. // DO NOT OVERRIDE THIS FUNCTION.
  17248. //
  17249. // If you see an error about overriding the following function or
  17250. // about it being private, you have mis-spelled SetUp() as Setup().
  17251. struct Setup_should_be_spelled_SetUp {};
  17252. virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
  17253. // We disallow copying Tests.
  17254. GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
  17255. };
  17256. typedef internal::TimeInMillis TimeInMillis;
  17257. // A copyable object representing a user specified test property which can be
  17258. // output as a key/value string pair.
  17259. //
  17260. // Don't inherit from TestProperty as its destructor is not virtual.
  17261. class TestProperty {
  17262. public:
  17263. // C'tor. TestProperty does NOT have a default constructor.
  17264. // Always use this constructor (with parameters) to create a
  17265. // TestProperty object.
  17266. TestProperty(const std::string& a_key, const std::string& a_value) :
  17267. key_(a_key), value_(a_value) {
  17268. }
  17269. // Gets the user supplied key.
  17270. const char* key() const {
  17271. return key_.c_str();
  17272. }
  17273. // Gets the user supplied value.
  17274. const char* value() const {
  17275. return value_.c_str();
  17276. }
  17277. // Sets a new value, overriding the one supplied in the constructor.
  17278. void SetValue(const std::string& new_value) {
  17279. value_ = new_value;
  17280. }
  17281. private:
  17282. // The key supplied by the user.
  17283. std::string key_;
  17284. // The value supplied by the user.
  17285. std::string value_;
  17286. };
  17287. // The result of a single Test. This includes a list of
  17288. // TestPartResults, a list of TestProperties, a count of how many
  17289. // death tests there are in the Test, and how much time it took to run
  17290. // the Test.
  17291. //
  17292. // TestResult is not copyable.
  17293. class GTEST_API_ TestResult {
  17294. public:
  17295. // Creates an empty TestResult.
  17296. TestResult();
  17297. // D'tor. Do not inherit from TestResult.
  17298. ~TestResult();
  17299. // Gets the number of all test parts. This is the sum of the number
  17300. // of successful test parts and the number of failed test parts.
  17301. int total_part_count() const;
  17302. // Returns the number of the test properties.
  17303. int test_property_count() const;
  17304. // Returns true iff the test passed (i.e. no test part failed).
  17305. bool Passed() const { return !Failed(); }
  17306. // Returns true iff the test failed.
  17307. bool Failed() const;
  17308. // Returns true iff the test fatally failed.
  17309. bool HasFatalFailure() const;
  17310. // Returns true iff the test has a non-fatal failure.
  17311. bool HasNonfatalFailure() const;
  17312. // Returns the elapsed time, in milliseconds.
  17313. TimeInMillis elapsed_time() const { return elapsed_time_; }
  17314. // Returns the i-th test part result among all the results. i can range
  17315. // from 0 to test_property_count() - 1. If i is not in that range, aborts
  17316. // the program.
  17317. const TestPartResult& GetTestPartResult(int i) const;
  17318. // Returns the i-th test property. i can range from 0 to
  17319. // test_property_count() - 1. If i is not in that range, aborts the
  17320. // program.
  17321. const TestProperty& GetTestProperty(int i) const;
  17322. private:
  17323. friend class TestInfo;
  17324. friend class TestCase;
  17325. friend class UnitTest;
  17326. friend class internal::DefaultGlobalTestPartResultReporter;
  17327. friend class internal::ExecDeathTest;
  17328. friend class internal::TestResultAccessor;
  17329. friend class internal::UnitTestImpl;
  17330. friend class internal::WindowsDeathTest;
  17331. // Gets the vector of TestPartResults.
  17332. const std::vector<TestPartResult>& test_part_results() const {
  17333. return test_part_results_;
  17334. }
  17335. // Gets the vector of TestProperties.
  17336. const std::vector<TestProperty>& test_properties() const {
  17337. return test_properties_;
  17338. }
  17339. // Sets the elapsed time.
  17340. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
  17341. // Adds a test property to the list. The property is validated and may add
  17342. // a non-fatal failure if invalid (e.g., if it conflicts with reserved
  17343. // key names). If a property is already recorded for the same key, the
  17344. // value will be updated, rather than storing multiple values for the same
  17345. // key. xml_element specifies the element for which the property is being
  17346. // recorded and is used for validation.
  17347. void RecordProperty(const std::string& xml_element,
  17348. const TestProperty& test_property);
  17349. // Adds a failure if the key is a reserved attribute of Google Test
  17350. // testcase tags. Returns true if the property is valid.
  17351. // TODO(russr): Validate attribute names are legal and human readable.
  17352. static bool ValidateTestProperty(const std::string& xml_element,
  17353. const TestProperty& test_property);
  17354. // Adds a test part result to the list.
  17355. void AddTestPartResult(const TestPartResult& test_part_result);
  17356. // Returns the death test count.
  17357. int death_test_count() const { return death_test_count_; }
  17358. // Increments the death test count, returning the new count.
  17359. int increment_death_test_count() { return ++death_test_count_; }
  17360. // Clears the test part results.
  17361. void ClearTestPartResults();
  17362. // Clears the object.
  17363. void Clear();
  17364. // Protects mutable state of the property vector and of owned
  17365. // properties, whose values may be updated.
  17366. internal::Mutex test_properites_mutex_;
  17367. // The vector of TestPartResults
  17368. std::vector<TestPartResult> test_part_results_;
  17369. // The vector of TestProperties
  17370. std::vector<TestProperty> test_properties_;
  17371. // Running count of death tests.
  17372. int death_test_count_;
  17373. // The elapsed time, in milliseconds.
  17374. TimeInMillis elapsed_time_;
  17375. // We disallow copying TestResult.
  17376. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
  17377. }; // class TestResult
  17378. // A TestInfo object stores the following information about a test:
  17379. //
  17380. // Test case name
  17381. // Test name
  17382. // Whether the test should be run
  17383. // A function pointer that creates the test object when invoked
  17384. // Test result
  17385. //
  17386. // The constructor of TestInfo registers itself with the UnitTest
  17387. // singleton such that the RUN_ALL_TESTS() macro knows which tests to
  17388. // run.
  17389. class GTEST_API_ TestInfo {
  17390. public:
  17391. // Destructs a TestInfo object. This function is not virtual, so
  17392. // don't inherit from TestInfo.
  17393. ~TestInfo();
  17394. // Returns the test case name.
  17395. const char* test_case_name() const { return test_case_name_.c_str(); }
  17396. // Returns the test name.
  17397. const char* name() const { return name_.c_str(); }
  17398. // Returns the name of the parameter type, or NULL if this is not a typed
  17399. // or a type-parameterized test.
  17400. const char* type_param() const {
  17401. if (type_param_.get() != NULL)
  17402. return type_param_->c_str();
  17403. return NULL;
  17404. }
  17405. // Returns the text representation of the value parameter, or NULL if this
  17406. // is not a value-parameterized test.
  17407. const char* value_param() const {
  17408. if (value_param_.get() != NULL)
  17409. return value_param_->c_str();
  17410. return NULL;
  17411. }
  17412. // Returns the file name where this test is defined.
  17413. const char* file() const { return location_.file.c_str(); }
  17414. // Returns the line where this test is defined.
  17415. int line() const { return location_.line; }
  17416. // Returns true if this test should run, that is if the test is not
  17417. // disabled (or it is disabled but the also_run_disabled_tests flag has
  17418. // been specified) and its full name matches the user-specified filter.
  17419. //
  17420. // Google Test allows the user to filter the tests by their full names.
  17421. // The full name of a test Bar in test case Foo is defined as
  17422. // "Foo.Bar". Only the tests that match the filter will run.
  17423. //
  17424. // A filter is a colon-separated list of glob (not regex) patterns,
  17425. // optionally followed by a '-' and a colon-separated list of
  17426. // negative patterns (tests to exclude). A test is run if it
  17427. // matches one of the positive patterns and does not match any of
  17428. // the negative patterns.
  17429. //
  17430. // For example, *A*:Foo.* is a filter that matches any string that
  17431. // contains the character 'A' or starts with "Foo.".
  17432. bool should_run() const { return should_run_; }
  17433. // Returns true iff this test will appear in the XML report.
  17434. bool is_reportable() const {
  17435. // For now, the XML report includes all tests matching the filter.
  17436. // In the future, we may trim tests that are excluded because of
  17437. // sharding.
  17438. return matches_filter_;
  17439. }
  17440. // Returns the result of the test.
  17441. const TestResult* result() const { return &result_; }
  17442. private:
  17443. #if GTEST_HAS_DEATH_TEST
  17444. friend class internal::DefaultDeathTestFactory;
  17445. #endif // GTEST_HAS_DEATH_TEST
  17446. friend class Test;
  17447. friend class TestCase;
  17448. friend class internal::UnitTestImpl;
  17449. friend class internal::StreamingListenerTest;
  17450. friend TestInfo* internal::MakeAndRegisterTestInfo(
  17451. const char* test_case_name,
  17452. const char* name,
  17453. const char* type_param,
  17454. const char* value_param,
  17455. internal::CodeLocation code_location,
  17456. internal::TypeId fixture_class_id,
  17457. Test::SetUpTestCaseFunc set_up_tc,
  17458. Test::TearDownTestCaseFunc tear_down_tc,
  17459. internal::TestFactoryBase* factory);
  17460. // Constructs a TestInfo object. The newly constructed instance assumes
  17461. // ownership of the factory object.
  17462. TestInfo(const std::string& test_case_name,
  17463. const std::string& name,
  17464. const char* a_type_param, // NULL if not a type-parameterized test
  17465. const char* a_value_param, // NULL if not a value-parameterized test
  17466. internal::CodeLocation a_code_location,
  17467. internal::TypeId fixture_class_id,
  17468. internal::TestFactoryBase* factory);
  17469. // Increments the number of death tests encountered in this test so
  17470. // far.
  17471. int increment_death_test_count() {
  17472. return result_.increment_death_test_count();
  17473. }
  17474. // Creates the test object, runs it, records its result, and then
  17475. // deletes it.
  17476. void Run();
  17477. static void ClearTestResult(TestInfo* test_info) {
  17478. test_info->result_.Clear();
  17479. }
  17480. // These fields are immutable properties of the test.
  17481. const std::string test_case_name_; // Test case name
  17482. const std::string name_; // Test name
  17483. // Name of the parameter type, or NULL if this is not a typed or a
  17484. // type-parameterized test.
  17485. const internal::scoped_ptr<const ::std::string> type_param_;
  17486. // Text representation of the value parameter, or NULL if this is not a
  17487. // value-parameterized test.
  17488. const internal::scoped_ptr<const ::std::string> value_param_;
  17489. internal::CodeLocation location_;
  17490. const internal::TypeId fixture_class_id_; // ID of the test fixture class
  17491. bool should_run_; // True iff this test should run
  17492. bool is_disabled_; // True iff this test is disabled
  17493. bool matches_filter_; // True if this test matches the
  17494. // user-specified filter.
  17495. internal::TestFactoryBase* const factory_; // The factory that creates
  17496. // the test object
  17497. // This field is mutable and needs to be reset before running the
  17498. // test for the second time.
  17499. TestResult result_;
  17500. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
  17501. };
  17502. // A test case, which consists of a vector of TestInfos.
  17503. //
  17504. // TestCase is not copyable.
  17505. class GTEST_API_ TestCase {
  17506. public:
  17507. // Creates a TestCase with the given name.
  17508. //
  17509. // TestCase does NOT have a default constructor. Always use this
  17510. // constructor to create a TestCase object.
  17511. //
  17512. // Arguments:
  17513. //
  17514. // name: name of the test case
  17515. // a_type_param: the name of the test's type parameter, or NULL if
  17516. // this is not a type-parameterized test.
  17517. // set_up_tc: pointer to the function that sets up the test case
  17518. // tear_down_tc: pointer to the function that tears down the test case
  17519. TestCase(const char* name, const char* a_type_param,
  17520. Test::SetUpTestCaseFunc set_up_tc,
  17521. Test::TearDownTestCaseFunc tear_down_tc);
  17522. // Destructor of TestCase.
  17523. virtual ~TestCase();
  17524. // Gets the name of the TestCase.
  17525. const char* name() const { return name_.c_str(); }
  17526. // Returns the name of the parameter type, or NULL if this is not a
  17527. // type-parameterized test case.
  17528. const char* type_param() const {
  17529. if (type_param_.get() != NULL)
  17530. return type_param_->c_str();
  17531. return NULL;
  17532. }
  17533. // Returns true if any test in this test case should run.
  17534. bool should_run() const { return should_run_; }
  17535. // Gets the number of successful tests in this test case.
  17536. int successful_test_count() const;
  17537. // Gets the number of failed tests in this test case.
  17538. int failed_test_count() const;
  17539. // Gets the number of disabled tests that will be reported in the XML report.
  17540. int reportable_disabled_test_count() const;
  17541. // Gets the number of disabled tests in this test case.
  17542. int disabled_test_count() const;
  17543. // Gets the number of tests to be printed in the XML report.
  17544. int reportable_test_count() const;
  17545. // Get the number of tests in this test case that should run.
  17546. int test_to_run_count() const;
  17547. // Gets the number of all tests in this test case.
  17548. int total_test_count() const;
  17549. // Returns true iff the test case passed.
  17550. bool Passed() const { return !Failed(); }
  17551. // Returns true iff the test case failed.
  17552. bool Failed() const { return failed_test_count() > 0; }
  17553. // Returns the elapsed time, in milliseconds.
  17554. TimeInMillis elapsed_time() const { return elapsed_time_; }
  17555. // Returns the i-th test among all the tests. i can range from 0 to
  17556. // total_test_count() - 1. If i is not in that range, returns NULL.
  17557. const TestInfo* GetTestInfo(int i) const;
  17558. // Returns the TestResult that holds test properties recorded during
  17559. // execution of SetUpTestCase and TearDownTestCase.
  17560. const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; }
  17561. private:
  17562. friend class Test;
  17563. friend class internal::UnitTestImpl;
  17564. // Gets the (mutable) vector of TestInfos in this TestCase.
  17565. std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
  17566. // Gets the (immutable) vector of TestInfos in this TestCase.
  17567. const std::vector<TestInfo*>& test_info_list() const {
  17568. return test_info_list_;
  17569. }
  17570. // Returns the i-th test among all the tests. i can range from 0 to
  17571. // total_test_count() - 1. If i is not in that range, returns NULL.
  17572. TestInfo* GetMutableTestInfo(int i);
  17573. // Sets the should_run member.
  17574. void set_should_run(bool should) { should_run_ = should; }
  17575. // Adds a TestInfo to this test case. Will delete the TestInfo upon
  17576. // destruction of the TestCase object.
  17577. void AddTestInfo(TestInfo * test_info);
  17578. // Clears the results of all tests in this test case.
  17579. void ClearResult();
  17580. // Clears the results of all tests in the given test case.
  17581. static void ClearTestCaseResult(TestCase* test_case) {
  17582. test_case->ClearResult();
  17583. }
  17584. // Runs every test in this TestCase.
  17585. void Run();
  17586. // Runs SetUpTestCase() for this TestCase. This wrapper is needed
  17587. // for catching exceptions thrown from SetUpTestCase().
  17588. void RunSetUpTestCase() { (*set_up_tc_)(); }
  17589. // Runs TearDownTestCase() for this TestCase. This wrapper is
  17590. // needed for catching exceptions thrown from TearDownTestCase().
  17591. void RunTearDownTestCase() { (*tear_down_tc_)(); }
  17592. // Returns true iff test passed.
  17593. static bool TestPassed(const TestInfo* test_info) {
  17594. return test_info->should_run() && test_info->result()->Passed();
  17595. }
  17596. // Returns true iff test failed.
  17597. static bool TestFailed(const TestInfo* test_info) {
  17598. return test_info->should_run() && test_info->result()->Failed();
  17599. }
  17600. // Returns true iff the test is disabled and will be reported in the XML
  17601. // report.
  17602. static bool TestReportableDisabled(const TestInfo* test_info) {
  17603. return test_info->is_reportable() && test_info->is_disabled_;
  17604. }
  17605. // Returns true iff test is disabled.
  17606. static bool TestDisabled(const TestInfo* test_info) {
  17607. return test_info->is_disabled_;
  17608. }
  17609. // Returns true iff this test will appear in the XML report.
  17610. static bool TestReportable(const TestInfo* test_info) {
  17611. return test_info->is_reportable();
  17612. }
  17613. // Returns true if the given test should run.
  17614. static bool ShouldRunTest(const TestInfo* test_info) {
  17615. return test_info->should_run();
  17616. }
  17617. // Shuffles the tests in this test case.
  17618. void ShuffleTests(internal::Random* random);
  17619. // Restores the test order to before the first shuffle.
  17620. void UnshuffleTests();
  17621. // Name of the test case.
  17622. std::string name_;
  17623. // Name of the parameter type, or NULL if this is not a typed or a
  17624. // type-parameterized test.
  17625. const internal::scoped_ptr<const ::std::string> type_param_;
  17626. // The vector of TestInfos in their original order. It owns the
  17627. // elements in the vector.
  17628. std::vector<TestInfo*> test_info_list_;
  17629. // Provides a level of indirection for the test list to allow easy
  17630. // shuffling and restoring the test order. The i-th element in this
  17631. // vector is the index of the i-th test in the shuffled test list.
  17632. std::vector<int> test_indices_;
  17633. // Pointer to the function that sets up the test case.
  17634. Test::SetUpTestCaseFunc set_up_tc_;
  17635. // Pointer to the function that tears down the test case.
  17636. Test::TearDownTestCaseFunc tear_down_tc_;
  17637. // True iff any test in this test case should run.
  17638. bool should_run_;
  17639. // Elapsed time, in milliseconds.
  17640. TimeInMillis elapsed_time_;
  17641. // Holds test properties recorded during execution of SetUpTestCase and
  17642. // TearDownTestCase.
  17643. TestResult ad_hoc_test_result_;
  17644. // We disallow copying TestCases.
  17645. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
  17646. };
  17647. // An Environment object is capable of setting up and tearing down an
  17648. // environment. You should subclass this to define your own
  17649. // environment(s).
  17650. //
  17651. // An Environment object does the set-up and tear-down in virtual
  17652. // methods SetUp() and TearDown() instead of the constructor and the
  17653. // destructor, as:
  17654. //
  17655. // 1. You cannot safely throw from a destructor. This is a problem
  17656. // as in some cases Google Test is used where exceptions are enabled, and
  17657. // we may want to implement ASSERT_* using exceptions where they are
  17658. // available.
  17659. // 2. You cannot use ASSERT_* directly in a constructor or
  17660. // destructor.
  17661. class Environment {
  17662. public:
  17663. // The d'tor is virtual as we need to subclass Environment.
  17664. virtual ~Environment() {}
  17665. // Override this to define how to set up the environment.
  17666. virtual void SetUp() {}
  17667. // Override this to define how to tear down the environment.
  17668. virtual void TearDown() {}
  17669. private:
  17670. // If you see an error about overriding the following function or
  17671. // about it being private, you have mis-spelled SetUp() as Setup().
  17672. struct Setup_should_be_spelled_SetUp {};
  17673. virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
  17674. };
  17675. // The interface for tracing execution of tests. The methods are organized in
  17676. // the order the corresponding events are fired.
  17677. class TestEventListener {
  17678. public:
  17679. virtual ~TestEventListener() {}
  17680. // Fired before any test activity starts.
  17681. virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
  17682. // Fired before each iteration of tests starts. There may be more than
  17683. // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
  17684. // index, starting from 0.
  17685. virtual void OnTestIterationStart(const UnitTest& unit_test,
  17686. int iteration) = 0;
  17687. // Fired before environment set-up for each iteration of tests starts.
  17688. virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
  17689. // Fired after environment set-up for each iteration of tests ends.
  17690. virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
  17691. // Fired before the test case starts.
  17692. virtual void OnTestCaseStart(const TestCase& test_case) = 0;
  17693. // Fired before the test starts.
  17694. virtual void OnTestStart(const TestInfo& test_info) = 0;
  17695. // Fired after a failed assertion or a SUCCEED() invocation.
  17696. virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
  17697. // Fired after the test ends.
  17698. virtual void OnTestEnd(const TestInfo& test_info) = 0;
  17699. // Fired after the test case ends.
  17700. virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
  17701. // Fired before environment tear-down for each iteration of tests starts.
  17702. virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
  17703. // Fired after environment tear-down for each iteration of tests ends.
  17704. virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
  17705. // Fired after each iteration of tests finishes.
  17706. virtual void OnTestIterationEnd(const UnitTest& unit_test,
  17707. int iteration) = 0;
  17708. // Fired after all test activities have ended.
  17709. virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
  17710. };
  17711. // The convenience class for users who need to override just one or two
  17712. // methods and are not concerned that a possible change to a signature of
  17713. // the methods they override will not be caught during the build. For
  17714. // comments about each method please see the definition of TestEventListener
  17715. // above.
  17716. class EmptyTestEventListener : public TestEventListener {
  17717. public:
  17718. virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
  17719. virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
  17720. int /*iteration*/) {}
  17721. virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
  17722. virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
  17723. virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
  17724. virtual void OnTestStart(const TestInfo& /*test_info*/) {}
  17725. virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
  17726. virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
  17727. virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
  17728. virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
  17729. virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
  17730. virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
  17731. int /*iteration*/) {}
  17732. virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
  17733. };
  17734. // TestEventListeners lets users add listeners to track events in Google Test.
  17735. class GTEST_API_ TestEventListeners {
  17736. public:
  17737. TestEventListeners();
  17738. ~TestEventListeners();
  17739. // Appends an event listener to the end of the list. Google Test assumes
  17740. // the ownership of the listener (i.e. it will delete the listener when
  17741. // the test program finishes).
  17742. void Append(TestEventListener* listener);
  17743. // Removes the given event listener from the list and returns it. It then
  17744. // becomes the caller's responsibility to delete the listener. Returns
  17745. // NULL if the listener is not found in the list.
  17746. TestEventListener* Release(TestEventListener* listener);
  17747. // Returns the standard listener responsible for the default console
  17748. // output. Can be removed from the listeners list to shut down default
  17749. // console output. Note that removing this object from the listener list
  17750. // with Release transfers its ownership to the caller and makes this
  17751. // function return NULL the next time.
  17752. TestEventListener* default_result_printer() const {
  17753. return default_result_printer_;
  17754. }
  17755. // Returns the standard listener responsible for the default XML output
  17756. // controlled by the --gtest_output=xml flag. Can be removed from the
  17757. // listeners list by users who want to shut down the default XML output
  17758. // controlled by this flag and substitute it with custom one. Note that
  17759. // removing this object from the listener list with Release transfers its
  17760. // ownership to the caller and makes this function return NULL the next
  17761. // time.
  17762. TestEventListener* default_xml_generator() const {
  17763. return default_xml_generator_;
  17764. }
  17765. private:
  17766. friend class TestCase;
  17767. friend class TestInfo;
  17768. friend class internal::DefaultGlobalTestPartResultReporter;
  17769. friend class internal::NoExecDeathTest;
  17770. friend class internal::TestEventListenersAccessor;
  17771. friend class internal::UnitTestImpl;
  17772. // Returns repeater that broadcasts the TestEventListener events to all
  17773. // subscribers.
  17774. TestEventListener* repeater();
  17775. // Sets the default_result_printer attribute to the provided listener.
  17776. // The listener is also added to the listener list and previous
  17777. // default_result_printer is removed from it and deleted. The listener can
  17778. // also be NULL in which case it will not be added to the list. Does
  17779. // nothing if the previous and the current listener objects are the same.
  17780. void SetDefaultResultPrinter(TestEventListener* listener);
  17781. // Sets the default_xml_generator attribute to the provided listener. The
  17782. // listener is also added to the listener list and previous
  17783. // default_xml_generator is removed from it and deleted. The listener can
  17784. // also be NULL in which case it will not be added to the list. Does
  17785. // nothing if the previous and the current listener objects are the same.
  17786. void SetDefaultXmlGenerator(TestEventListener* listener);
  17787. // Controls whether events will be forwarded by the repeater to the
  17788. // listeners in the list.
  17789. bool EventForwardingEnabled() const;
  17790. void SuppressEventForwarding();
  17791. // The actual list of listeners.
  17792. internal::TestEventRepeater* repeater_;
  17793. // Listener responsible for the standard result output.
  17794. TestEventListener* default_result_printer_;
  17795. // Listener responsible for the creation of the XML output file.
  17796. TestEventListener* default_xml_generator_;
  17797. // We disallow copying TestEventListeners.
  17798. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
  17799. };
  17800. // A UnitTest consists of a vector of TestCases.
  17801. //
  17802. // This is a singleton class. The only instance of UnitTest is
  17803. // created when UnitTest::GetInstance() is first called. This
  17804. // instance is never deleted.
  17805. //
  17806. // UnitTest is not copyable.
  17807. //
  17808. // This class is thread-safe as long as the methods are called
  17809. // according to their specification.
  17810. class GTEST_API_ UnitTest {
  17811. public:
  17812. // Gets the singleton UnitTest object. The first time this method
  17813. // is called, a UnitTest object is constructed and returned.
  17814. // Consecutive calls will return the same object.
  17815. static UnitTest* GetInstance();
  17816. // Runs all tests in this UnitTest object and prints the result.
  17817. // Returns 0 if successful, or 1 otherwise.
  17818. //
  17819. // This method can only be called from the main thread.
  17820. //
  17821. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  17822. int Run() GTEST_MUST_USE_RESULT_;
  17823. // Returns the working directory when the first TEST() or TEST_F()
  17824. // was executed. The UnitTest object owns the string.
  17825. const char* original_working_dir() const;
  17826. // Returns the TestCase object for the test that's currently running,
  17827. // or NULL if no test is running.
  17828. const TestCase* current_test_case() const
  17829. GTEST_LOCK_EXCLUDED_(mutex_);
  17830. // Returns the TestInfo object for the test that's currently running,
  17831. // or NULL if no test is running.
  17832. const TestInfo* current_test_info() const
  17833. GTEST_LOCK_EXCLUDED_(mutex_);
  17834. // Returns the random seed used at the start of the current test run.
  17835. int random_seed() const;
  17836. #if GTEST_HAS_PARAM_TEST
  17837. // Returns the ParameterizedTestCaseRegistry object used to keep track of
  17838. // value-parameterized tests and instantiate and register them.
  17839. //
  17840. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  17841. internal::ParameterizedTestCaseRegistry& parameterized_test_registry()
  17842. GTEST_LOCK_EXCLUDED_(mutex_);
  17843. #endif // GTEST_HAS_PARAM_TEST
  17844. // Gets the number of successful test cases.
  17845. int successful_test_case_count() const;
  17846. // Gets the number of failed test cases.
  17847. int failed_test_case_count() const;
  17848. // Gets the number of all test cases.
  17849. int total_test_case_count() const;
  17850. // Gets the number of all test cases that contain at least one test
  17851. // that should run.
  17852. int test_case_to_run_count() const;
  17853. // Gets the number of successful tests.
  17854. int successful_test_count() const;
  17855. // Gets the number of failed tests.
  17856. int failed_test_count() const;
  17857. // Gets the number of disabled tests that will be reported in the XML report.
  17858. int reportable_disabled_test_count() const;
  17859. // Gets the number of disabled tests.
  17860. int disabled_test_count() const;
  17861. // Gets the number of tests to be printed in the XML report.
  17862. int reportable_test_count() const;
  17863. // Gets the number of all tests.
  17864. int total_test_count() const;
  17865. // Gets the number of tests that should run.
  17866. int test_to_run_count() const;
  17867. // Gets the time of the test program start, in ms from the start of the
  17868. // UNIX epoch.
  17869. TimeInMillis start_timestamp() const;
  17870. // Gets the elapsed time, in milliseconds.
  17871. TimeInMillis elapsed_time() const;
  17872. // Returns true iff the unit test passed (i.e. all test cases passed).
  17873. bool Passed() const;
  17874. // Returns true iff the unit test failed (i.e. some test case failed
  17875. // or something outside of all tests failed).
  17876. bool Failed() const;
  17877. // Gets the i-th test case among all the test cases. i can range from 0 to
  17878. // total_test_case_count() - 1. If i is not in that range, returns NULL.
  17879. const TestCase* GetTestCase(int i) const;
  17880. // Returns the TestResult containing information on test failures and
  17881. // properties logged outside of individual test cases.
  17882. const TestResult& ad_hoc_test_result() const;
  17883. // Returns the list of event listeners that can be used to track events
  17884. // inside Google Test.
  17885. TestEventListeners& listeners();
  17886. private:
  17887. // Registers and returns a global test environment. When a test
  17888. // program is run, all global test environments will be set-up in
  17889. // the order they were registered. After all tests in the program
  17890. // have finished, all global test environments will be torn-down in
  17891. // the *reverse* order they were registered.
  17892. //
  17893. // The UnitTest object takes ownership of the given environment.
  17894. //
  17895. // This method can only be called from the main thread.
  17896. Environment* AddEnvironment(Environment* env);
  17897. // Adds a TestPartResult to the current TestResult object. All
  17898. // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
  17899. // eventually call this to report their results. The user code
  17900. // should use the assertion macros instead of calling this directly.
  17901. void AddTestPartResult(TestPartResult::Type result_type,
  17902. const char* file_name,
  17903. int line_number,
  17904. const std::string& message,
  17905. const std::string& os_stack_trace)
  17906. GTEST_LOCK_EXCLUDED_(mutex_);
  17907. // Adds a TestProperty to the current TestResult object when invoked from
  17908. // inside a test, to current TestCase's ad_hoc_test_result_ when invoked
  17909. // from SetUpTestCase or TearDownTestCase, or to the global property set
  17910. // when invoked elsewhere. If the result already contains a property with
  17911. // the same key, the value will be updated.
  17912. void RecordProperty(const std::string& key, const std::string& value);
  17913. // Gets the i-th test case among all the test cases. i can range from 0 to
  17914. // total_test_case_count() - 1. If i is not in that range, returns NULL.
  17915. TestCase* GetMutableTestCase(int i);
  17916. // Accessors for the implementation object.
  17917. internal::UnitTestImpl* impl() { return impl_; }
  17918. const internal::UnitTestImpl* impl() const { return impl_; }
  17919. // These classes and funcions are friends as they need to access private
  17920. // members of UnitTest.
  17921. friend class Test;
  17922. friend class internal::AssertHelper;
  17923. friend class internal::ScopedTrace;
  17924. friend class internal::StreamingListenerTest;
  17925. friend class internal::UnitTestRecordPropertyTestHelper;
  17926. friend Environment* AddGlobalTestEnvironment(Environment* env);
  17927. friend internal::UnitTestImpl* internal::GetUnitTestImpl();
  17928. friend void internal::ReportFailureInUnknownLocation(
  17929. TestPartResult::Type result_type,
  17930. const std::string& message);
  17931. // Creates an empty UnitTest.
  17932. UnitTest();
  17933. // D'tor
  17934. virtual ~UnitTest();
  17935. // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
  17936. // Google Test trace stack.
  17937. void PushGTestTrace(const internal::TraceInfo& trace)
  17938. GTEST_LOCK_EXCLUDED_(mutex_);
  17939. // Pops a trace from the per-thread Google Test trace stack.
  17940. void PopGTestTrace()
  17941. GTEST_LOCK_EXCLUDED_(mutex_);
  17942. // Protects mutable state in *impl_. This is mutable as some const
  17943. // methods need to lock it too.
  17944. mutable internal::Mutex mutex_;
  17945. // Opaque implementation object. This field is never changed once
  17946. // the object is constructed. We don't mark it as const here, as
  17947. // doing so will cause a warning in the constructor of UnitTest.
  17948. // Mutable state in *impl_ is protected by mutex_.
  17949. internal::UnitTestImpl* impl_;
  17950. // We disallow copying UnitTest.
  17951. GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
  17952. };
  17953. // A convenient wrapper for adding an environment for the test
  17954. // program.
  17955. //
  17956. // You should call this before RUN_ALL_TESTS() is called, probably in
  17957. // main(). If you use gtest_main, you need to call this before main()
  17958. // starts for it to take effect. For example, you can define a global
  17959. // variable like this:
  17960. //
  17961. // testing::Environment* const foo_env =
  17962. // testing::AddGlobalTestEnvironment(new FooEnvironment);
  17963. //
  17964. // However, we strongly recommend you to write your own main() and
  17965. // call AddGlobalTestEnvironment() there, as relying on initialization
  17966. // of global variables makes the code harder to read and may cause
  17967. // problems when you register multiple environments from different
  17968. // translation units and the environments have dependencies among them
  17969. // (remember that the compiler doesn't guarantee the order in which
  17970. // global variables from different translation units are initialized).
  17971. inline Environment* AddGlobalTestEnvironment(Environment* env) {
  17972. return UnitTest::GetInstance()->AddEnvironment(env);
  17973. }
  17974. // Initializes Google Test. This must be called before calling
  17975. // RUN_ALL_TESTS(). In particular, it parses a command line for the
  17976. // flags that Google Test recognizes. Whenever a Google Test flag is
  17977. // seen, it is removed from argv, and *argc is decremented.
  17978. //
  17979. // No value is returned. Instead, the Google Test flag variables are
  17980. // updated.
  17981. //
  17982. // Calling the function for the second time has no user-visible effect.
  17983. GTEST_API_ void InitGoogleTest(int* argc, char** argv);
  17984. // This overloaded version can be used in Windows programs compiled in
  17985. // UNICODE mode.
  17986. GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
  17987. namespace internal {
  17988. // Separate the error generating code from the code path to reduce the stack
  17989. // frame size of CmpHelperEQ. This helps reduce the overhead of some sanitizers
  17990. // when calling EXPECT_* in a tight loop.
  17991. template <typename T1, typename T2>
  17992. AssertionResult CmpHelperEQFailure(const char* lhs_expression,
  17993. const char* rhs_expression,
  17994. const T1& lhs, const T2& rhs) {
  17995. return EqFailure(lhs_expression,
  17996. rhs_expression,
  17997. FormatForComparisonFailureMessage(lhs, rhs),
  17998. FormatForComparisonFailureMessage(rhs, lhs),
  17999. false);
  18000. }
  18001. // The helper function for {ASSERT|EXPECT}_EQ.
  18002. template <typename T1, typename T2>
  18003. AssertionResult CmpHelperEQ(const char* lhs_expression,
  18004. const char* rhs_expression,
  18005. const T1& lhs,
  18006. const T2& rhs) {
  18007. GTEST_DISABLE_MSC_WARNINGS_PUSH_(4389 /* signed/unsigned mismatch */)
  18008. if (lhs == rhs) {
  18009. return AssertionSuccess();
  18010. }
  18011. GTEST_DISABLE_MSC_WARNINGS_POP_()
  18012. return CmpHelperEQFailure(lhs_expression, rhs_expression, lhs, rhs);
  18013. }
  18014. // With this overloaded version, we allow anonymous enums to be used
  18015. // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
  18016. // can be implicitly cast to BiggestInt.
  18017. GTEST_API_ AssertionResult CmpHelperEQ(const char* lhs_expression,
  18018. const char* rhs_expression,
  18019. BiggestInt lhs,
  18020. BiggestInt rhs);
  18021. // The helper class for {ASSERT|EXPECT}_EQ. The template argument
  18022. // lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
  18023. // is a null pointer literal. The following default implementation is
  18024. // for lhs_is_null_literal being false.
  18025. template <bool lhs_is_null_literal>
  18026. class EqHelper {
  18027. public:
  18028. // This templatized version is for the general case.
  18029. template <typename T1, typename T2>
  18030. static AssertionResult Compare(const char* lhs_expression,
  18031. const char* rhs_expression,
  18032. const T1& lhs,
  18033. const T2& rhs) {
  18034. return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
  18035. }
  18036. // With this overloaded version, we allow anonymous enums to be used
  18037. // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
  18038. // enums can be implicitly cast to BiggestInt.
  18039. //
  18040. // Even though its body looks the same as the above version, we
  18041. // cannot merge the two, as it will make anonymous enums unhappy.
  18042. static AssertionResult Compare(const char* lhs_expression,
  18043. const char* rhs_expression,
  18044. BiggestInt lhs,
  18045. BiggestInt rhs) {
  18046. return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
  18047. }
  18048. };
  18049. // This specialization is used when the first argument to ASSERT_EQ()
  18050. // is a null pointer literal, like NULL, false, or 0.
  18051. template <>
  18052. class EqHelper<true> {
  18053. public:
  18054. // We define two overloaded versions of Compare(). The first
  18055. // version will be picked when the second argument to ASSERT_EQ() is
  18056. // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
  18057. // EXPECT_EQ(false, a_bool).
  18058. template <typename T1, typename T2>
  18059. static AssertionResult Compare(
  18060. const char* lhs_expression,
  18061. const char* rhs_expression,
  18062. const T1& lhs,
  18063. const T2& rhs,
  18064. // The following line prevents this overload from being considered if T2
  18065. // is not a pointer type. We need this because ASSERT_EQ(NULL, my_ptr)
  18066. // expands to Compare("", "", NULL, my_ptr), which requires a conversion
  18067. // to match the Secret* in the other overload, which would otherwise make
  18068. // this template match better.
  18069. typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
  18070. return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
  18071. }
  18072. // This version will be picked when the second argument to ASSERT_EQ() is a
  18073. // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
  18074. template <typename T>
  18075. static AssertionResult Compare(
  18076. const char* lhs_expression,
  18077. const char* rhs_expression,
  18078. // We used to have a second template parameter instead of Secret*. That
  18079. // template parameter would deduce to 'long', making this a better match
  18080. // than the first overload even without the first overload's EnableIf.
  18081. // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
  18082. // non-pointer argument" (even a deduced integral argument), so the old
  18083. // implementation caused warnings in user code.
  18084. Secret* /* lhs (NULL) */,
  18085. T* rhs) {
  18086. // We already know that 'lhs' is a null pointer.
  18087. return CmpHelperEQ(lhs_expression, rhs_expression,
  18088. static_cast<T*>(NULL), rhs);
  18089. }
  18090. };
  18091. // Separate the error generating code from the code path to reduce the stack
  18092. // frame size of CmpHelperOP. This helps reduce the overhead of some sanitizers
  18093. // when calling EXPECT_OP in a tight loop.
  18094. template <typename T1, typename T2>
  18095. AssertionResult CmpHelperOpFailure(const char* expr1, const char* expr2,
  18096. const T1& val1, const T2& val2,
  18097. const char* op) {
  18098. return AssertionFailure()
  18099. << "Expected: (" << expr1 << ") " << op << " (" << expr2
  18100. << "), actual: " << FormatForComparisonFailureMessage(val1, val2)
  18101. << " vs " << FormatForComparisonFailureMessage(val2, val1);
  18102. }
  18103. // A macro for implementing the helper functions needed to implement
  18104. // ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste
  18105. // of similar code.
  18106. //
  18107. // For each templatized helper function, we also define an overloaded
  18108. // version for BiggestInt in order to reduce code bloat and allow
  18109. // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
  18110. // with gcc 4.
  18111. //
  18112. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  18113. #define GTEST_IMPL_CMP_HELPER_(op_name, op)\
  18114. template <typename T1, typename T2>\
  18115. AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
  18116. const T1& val1, const T2& val2) {\
  18117. if (val1 op val2) {\
  18118. return AssertionSuccess();\
  18119. } else {\
  18120. return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\
  18121. }\
  18122. }\
  18123. GTEST_API_ AssertionResult CmpHelper##op_name(\
  18124. const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
  18125. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  18126. // Implements the helper function for {ASSERT|EXPECT}_NE
  18127. GTEST_IMPL_CMP_HELPER_(NE, !=);
  18128. // Implements the helper function for {ASSERT|EXPECT}_LE
  18129. GTEST_IMPL_CMP_HELPER_(LE, <=);
  18130. // Implements the helper function for {ASSERT|EXPECT}_LT
  18131. GTEST_IMPL_CMP_HELPER_(LT, <);
  18132. // Implements the helper function for {ASSERT|EXPECT}_GE
  18133. GTEST_IMPL_CMP_HELPER_(GE, >=);
  18134. // Implements the helper function for {ASSERT|EXPECT}_GT
  18135. GTEST_IMPL_CMP_HELPER_(GT, >);
  18136. #undef GTEST_IMPL_CMP_HELPER_
  18137. // The helper function for {ASSERT|EXPECT}_STREQ.
  18138. //
  18139. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  18140. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
  18141. const char* s2_expression,
  18142. const char* s1,
  18143. const char* s2);
  18144. // The helper function for {ASSERT|EXPECT}_STRCASEEQ.
  18145. //
  18146. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  18147. GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression,
  18148. const char* s2_expression,
  18149. const char* s1,
  18150. const char* s2);
  18151. // The helper function for {ASSERT|EXPECT}_STRNE.
  18152. //
  18153. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  18154. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
  18155. const char* s2_expression,
  18156. const char* s1,
  18157. const char* s2);
  18158. // The helper function for {ASSERT|EXPECT}_STRCASENE.
  18159. //
  18160. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  18161. GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
  18162. const char* s2_expression,
  18163. const char* s1,
  18164. const char* s2);
  18165. // Helper function for *_STREQ on wide strings.
  18166. //
  18167. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  18168. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
  18169. const char* s2_expression,
  18170. const wchar_t* s1,
  18171. const wchar_t* s2);
  18172. // Helper function for *_STRNE on wide strings.
  18173. //
  18174. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  18175. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
  18176. const char* s2_expression,
  18177. const wchar_t* s1,
  18178. const wchar_t* s2);
  18179. } // namespace internal
  18180. // IsSubstring() and IsNotSubstring() are intended to be used as the
  18181. // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
  18182. // themselves. They check whether needle is a substring of haystack
  18183. // (NULL is considered a substring of itself only), and return an
  18184. // appropriate error message when they fail.
  18185. //
  18186. // The {needle,haystack}_expr arguments are the stringified
  18187. // expressions that generated the two real arguments.
  18188. GTEST_API_ AssertionResult IsSubstring(
  18189. const char* needle_expr, const char* haystack_expr,
  18190. const char* needle, const char* haystack);
  18191. GTEST_API_ AssertionResult IsSubstring(
  18192. const char* needle_expr, const char* haystack_expr,
  18193. const wchar_t* needle, const wchar_t* haystack);
  18194. GTEST_API_ AssertionResult IsNotSubstring(
  18195. const char* needle_expr, const char* haystack_expr,
  18196. const char* needle, const char* haystack);
  18197. GTEST_API_ AssertionResult IsNotSubstring(
  18198. const char* needle_expr, const char* haystack_expr,
  18199. const wchar_t* needle, const wchar_t* haystack);
  18200. GTEST_API_ AssertionResult IsSubstring(
  18201. const char* needle_expr, const char* haystack_expr,
  18202. const ::std::string& needle, const ::std::string& haystack);
  18203. GTEST_API_ AssertionResult IsNotSubstring(
  18204. const char* needle_expr, const char* haystack_expr,
  18205. const ::std::string& needle, const ::std::string& haystack);
  18206. #if GTEST_HAS_STD_WSTRING
  18207. GTEST_API_ AssertionResult IsSubstring(
  18208. const char* needle_expr, const char* haystack_expr,
  18209. const ::std::wstring& needle, const ::std::wstring& haystack);
  18210. GTEST_API_ AssertionResult IsNotSubstring(
  18211. const char* needle_expr, const char* haystack_expr,
  18212. const ::std::wstring& needle, const ::std::wstring& haystack);
  18213. #endif // GTEST_HAS_STD_WSTRING
  18214. namespace internal {
  18215. // Helper template function for comparing floating-points.
  18216. //
  18217. // Template parameter:
  18218. //
  18219. // RawType: the raw floating-point type (either float or double)
  18220. //
  18221. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  18222. template <typename RawType>
  18223. AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression,
  18224. const char* rhs_expression,
  18225. RawType lhs_value,
  18226. RawType rhs_value) {
  18227. const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value);
  18228. if (lhs.AlmostEquals(rhs)) {
  18229. return AssertionSuccess();
  18230. }
  18231. ::std::stringstream lhs_ss;
  18232. lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
  18233. << lhs_value;
  18234. ::std::stringstream rhs_ss;
  18235. rhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
  18236. << rhs_value;
  18237. return EqFailure(lhs_expression,
  18238. rhs_expression,
  18239. StringStreamToString(&lhs_ss),
  18240. StringStreamToString(&rhs_ss),
  18241. false);
  18242. }
  18243. // Helper function for implementing ASSERT_NEAR.
  18244. //
  18245. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  18246. GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
  18247. const char* expr2,
  18248. const char* abs_error_expr,
  18249. double val1,
  18250. double val2,
  18251. double abs_error);
  18252. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  18253. // A class that enables one to stream messages to assertion macros
  18254. class GTEST_API_ AssertHelper {
  18255. public:
  18256. // Constructor.
  18257. AssertHelper(TestPartResult::Type type,
  18258. const char* file,
  18259. int line,
  18260. const char* message);
  18261. ~AssertHelper();
  18262. // Message assignment is a semantic trick to enable assertion
  18263. // streaming; see the GTEST_MESSAGE_ macro below.
  18264. void operator=(const Message& message) const;
  18265. private:
  18266. // We put our data in a struct so that the size of the AssertHelper class can
  18267. // be as small as possible. This is important because gcc is incapable of
  18268. // re-using stack space even for temporary variables, so every EXPECT_EQ
  18269. // reserves stack space for another AssertHelper.
  18270. struct AssertHelperData {
  18271. AssertHelperData(TestPartResult::Type t,
  18272. const char* srcfile,
  18273. int line_num,
  18274. const char* msg)
  18275. : type(t), file(srcfile), line(line_num), message(msg) { }
  18276. TestPartResult::Type const type;
  18277. const char* const file;
  18278. int const line;
  18279. std::string const message;
  18280. private:
  18281. GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
  18282. };
  18283. AssertHelperData* const data_;
  18284. GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
  18285. };
  18286. } // namespace internal
  18287. #if GTEST_HAS_PARAM_TEST
  18288. // The pure interface class that all value-parameterized tests inherit from.
  18289. // A value-parameterized class must inherit from both ::testing::Test and
  18290. // ::testing::WithParamInterface. In most cases that just means inheriting
  18291. // from ::testing::TestWithParam, but more complicated test hierarchies
  18292. // may need to inherit from Test and WithParamInterface at different levels.
  18293. //
  18294. // This interface has support for accessing the test parameter value via
  18295. // the GetParam() method.
  18296. //
  18297. // Use it with one of the parameter generator defining functions, like Range(),
  18298. // Values(), ValuesIn(), Bool(), and Combine().
  18299. //
  18300. // class FooTest : public ::testing::TestWithParam<int> {
  18301. // protected:
  18302. // FooTest() {
  18303. // // Can use GetParam() here.
  18304. // }
  18305. // virtual ~FooTest() {
  18306. // // Can use GetParam() here.
  18307. // }
  18308. // virtual void SetUp() {
  18309. // // Can use GetParam() here.
  18310. // }
  18311. // virtual void TearDown {
  18312. // // Can use GetParam() here.
  18313. // }
  18314. // };
  18315. // TEST_P(FooTest, DoesBar) {
  18316. // // Can use GetParam() method here.
  18317. // Foo foo;
  18318. // ASSERT_TRUE(foo.DoesBar(GetParam()));
  18319. // }
  18320. // INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
  18321. template <typename T>
  18322. class WithParamInterface {
  18323. public:
  18324. typedef T ParamType;
  18325. virtual ~WithParamInterface() {}
  18326. // The current parameter value. Is also available in the test fixture's
  18327. // constructor. This member function is non-static, even though it only
  18328. // references static data, to reduce the opportunity for incorrect uses
  18329. // like writing 'WithParamInterface<bool>::GetParam()' for a test that
  18330. // uses a fixture whose parameter type is int.
  18331. const ParamType& GetParam() const {
  18332. GTEST_CHECK_(parameter_ != NULL)
  18333. << "GetParam() can only be called inside a value-parameterized test "
  18334. << "-- did you intend to write TEST_P instead of TEST_F?";
  18335. return *parameter_;
  18336. }
  18337. private:
  18338. // Sets parameter value. The caller is responsible for making sure the value
  18339. // remains alive and unchanged throughout the current test.
  18340. static void SetParam(const ParamType* parameter) {
  18341. parameter_ = parameter;
  18342. }
  18343. // Static value used for accessing parameter during a test lifetime.
  18344. static const ParamType* parameter_;
  18345. // TestClass must be a subclass of WithParamInterface<T> and Test.
  18346. template <class TestClass> friend class internal::ParameterizedTestFactory;
  18347. };
  18348. template <typename T>
  18349. const T* WithParamInterface<T>::parameter_ = NULL;
  18350. // Most value-parameterized classes can ignore the existence of
  18351. // WithParamInterface, and can just inherit from ::testing::TestWithParam.
  18352. template <typename T>
  18353. class TestWithParam : public Test, public WithParamInterface<T> {
  18354. };
  18355. #endif // GTEST_HAS_PARAM_TEST
  18356. // Macros for indicating success/failure in test code.
  18357. // ADD_FAILURE unconditionally adds a failure to the current test.
  18358. // SUCCEED generates a success - it doesn't automatically make the
  18359. // current test successful, as a test is only successful when it has
  18360. // no failure.
  18361. //
  18362. // EXPECT_* verifies that a certain condition is satisfied. If not,
  18363. // it behaves like ADD_FAILURE. In particular:
  18364. //
  18365. // EXPECT_TRUE verifies that a Boolean condition is true.
  18366. // EXPECT_FALSE verifies that a Boolean condition is false.
  18367. //
  18368. // FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
  18369. // that they will also abort the current function on failure. People
  18370. // usually want the fail-fast behavior of FAIL and ASSERT_*, but those
  18371. // writing data-driven tests often find themselves using ADD_FAILURE
  18372. // and EXPECT_* more.
  18373. // Generates a nonfatal failure with a generic message.
  18374. #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
  18375. // Generates a nonfatal failure at the given source file location with
  18376. // a generic message.
  18377. #define ADD_FAILURE_AT(file, line) \
  18378. GTEST_MESSAGE_AT_(file, line, "Failed", \
  18379. ::testing::TestPartResult::kNonFatalFailure)
  18380. // Generates a fatal failure with a generic message.
  18381. #define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
  18382. // Define this macro to 1 to omit the definition of FAIL(), which is a
  18383. // generic name and clashes with some other libraries.
  18384. #if !GTEST_DONT_DEFINE_FAIL
  18385. # define FAIL() GTEST_FAIL()
  18386. #endif
  18387. // Generates a success with a generic message.
  18388. #define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
  18389. // Define this macro to 1 to omit the definition of SUCCEED(), which
  18390. // is a generic name and clashes with some other libraries.
  18391. #if !GTEST_DONT_DEFINE_SUCCEED
  18392. # define SUCCEED() GTEST_SUCCEED()
  18393. #endif
  18394. // Macros for testing exceptions.
  18395. //
  18396. // * {ASSERT|EXPECT}_THROW(statement, expected_exception):
  18397. // Tests that the statement throws the expected exception.
  18398. // * {ASSERT|EXPECT}_NO_THROW(statement):
  18399. // Tests that the statement doesn't throw any exception.
  18400. // * {ASSERT|EXPECT}_ANY_THROW(statement):
  18401. // Tests that the statement throws an exception.
  18402. #define EXPECT_THROW(statement, expected_exception) \
  18403. GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
  18404. #define EXPECT_NO_THROW(statement) \
  18405. GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
  18406. #define EXPECT_ANY_THROW(statement) \
  18407. GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
  18408. #define ASSERT_THROW(statement, expected_exception) \
  18409. GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
  18410. #define ASSERT_NO_THROW(statement) \
  18411. GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
  18412. #define ASSERT_ANY_THROW(statement) \
  18413. GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
  18414. // Boolean assertions. Condition can be either a Boolean expression or an
  18415. // AssertionResult. For more information on how to use AssertionResult with
  18416. // these macros see comments on that class.
  18417. #define EXPECT_TRUE(condition) \
  18418. GTEST_TEST_BOOLEAN_((condition), #condition, false, true, \
  18419. GTEST_NONFATAL_FAILURE_)
  18420. #define EXPECT_FALSE(condition) \
  18421. GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
  18422. GTEST_NONFATAL_FAILURE_)
  18423. #define ASSERT_TRUE(condition) \
  18424. GTEST_TEST_BOOLEAN_((condition), #condition, false, true, \
  18425. GTEST_FATAL_FAILURE_)
  18426. #define ASSERT_FALSE(condition) \
  18427. GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
  18428. GTEST_FATAL_FAILURE_)
  18429. // Includes the auto-generated header that implements a family of
  18430. // generic predicate assertion macros.
  18431. // Copyright 2006, Google Inc.
  18432. // All rights reserved.
  18433. //
  18434. // Redistribution and use in source and binary forms, with or without
  18435. // modification, are permitted provided that the following conditions are
  18436. // met:
  18437. //
  18438. // * Redistributions of source code must retain the above copyright
  18439. // notice, this list of conditions and the following disclaimer.
  18440. // * Redistributions in binary form must reproduce the above
  18441. // copyright notice, this list of conditions and the following disclaimer
  18442. // in the documentation and/or other materials provided with the
  18443. // distribution.
  18444. // * Neither the name of Google Inc. nor the names of its
  18445. // contributors may be used to endorse or promote products derived from
  18446. // this software without specific prior written permission.
  18447. //
  18448. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  18449. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  18450. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  18451. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  18452. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  18453. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18454. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  18455. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  18456. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  18457. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  18458. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  18459. // This file is AUTOMATICALLY GENERATED on 10/31/2011 by command
  18460. // 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
  18461. //
  18462. // Implements a family of generic predicate assertion macros.
  18463. #ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
  18464. #define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
  18465. // Makes sure this header is not included before gtest.h.
  18466. #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
  18467. # error Do not include gtest_pred_impl.h directly. Include gtest.h instead.
  18468. #endif // GTEST_INCLUDE_GTEST_GTEST_H_
  18469. // This header implements a family of generic predicate assertion
  18470. // macros:
  18471. //
  18472. // ASSERT_PRED_FORMAT1(pred_format, v1)
  18473. // ASSERT_PRED_FORMAT2(pred_format, v1, v2)
  18474. // ...
  18475. //
  18476. // where pred_format is a function or functor that takes n (in the
  18477. // case of ASSERT_PRED_FORMATn) values and their source expression
  18478. // text, and returns a testing::AssertionResult. See the definition
  18479. // of ASSERT_EQ in gtest.h for an example.
  18480. //
  18481. // If you don't care about formatting, you can use the more
  18482. // restrictive version:
  18483. //
  18484. // ASSERT_PRED1(pred, v1)
  18485. // ASSERT_PRED2(pred, v1, v2)
  18486. // ...
  18487. //
  18488. // where pred is an n-ary function or functor that returns bool,
  18489. // and the values v1, v2, ..., must support the << operator for
  18490. // streaming to std::ostream.
  18491. //
  18492. // We also define the EXPECT_* variations.
  18493. //
  18494. // For now we only support predicates whose arity is at most 5.
  18495. // Please email googletestframework@googlegroups.com if you need
  18496. // support for higher arities.
  18497. // GTEST_ASSERT_ is the basic statement to which all of the assertions
  18498. // in this file reduce. Don't use this in your code.
  18499. #define GTEST_ASSERT_(expression, on_failure) \
  18500. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  18501. if (const ::testing::AssertionResult gtest_ar = (expression)) \
  18502. ; \
  18503. else \
  18504. on_failure(gtest_ar.failure_message())
  18505. // Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use
  18506. // this in your code.
  18507. template <typename Pred,
  18508. typename T1>
  18509. AssertionResult AssertPred1Helper(const char* pred_text,
  18510. const char* e1,
  18511. Pred pred,
  18512. const T1& v1) {
  18513. if (pred(v1)) return AssertionSuccess();
  18514. return AssertionFailure() << pred_text << "("
  18515. << e1 << ") evaluates to false, where"
  18516. << "\n" << e1 << " evaluates to " << v1;
  18517. }
  18518. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
  18519. // Don't use this in your code.
  18520. #define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
  18521. GTEST_ASSERT_(pred_format(#v1, v1), \
  18522. on_failure)
  18523. // Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use
  18524. // this in your code.
  18525. #define GTEST_PRED1_(pred, v1, on_failure)\
  18526. GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
  18527. #v1, \
  18528. pred, \
  18529. v1), on_failure)
  18530. // Unary predicate assertion macros.
  18531. #define EXPECT_PRED_FORMAT1(pred_format, v1) \
  18532. GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
  18533. #define EXPECT_PRED1(pred, v1) \
  18534. GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
  18535. #define ASSERT_PRED_FORMAT1(pred_format, v1) \
  18536. GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
  18537. #define ASSERT_PRED1(pred, v1) \
  18538. GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
  18539. // Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use
  18540. // this in your code.
  18541. template <typename Pred,
  18542. typename T1,
  18543. typename T2>
  18544. AssertionResult AssertPred2Helper(const char* pred_text,
  18545. const char* e1,
  18546. const char* e2,
  18547. Pred pred,
  18548. const T1& v1,
  18549. const T2& v2) {
  18550. if (pred(v1, v2)) return AssertionSuccess();
  18551. return AssertionFailure() << pred_text << "("
  18552. << e1 << ", "
  18553. << e2 << ") evaluates to false, where"
  18554. << "\n" << e1 << " evaluates to " << v1
  18555. << "\n" << e2 << " evaluates to " << v2;
  18556. }
  18557. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
  18558. // Don't use this in your code.
  18559. #define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
  18560. GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \
  18561. on_failure)
  18562. // Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use
  18563. // this in your code.
  18564. #define GTEST_PRED2_(pred, v1, v2, on_failure)\
  18565. GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
  18566. #v1, \
  18567. #v2, \
  18568. pred, \
  18569. v1, \
  18570. v2), on_failure)
  18571. // Binary predicate assertion macros.
  18572. #define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
  18573. GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
  18574. #define EXPECT_PRED2(pred, v1, v2) \
  18575. GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
  18576. #define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
  18577. GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
  18578. #define ASSERT_PRED2(pred, v1, v2) \
  18579. GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
  18580. // Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use
  18581. // this in your code.
  18582. template <typename Pred,
  18583. typename T1,
  18584. typename T2,
  18585. typename T3>
  18586. AssertionResult AssertPred3Helper(const char* pred_text,
  18587. const char* e1,
  18588. const char* e2,
  18589. const char* e3,
  18590. Pred pred,
  18591. const T1& v1,
  18592. const T2& v2,
  18593. const T3& v3) {
  18594. if (pred(v1, v2, v3)) return AssertionSuccess();
  18595. return AssertionFailure() << pred_text << "("
  18596. << e1 << ", "
  18597. << e2 << ", "
  18598. << e3 << ") evaluates to false, where"
  18599. << "\n" << e1 << " evaluates to " << v1
  18600. << "\n" << e2 << " evaluates to " << v2
  18601. << "\n" << e3 << " evaluates to " << v3;
  18602. }
  18603. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
  18604. // Don't use this in your code.
  18605. #define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
  18606. GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \
  18607. on_failure)
  18608. // Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use
  18609. // this in your code.
  18610. #define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
  18611. GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
  18612. #v1, \
  18613. #v2, \
  18614. #v3, \
  18615. pred, \
  18616. v1, \
  18617. v2, \
  18618. v3), on_failure)
  18619. // Ternary predicate assertion macros.
  18620. #define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
  18621. GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
  18622. #define EXPECT_PRED3(pred, v1, v2, v3) \
  18623. GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
  18624. #define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
  18625. GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
  18626. #define ASSERT_PRED3(pred, v1, v2, v3) \
  18627. GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
  18628. // Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use
  18629. // this in your code.
  18630. template <typename Pred,
  18631. typename T1,
  18632. typename T2,
  18633. typename T3,
  18634. typename T4>
  18635. AssertionResult AssertPred4Helper(const char* pred_text,
  18636. const char* e1,
  18637. const char* e2,
  18638. const char* e3,
  18639. const char* e4,
  18640. Pred pred,
  18641. const T1& v1,
  18642. const T2& v2,
  18643. const T3& v3,
  18644. const T4& v4) {
  18645. if (pred(v1, v2, v3, v4)) return AssertionSuccess();
  18646. return AssertionFailure() << pred_text << "("
  18647. << e1 << ", "
  18648. << e2 << ", "
  18649. << e3 << ", "
  18650. << e4 << ") evaluates to false, where"
  18651. << "\n" << e1 << " evaluates to " << v1
  18652. << "\n" << e2 << " evaluates to " << v2
  18653. << "\n" << e3 << " evaluates to " << v3
  18654. << "\n" << e4 << " evaluates to " << v4;
  18655. }
  18656. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
  18657. // Don't use this in your code.
  18658. #define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
  18659. GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \
  18660. on_failure)
  18661. // Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use
  18662. // this in your code.
  18663. #define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
  18664. GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
  18665. #v1, \
  18666. #v2, \
  18667. #v3, \
  18668. #v4, \
  18669. pred, \
  18670. v1, \
  18671. v2, \
  18672. v3, \
  18673. v4), on_failure)
  18674. // 4-ary predicate assertion macros.
  18675. #define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
  18676. GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
  18677. #define EXPECT_PRED4(pred, v1, v2, v3, v4) \
  18678. GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
  18679. #define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
  18680. GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
  18681. #define ASSERT_PRED4(pred, v1, v2, v3, v4) \
  18682. GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
  18683. // Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use
  18684. // this in your code.
  18685. template <typename Pred,
  18686. typename T1,
  18687. typename T2,
  18688. typename T3,
  18689. typename T4,
  18690. typename T5>
  18691. AssertionResult AssertPred5Helper(const char* pred_text,
  18692. const char* e1,
  18693. const char* e2,
  18694. const char* e3,
  18695. const char* e4,
  18696. const char* e5,
  18697. Pred pred,
  18698. const T1& v1,
  18699. const T2& v2,
  18700. const T3& v3,
  18701. const T4& v4,
  18702. const T5& v5) {
  18703. if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
  18704. return AssertionFailure() << pred_text << "("
  18705. << e1 << ", "
  18706. << e2 << ", "
  18707. << e3 << ", "
  18708. << e4 << ", "
  18709. << e5 << ") evaluates to false, where"
  18710. << "\n" << e1 << " evaluates to " << v1
  18711. << "\n" << e2 << " evaluates to " << v2
  18712. << "\n" << e3 << " evaluates to " << v3
  18713. << "\n" << e4 << " evaluates to " << v4
  18714. << "\n" << e5 << " evaluates to " << v5;
  18715. }
  18716. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
  18717. // Don't use this in your code.
  18718. #define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
  18719. GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \
  18720. on_failure)
  18721. // Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use
  18722. // this in your code.
  18723. #define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
  18724. GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
  18725. #v1, \
  18726. #v2, \
  18727. #v3, \
  18728. #v4, \
  18729. #v5, \
  18730. pred, \
  18731. v1, \
  18732. v2, \
  18733. v3, \
  18734. v4, \
  18735. v5), on_failure)
  18736. // 5-ary predicate assertion macros.
  18737. #define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
  18738. GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
  18739. #define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
  18740. GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
  18741. #define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
  18742. GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
  18743. #define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
  18744. GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
  18745. #endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
  18746. // Macros for testing equalities and inequalities.
  18747. //
  18748. // * {ASSERT|EXPECT}_EQ(v1, v2): Tests that v1 == v2
  18749. // * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
  18750. // * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2
  18751. // * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2
  18752. // * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2
  18753. // * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2
  18754. //
  18755. // When they are not, Google Test prints both the tested expressions and
  18756. // their actual values. The values must be compatible built-in types,
  18757. // or you will get a compiler error. By "compatible" we mean that the
  18758. // values can be compared by the respective operator.
  18759. //
  18760. // Note:
  18761. //
  18762. // 1. It is possible to make a user-defined type work with
  18763. // {ASSERT|EXPECT}_??(), but that requires overloading the
  18764. // comparison operators and is thus discouraged by the Google C++
  18765. // Usage Guide. Therefore, you are advised to use the
  18766. // {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
  18767. // equal.
  18768. //
  18769. // 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
  18770. // pointers (in particular, C strings). Therefore, if you use it
  18771. // with two C strings, you are testing how their locations in memory
  18772. // are related, not how their content is related. To compare two C
  18773. // strings by content, use {ASSERT|EXPECT}_STR*().
  18774. //
  18775. // 3. {ASSERT|EXPECT}_EQ(v1, v2) is preferred to
  18776. // {ASSERT|EXPECT}_TRUE(v1 == v2), as the former tells you
  18777. // what the actual value is when it fails, and similarly for the
  18778. // other comparisons.
  18779. //
  18780. // 4. Do not depend on the order in which {ASSERT|EXPECT}_??()
  18781. // evaluate their arguments, which is undefined.
  18782. //
  18783. // 5. These macros evaluate their arguments exactly once.
  18784. //
  18785. // Examples:
  18786. //
  18787. // EXPECT_NE(5, Foo());
  18788. // EXPECT_EQ(NULL, a_pointer);
  18789. // ASSERT_LT(i, array_size);
  18790. // ASSERT_GT(records.size(), 0) << "There is no record left.";
  18791. #define EXPECT_EQ(val1, val2) \
  18792. EXPECT_PRED_FORMAT2(::testing::internal:: \
  18793. EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
  18794. val1, val2)
  18795. #define EXPECT_NE(val1, val2) \
  18796. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
  18797. #define EXPECT_LE(val1, val2) \
  18798. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
  18799. #define EXPECT_LT(val1, val2) \
  18800. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
  18801. #define EXPECT_GE(val1, val2) \
  18802. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
  18803. #define EXPECT_GT(val1, val2) \
  18804. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
  18805. #define GTEST_ASSERT_EQ(val1, val2) \
  18806. ASSERT_PRED_FORMAT2(::testing::internal:: \
  18807. EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
  18808. val1, val2)
  18809. #define GTEST_ASSERT_NE(val1, val2) \
  18810. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
  18811. #define GTEST_ASSERT_LE(val1, val2) \
  18812. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
  18813. #define GTEST_ASSERT_LT(val1, val2) \
  18814. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
  18815. #define GTEST_ASSERT_GE(val1, val2) \
  18816. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
  18817. #define GTEST_ASSERT_GT(val1, val2) \
  18818. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
  18819. // Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
  18820. // ASSERT_XY(), which clashes with some users' own code.
  18821. #if !GTEST_DONT_DEFINE_ASSERT_EQ
  18822. # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
  18823. #endif
  18824. #if !GTEST_DONT_DEFINE_ASSERT_NE
  18825. # define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
  18826. #endif
  18827. #if !GTEST_DONT_DEFINE_ASSERT_LE
  18828. # define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
  18829. #endif
  18830. #if !GTEST_DONT_DEFINE_ASSERT_LT
  18831. # define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
  18832. #endif
  18833. #if !GTEST_DONT_DEFINE_ASSERT_GE
  18834. # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
  18835. #endif
  18836. #if !GTEST_DONT_DEFINE_ASSERT_GT
  18837. # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
  18838. #endif
  18839. // C-string Comparisons. All tests treat NULL and any non-NULL string
  18840. // as different. Two NULLs are equal.
  18841. //
  18842. // * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2
  18843. // * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2
  18844. // * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
  18845. // * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
  18846. //
  18847. // For wide or narrow string objects, you can use the
  18848. // {ASSERT|EXPECT}_??() macros.
  18849. //
  18850. // Don't depend on the order in which the arguments are evaluated,
  18851. // which is undefined.
  18852. //
  18853. // These macros evaluate their arguments exactly once.
  18854. #define EXPECT_STREQ(s1, s2) \
  18855. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
  18856. #define EXPECT_STRNE(s1, s2) \
  18857. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
  18858. #define EXPECT_STRCASEEQ(s1, s2) \
  18859. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
  18860. #define EXPECT_STRCASENE(s1, s2)\
  18861. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
  18862. #define ASSERT_STREQ(s1, s2) \
  18863. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
  18864. #define ASSERT_STRNE(s1, s2) \
  18865. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
  18866. #define ASSERT_STRCASEEQ(s1, s2) \
  18867. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
  18868. #define ASSERT_STRCASENE(s1, s2)\
  18869. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
  18870. // Macros for comparing floating-point numbers.
  18871. //
  18872. // * {ASSERT|EXPECT}_FLOAT_EQ(val1, val2):
  18873. // Tests that two float values are almost equal.
  18874. // * {ASSERT|EXPECT}_DOUBLE_EQ(val1, val2):
  18875. // Tests that two double values are almost equal.
  18876. // * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
  18877. // Tests that v1 and v2 are within the given distance to each other.
  18878. //
  18879. // Google Test uses ULP-based comparison to automatically pick a default
  18880. // error bound that is appropriate for the operands. See the
  18881. // FloatingPoint template class in gtest-internal.h if you are
  18882. // interested in the implementation details.
  18883. #define EXPECT_FLOAT_EQ(val1, val2)\
  18884. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
  18885. val1, val2)
  18886. #define EXPECT_DOUBLE_EQ(val1, val2)\
  18887. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
  18888. val1, val2)
  18889. #define ASSERT_FLOAT_EQ(val1, val2)\
  18890. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
  18891. val1, val2)
  18892. #define ASSERT_DOUBLE_EQ(val1, val2)\
  18893. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
  18894. val1, val2)
  18895. #define EXPECT_NEAR(val1, val2, abs_error)\
  18896. EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
  18897. val1, val2, abs_error)
  18898. #define ASSERT_NEAR(val1, val2, abs_error)\
  18899. ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
  18900. val1, val2, abs_error)
  18901. // These predicate format functions work on floating-point values, and
  18902. // can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
  18903. //
  18904. // EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
  18905. // Asserts that val1 is less than, or almost equal to, val2. Fails
  18906. // otherwise. In particular, it fails if either val1 or val2 is NaN.
  18907. GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
  18908. float val1, float val2);
  18909. GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
  18910. double val1, double val2);
  18911. #if GTEST_OS_WINDOWS
  18912. // Macros that test for HRESULT failure and success, these are only useful
  18913. // on Windows, and rely on Windows SDK macros and APIs to compile.
  18914. //
  18915. // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
  18916. //
  18917. // When expr unexpectedly fails or succeeds, Google Test prints the
  18918. // expected result and the actual result with both a human-readable
  18919. // string representation of the error, if available, as well as the
  18920. // hex result code.
  18921. # define EXPECT_HRESULT_SUCCEEDED(expr) \
  18922. EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
  18923. # define ASSERT_HRESULT_SUCCEEDED(expr) \
  18924. ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
  18925. # define EXPECT_HRESULT_FAILED(expr) \
  18926. EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
  18927. # define ASSERT_HRESULT_FAILED(expr) \
  18928. ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
  18929. #endif // GTEST_OS_WINDOWS
  18930. // Macros that execute statement and check that it doesn't generate new fatal
  18931. // failures in the current thread.
  18932. //
  18933. // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
  18934. //
  18935. // Examples:
  18936. //
  18937. // EXPECT_NO_FATAL_FAILURE(Process());
  18938. // ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
  18939. //
  18940. #define ASSERT_NO_FATAL_FAILURE(statement) \
  18941. GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
  18942. #define EXPECT_NO_FATAL_FAILURE(statement) \
  18943. GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
  18944. // Causes a trace (including the source file path, the current line
  18945. // number, and the given message) to be included in every test failure
  18946. // message generated by code in the current scope. The effect is
  18947. // undone when the control leaves the current scope.
  18948. //
  18949. // The message argument can be anything streamable to std::ostream.
  18950. //
  18951. // In the implementation, we include the current line number as part
  18952. // of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
  18953. // to appear in the same block - as long as they are on different
  18954. // lines.
  18955. #define SCOPED_TRACE(message) \
  18956. ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
  18957. __FILE__, __LINE__, ::testing::Message() << (message))
  18958. // Compile-time assertion for type equality.
  18959. // StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
  18960. // the same type. The value it returns is not interesting.
  18961. //
  18962. // Instead of making StaticAssertTypeEq a class template, we make it a
  18963. // function template that invokes a helper class template. This
  18964. // prevents a user from misusing StaticAssertTypeEq<T1, T2> by
  18965. // defining objects of that type.
  18966. //
  18967. // CAVEAT:
  18968. //
  18969. // When used inside a method of a class template,
  18970. // StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
  18971. // instantiated. For example, given:
  18972. //
  18973. // template <typename T> class Foo {
  18974. // public:
  18975. // void Bar() { testing::StaticAssertTypeEq<int, T>(); }
  18976. // };
  18977. //
  18978. // the code:
  18979. //
  18980. // void Test1() { Foo<bool> foo; }
  18981. //
  18982. // will NOT generate a compiler error, as Foo<bool>::Bar() is never
  18983. // actually instantiated. Instead, you need:
  18984. //
  18985. // void Test2() { Foo<bool> foo; foo.Bar(); }
  18986. //
  18987. // to cause a compiler error.
  18988. template <typename T1, typename T2>
  18989. bool StaticAssertTypeEq() {
  18990. (void)internal::StaticAssertTypeEqHelper<T1, T2>();
  18991. return true;
  18992. }
  18993. // Defines a test.
  18994. //
  18995. // The first parameter is the name of the test case, and the second
  18996. // parameter is the name of the test within the test case.
  18997. //
  18998. // The convention is to end the test case name with "Test". For
  18999. // example, a test case for the Foo class can be named FooTest.
  19000. //
  19001. // Test code should appear between braces after an invocation of
  19002. // this macro. Example:
  19003. //
  19004. // TEST(FooTest, InitializesCorrectly) {
  19005. // Foo foo;
  19006. // EXPECT_TRUE(foo.StatusIsOK());
  19007. // }
  19008. // Note that we call GetTestTypeId() instead of GetTypeId<
  19009. // ::testing::Test>() here to get the type ID of testing::Test. This
  19010. // is to work around a suspected linker bug when using Google Test as
  19011. // a framework on Mac OS X. The bug causes GetTypeId<
  19012. // ::testing::Test>() to return different values depending on whether
  19013. // the call is from the Google Test framework itself or from user test
  19014. // code. GetTestTypeId() is guaranteed to always return the same
  19015. // value, as it always calls GetTypeId<>() from the Google Test
  19016. // framework.
  19017. #define GTEST_TEST(test_case_name, test_name)\
  19018. GTEST_TEST_(test_case_name, test_name, \
  19019. ::testing::Test, ::testing::internal::GetTestTypeId())
  19020. // Define this macro to 1 to omit the definition of TEST(), which
  19021. // is a generic name and clashes with some other libraries.
  19022. #if !GTEST_DONT_DEFINE_TEST
  19023. # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
  19024. #endif
  19025. // Defines a test that uses a test fixture.
  19026. //
  19027. // The first parameter is the name of the test fixture class, which
  19028. // also doubles as the test case name. The second parameter is the
  19029. // name of the test within the test case.
  19030. //
  19031. // A test fixture class must be declared earlier. The user should put
  19032. // his test code between braces after using this macro. Example:
  19033. //
  19034. // class FooTest : public testing::Test {
  19035. // protected:
  19036. // virtual void SetUp() { b_.AddElement(3); }
  19037. //
  19038. // Foo a_;
  19039. // Foo b_;
  19040. // };
  19041. //
  19042. // TEST_F(FooTest, InitializesCorrectly) {
  19043. // EXPECT_TRUE(a_.StatusIsOK());
  19044. // }
  19045. //
  19046. // TEST_F(FooTest, ReturnsElementCountCorrectly) {
  19047. // EXPECT_EQ(0, a_.size());
  19048. // EXPECT_EQ(1, b_.size());
  19049. // }
  19050. #define TEST_F(test_fixture, test_name)\
  19051. GTEST_TEST_(test_fixture, test_name, test_fixture, \
  19052. ::testing::internal::GetTypeId<test_fixture>())
  19053. } // namespace testing
  19054. // Use this function in main() to run all tests. It returns 0 if all
  19055. // tests are successful, or 1 otherwise.
  19056. //
  19057. // RUN_ALL_TESTS() should be invoked after the command line has been
  19058. // parsed by InitGoogleTest().
  19059. //
  19060. // This function was formerly a macro; thus, it is in the global
  19061. // namespace and has an all-caps name.
  19062. int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;
  19063. inline int RUN_ALL_TESTS() {
  19064. return ::testing::UnitTest::GetInstance()->Run();
  19065. }
  19066. #endif // GTEST_INCLUDE_GTEST_GTEST_H_