gtest.h 783 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552
  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: [email protected] (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' ([email protected])
  49. // easyUnit framework.
  50. #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
  51. #define GTEST_INCLUDE_GTEST_GTEST_H_
  52. #include <limits>
  53. #include <vector>
  54. #pragma warning( push )
  55. #pragma warning( disable : 4996)
  56. // Copyright 2005, Google Inc.
  57. // All rights reserved.
  58. //
  59. // Redistribution and use in source and binary forms, with or without
  60. // modification, are permitted provided that the following conditions are
  61. // met:
  62. //
  63. // * Redistributions of source code must retain the above copyright
  64. // notice, this list of conditions and the following disclaimer.
  65. // * Redistributions in binary form must reproduce the above
  66. // copyright notice, this list of conditions and the following disclaimer
  67. // in the documentation and/or other materials provided with the
  68. // distribution.
  69. // * Neither the name of Google Inc. nor the names of its
  70. // contributors may be used to endorse or promote products derived from
  71. // this software without specific prior written permission.
  72. //
  73. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  74. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  75. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  76. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  77. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  78. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  79. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  80. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  81. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  82. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  83. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  84. //
  85. // Authors: [email protected] (Zhanyong Wan), [email protected] (Sean Mcafee)
  86. //
  87. // The Google C++ Testing Framework (Google Test)
  88. //
  89. // This header file declares functions and macros used internally by
  90. // Google Test. They are subject to change without notice.
  91. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
  92. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
  93. // Copyright 2005, Google Inc.
  94. // All rights reserved.
  95. //
  96. // Redistribution and use in source and binary forms, with or without
  97. // modification, are permitted provided that the following conditions are
  98. // met:
  99. //
  100. // * Redistributions of source code must retain the above copyright
  101. // notice, this list of conditions and the following disclaimer.
  102. // * Redistributions in binary form must reproduce the above
  103. // copyright notice, this list of conditions and the following disclaimer
  104. // in the documentation and/or other materials provided with the
  105. // distribution.
  106. // * Neither the name of Google Inc. nor the names of its
  107. // contributors may be used to endorse or promote products derived from
  108. // this software without specific prior written permission.
  109. //
  110. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  111. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  112. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  113. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  114. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  115. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  116. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  117. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  118. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  119. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  120. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  121. //
  122. // Authors: [email protected] (Zhanyong Wan)
  123. //
  124. // Low-level types and utilities for porting Google Test to various
  125. // platforms. They are subject to change without notice. DO NOT USE
  126. // THEM IN USER CODE.
  127. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
  128. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
  129. // The user can define the following macros in the build script to
  130. // control Google Test's behavior. If the user doesn't define a macro
  131. // in this list, Google Test will define it.
  132. //
  133. // GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2)
  134. // is/isn't available.
  135. // GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions
  136. // are enabled.
  137. // GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string
  138. // is/isn't available (some systems define
  139. // ::string, which is different to std::string).
  140. // GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
  141. // is/isn't available (some systems define
  142. // ::wstring, which is different to std::wstring).
  143. // GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular
  144. // expressions are/aren't available.
  145. // GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that <pthread.h>
  146. // is/isn't available.
  147. // GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't
  148. // enabled.
  149. // GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that
  150. // std::wstring does/doesn't work (Google Test can
  151. // be used where std::wstring is unavailable).
  152. // GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple
  153. // is/isn't available.
  154. // GTEST_HAS_SEH - Define it to 1/0 to indicate whether the
  155. // compiler supports Microsoft's "Structured
  156. // Exception Handling".
  157. // GTEST_HAS_STREAM_REDIRECTION
  158. // - Define it to 1/0 to indicate whether the
  159. // platform supports I/O stream redirection using
  160. // dup() and dup2().
  161. // GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google
  162. // Test's own tr1 tuple implementation should be
  163. // used. Unused when the user sets
  164. // GTEST_HAS_TR1_TUPLE to 0.
  165. // GTEST_LINKED_AS_SHARED_LIBRARY
  166. // - Define to 1 when compiling tests that use
  167. // Google Test as a shared library (known as
  168. // DLL on Windows).
  169. // GTEST_CREATE_SHARED_LIBRARY
  170. // - Define to 1 when compiling Google Test itself
  171. // as a shared library.
  172. // This header defines the following utilities:
  173. //
  174. // Macros indicating the current platform (defined to 1 if compiled on
  175. // the given platform; otherwise undefined):
  176. // GTEST_OS_AIX - IBM AIX
  177. // GTEST_OS_CYGWIN - Cygwin
  178. // GTEST_OS_HPUX - HP-UX
  179. // GTEST_OS_LINUX - Linux
  180. // GTEST_OS_LINUX_ANDROID - Google Android
  181. // GTEST_OS_MAC - Mac OS X
  182. // GTEST_OS_NACL - Google Native Client (NaCl)
  183. // GTEST_OS_SOLARIS - Sun Solaris
  184. // GTEST_OS_SYMBIAN - Symbian
  185. // GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile)
  186. // GTEST_OS_WINDOWS_DESKTOP - Windows Desktop
  187. // GTEST_OS_WINDOWS_MINGW - MinGW
  188. // GTEST_OS_WINDOWS_MOBILE - Windows Mobile
  189. // GTEST_OS_ZOS - z/OS
  190. //
  191. // Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
  192. // most stable support. Since core members of the Google Test project
  193. // don't have access to other platforms, support for them may be less
  194. // stable. If you notice any problems on your platform, please notify
  195. // [email protected] (patches for fixing them are
  196. // even more welcome!).
  197. //
  198. // Note that it is possible that none of the GTEST_OS_* macros are defined.
  199. //
  200. // Macros indicating available Google Test features (defined to 1 if
  201. // the corresponding feature is supported; otherwise undefined):
  202. // GTEST_HAS_COMBINE - the Combine() function (for value-parameterized
  203. // tests)
  204. // GTEST_HAS_DEATH_TEST - death tests
  205. // GTEST_HAS_PARAM_TEST - value-parameterized tests
  206. // GTEST_HAS_TYPED_TEST - typed tests
  207. // GTEST_HAS_TYPED_TEST_P - type-parameterized tests
  208. // GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with
  209. // GTEST_HAS_POSIX_RE (see above) which users can
  210. // define themselves.
  211. // GTEST_USES_SIMPLE_RE - our own simple regex is used;
  212. // the above two are mutually exclusive.
  213. // GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
  214. //
  215. // Macros for basic C++ coding:
  216. // GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
  217. // GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a
  218. // variable don't have to be used.
  219. // GTEST_DISALLOW_ASSIGN_ - disables operator=.
  220. // GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
  221. // GTEST_MUST_USE_RESULT_ - declares that a function's result must be used.
  222. //
  223. // Synchronization:
  224. // Mutex, MutexLock, ThreadLocal, GetThreadCount()
  225. // - synchronization primitives.
  226. // GTEST_IS_THREADSAFE - defined to 1 to indicate that the above
  227. // synchronization primitives have real implementations
  228. // and Google Test is thread-safe; or 0 otherwise.
  229. //
  230. // Template meta programming:
  231. // is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only.
  232. // IteratorTraits - partial implementation of std::iterator_traits, which
  233. // is not available in libCstd when compiled with Sun C++.
  234. //
  235. // Smart pointers:
  236. // scoped_ptr - as in TR2.
  237. //
  238. // Regular expressions:
  239. // RE - a simple regular expression class using the POSIX
  240. // Extended Regular Expression syntax on UNIX-like
  241. // platforms, or a reduced regular exception syntax on
  242. // other platforms, including Windows.
  243. //
  244. // Logging:
  245. // GTEST_LOG_() - logs messages at the specified severity level.
  246. // LogToStderr() - directs all log messages to stderr.
  247. // FlushInfoLog() - flushes informational log messages.
  248. //
  249. // Stdout and stderr capturing:
  250. // CaptureStdout() - starts capturing stdout.
  251. // GetCapturedStdout() - stops capturing stdout and returns the captured
  252. // string.
  253. // CaptureStderr() - starts capturing stderr.
  254. // GetCapturedStderr() - stops capturing stderr and returns the captured
  255. // string.
  256. //
  257. // Integer types:
  258. // TypeWithSize - maps an integer to a int type.
  259. // Int32, UInt32, Int64, UInt64, TimeInMillis
  260. // - integers of known sizes.
  261. // BiggestInt - the biggest signed integer type.
  262. //
  263. // Command-line utilities:
  264. // GTEST_FLAG() - references a flag.
  265. // GTEST_DECLARE_*() - declares a flag.
  266. // GTEST_DEFINE_*() - defines a flag.
  267. // GetArgvs() - returns the command line as a vector of strings.
  268. //
  269. // Environment variable utilities:
  270. // GetEnv() - gets the value of an environment variable.
  271. // BoolFromGTestEnv() - parses a bool environment variable.
  272. // Int32FromGTestEnv() - parses an Int32 environment variable.
  273. // StringFromGTestEnv() - parses a string environment variable.
  274. #include <ctype.h> // for isspace, etc
  275. #include <stddef.h> // for ptrdiff_t
  276. #include <stdlib.h>
  277. #include <stdio.h>
  278. #include <string.h>
  279. #ifndef _WIN32_WCE
  280. # include <sys/types.h>
  281. # include <sys/stat.h>
  282. #endif // !_WIN32_WCE
  283. #include <iostream> // NOLINT
  284. #include <sstream> // NOLINT
  285. #include <string> // NOLINT
  286. #define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
  287. #define GTEST_FLAG_PREFIX_ "gtest_"
  288. #define GTEST_FLAG_PREFIX_DASH_ "gtest-"
  289. #define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
  290. #define GTEST_NAME_ "Google Test"
  291. #define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/"
  292. // Determines the version of gcc that is used to compile this.
  293. #ifdef __GNUC__
  294. // 40302 means version 4.3.2.
  295. # define GTEST_GCC_VER_ \
  296. (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
  297. #endif // __GNUC__
  298. // Determines the platform on which Google Test is compiled.
  299. #ifdef __CYGWIN__
  300. # define GTEST_OS_CYGWIN 1
  301. #elif defined __SYMBIAN32__
  302. # define GTEST_OS_SYMBIAN 1
  303. #elif defined _WIN32
  304. # define GTEST_OS_WINDOWS 1
  305. # ifdef _WIN32_WCE
  306. # define GTEST_OS_WINDOWS_MOBILE 1
  307. # elif defined(__MINGW__) || defined(__MINGW32__)
  308. # define GTEST_OS_WINDOWS_MINGW 1
  309. # else
  310. # define GTEST_OS_WINDOWS_DESKTOP 1
  311. # endif // _WIN32_WCE
  312. #elif defined __APPLE__
  313. # define GTEST_OS_MAC 1
  314. #elif defined __linux__
  315. # define GTEST_OS_LINUX 1
  316. # ifdef ANDROID
  317. # define GTEST_OS_LINUX_ANDROID 1
  318. # endif // ANDROID
  319. #elif defined __MVS__
  320. # define GTEST_OS_ZOS 1
  321. #elif defined(__sun) && defined(__SVR4)
  322. # define GTEST_OS_SOLARIS 1
  323. #elif defined(_AIX)
  324. # define GTEST_OS_AIX 1
  325. #elif defined(__hpux)
  326. # define GTEST_OS_HPUX 1
  327. #elif defined __native_client__
  328. # define GTEST_OS_NACL 1
  329. #endif // __CYGWIN__
  330. // Brings in definitions for functions used in the testing::internal::posix
  331. // namespace (read, write, close, chdir, isatty, stat). We do not currently
  332. // use them on Windows Mobile.
  333. #if !GTEST_OS_WINDOWS
  334. // This assumes that non-Windows OSes provide unistd.h. For OSes where this
  335. // is not the case, we need to include headers that provide the functions
  336. // mentioned above.
  337. # include <unistd.h>
  338. # if !GTEST_OS_NACL
  339. // TODO([email protected]): Remove this condition when Native Client SDK adds
  340. // strings.h (tracked in
  341. // http://code.google.com/p/nativeclient/issues/detail?id=1175).
  342. # include <strings.h> // Native Client doesn't provide strings.h.
  343. # endif
  344. #elif !GTEST_OS_WINDOWS_MOBILE
  345. # include <direct.h>
  346. # include <io.h>
  347. #endif
  348. // Defines this to true iff Google Test can use POSIX regular expressions.
  349. #ifndef GTEST_HAS_POSIX_RE
  350. # define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)
  351. #endif
  352. #if GTEST_HAS_POSIX_RE
  353. // On some platforms, <regex.h> needs someone to define size_t, and
  354. // won't compile otherwise. We can #include it here as we already
  355. // included <stdlib.h>, which is guaranteed to define size_t through
  356. // <stddef.h>.
  357. # include <regex.h> // NOLINT
  358. # define GTEST_USES_POSIX_RE 1
  359. #elif GTEST_OS_WINDOWS
  360. // <regex.h> is not available on Windows. Use our own simple regex
  361. // implementation instead.
  362. # define GTEST_USES_SIMPLE_RE 1
  363. #else
  364. // <regex.h> may not be available on this platform. Use our own
  365. // simple regex implementation instead.
  366. # define GTEST_USES_SIMPLE_RE 1
  367. #endif // GTEST_HAS_POSIX_RE
  368. #ifndef GTEST_HAS_EXCEPTIONS
  369. // The user didn't tell us whether exceptions are enabled, so we need
  370. // to figure it out.
  371. # if defined(_MSC_VER) || defined(__BORLANDC__)
  372. // MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS
  373. // macro to enable exceptions, so we'll do the same.
  374. // Assumes that exceptions are enabled by default.
  375. # ifndef _HAS_EXCEPTIONS
  376. # define _HAS_EXCEPTIONS 1
  377. # endif // _HAS_EXCEPTIONS
  378. # define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
  379. # elif defined(__GNUC__) && __EXCEPTIONS
  380. // gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
  381. # define GTEST_HAS_EXCEPTIONS 1
  382. # elif defined(__SUNPRO_CC)
  383. // Sun Pro CC supports exceptions. However, there is no compile-time way of
  384. // detecting whether they are enabled or not. Therefore, we assume that
  385. // they are enabled unless the user tells us otherwise.
  386. # define GTEST_HAS_EXCEPTIONS 1
  387. # elif defined(__IBMCPP__) && __EXCEPTIONS
  388. // xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
  389. # define GTEST_HAS_EXCEPTIONS 1
  390. # elif defined(__HP_aCC)
  391. // Exception handling is in effect by default in HP aCC compiler. It has to
  392. // be turned of by +noeh compiler option if desired.
  393. # define GTEST_HAS_EXCEPTIONS 1
  394. # else
  395. // For other compilers, we assume exceptions are disabled to be
  396. // conservative.
  397. # define GTEST_HAS_EXCEPTIONS 0
  398. # endif // defined(_MSC_VER) || defined(__BORLANDC__)
  399. #endif // GTEST_HAS_EXCEPTIONS
  400. #if !defined(GTEST_HAS_STD_STRING)
  401. // Even though we don't use this macro any longer, we keep it in case
  402. // some clients still depend on it.
  403. # define GTEST_HAS_STD_STRING 1
  404. #elif !GTEST_HAS_STD_STRING
  405. // The user told us that ::std::string isn't available.
  406. # error "Google Test cannot be used where ::std::string isn't available."
  407. #endif // !defined(GTEST_HAS_STD_STRING)
  408. #ifndef GTEST_HAS_GLOBAL_STRING
  409. // The user didn't tell us whether ::string is available, so we need
  410. // to figure it out.
  411. # define GTEST_HAS_GLOBAL_STRING 0
  412. #endif // GTEST_HAS_GLOBAL_STRING
  413. #ifndef GTEST_HAS_STD_WSTRING
  414. // The user didn't tell us whether ::std::wstring is available, so we need
  415. // to figure it out.
  416. // TODO([email protected]): uses autoconf to detect whether ::std::wstring
  417. // is available.
  418. // Cygwin 1.7 and below doesn't support ::std::wstring.
  419. // Solaris' libc++ doesn't support it either. Android has
  420. // no support for it at least as recent as Froyo (2.2).
  421. # define GTEST_HAS_STD_WSTRING \
  422. (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
  423. #endif // GTEST_HAS_STD_WSTRING
  424. #ifndef GTEST_HAS_GLOBAL_WSTRING
  425. // The user didn't tell us whether ::wstring is available, so we need
  426. // to figure it out.
  427. # define GTEST_HAS_GLOBAL_WSTRING \
  428. (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
  429. #endif // GTEST_HAS_GLOBAL_WSTRING
  430. // Determines whether RTTI is available.
  431. #ifndef GTEST_HAS_RTTI
  432. // The user didn't tell us whether RTTI is enabled, so we need to
  433. // figure it out.
  434. # ifdef _MSC_VER
  435. # ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled.
  436. # define GTEST_HAS_RTTI 1
  437. # else
  438. # define GTEST_HAS_RTTI 0
  439. # endif
  440. // Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
  441. # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
  442. # ifdef __GXX_RTTI
  443. # define GTEST_HAS_RTTI 1
  444. # else
  445. # define GTEST_HAS_RTTI 0
  446. # endif // __GXX_RTTI
  447. // Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
  448. // both the typeid and dynamic_cast features are present.
  449. # elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
  450. # ifdef __RTTI_ALL__
  451. # define GTEST_HAS_RTTI 1
  452. # else
  453. # define GTEST_HAS_RTTI 0
  454. # endif
  455. # else
  456. // For all other compilers, we assume RTTI is enabled.
  457. # define GTEST_HAS_RTTI 1
  458. # endif // _MSC_VER
  459. #endif // GTEST_HAS_RTTI
  460. // It's this header's responsibility to #include <typeinfo> when RTTI
  461. // is enabled.
  462. #if GTEST_HAS_RTTI
  463. # include <typeinfo>
  464. #endif
  465. // Determines whether Google Test can use the pthreads library.
  466. #ifndef GTEST_HAS_PTHREAD
  467. // The user didn't tell us explicitly, so we assume pthreads support is
  468. // available on Linux and Mac.
  469. //
  470. // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
  471. // to your compiler flags.
  472. # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX)
  473. #endif // GTEST_HAS_PTHREAD
  474. #if GTEST_HAS_PTHREAD
  475. // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
  476. // true.
  477. # include <pthread.h> // NOLINT
  478. // For timespec and nanosleep, used below.
  479. # include <time.h> // NOLINT
  480. #endif
  481. // Determines whether Google Test can use tr1/tuple. You can define
  482. // this macro to 0 to prevent Google Test from using tuple (any
  483. // feature depending on tuple with be disabled in this mode).
  484. #ifndef GTEST_HAS_TR1_TUPLE
  485. // The user didn't tell us not to do it, so we assume it's OK.
  486. # define GTEST_HAS_TR1_TUPLE 1
  487. #endif // GTEST_HAS_TR1_TUPLE
  488. // Determines whether Google Test's own tr1 tuple implementation
  489. // should be used.
  490. #ifndef GTEST_USE_OWN_TR1_TUPLE
  491. // The user didn't tell us, so we need to figure it out.
  492. // We use our own TR1 tuple if we aren't sure the user has an
  493. // implementation of it already. At this time, GCC 4.0.0+ and MSVC
  494. // 2010 are the only mainstream compilers that come with a TR1 tuple
  495. // implementation. NVIDIA's CUDA NVCC compiler pretends to be GCC by
  496. // defining __GNUC__ and friends, but cannot compile GCC's tuple
  497. // implementation. MSVC 2008 (9.0) provides TR1 tuple in a 323 MB
  498. // Feature Pack download, which we cannot assume the user has.
  499. # if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000)) \
  500. || _MSC_VER >= 1600
  501. # define GTEST_USE_OWN_TR1_TUPLE 0
  502. # else
  503. # define GTEST_USE_OWN_TR1_TUPLE 1
  504. # endif
  505. #endif // GTEST_USE_OWN_TR1_TUPLE
  506. // To avoid conditional compilation everywhere, we make it
  507. // gtest-port.h's responsibility to #include the header implementing
  508. // tr1/tuple.
  509. #if GTEST_HAS_TR1_TUPLE
  510. # if GTEST_USE_OWN_TR1_TUPLE
  511. // This file was GENERATED by a script. DO NOT EDIT BY HAND!!!
  512. // Copyright 2009 Google Inc.
  513. // All Rights Reserved.
  514. //
  515. // Redistribution and use in source and binary forms, with or without
  516. // modification, are permitted provided that the following conditions are
  517. // met:
  518. //
  519. // * Redistributions of source code must retain the above copyright
  520. // notice, this list of conditions and the following disclaimer.
  521. // * Redistributions in binary form must reproduce the above
  522. // copyright notice, this list of conditions and the following disclaimer
  523. // in the documentation and/or other materials provided with the
  524. // distribution.
  525. // * Neither the name of Google Inc. nor the names of its
  526. // contributors may be used to endorse or promote products derived from
  527. // this software without specific prior written permission.
  528. //
  529. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  530. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  531. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  532. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  533. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  534. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  535. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  536. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  537. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  538. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  539. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  540. //
  541. // Author: [email protected] (Zhanyong Wan)
  542. // Implements a subset of TR1 tuple needed by Google Test and Google Mock.
  543. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
  544. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
  545. #include <utility> // For ::std::pair.
  546. // The compiler used in Symbian has a bug that prevents us from declaring the
  547. // tuple template as a friend (it complains that tuple is redefined). This
  548. // hack bypasses the bug by declaring the members that should otherwise be
  549. // private as public.
  550. // Sun Studio versions < 12 also have the above bug.
  551. #if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
  552. # define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
  553. #else
  554. # define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
  555. template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
  556. private:
  557. #endif
  558. // GTEST_n_TUPLE_(T) is the type of an n-tuple.
  559. #define GTEST_0_TUPLE_(T) tuple<>
  560. #define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
  561. void, void, void>
  562. #define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
  563. void, void, void>
  564. #define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
  565. void, void, void>
  566. #define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
  567. void, void, void>
  568. #define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
  569. void, void, void>
  570. #define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
  571. void, void, void>
  572. #define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  573. void, void, void>
  574. #define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  575. T##7, void, void>
  576. #define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  577. T##7, T##8, void>
  578. #define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  579. T##7, T##8, T##9>
  580. // GTEST_n_TYPENAMES_(T) declares a list of n typenames.
  581. #define GTEST_0_TYPENAMES_(T)
  582. #define GTEST_1_TYPENAMES_(T) typename T##0
  583. #define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
  584. #define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
  585. #define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  586. typename T##3
  587. #define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  588. typename T##3, typename T##4
  589. #define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  590. typename T##3, typename T##4, typename T##5
  591. #define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  592. typename T##3, typename T##4, typename T##5, typename T##6
  593. #define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  594. typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
  595. #define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  596. typename T##3, typename T##4, typename T##5, typename T##6, \
  597. typename T##7, typename T##8
  598. #define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  599. typename T##3, typename T##4, typename T##5, typename T##6, \
  600. typename T##7, typename T##8, typename T##9
  601. // In theory, defining stuff in the ::std namespace is undefined
  602. // behavior. We can do this as we are playing the role of a standard
  603. // library vendor.
  604. namespace std {
  605. namespace tr1 {
  606. template <typename T0 = void, typename T1 = void, typename T2 = void,
  607. typename T3 = void, typename T4 = void, typename T5 = void,
  608. typename T6 = void, typename T7 = void, typename T8 = void,
  609. typename T9 = void>
  610. class tuple;
  611. // Anything in namespace gtest_internal is Google Test's INTERNAL
  612. // IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
  613. namespace gtest_internal {
  614. // ByRef<T>::type is T if T is a reference; otherwise it's const T&.
  615. template <typename T>
  616. struct ByRef { typedef const T& type; }; // NOLINT
  617. template <typename T>
  618. struct ByRef<T&> { typedef T& type; }; // NOLINT
  619. // A handy wrapper for ByRef.
  620. #define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
  621. // AddRef<T>::type is T if T is a reference; otherwise it's T&. This
  622. // is the same as tr1::add_reference<T>::type.
  623. template <typename T>
  624. struct AddRef { typedef T& type; }; // NOLINT
  625. template <typename T>
  626. struct AddRef<T&> { typedef T& type; }; // NOLINT
  627. // A handy wrapper for AddRef.
  628. #define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
  629. // A helper for implementing get<k>().
  630. template <int k> class Get;
  631. // A helper for implementing tuple_element<k, T>. kIndexValid is true
  632. // iff k < the number of fields in tuple type T.
  633. template <bool kIndexValid, int kIndex, class Tuple>
  634. struct TupleElement;
  635. template <GTEST_10_TYPENAMES_(T)>
  636. struct TupleElement<true, 0, GTEST_10_TUPLE_(T)> { typedef T0 type; };
  637. template <GTEST_10_TYPENAMES_(T)>
  638. struct TupleElement<true, 1, GTEST_10_TUPLE_(T)> { typedef T1 type; };
  639. template <GTEST_10_TYPENAMES_(T)>
  640. struct TupleElement<true, 2, GTEST_10_TUPLE_(T)> { typedef T2 type; };
  641. template <GTEST_10_TYPENAMES_(T)>
  642. struct TupleElement<true, 3, GTEST_10_TUPLE_(T)> { typedef T3 type; };
  643. template <GTEST_10_TYPENAMES_(T)>
  644. struct TupleElement<true, 4, GTEST_10_TUPLE_(T)> { typedef T4 type; };
  645. template <GTEST_10_TYPENAMES_(T)>
  646. struct TupleElement<true, 5, GTEST_10_TUPLE_(T)> { typedef T5 type; };
  647. template <GTEST_10_TYPENAMES_(T)>
  648. struct TupleElement<true, 6, GTEST_10_TUPLE_(T)> { typedef T6 type; };
  649. template <GTEST_10_TYPENAMES_(T)>
  650. struct TupleElement<true, 7, GTEST_10_TUPLE_(T)> { typedef T7 type; };
  651. template <GTEST_10_TYPENAMES_(T)>
  652. struct TupleElement<true, 8, GTEST_10_TUPLE_(T)> { typedef T8 type; };
  653. template <GTEST_10_TYPENAMES_(T)>
  654. struct TupleElement<true, 9, GTEST_10_TUPLE_(T)> { typedef T9 type; };
  655. } // namespace gtest_internal
  656. template <>
  657. class tuple<> {
  658. public:
  659. tuple() {}
  660. tuple(const tuple& /* t */) {}
  661. tuple& operator=(const tuple& /* t */) { return *this; }
  662. };
  663. template <GTEST_1_TYPENAMES_(T)>
  664. class GTEST_1_TUPLE_(T) {
  665. public:
  666. template <int k> friend class gtest_internal::Get;
  667. tuple() : f0_() {}
  668. explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
  669. tuple(const tuple& t) : f0_(t.f0_) {}
  670. template <GTEST_1_TYPENAMES_(U)>
  671. tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
  672. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  673. template <GTEST_1_TYPENAMES_(U)>
  674. tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
  675. return CopyFrom(t);
  676. }
  677. GTEST_DECLARE_TUPLE_AS_FRIEND_
  678. template <GTEST_1_TYPENAMES_(U)>
  679. tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
  680. f0_ = t.f0_;
  681. return *this;
  682. }
  683. T0 f0_;
  684. };
  685. template <GTEST_2_TYPENAMES_(T)>
  686. class GTEST_2_TUPLE_(T) {
  687. public:
  688. template <int k> friend class gtest_internal::Get;
  689. tuple() : f0_(), f1_() {}
  690. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
  691. f1_(f1) {}
  692. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
  693. template <GTEST_2_TYPENAMES_(U)>
  694. tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
  695. template <typename U0, typename U1>
  696. tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
  697. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  698. template <GTEST_2_TYPENAMES_(U)>
  699. tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
  700. return CopyFrom(t);
  701. }
  702. template <typename U0, typename U1>
  703. tuple& operator=(const ::std::pair<U0, U1>& p) {
  704. f0_ = p.first;
  705. f1_ = p.second;
  706. return *this;
  707. }
  708. GTEST_DECLARE_TUPLE_AS_FRIEND_
  709. template <GTEST_2_TYPENAMES_(U)>
  710. tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
  711. f0_ = t.f0_;
  712. f1_ = t.f1_;
  713. return *this;
  714. }
  715. T0 f0_;
  716. T1 f1_;
  717. };
  718. template <GTEST_3_TYPENAMES_(T)>
  719. class GTEST_3_TUPLE_(T) {
  720. public:
  721. template <int k> friend class gtest_internal::Get;
  722. tuple() : f0_(), f1_(), f2_() {}
  723. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  724. GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
  725. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
  726. template <GTEST_3_TYPENAMES_(U)>
  727. tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
  728. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  729. template <GTEST_3_TYPENAMES_(U)>
  730. tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
  731. return CopyFrom(t);
  732. }
  733. GTEST_DECLARE_TUPLE_AS_FRIEND_
  734. template <GTEST_3_TYPENAMES_(U)>
  735. tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
  736. f0_ = t.f0_;
  737. f1_ = t.f1_;
  738. f2_ = t.f2_;
  739. return *this;
  740. }
  741. T0 f0_;
  742. T1 f1_;
  743. T2 f2_;
  744. };
  745. template <GTEST_4_TYPENAMES_(T)>
  746. class GTEST_4_TUPLE_(T) {
  747. public:
  748. template <int k> friend class gtest_internal::Get;
  749. tuple() : f0_(), f1_(), f2_(), f3_() {}
  750. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  751. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
  752. f3_(f3) {}
  753. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
  754. template <GTEST_4_TYPENAMES_(U)>
  755. tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  756. f3_(t.f3_) {}
  757. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  758. template <GTEST_4_TYPENAMES_(U)>
  759. tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
  760. return CopyFrom(t);
  761. }
  762. GTEST_DECLARE_TUPLE_AS_FRIEND_
  763. template <GTEST_4_TYPENAMES_(U)>
  764. tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
  765. f0_ = t.f0_;
  766. f1_ = t.f1_;
  767. f2_ = t.f2_;
  768. f3_ = t.f3_;
  769. return *this;
  770. }
  771. T0 f0_;
  772. T1 f1_;
  773. T2 f2_;
  774. T3 f3_;
  775. };
  776. template <GTEST_5_TYPENAMES_(T)>
  777. class GTEST_5_TUPLE_(T) {
  778. public:
  779. template <int k> friend class gtest_internal::Get;
  780. tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
  781. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  782. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
  783. GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
  784. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  785. f4_(t.f4_) {}
  786. template <GTEST_5_TYPENAMES_(U)>
  787. tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  788. f3_(t.f3_), f4_(t.f4_) {}
  789. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  790. template <GTEST_5_TYPENAMES_(U)>
  791. tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
  792. return CopyFrom(t);
  793. }
  794. GTEST_DECLARE_TUPLE_AS_FRIEND_
  795. template <GTEST_5_TYPENAMES_(U)>
  796. tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
  797. f0_ = t.f0_;
  798. f1_ = t.f1_;
  799. f2_ = t.f2_;
  800. f3_ = t.f3_;
  801. f4_ = t.f4_;
  802. return *this;
  803. }
  804. T0 f0_;
  805. T1 f1_;
  806. T2 f2_;
  807. T3 f3_;
  808. T4 f4_;
  809. };
  810. template <GTEST_6_TYPENAMES_(T)>
  811. class GTEST_6_TUPLE_(T) {
  812. public:
  813. template <int k> friend class gtest_internal::Get;
  814. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
  815. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  816. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  817. GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
  818. f5_(f5) {}
  819. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  820. f4_(t.f4_), f5_(t.f5_) {}
  821. template <GTEST_6_TYPENAMES_(U)>
  822. tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  823. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
  824. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  825. template <GTEST_6_TYPENAMES_(U)>
  826. tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
  827. return CopyFrom(t);
  828. }
  829. GTEST_DECLARE_TUPLE_AS_FRIEND_
  830. template <GTEST_6_TYPENAMES_(U)>
  831. tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
  832. f0_ = t.f0_;
  833. f1_ = t.f1_;
  834. f2_ = t.f2_;
  835. f3_ = t.f3_;
  836. f4_ = t.f4_;
  837. f5_ = t.f5_;
  838. return *this;
  839. }
  840. T0 f0_;
  841. T1 f1_;
  842. T2 f2_;
  843. T3 f3_;
  844. T4 f4_;
  845. T5 f5_;
  846. };
  847. template <GTEST_7_TYPENAMES_(T)>
  848. class GTEST_7_TUPLE_(T) {
  849. public:
  850. template <int k> friend class gtest_internal::Get;
  851. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
  852. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  853. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  854. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
  855. f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
  856. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  857. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
  858. template <GTEST_7_TYPENAMES_(U)>
  859. tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  860. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
  861. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  862. template <GTEST_7_TYPENAMES_(U)>
  863. tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
  864. return CopyFrom(t);
  865. }
  866. GTEST_DECLARE_TUPLE_AS_FRIEND_
  867. template <GTEST_7_TYPENAMES_(U)>
  868. tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
  869. f0_ = t.f0_;
  870. f1_ = t.f1_;
  871. f2_ = t.f2_;
  872. f3_ = t.f3_;
  873. f4_ = t.f4_;
  874. f5_ = t.f5_;
  875. f6_ = t.f6_;
  876. return *this;
  877. }
  878. T0 f0_;
  879. T1 f1_;
  880. T2 f2_;
  881. T3 f3_;
  882. T4 f4_;
  883. T5 f5_;
  884. T6 f6_;
  885. };
  886. template <GTEST_8_TYPENAMES_(T)>
  887. class GTEST_8_TUPLE_(T) {
  888. public:
  889. template <int k> friend class gtest_internal::Get;
  890. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
  891. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  892. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  893. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
  894. GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
  895. f5_(f5), f6_(f6), f7_(f7) {}
  896. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  897. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
  898. template <GTEST_8_TYPENAMES_(U)>
  899. tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  900. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
  901. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  902. template <GTEST_8_TYPENAMES_(U)>
  903. tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
  904. return CopyFrom(t);
  905. }
  906. GTEST_DECLARE_TUPLE_AS_FRIEND_
  907. template <GTEST_8_TYPENAMES_(U)>
  908. tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
  909. f0_ = t.f0_;
  910. f1_ = t.f1_;
  911. f2_ = t.f2_;
  912. f3_ = t.f3_;
  913. f4_ = t.f4_;
  914. f5_ = t.f5_;
  915. f6_ = t.f6_;
  916. f7_ = t.f7_;
  917. return *this;
  918. }
  919. T0 f0_;
  920. T1 f1_;
  921. T2 f2_;
  922. T3 f3_;
  923. T4 f4_;
  924. T5 f5_;
  925. T6 f6_;
  926. T7 f7_;
  927. };
  928. template <GTEST_9_TYPENAMES_(T)>
  929. class GTEST_9_TUPLE_(T) {
  930. public:
  931. template <int k> friend class gtest_internal::Get;
  932. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
  933. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  934. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  935. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
  936. GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
  937. f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
  938. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  939. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
  940. template <GTEST_9_TYPENAMES_(U)>
  941. tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  942. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
  943. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  944. template <GTEST_9_TYPENAMES_(U)>
  945. tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
  946. return CopyFrom(t);
  947. }
  948. GTEST_DECLARE_TUPLE_AS_FRIEND_
  949. template <GTEST_9_TYPENAMES_(U)>
  950. tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
  951. f0_ = t.f0_;
  952. f1_ = t.f1_;
  953. f2_ = t.f2_;
  954. f3_ = t.f3_;
  955. f4_ = t.f4_;
  956. f5_ = t.f5_;
  957. f6_ = t.f6_;
  958. f7_ = t.f7_;
  959. f8_ = t.f8_;
  960. return *this;
  961. }
  962. T0 f0_;
  963. T1 f1_;
  964. T2 f2_;
  965. T3 f3_;
  966. T4 f4_;
  967. T5 f5_;
  968. T6 f6_;
  969. T7 f7_;
  970. T8 f8_;
  971. };
  972. template <GTEST_10_TYPENAMES_(T)>
  973. class tuple {
  974. public:
  975. template <int k> friend class gtest_internal::Get;
  976. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
  977. f9_() {}
  978. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  979. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  980. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
  981. GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
  982. f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
  983. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  984. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
  985. template <GTEST_10_TYPENAMES_(U)>
  986. tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  987. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
  988. f9_(t.f9_) {}
  989. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  990. template <GTEST_10_TYPENAMES_(U)>
  991. tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
  992. return CopyFrom(t);
  993. }
  994. GTEST_DECLARE_TUPLE_AS_FRIEND_
  995. template <GTEST_10_TYPENAMES_(U)>
  996. tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
  997. f0_ = t.f0_;
  998. f1_ = t.f1_;
  999. f2_ = t.f2_;
  1000. f3_ = t.f3_;
  1001. f4_ = t.f4_;
  1002. f5_ = t.f5_;
  1003. f6_ = t.f6_;
  1004. f7_ = t.f7_;
  1005. f8_ = t.f8_;
  1006. f9_ = t.f9_;
  1007. return *this;
  1008. }
  1009. T0 f0_;
  1010. T1 f1_;
  1011. T2 f2_;
  1012. T3 f3_;
  1013. T4 f4_;
  1014. T5 f5_;
  1015. T6 f6_;
  1016. T7 f7_;
  1017. T8 f8_;
  1018. T9 f9_;
  1019. };
  1020. // 6.1.3.2 Tuple creation functions.
  1021. // Known limitations: we don't support passing an
  1022. // std::tr1::reference_wrapper<T> to make_tuple(). And we don't
  1023. // implement tie().
  1024. inline tuple<> make_tuple() { return tuple<>(); }
  1025. template <GTEST_1_TYPENAMES_(T)>
  1026. inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
  1027. return GTEST_1_TUPLE_(T)(f0);
  1028. }
  1029. template <GTEST_2_TYPENAMES_(T)>
  1030. inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
  1031. return GTEST_2_TUPLE_(T)(f0, f1);
  1032. }
  1033. template <GTEST_3_TYPENAMES_(T)>
  1034. inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
  1035. return GTEST_3_TUPLE_(T)(f0, f1, f2);
  1036. }
  1037. template <GTEST_4_TYPENAMES_(T)>
  1038. inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1039. const T3& f3) {
  1040. return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
  1041. }
  1042. template <GTEST_5_TYPENAMES_(T)>
  1043. inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1044. const T3& f3, const T4& f4) {
  1045. return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
  1046. }
  1047. template <GTEST_6_TYPENAMES_(T)>
  1048. inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1049. const T3& f3, const T4& f4, const T5& f5) {
  1050. return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
  1051. }
  1052. template <GTEST_7_TYPENAMES_(T)>
  1053. inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1054. const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
  1055. return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
  1056. }
  1057. template <GTEST_8_TYPENAMES_(T)>
  1058. inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1059. const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
  1060. return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
  1061. }
  1062. template <GTEST_9_TYPENAMES_(T)>
  1063. inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1064. const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
  1065. const T8& f8) {
  1066. return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
  1067. }
  1068. template <GTEST_10_TYPENAMES_(T)>
  1069. inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1070. const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
  1071. const T8& f8, const T9& f9) {
  1072. return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
  1073. }
  1074. // 6.1.3.3 Tuple helper classes.
  1075. template <typename Tuple> struct tuple_size;
  1076. template <GTEST_0_TYPENAMES_(T)>
  1077. struct tuple_size<GTEST_0_TUPLE_(T)> { static const int value = 0; };
  1078. template <GTEST_1_TYPENAMES_(T)>
  1079. struct tuple_size<GTEST_1_TUPLE_(T)> { static const int value = 1; };
  1080. template <GTEST_2_TYPENAMES_(T)>
  1081. struct tuple_size<GTEST_2_TUPLE_(T)> { static const int value = 2; };
  1082. template <GTEST_3_TYPENAMES_(T)>
  1083. struct tuple_size<GTEST_3_TUPLE_(T)> { static const int value = 3; };
  1084. template <GTEST_4_TYPENAMES_(T)>
  1085. struct tuple_size<GTEST_4_TUPLE_(T)> { static const int value = 4; };
  1086. template <GTEST_5_TYPENAMES_(T)>
  1087. struct tuple_size<GTEST_5_TUPLE_(T)> { static const int value = 5; };
  1088. template <GTEST_6_TYPENAMES_(T)>
  1089. struct tuple_size<GTEST_6_TUPLE_(T)> { static const int value = 6; };
  1090. template <GTEST_7_TYPENAMES_(T)>
  1091. struct tuple_size<GTEST_7_TUPLE_(T)> { static const int value = 7; };
  1092. template <GTEST_8_TYPENAMES_(T)>
  1093. struct tuple_size<GTEST_8_TUPLE_(T)> { static const int value = 8; };
  1094. template <GTEST_9_TYPENAMES_(T)>
  1095. struct tuple_size<GTEST_9_TUPLE_(T)> { static const int value = 9; };
  1096. template <GTEST_10_TYPENAMES_(T)>
  1097. struct tuple_size<GTEST_10_TUPLE_(T)> { static const int value = 10; };
  1098. template <int k, class Tuple>
  1099. struct tuple_element {
  1100. typedef typename gtest_internal::TupleElement<
  1101. k < (tuple_size<Tuple>::value), k, Tuple>::type type;
  1102. };
  1103. #define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
  1104. // 6.1.3.4 Element access.
  1105. namespace gtest_internal {
  1106. template <>
  1107. class Get<0> {
  1108. public:
  1109. template <class Tuple>
  1110. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
  1111. Field(Tuple& t) { return t.f0_; } // NOLINT
  1112. template <class Tuple>
  1113. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
  1114. ConstField(const Tuple& t) { return t.f0_; }
  1115. };
  1116. template <>
  1117. class Get<1> {
  1118. public:
  1119. template <class Tuple>
  1120. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
  1121. Field(Tuple& t) { return t.f1_; } // NOLINT
  1122. template <class Tuple>
  1123. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
  1124. ConstField(const Tuple& t) { return t.f1_; }
  1125. };
  1126. template <>
  1127. class Get<2> {
  1128. public:
  1129. template <class Tuple>
  1130. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
  1131. Field(Tuple& t) { return t.f2_; } // NOLINT
  1132. template <class Tuple>
  1133. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
  1134. ConstField(const Tuple& t) { return t.f2_; }
  1135. };
  1136. template <>
  1137. class Get<3> {
  1138. public:
  1139. template <class Tuple>
  1140. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
  1141. Field(Tuple& t) { return t.f3_; } // NOLINT
  1142. template <class Tuple>
  1143. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
  1144. ConstField(const Tuple& t) { return t.f3_; }
  1145. };
  1146. template <>
  1147. class Get<4> {
  1148. public:
  1149. template <class Tuple>
  1150. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
  1151. Field(Tuple& t) { return t.f4_; } // NOLINT
  1152. template <class Tuple>
  1153. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
  1154. ConstField(const Tuple& t) { return t.f4_; }
  1155. };
  1156. template <>
  1157. class Get<5> {
  1158. public:
  1159. template <class Tuple>
  1160. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
  1161. Field(Tuple& t) { return t.f5_; } // NOLINT
  1162. template <class Tuple>
  1163. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
  1164. ConstField(const Tuple& t) { return t.f5_; }
  1165. };
  1166. template <>
  1167. class Get<6> {
  1168. public:
  1169. template <class Tuple>
  1170. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
  1171. Field(Tuple& t) { return t.f6_; } // NOLINT
  1172. template <class Tuple>
  1173. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
  1174. ConstField(const Tuple& t) { return t.f6_; }
  1175. };
  1176. template <>
  1177. class Get<7> {
  1178. public:
  1179. template <class Tuple>
  1180. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
  1181. Field(Tuple& t) { return t.f7_; } // NOLINT
  1182. template <class Tuple>
  1183. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
  1184. ConstField(const Tuple& t) { return t.f7_; }
  1185. };
  1186. template <>
  1187. class Get<8> {
  1188. public:
  1189. template <class Tuple>
  1190. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
  1191. Field(Tuple& t) { return t.f8_; } // NOLINT
  1192. template <class Tuple>
  1193. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
  1194. ConstField(const Tuple& t) { return t.f8_; }
  1195. };
  1196. template <>
  1197. class Get<9> {
  1198. public:
  1199. template <class Tuple>
  1200. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
  1201. Field(Tuple& t) { return t.f9_; } // NOLINT
  1202. template <class Tuple>
  1203. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
  1204. ConstField(const Tuple& t) { return t.f9_; }
  1205. };
  1206. } // namespace gtest_internal
  1207. template <int k, GTEST_10_TYPENAMES_(T)>
  1208. GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
  1209. get(GTEST_10_TUPLE_(T)& t) {
  1210. return gtest_internal::Get<k>::Field(t);
  1211. }
  1212. template <int k, GTEST_10_TYPENAMES_(T)>
  1213. GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
  1214. get(const GTEST_10_TUPLE_(T)& t) {
  1215. return gtest_internal::Get<k>::ConstField(t);
  1216. }
  1217. // 6.1.3.5 Relational operators
  1218. // We only implement == and !=, as we don't have a need for the rest yet.
  1219. namespace gtest_internal {
  1220. // SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
  1221. // first k fields of t1 equals the first k fields of t2.
  1222. // SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
  1223. // k1 != k2.
  1224. template <int kSize1, int kSize2>
  1225. struct SameSizeTuplePrefixComparator;
  1226. template <>
  1227. struct SameSizeTuplePrefixComparator<0, 0> {
  1228. template <class Tuple1, class Tuple2>
  1229. static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
  1230. return true;
  1231. }
  1232. };
  1233. template <int k>
  1234. struct SameSizeTuplePrefixComparator<k, k> {
  1235. template <class Tuple1, class Tuple2>
  1236. static bool Eq(const Tuple1& t1, const Tuple2& t2) {
  1237. return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
  1238. ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
  1239. }
  1240. };
  1241. } // namespace gtest_internal
  1242. template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
  1243. inline bool operator==(const GTEST_10_TUPLE_(T)& t,
  1244. const GTEST_10_TUPLE_(U)& u) {
  1245. return gtest_internal::SameSizeTuplePrefixComparator<
  1246. tuple_size<GTEST_10_TUPLE_(T)>::value,
  1247. tuple_size<GTEST_10_TUPLE_(U)>::value>::Eq(t, u);
  1248. }
  1249. template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
  1250. inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
  1251. const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
  1252. // 6.1.4 Pairs.
  1253. // Unimplemented.
  1254. } // namespace tr1
  1255. } // namespace std
  1256. #undef GTEST_0_TUPLE_
  1257. #undef GTEST_1_TUPLE_
  1258. #undef GTEST_2_TUPLE_
  1259. #undef GTEST_3_TUPLE_
  1260. #undef GTEST_4_TUPLE_
  1261. #undef GTEST_5_TUPLE_
  1262. #undef GTEST_6_TUPLE_
  1263. #undef GTEST_7_TUPLE_
  1264. #undef GTEST_8_TUPLE_
  1265. #undef GTEST_9_TUPLE_
  1266. #undef GTEST_10_TUPLE_
  1267. #undef GTEST_0_TYPENAMES_
  1268. #undef GTEST_1_TYPENAMES_
  1269. #undef GTEST_2_TYPENAMES_
  1270. #undef GTEST_3_TYPENAMES_
  1271. #undef GTEST_4_TYPENAMES_
  1272. #undef GTEST_5_TYPENAMES_
  1273. #undef GTEST_6_TYPENAMES_
  1274. #undef GTEST_7_TYPENAMES_
  1275. #undef GTEST_8_TYPENAMES_
  1276. #undef GTEST_9_TYPENAMES_
  1277. #undef GTEST_10_TYPENAMES_
  1278. #undef GTEST_DECLARE_TUPLE_AS_FRIEND_
  1279. #undef GTEST_BY_REF_
  1280. #undef GTEST_ADD_REF_
  1281. #undef GTEST_TUPLE_ELEMENT_
  1282. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
  1283. # elif GTEST_OS_SYMBIAN
  1284. // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
  1285. // use STLport's tuple implementation, which unfortunately doesn't
  1286. // work as the copy of STLport distributed with Symbian is incomplete.
  1287. // By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
  1288. // use its own tuple implementation.
  1289. # ifdef BOOST_HAS_TR1_TUPLE
  1290. # undef BOOST_HAS_TR1_TUPLE
  1291. # endif // BOOST_HAS_TR1_TUPLE
  1292. // This prevents <boost/tr1/detail/config.hpp>, which defines
  1293. // BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
  1294. # define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
  1295. # include <tuple>
  1296. # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
  1297. // GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header. This does
  1298. // not conform to the TR1 spec, which requires the header to be <tuple>.
  1299. # if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
  1300. // Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
  1301. // which is #included by <tr1/tuple>, to not compile when RTTI is
  1302. // disabled. _TR1_FUNCTIONAL is the header guard for
  1303. // <tr1/functional>. Hence the following #define is a hack to prevent
  1304. // <tr1/functional> from being included.
  1305. # define _TR1_FUNCTIONAL 1
  1306. # include <tr1/tuple>
  1307. # undef _TR1_FUNCTIONAL // Allows the user to #include
  1308. // <tr1/functional> if he chooses to.
  1309. # else
  1310. # include <tr1/tuple> // NOLINT
  1311. # endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
  1312. # else
  1313. // If the compiler is not GCC 4.0+, we assume the user is using a
  1314. // spec-conforming TR1 implementation.
  1315. # include <tuple> // NOLINT
  1316. # endif // GTEST_USE_OWN_TR1_TUPLE
  1317. #endif // GTEST_HAS_TR1_TUPLE
  1318. // Determines whether clone(2) is supported.
  1319. // Usually it will only be available on Linux, excluding
  1320. // Linux on the Itanium architecture.
  1321. // Also see http://linux.die.net/man/2/clone.
  1322. #ifndef GTEST_HAS_CLONE
  1323. // The user didn't tell us, so we need to figure it out.
  1324. # if GTEST_OS_LINUX && !defined(__ia64__)
  1325. # define GTEST_HAS_CLONE 1
  1326. # else
  1327. # define GTEST_HAS_CLONE 0
  1328. # endif // GTEST_OS_LINUX && !defined(__ia64__)
  1329. #endif // GTEST_HAS_CLONE
  1330. // Determines whether to support stream redirection. This is used to test
  1331. // output correctness and to implement death tests.
  1332. #ifndef GTEST_HAS_STREAM_REDIRECTION
  1333. // By default, we assume that stream redirection is supported on all
  1334. // platforms except known mobile ones.
  1335. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN
  1336. # define GTEST_HAS_STREAM_REDIRECTION 0
  1337. # else
  1338. # define GTEST_HAS_STREAM_REDIRECTION 1
  1339. # endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
  1340. #endif // GTEST_HAS_STREAM_REDIRECTION
  1341. // Determines whether to support death tests.
  1342. // Google Test does not support death tests for VC 7.1 and earlier as
  1343. // abort() in a VC 7.1 application compiled as GUI in debug config
  1344. // pops up a dialog window that cannot be suppressed programmatically.
  1345. #if (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
  1346. (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
  1347. GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX)
  1348. # define GTEST_HAS_DEATH_TEST 1
  1349. # include <vector> // NOLINT
  1350. #endif
  1351. // We don't support MSVC 7.1 with exceptions disabled now. Therefore
  1352. // all the compilers we care about are adequate for supporting
  1353. // value-parameterized tests.
  1354. #define GTEST_HAS_PARAM_TEST 1
  1355. // Determines whether to support type-driven tests.
  1356. // Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
  1357. // Sun Pro CC, IBM Visual Age, and HP aCC support.
  1358. #if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
  1359. defined(__IBMCPP__) || defined(__HP_aCC)
  1360. # define GTEST_HAS_TYPED_TEST 1
  1361. # define GTEST_HAS_TYPED_TEST_P 1
  1362. #endif
  1363. // Determines whether to support Combine(). This only makes sense when
  1364. // value-parameterized tests are enabled. The implementation doesn't
  1365. // work on Sun Studio since it doesn't understand templated conversion
  1366. // operators.
  1367. #if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)
  1368. # define GTEST_HAS_COMBINE 1
  1369. #endif
  1370. // Determines whether the system compiler uses UTF-16 for encoding wide strings.
  1371. #define GTEST_WIDE_STRING_USES_UTF16_ \
  1372. (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
  1373. // Determines whether test results can be streamed to a socket.
  1374. #if GTEST_OS_LINUX
  1375. # define GTEST_CAN_STREAM_RESULTS_ 1
  1376. #endif
  1377. // Defines some utility macros.
  1378. // The GNU compiler emits a warning if nested "if" statements are followed by
  1379. // an "else" statement and braces are not used to explicitly disambiguate the
  1380. // "else" binding. This leads to problems with code like:
  1381. //
  1382. // if (gate)
  1383. // ASSERT_*(condition) << "Some message";
  1384. //
  1385. // The "switch (0) case 0:" idiom is used to suppress this.
  1386. #ifdef __INTEL_COMPILER
  1387. # define GTEST_AMBIGUOUS_ELSE_BLOCKER_
  1388. #else
  1389. # define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default: // NOLINT
  1390. #endif
  1391. // Use this annotation at the end of a struct/class definition to
  1392. // prevent the compiler from optimizing away instances that are never
  1393. // used. This is useful when all interesting logic happens inside the
  1394. // c'tor and / or d'tor. Example:
  1395. //
  1396. // struct Foo {
  1397. // Foo() { ... }
  1398. // } GTEST_ATTRIBUTE_UNUSED_;
  1399. //
  1400. // Also use it after a variable or parameter declaration to tell the
  1401. // compiler the variable/parameter does not have to be used.
  1402. #if defined(__GNUC__) && !defined(COMPILER_ICC)
  1403. # define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
  1404. #else
  1405. # define GTEST_ATTRIBUTE_UNUSED_
  1406. #endif
  1407. // A macro to disallow operator=
  1408. // This should be used in the private: declarations for a class.
  1409. #define GTEST_DISALLOW_ASSIGN_(type)\
  1410. void operator=(type const &)
  1411. // A macro to disallow copy constructor and operator=
  1412. // This should be used in the private: declarations for a class.
  1413. #define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
  1414. type(type const &);\
  1415. GTEST_DISALLOW_ASSIGN_(type)
  1416. // Tell the compiler to warn about unused return values for functions declared
  1417. // with this macro. The macro should be used on function declarations
  1418. // following the argument list:
  1419. //
  1420. // Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
  1421. #if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
  1422. # define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
  1423. #else
  1424. # define GTEST_MUST_USE_RESULT_
  1425. #endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
  1426. // Determine whether the compiler supports Microsoft's Structured Exception
  1427. // Handling. This is supported by several Windows compilers but generally
  1428. // does not exist on any other system.
  1429. #ifndef GTEST_HAS_SEH
  1430. // The user didn't tell us, so we need to figure it out.
  1431. # if defined(_MSC_VER) || defined(__BORLANDC__)
  1432. // These two compilers are known to support SEH.
  1433. # define GTEST_HAS_SEH 1
  1434. # else
  1435. // Assume no SEH.
  1436. # define GTEST_HAS_SEH 0
  1437. # endif
  1438. #endif // GTEST_HAS_SEH
  1439. #ifdef _MSC_VER
  1440. # if GTEST_LINKED_AS_SHARED_LIBRARY
  1441. # define GTEST_API_ __declspec(dllimport)
  1442. # elif GTEST_CREATE_SHARED_LIBRARY
  1443. # define GTEST_API_ __declspec(dllexport)
  1444. # endif
  1445. #endif // _MSC_VER
  1446. #ifndef GTEST_API_
  1447. # define GTEST_API_
  1448. #endif
  1449. #ifdef __GNUC__
  1450. // Ask the compiler to never inline a given function.
  1451. # define GTEST_NO_INLINE_ __attribute__((noinline))
  1452. #else
  1453. # define GTEST_NO_INLINE_
  1454. #endif
  1455. namespace testing {
  1456. class Message;
  1457. namespace internal {
  1458. class String;
  1459. // The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
  1460. // expression is true. For example, you could use it to verify the
  1461. // size of a static array:
  1462. //
  1463. // GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,
  1464. // content_type_names_incorrect_size);
  1465. //
  1466. // or to make sure a struct is smaller than a certain size:
  1467. //
  1468. // GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
  1469. //
  1470. // The second argument to the macro is the name of the variable. If
  1471. // the expression is false, most compilers will issue a warning/error
  1472. // containing the name of the variable.
  1473. template <bool>
  1474. struct CompileAssert {
  1475. };
  1476. #define GTEST_COMPILE_ASSERT_(expr, msg) \
  1477. typedef ::testing::internal::CompileAssert<(bool(expr))> \
  1478. msg[bool(expr) ? 1 : -1]
  1479. // Implementation details of GTEST_COMPILE_ASSERT_:
  1480. //
  1481. // - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
  1482. // elements (and thus is invalid) when the expression is false.
  1483. //
  1484. // - The simpler definition
  1485. //
  1486. // #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
  1487. //
  1488. // does not work, as gcc supports variable-length arrays whose sizes
  1489. // are determined at run-time (this is gcc's extension and not part
  1490. // of the C++ standard). As a result, gcc fails to reject the
  1491. // following code with the simple definition:
  1492. //
  1493. // int foo;
  1494. // GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
  1495. // // not a compile-time constant.
  1496. //
  1497. // - By using the type CompileAssert<(bool(expr))>, we ensures that
  1498. // expr is a compile-time constant. (Template arguments must be
  1499. // determined at compile-time.)
  1500. //
  1501. // - The outter parentheses in CompileAssert<(bool(expr))> are necessary
  1502. // to work around a bug in gcc 3.4.4 and 4.0.1. If we had written
  1503. //
  1504. // CompileAssert<bool(expr)>
  1505. //
  1506. // instead, these compilers will refuse to compile
  1507. //
  1508. // GTEST_COMPILE_ASSERT_(5 > 0, some_message);
  1509. //
  1510. // (They seem to think the ">" in "5 > 0" marks the end of the
  1511. // template argument list.)
  1512. //
  1513. // - The array size is (bool(expr) ? 1 : -1), instead of simply
  1514. //
  1515. // ((expr) ? 1 : -1).
  1516. //
  1517. // This is to avoid running into a bug in MS VC 7.1, which
  1518. // causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
  1519. // StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
  1520. //
  1521. // This template is declared, but intentionally undefined.
  1522. template <typename T1, typename T2>
  1523. struct StaticAssertTypeEqHelper;
  1524. template <typename T>
  1525. struct StaticAssertTypeEqHelper<T, T> {};
  1526. #if GTEST_HAS_GLOBAL_STRING
  1527. typedef ::string string;
  1528. #else
  1529. typedef ::std::string string;
  1530. #endif // GTEST_HAS_GLOBAL_STRING
  1531. #if GTEST_HAS_GLOBAL_WSTRING
  1532. typedef ::wstring wstring;
  1533. #elif GTEST_HAS_STD_WSTRING
  1534. typedef ::std::wstring wstring;
  1535. #endif // GTEST_HAS_GLOBAL_WSTRING
  1536. // A helper for suppressing warnings on constant condition. It just
  1537. // returns 'condition'.
  1538. GTEST_API_ bool IsTrue(bool condition);
  1539. // Defines scoped_ptr.
  1540. // This implementation of scoped_ptr is PARTIAL - it only contains
  1541. // enough stuff to satisfy Google Test's need.
  1542. template <typename T>
  1543. class scoped_ptr {
  1544. public:
  1545. typedef T element_type;
  1546. explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
  1547. ~scoped_ptr() { reset(); }
  1548. T& operator*() const { return *ptr_; }
  1549. T* operator->() const { return ptr_; }
  1550. T* get() const { return ptr_; }
  1551. T* release() {
  1552. T* const ptr = ptr_;
  1553. ptr_ = NULL;
  1554. return ptr;
  1555. }
  1556. void reset(T* p = NULL) {
  1557. if (p != ptr_) {
  1558. if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type.
  1559. delete ptr_;
  1560. }
  1561. ptr_ = p;
  1562. }
  1563. }
  1564. private:
  1565. T* ptr_;
  1566. GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
  1567. };
  1568. // Defines RE.
  1569. // A simple C++ wrapper for <regex.h>. It uses the POSIX Extended
  1570. // Regular Expression syntax.
  1571. class GTEST_API_ RE {
  1572. public:
  1573. // A copy constructor is required by the Standard to initialize object
  1574. // references from r-values.
  1575. RE(const RE& other) { Init(other.pattern()); }
  1576. // Constructs an RE from a string.
  1577. RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT
  1578. #if GTEST_HAS_GLOBAL_STRING
  1579. RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT
  1580. #endif // GTEST_HAS_GLOBAL_STRING
  1581. RE(const char* regex) { Init(regex); } // NOLINT
  1582. ~RE();
  1583. // Returns the string representation of the regex.
  1584. const char* pattern() const { return pattern_; }
  1585. // FullMatch(str, re) returns true iff regular expression re matches
  1586. // the entire str.
  1587. // PartialMatch(str, re) returns true iff regular expression re
  1588. // matches a substring of str (including str itself).
  1589. //
  1590. // TODO([email protected]): make FullMatch() and PartialMatch() work
  1591. // when str contains NUL characters.
  1592. static bool FullMatch(const ::std::string& str, const RE& re) {
  1593. return FullMatch(str.c_str(), re);
  1594. }
  1595. static bool PartialMatch(const ::std::string& str, const RE& re) {
  1596. return PartialMatch(str.c_str(), re);
  1597. }
  1598. #if GTEST_HAS_GLOBAL_STRING
  1599. static bool FullMatch(const ::string& str, const RE& re) {
  1600. return FullMatch(str.c_str(), re);
  1601. }
  1602. static bool PartialMatch(const ::string& str, const RE& re) {
  1603. return PartialMatch(str.c_str(), re);
  1604. }
  1605. #endif // GTEST_HAS_GLOBAL_STRING
  1606. static bool FullMatch(const char* str, const RE& re);
  1607. static bool PartialMatch(const char* str, const RE& re);
  1608. private:
  1609. void Init(const char* regex);
  1610. // We use a const char* instead of a string, as Google Test may be used
  1611. // where string is not available. We also do not use Google Test's own
  1612. // String type here, in order to simplify dependencies between the
  1613. // files.
  1614. const char* pattern_;
  1615. bool is_valid_;
  1616. #if GTEST_USES_POSIX_RE
  1617. regex_t full_regex_; // For FullMatch().
  1618. regex_t partial_regex_; // For PartialMatch().
  1619. #else // GTEST_USES_SIMPLE_RE
  1620. const char* full_pattern_; // For FullMatch();
  1621. #endif
  1622. GTEST_DISALLOW_ASSIGN_(RE);
  1623. };
  1624. // Formats a source file path and a line number as they would appear
  1625. // in an error message from the compiler used to compile this code.
  1626. GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
  1627. // Formats a file location for compiler-independent XML output.
  1628. // Although this function is not platform dependent, we put it next to
  1629. // FormatFileLocation in order to contrast the two functions.
  1630. GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
  1631. int line);
  1632. // Defines logging utilities:
  1633. // GTEST_LOG_(severity) - logs messages at the specified severity level. The
  1634. // message itself is streamed into the macro.
  1635. // LogToStderr() - directs all log messages to stderr.
  1636. // FlushInfoLog() - flushes informational log messages.
  1637. enum GTestLogSeverity {
  1638. GTEST_INFO,
  1639. GTEST_WARNING,
  1640. GTEST_ERROR,
  1641. GTEST_FATAL
  1642. };
  1643. // Formats log entry severity, provides a stream object for streaming the
  1644. // log message, and terminates the message with a newline when going out of
  1645. // scope.
  1646. class GTEST_API_ GTestLog {
  1647. public:
  1648. GTestLog(GTestLogSeverity severity, const char* file, int line);
  1649. // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
  1650. ~GTestLog();
  1651. ::std::ostream& GetStream() { return ::std::cerr; }
  1652. private:
  1653. const GTestLogSeverity severity_;
  1654. GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
  1655. };
  1656. #define GTEST_LOG_(severity) \
  1657. ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
  1658. __FILE__, __LINE__).GetStream()
  1659. inline void LogToStderr() {}
  1660. inline void FlushInfoLog() { fflush(NULL); }
  1661. // INTERNAL IMPLEMENTATION - DO NOT USE.
  1662. //
  1663. // GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
  1664. // is not satisfied.
  1665. // Synopsys:
  1666. // GTEST_CHECK_(boolean_condition);
  1667. // or
  1668. // GTEST_CHECK_(boolean_condition) << "Additional message";
  1669. //
  1670. // This checks the condition and if the condition is not satisfied
  1671. // it prints message about the condition violation, including the
  1672. // condition itself, plus additional message streamed into it, if any,
  1673. // and then it aborts the program. It aborts the program irrespective of
  1674. // whether it is built in the debug mode or not.
  1675. #define GTEST_CHECK_(condition) \
  1676. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  1677. if (::testing::internal::IsTrue(condition)) \
  1678. ; \
  1679. else \
  1680. GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
  1681. // An all-mode assert to verify that the given POSIX-style function
  1682. // call returns 0 (indicating success). Known limitation: this
  1683. // doesn't expand to a balanced 'if' statement, so enclose the macro
  1684. // in {} if you need to use it as the only statement in an 'if'
  1685. // branch.
  1686. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
  1687. if (const int gtest_error = (posix_call)) \
  1688. GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
  1689. << gtest_error
  1690. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  1691. //
  1692. // Use ImplicitCast_ as a safe version of static_cast for upcasting in
  1693. // the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
  1694. // const Foo*). When you use ImplicitCast_, the compiler checks that
  1695. // the cast is safe. Such explicit ImplicitCast_s are necessary in
  1696. // surprisingly many situations where C++ demands an exact type match
  1697. // instead of an argument type convertable to a target type.
  1698. //
  1699. // The syntax for using ImplicitCast_ is the same as for static_cast:
  1700. //
  1701. // ImplicitCast_<ToType>(expr)
  1702. //
  1703. // ImplicitCast_ would have been part of the C++ standard library,
  1704. // but the proposal was submitted too late. It will probably make
  1705. // its way into the language in the future.
  1706. //
  1707. // This relatively ugly name is intentional. It prevents clashes with
  1708. // similar functions users may have (e.g., implicit_cast). The internal
  1709. // namespace alone is not enough because the function can be found by ADL.
  1710. template<typename To>
  1711. inline To ImplicitCast_(To x) { return x; }
  1712. // When you upcast (that is, cast a pointer from type Foo to type
  1713. // SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
  1714. // always succeed. When you downcast (that is, cast a pointer from
  1715. // type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
  1716. // how do you know the pointer is really of type SubclassOfFoo? It
  1717. // could be a bare Foo, or of type DifferentSubclassOfFoo. Thus,
  1718. // when you downcast, you should use this macro. In debug mode, we
  1719. // use dynamic_cast<> to double-check the downcast is legal (we die
  1720. // if it's not). In normal mode, we do the efficient static_cast<>
  1721. // instead. Thus, it's important to test in debug mode to make sure
  1722. // the cast is legal!
  1723. // This is the only place in the code we should use dynamic_cast<>.
  1724. // In particular, you SHOULDN'T be using dynamic_cast<> in order to
  1725. // do RTTI (eg code like this:
  1726. // if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
  1727. // if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
  1728. // You should design the code some other way not to need this.
  1729. //
  1730. // This relatively ugly name is intentional. It prevents clashes with
  1731. // similar functions users may have (e.g., down_cast). The internal
  1732. // namespace alone is not enough because the function can be found by ADL.
  1733. template<typename To, typename From> // use like this: DownCast_<T*>(foo);
  1734. inline To DownCast_(From* f) { // so we only accept pointers
  1735. // Ensures that To is a sub-type of From *. This test is here only
  1736. // for compile-time type checking, and has no overhead in an
  1737. // optimized build at run-time, as it will be optimized away
  1738. // completely.
  1739. if (false) {
  1740. const To to = NULL;
  1741. ::testing::internal::ImplicitCast_<From*>(to);
  1742. }
  1743. #if GTEST_HAS_RTTI
  1744. // RTTI: debug mode only!
  1745. GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
  1746. #endif
  1747. return static_cast<To>(f);
  1748. }
  1749. // Downcasts the pointer of type Base to Derived.
  1750. // Derived must be a subclass of Base. The parameter MUST
  1751. // point to a class of type Derived, not any subclass of it.
  1752. // When RTTI is available, the function performs a runtime
  1753. // check to enforce this.
  1754. template <class Derived, class Base>
  1755. Derived* CheckedDowncastToActualType(Base* base) {
  1756. #if GTEST_HAS_RTTI
  1757. GTEST_CHECK_(typeid(*base) == typeid(Derived));
  1758. return dynamic_cast<Derived*>(base); // NOLINT
  1759. #else
  1760. return static_cast<Derived*>(base); // Poor man's downcast.
  1761. #endif
  1762. }
  1763. #if GTEST_HAS_STREAM_REDIRECTION
  1764. // Defines the stderr capturer:
  1765. // CaptureStdout - starts capturing stdout.
  1766. // GetCapturedStdout - stops capturing stdout and returns the captured string.
  1767. // CaptureStderr - starts capturing stderr.
  1768. // GetCapturedStderr - stops capturing stderr and returns the captured string.
  1769. //
  1770. GTEST_API_ void CaptureStdout();
  1771. GTEST_API_ String GetCapturedStdout();
  1772. GTEST_API_ void CaptureStderr();
  1773. GTEST_API_ String GetCapturedStderr();
  1774. #endif // GTEST_HAS_STREAM_REDIRECTION
  1775. #if GTEST_HAS_DEATH_TEST
  1776. // A copy of all command line arguments. Set by InitGoogleTest().
  1777. extern ::std::vector<String> g_argvs;
  1778. // GTEST_HAS_DEATH_TEST implies we have ::std::string.
  1779. const ::std::vector<String>& GetArgvs();
  1780. #endif // GTEST_HAS_DEATH_TEST
  1781. // Defines synchronization primitives.
  1782. #if GTEST_HAS_PTHREAD
  1783. // Sleeps for (roughly) n milli-seconds. This function is only for
  1784. // testing Google Test's own constructs. Don't use it in user tests,
  1785. // either directly or indirectly.
  1786. inline void SleepMilliseconds(int n) {
  1787. const timespec time = {
  1788. 0, // 0 seconds.
  1789. n * 1000L * 1000L, // And n ms.
  1790. };
  1791. nanosleep(&time, NULL);
  1792. }
  1793. // Allows a controller thread to pause execution of newly created
  1794. // threads until notified. Instances of this class must be created
  1795. // and destroyed in the controller thread.
  1796. //
  1797. // This class is only for testing Google Test's own constructs. Do not
  1798. // use it in user tests, either directly or indirectly.
  1799. class Notification {
  1800. public:
  1801. Notification() : notified_(false) {}
  1802. // Notifies all threads created with this notification to start. Must
  1803. // be called from the controller thread.
  1804. void Notify() { notified_ = true; }
  1805. // Blocks until the controller thread notifies. Must be called from a test
  1806. // thread.
  1807. void WaitForNotification() {
  1808. while(!notified_) {
  1809. SleepMilliseconds(10);
  1810. }
  1811. }
  1812. private:
  1813. volatile bool notified_;
  1814. GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
  1815. };
  1816. // As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
  1817. // Consequently, it cannot select a correct instantiation of ThreadWithParam
  1818. // in order to call its Run(). Introducing ThreadWithParamBase as a
  1819. // non-templated base class for ThreadWithParam allows us to bypass this
  1820. // problem.
  1821. class ThreadWithParamBase {
  1822. public:
  1823. virtual ~ThreadWithParamBase() {}
  1824. virtual void Run() = 0;
  1825. };
  1826. // pthread_create() accepts a pointer to a function type with the C linkage.
  1827. // According to the Standard (7.5/1), function types with different linkages
  1828. // are different even if they are otherwise identical. Some compilers (for
  1829. // example, SunStudio) treat them as different types. Since class methods
  1830. // cannot be defined with C-linkage we need to define a free C-function to
  1831. // pass into pthread_create().
  1832. extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
  1833. static_cast<ThreadWithParamBase*>(thread)->Run();
  1834. return NULL;
  1835. }
  1836. // Helper class for testing Google Test's multi-threading constructs.
  1837. // To use it, write:
  1838. //
  1839. // void ThreadFunc(int param) { /* Do things with param */ }
  1840. // Notification thread_can_start;
  1841. // ...
  1842. // // The thread_can_start parameter is optional; you can supply NULL.
  1843. // ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
  1844. // thread_can_start.Notify();
  1845. //
  1846. // These classes are only for testing Google Test's own constructs. Do
  1847. // not use them in user tests, either directly or indirectly.
  1848. template <typename T>
  1849. class ThreadWithParam : public ThreadWithParamBase {
  1850. public:
  1851. typedef void (*UserThreadFunc)(T);
  1852. ThreadWithParam(
  1853. UserThreadFunc func, T param, Notification* thread_can_start)
  1854. : func_(func),
  1855. param_(param),
  1856. thread_can_start_(thread_can_start),
  1857. finished_(false) {
  1858. ThreadWithParamBase* const base = this;
  1859. // The thread can be created only after all fields except thread_
  1860. // have been initialized.
  1861. GTEST_CHECK_POSIX_SUCCESS_(
  1862. pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
  1863. }
  1864. ~ThreadWithParam() { Join(); }
  1865. void Join() {
  1866. if (!finished_) {
  1867. GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
  1868. finished_ = true;
  1869. }
  1870. }
  1871. virtual void Run() {
  1872. if (thread_can_start_ != NULL)
  1873. thread_can_start_->WaitForNotification();
  1874. func_(param_);
  1875. }
  1876. private:
  1877. const UserThreadFunc func_; // User-supplied thread function.
  1878. const T param_; // User-supplied parameter to the thread function.
  1879. // When non-NULL, used to block execution until the controller thread
  1880. // notifies.
  1881. Notification* const thread_can_start_;
  1882. bool finished_; // true iff we know that the thread function has finished.
  1883. pthread_t thread_; // The native thread object.
  1884. GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
  1885. };
  1886. // MutexBase and Mutex implement mutex on pthreads-based platforms. They
  1887. // are used in conjunction with class MutexLock:
  1888. //
  1889. // Mutex mutex;
  1890. // ...
  1891. // MutexLock lock(&mutex); // Acquires the mutex and releases it at the end
  1892. // // of the current scope.
  1893. //
  1894. // MutexBase implements behavior for both statically and dynamically
  1895. // allocated mutexes. Do not use MutexBase directly. Instead, write
  1896. // the following to define a static mutex:
  1897. //
  1898. // GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
  1899. //
  1900. // You can forward declare a static mutex like this:
  1901. //
  1902. // GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
  1903. //
  1904. // To create a dynamic mutex, just define an object of type Mutex.
  1905. class MutexBase {
  1906. public:
  1907. // Acquires this mutex.
  1908. void Lock() {
  1909. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
  1910. owner_ = pthread_self();
  1911. }
  1912. // Releases this mutex.
  1913. void Unlock() {
  1914. // We don't protect writing to owner_ here, as it's the caller's
  1915. // responsibility to ensure that the current thread holds the
  1916. // mutex when this is called.
  1917. owner_ = 0;
  1918. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
  1919. }
  1920. // Does nothing if the current thread holds the mutex. Otherwise, crashes
  1921. // with high probability.
  1922. void AssertHeld() const {
  1923. GTEST_CHECK_(owner_ == pthread_self())
  1924. << "The current thread is not holding the mutex @" << this;
  1925. }
  1926. // A static mutex may be used before main() is entered. It may even
  1927. // be used before the dynamic initialization stage. Therefore we
  1928. // must be able to initialize a static mutex object at link time.
  1929. // This means MutexBase has to be a POD and its member variables
  1930. // have to be public.
  1931. public:
  1932. pthread_mutex_t mutex_; // The underlying pthread mutex.
  1933. pthread_t owner_; // The thread holding the mutex; 0 means no one holds it.
  1934. };
  1935. // Forward-declares a static mutex.
  1936. # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
  1937. extern ::testing::internal::MutexBase mutex
  1938. // Defines and statically (i.e. at link time) initializes a static mutex.
  1939. # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
  1940. ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, 0 }
  1941. // The Mutex class can only be used for mutexes created at runtime. It
  1942. // shares its API with MutexBase otherwise.
  1943. class Mutex : public MutexBase {
  1944. public:
  1945. Mutex() {
  1946. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
  1947. owner_ = 0;
  1948. }
  1949. ~Mutex() {
  1950. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
  1951. }
  1952. private:
  1953. GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
  1954. };
  1955. // We cannot name this class MutexLock as the ctor declaration would
  1956. // conflict with a macro named MutexLock, which is defined on some
  1957. // platforms. Hence the typedef trick below.
  1958. class GTestMutexLock {
  1959. public:
  1960. explicit GTestMutexLock(MutexBase* mutex)
  1961. : mutex_(mutex) { mutex_->Lock(); }
  1962. ~GTestMutexLock() { mutex_->Unlock(); }
  1963. private:
  1964. MutexBase* const mutex_;
  1965. GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
  1966. };
  1967. typedef GTestMutexLock MutexLock;
  1968. // Helpers for ThreadLocal.
  1969. // pthread_key_create() requires DeleteThreadLocalValue() to have
  1970. // C-linkage. Therefore it cannot be templatized to access
  1971. // ThreadLocal<T>. Hence the need for class
  1972. // ThreadLocalValueHolderBase.
  1973. class ThreadLocalValueHolderBase {
  1974. public:
  1975. virtual ~ThreadLocalValueHolderBase() {}
  1976. };
  1977. // Called by pthread to delete thread-local data stored by
  1978. // pthread_setspecific().
  1979. extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
  1980. delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
  1981. }
  1982. // Implements thread-local storage on pthreads-based systems.
  1983. //
  1984. // // Thread 1
  1985. // ThreadLocal<int> tl(100); // 100 is the default value for each thread.
  1986. //
  1987. // // Thread 2
  1988. // tl.set(150); // Changes the value for thread 2 only.
  1989. // EXPECT_EQ(150, tl.get());
  1990. //
  1991. // // Thread 1
  1992. // EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value.
  1993. // tl.set(200);
  1994. // EXPECT_EQ(200, tl.get());
  1995. //
  1996. // The template type argument T must have a public copy constructor.
  1997. // In addition, the default ThreadLocal constructor requires T to have
  1998. // a public default constructor.
  1999. //
  2000. // An object managed for a thread by a ThreadLocal instance is deleted
  2001. // when the thread exits. Or, if the ThreadLocal instance dies in
  2002. // that thread, when the ThreadLocal dies. It's the user's
  2003. // responsibility to ensure that all other threads using a ThreadLocal
  2004. // have exited when it dies, or the per-thread objects for those
  2005. // threads will not be deleted.
  2006. //
  2007. // Google Test only uses global ThreadLocal objects. That means they
  2008. // will die after main() has returned. Therefore, no per-thread
  2009. // object managed by Google Test will be leaked as long as all threads
  2010. // using Google Test have exited when main() returns.
  2011. template <typename T>
  2012. class ThreadLocal {
  2013. public:
  2014. ThreadLocal() : key_(CreateKey()),
  2015. default_() {}
  2016. explicit ThreadLocal(const T& value) : key_(CreateKey()),
  2017. default_(value) {}
  2018. ~ThreadLocal() {
  2019. // Destroys the managed object for the current thread, if any.
  2020. DeleteThreadLocalValue(pthread_getspecific(key_));
  2021. // Releases resources associated with the key. This will *not*
  2022. // delete managed objects for other threads.
  2023. GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
  2024. }
  2025. T* pointer() { return GetOrCreateValue(); }
  2026. const T* pointer() const { return GetOrCreateValue(); }
  2027. const T& get() const { return *pointer(); }
  2028. void set(const T& value) { *pointer() = value; }
  2029. private:
  2030. // Holds a value of type T.
  2031. class ValueHolder : public ThreadLocalValueHolderBase {
  2032. public:
  2033. explicit ValueHolder(const T& value) : value_(value) {}
  2034. T* pointer() { return &value_; }
  2035. private:
  2036. T value_;
  2037. GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
  2038. };
  2039. static pthread_key_t CreateKey() {
  2040. pthread_key_t key;
  2041. // When a thread exits, DeleteThreadLocalValue() will be called on
  2042. // the object managed for that thread.
  2043. GTEST_CHECK_POSIX_SUCCESS_(
  2044. pthread_key_create(&key, &DeleteThreadLocalValue));
  2045. return key;
  2046. }
  2047. T* GetOrCreateValue() const {
  2048. ThreadLocalValueHolderBase* const holder =
  2049. static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
  2050. if (holder != NULL) {
  2051. return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
  2052. }
  2053. ValueHolder* const new_holder = new ValueHolder(default_);
  2054. ThreadLocalValueHolderBase* const holder_base = new_holder;
  2055. GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
  2056. return new_holder->pointer();
  2057. }
  2058. // A key pthreads uses for looking up per-thread values.
  2059. const pthread_key_t key_;
  2060. const T default_; // The default value for each thread.
  2061. GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
  2062. };
  2063. # define GTEST_IS_THREADSAFE 1
  2064. #else // GTEST_HAS_PTHREAD
  2065. // A dummy implementation of synchronization primitives (mutex, lock,
  2066. // and thread-local variable). Necessary for compiling Google Test where
  2067. // mutex is not supported - using Google Test in multiple threads is not
  2068. // supported on such platforms.
  2069. class Mutex {
  2070. public:
  2071. Mutex() {}
  2072. void AssertHeld() const {}
  2073. };
  2074. # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
  2075. extern ::testing::internal::Mutex mutex
  2076. # define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
  2077. class GTestMutexLock {
  2078. public:
  2079. explicit GTestMutexLock(Mutex*) {} // NOLINT
  2080. };
  2081. typedef GTestMutexLock MutexLock;
  2082. template <typename T>
  2083. class ThreadLocal {
  2084. public:
  2085. ThreadLocal() : value_() {}
  2086. explicit ThreadLocal(const T& value) : value_(value) {}
  2087. T* pointer() { return &value_; }
  2088. const T* pointer() const { return &value_; }
  2089. const T& get() const { return value_; }
  2090. void set(const T& value) { value_ = value; }
  2091. private:
  2092. T value_;
  2093. };
  2094. // The above synchronization primitives have dummy implementations.
  2095. // Therefore Google Test is not thread-safe.
  2096. # define GTEST_IS_THREADSAFE 0
  2097. #endif // GTEST_HAS_PTHREAD
  2098. // Returns the number of threads running in the process, or 0 to indicate that
  2099. // we cannot detect it.
  2100. GTEST_API_ size_t GetThreadCount();
  2101. // Passing non-POD classes through ellipsis (...) crashes the ARM
  2102. // compiler and generates a warning in Sun Studio. The Nokia Symbian
  2103. // and the IBM XL C/C++ compiler try to instantiate a copy constructor
  2104. // for objects passed through ellipsis (...), failing for uncopyable
  2105. // objects. We define this to ensure that only POD is passed through
  2106. // ellipsis on these systems.
  2107. #if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
  2108. // We lose support for NULL detection where the compiler doesn't like
  2109. // passing non-POD classes through ellipsis (...).
  2110. # define GTEST_ELLIPSIS_NEEDS_POD_ 1
  2111. #else
  2112. # define GTEST_CAN_COMPARE_NULL 1
  2113. #endif
  2114. // The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
  2115. // const T& and const T* in a function template. These compilers
  2116. // _can_ decide between class template specializations for T and T*,
  2117. // so a tr1::type_traits-like is_pointer works.
  2118. #if defined(__SYMBIAN32__) || defined(__IBMCPP__)
  2119. # define GTEST_NEEDS_IS_POINTER_ 1
  2120. #endif
  2121. template <bool bool_value>
  2122. struct bool_constant {
  2123. typedef bool_constant<bool_value> type;
  2124. static const bool value = bool_value;
  2125. };
  2126. template <bool bool_value> const bool bool_constant<bool_value>::value;
  2127. typedef bool_constant<false> false_type;
  2128. typedef bool_constant<true> true_type;
  2129. template <typename T>
  2130. struct is_pointer : public false_type {};
  2131. template <typename T>
  2132. struct is_pointer<T*> : public true_type {};
  2133. template <typename Iterator>
  2134. struct IteratorTraits {
  2135. typedef typename Iterator::value_type value_type;
  2136. };
  2137. template <typename T>
  2138. struct IteratorTraits<T*> {
  2139. typedef T value_type;
  2140. };
  2141. template <typename T>
  2142. struct IteratorTraits<const T*> {
  2143. typedef T value_type;
  2144. };
  2145. #if GTEST_OS_WINDOWS
  2146. # define GTEST_PATH_SEP_ "\\"
  2147. # define GTEST_HAS_ALT_PATH_SEP_ 1
  2148. // The biggest signed integer type the compiler supports.
  2149. typedef __int64 BiggestInt;
  2150. #else
  2151. # define GTEST_PATH_SEP_ "/"
  2152. # define GTEST_HAS_ALT_PATH_SEP_ 0
  2153. typedef long long BiggestInt; // NOLINT
  2154. #endif // GTEST_OS_WINDOWS
  2155. // Utilities for char.
  2156. // isspace(int ch) and friends accept an unsigned char or EOF. char
  2157. // may be signed, depending on the compiler (or compiler flags).
  2158. // Therefore we need to cast a char to unsigned char before calling
  2159. // isspace(), etc.
  2160. inline bool IsAlpha(char ch) {
  2161. return isalpha(static_cast<unsigned char>(ch)) != 0;
  2162. }
  2163. inline bool IsAlNum(char ch) {
  2164. return isalnum(static_cast<unsigned char>(ch)) != 0;
  2165. }
  2166. inline bool IsDigit(char ch) {
  2167. return isdigit(static_cast<unsigned char>(ch)) != 0;
  2168. }
  2169. inline bool IsLower(char ch) {
  2170. return islower(static_cast<unsigned char>(ch)) != 0;
  2171. }
  2172. inline bool IsSpace(char ch) {
  2173. return isspace(static_cast<unsigned char>(ch)) != 0;
  2174. }
  2175. inline bool IsUpper(char ch) {
  2176. return isupper(static_cast<unsigned char>(ch)) != 0;
  2177. }
  2178. inline bool IsXDigit(char ch) {
  2179. return isxdigit(static_cast<unsigned char>(ch)) != 0;
  2180. }
  2181. inline char ToLower(char ch) {
  2182. return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
  2183. }
  2184. inline char ToUpper(char ch) {
  2185. return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
  2186. }
  2187. // The testing::internal::posix namespace holds wrappers for common
  2188. // POSIX functions. These wrappers hide the differences between
  2189. // Windows/MSVC and POSIX systems. Since some compilers define these
  2190. // standard functions as macros, the wrapper cannot have the same name
  2191. // as the wrapped function.
  2192. namespace posix {
  2193. // Functions with a different name on Windows.
  2194. #if GTEST_OS_WINDOWS
  2195. typedef struct _stat StatStruct;
  2196. # ifdef __BORLANDC__
  2197. inline int IsATTY(int fd) { return isatty(fd); }
  2198. inline int StrCaseCmp(const char* s1, const char* s2) {
  2199. return stricmp(s1, s2);
  2200. }
  2201. inline char* StrDup(const char* src) { return strdup(src); }
  2202. # else // !__BORLANDC__
  2203. # if GTEST_OS_WINDOWS_MOBILE
  2204. inline int IsATTY(int /* fd */) { return 0; }
  2205. # else
  2206. inline int IsATTY(int fd) { return _isatty(fd); }
  2207. # endif // GTEST_OS_WINDOWS_MOBILE
  2208. inline int StrCaseCmp(const char* s1, const char* s2) {
  2209. return _stricmp(s1, s2);
  2210. }
  2211. inline char* StrDup(const char* src) { return _strdup(src); }
  2212. # endif // __BORLANDC__
  2213. # if GTEST_OS_WINDOWS_MOBILE
  2214. inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
  2215. // Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
  2216. // time and thus not defined there.
  2217. # else
  2218. inline int FileNo(FILE* file) { return _fileno(file); }
  2219. inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
  2220. inline int RmDir(const char* dir) { return _rmdir(dir); }
  2221. inline bool IsDir(const StatStruct& st) {
  2222. return (_S_IFDIR & st.st_mode) != 0;
  2223. }
  2224. # endif // GTEST_OS_WINDOWS_MOBILE
  2225. #else
  2226. typedef struct stat StatStruct;
  2227. inline int FileNo(FILE* file) { return fileno(file); }
  2228. inline int IsATTY(int fd) { return isatty(fd); }
  2229. inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
  2230. inline int StrCaseCmp(const char* s1, const char* s2) {
  2231. return strcasecmp(s1, s2);
  2232. }
  2233. inline char* StrDup(const char* src) { return strdup(src); }
  2234. inline int RmDir(const char* dir) { return rmdir(dir); }
  2235. inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
  2236. #endif // GTEST_OS_WINDOWS
  2237. // Functions deprecated by MSVC 8.0.
  2238. #ifdef _MSC_VER
  2239. // Temporarily disable warning 4996 (deprecated function).
  2240. # pragma warning(push)
  2241. # pragma warning(disable:4996)
  2242. #endif
  2243. inline const char* StrNCpy(char* dest, const char* src, size_t n) {
  2244. return strncpy(dest, src, n);
  2245. }
  2246. // ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
  2247. // StrError() aren't needed on Windows CE at this time and thus not
  2248. // defined there.
  2249. #if !GTEST_OS_WINDOWS_MOBILE
  2250. inline int ChDir(const char* dir) { return chdir(dir); }
  2251. #endif
  2252. inline FILE* FOpen(const char* path, const char* mode) {
  2253. return fopen(path, mode);
  2254. }
  2255. #if !GTEST_OS_WINDOWS_MOBILE
  2256. inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
  2257. return freopen(path, mode, stream);
  2258. }
  2259. inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
  2260. #endif
  2261. inline int FClose(FILE* fp) { return fclose(fp); }
  2262. #if !GTEST_OS_WINDOWS_MOBILE
  2263. inline int Read(int fd, void* buf, unsigned int count) {
  2264. return static_cast<int>(read(fd, buf, count));
  2265. }
  2266. inline int Write(int fd, const void* buf, unsigned int count) {
  2267. return static_cast<int>(write(fd, buf, count));
  2268. }
  2269. inline int Close(int fd) { return close(fd); }
  2270. inline const char* StrError(int errnum) { return strerror(errnum); }
  2271. #endif
  2272. inline const char* GetEnv(const char* name) {
  2273. #if GTEST_OS_WINDOWS_MOBILE
  2274. // We are on Windows CE, which has no environment variables.
  2275. return NULL;
  2276. #elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
  2277. // Environment variables which we programmatically clear will be set to the
  2278. // empty string rather than unset (NULL). Handle that case.
  2279. const char* const env = getenv(name);
  2280. return (env != NULL && env[0] != '\0') ? env : NULL;
  2281. #else
  2282. return getenv(name);
  2283. #endif
  2284. }
  2285. #ifdef _MSC_VER
  2286. # pragma warning(pop) // Restores the warning state.
  2287. #endif
  2288. #if GTEST_OS_WINDOWS_MOBILE
  2289. // Windows CE has no C library. The abort() function is used in
  2290. // several places in Google Test. This implementation provides a reasonable
  2291. // imitation of standard behaviour.
  2292. void Abort();
  2293. #else
  2294. inline void Abort() { abort(); }
  2295. #endif // GTEST_OS_WINDOWS_MOBILE
  2296. } // namespace posix
  2297. // The maximum number a BiggestInt can represent. This definition
  2298. // works no matter BiggestInt is represented in one's complement or
  2299. // two's complement.
  2300. //
  2301. // We cannot rely on numeric_limits in STL, as __int64 and long long
  2302. // are not part of standard C++ and numeric_limits doesn't need to be
  2303. // defined for them.
  2304. const BiggestInt kMaxBiggestInt =
  2305. ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
  2306. // This template class serves as a compile-time function from size to
  2307. // type. It maps a size in bytes to a primitive type with that
  2308. // size. e.g.
  2309. //
  2310. // TypeWithSize<4>::UInt
  2311. //
  2312. // is typedef-ed to be unsigned int (unsigned integer made up of 4
  2313. // bytes).
  2314. //
  2315. // Such functionality should belong to STL, but I cannot find it
  2316. // there.
  2317. //
  2318. // Google Test uses this class in the implementation of floating-point
  2319. // comparison.
  2320. //
  2321. // For now it only handles UInt (unsigned int) as that's all Google Test
  2322. // needs. Other types can be easily added in the future if need
  2323. // arises.
  2324. template <size_t size>
  2325. class TypeWithSize {
  2326. public:
  2327. // This prevents the user from using TypeWithSize<N> with incorrect
  2328. // values of N.
  2329. typedef void UInt;
  2330. };
  2331. // The specialization for size 4.
  2332. template <>
  2333. class TypeWithSize<4> {
  2334. public:
  2335. // unsigned int has size 4 in both gcc and MSVC.
  2336. //
  2337. // As base/basictypes.h doesn't compile on Windows, we cannot use
  2338. // uint32, uint64, and etc here.
  2339. typedef int Int;
  2340. typedef unsigned int UInt;
  2341. };
  2342. // The specialization for size 8.
  2343. template <>
  2344. class TypeWithSize<8> {
  2345. public:
  2346. #if GTEST_OS_WINDOWS
  2347. typedef __int64 Int;
  2348. typedef unsigned __int64 UInt;
  2349. #else
  2350. typedef long long Int; // NOLINT
  2351. typedef unsigned long long UInt; // NOLINT
  2352. #endif // GTEST_OS_WINDOWS
  2353. };
  2354. // Integer types of known sizes.
  2355. typedef TypeWithSize<4>::Int Int32;
  2356. typedef TypeWithSize<4>::UInt UInt32;
  2357. typedef TypeWithSize<8>::Int Int64;
  2358. typedef TypeWithSize<8>::UInt UInt64;
  2359. typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds.
  2360. // Utilities for command line flags and environment variables.
  2361. // Macro for referencing flags.
  2362. #define GTEST_FLAG(name) FLAGS_gtest_##name
  2363. // Macros for declaring flags.
  2364. #define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
  2365. #define GTEST_DECLARE_int32_(name) \
  2366. GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
  2367. #define GTEST_DECLARE_string_(name) \
  2368. GTEST_API_ extern ::testing::internal::String GTEST_FLAG(name)
  2369. // Macros for defining flags.
  2370. #define GTEST_DEFINE_bool_(name, default_val, doc) \
  2371. GTEST_API_ bool GTEST_FLAG(name) = (default_val)
  2372. #define GTEST_DEFINE_int32_(name, default_val, doc) \
  2373. GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
  2374. #define GTEST_DEFINE_string_(name, default_val, doc) \
  2375. GTEST_API_ ::testing::internal::String GTEST_FLAG(name) = (default_val)
  2376. // Parses 'str' for a 32-bit signed integer. If successful, writes the result
  2377. // to *value and returns true; otherwise leaves *value unchanged and returns
  2378. // false.
  2379. // TODO(chandlerc): Find a better way to refactor flag and environment parsing
  2380. // out of both gtest-port.cc and gtest.cc to avoid exporting this utility
  2381. // function.
  2382. bool ParseInt32(const Message& src_text, const char* str, Int32* value);
  2383. // Parses a bool/Int32/string from the environment variable
  2384. // corresponding to the given Google Test flag.
  2385. bool BoolFromGTestEnv(const char* flag, bool default_val);
  2386. GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
  2387. const char* StringFromGTestEnv(const char* flag, const char* default_val);
  2388. } // namespace internal
  2389. } // namespace testing
  2390. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
  2391. #if GTEST_OS_LINUX
  2392. # include <stdlib.h>
  2393. # include <sys/types.h>
  2394. # include <sys/wait.h>
  2395. # include <unistd.h>
  2396. #endif // GTEST_OS_LINUX
  2397. #include <ctype.h>
  2398. #include <string.h>
  2399. #include <iomanip>
  2400. #include <limits>
  2401. #include <set>
  2402. // Copyright 2005, Google Inc.
  2403. // All rights reserved.
  2404. //
  2405. // Redistribution and use in source and binary forms, with or without
  2406. // modification, are permitted provided that the following conditions are
  2407. // met:
  2408. //
  2409. // * Redistributions of source code must retain the above copyright
  2410. // notice, this list of conditions and the following disclaimer.
  2411. // * Redistributions in binary form must reproduce the above
  2412. // copyright notice, this list of conditions and the following disclaimer
  2413. // in the documentation and/or other materials provided with the
  2414. // distribution.
  2415. // * Neither the name of Google Inc. nor the names of its
  2416. // contributors may be used to endorse or promote products derived from
  2417. // this software without specific prior written permission.
  2418. //
  2419. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  2420. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  2421. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  2422. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  2423. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  2424. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  2425. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  2426. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  2427. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  2428. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  2429. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2430. //
  2431. // Authors: [email protected] (Zhanyong Wan), [email protected] (Sean Mcafee)
  2432. //
  2433. // The Google C++ Testing Framework (Google Test)
  2434. //
  2435. // This header file declares the String class and functions used internally by
  2436. // Google Test. They are subject to change without notice. They should not used
  2437. // by code external to Google Test.
  2438. //
  2439. // This header file is #included by <gtest/internal/gtest-internal.h>.
  2440. // It should not be #included by other files.
  2441. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
  2442. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
  2443. #ifdef __BORLANDC__
  2444. // string.h is not guaranteed to provide strcpy on C++ Builder.
  2445. # include <mem.h>
  2446. #endif
  2447. #include <string.h>
  2448. #include <string>
  2449. namespace testing {
  2450. namespace internal {
  2451. // String - a UTF-8 string class.
  2452. //
  2453. // For historic reasons, we don't use std::string.
  2454. //
  2455. // TODO([email protected]): replace this class with std::string or
  2456. // implement it in terms of the latter.
  2457. //
  2458. // Note that String can represent both NULL and the empty string,
  2459. // while std::string cannot represent NULL.
  2460. //
  2461. // NULL and the empty string are considered different. NULL is less
  2462. // than anything (including the empty string) except itself.
  2463. //
  2464. // This class only provides minimum functionality necessary for
  2465. // implementing Google Test. We do not intend to implement a full-fledged
  2466. // string class here.
  2467. //
  2468. // Since the purpose of this class is to provide a substitute for
  2469. // std::string on platforms where it cannot be used, we define a copy
  2470. // constructor and assignment operators such that we don't need
  2471. // conditional compilation in a lot of places.
  2472. //
  2473. // In order to make the representation efficient, the d'tor of String
  2474. // is not virtual. Therefore DO NOT INHERIT FROM String.
  2475. class GTEST_API_ String {
  2476. public:
  2477. // Static utility methods
  2478. // Returns the input enclosed in double quotes if it's not NULL;
  2479. // otherwise returns "(null)". For example, "\"Hello\"" is returned
  2480. // for input "Hello".
  2481. //
  2482. // This is useful for printing a C string in the syntax of a literal.
  2483. //
  2484. // Known issue: escape sequences are not handled yet.
  2485. static String ShowCStringQuoted(const char* c_str);
  2486. // Clones a 0-terminated C string, allocating memory using new. The
  2487. // caller is responsible for deleting the return value using
  2488. // delete[]. Returns the cloned string, or NULL if the input is
  2489. // NULL.
  2490. //
  2491. // This is different from strdup() in string.h, which allocates
  2492. // memory using malloc().
  2493. static const char* CloneCString(const char* c_str);
  2494. #if GTEST_OS_WINDOWS_MOBILE
  2495. // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
  2496. // able to pass strings to Win32 APIs on CE we need to convert them
  2497. // to 'Unicode', UTF-16.
  2498. // Creates a UTF-16 wide string from the given ANSI string, allocating
  2499. // memory using new. The caller is responsible for deleting the return
  2500. // value using delete[]. Returns the wide string, or NULL if the
  2501. // input is NULL.
  2502. //
  2503. // The wide string is created using the ANSI codepage (CP_ACP) to
  2504. // match the behaviour of the ANSI versions of Win32 calls and the
  2505. // C runtime.
  2506. static LPCWSTR AnsiToUtf16(const char* c_str);
  2507. // Creates an ANSI string from the given wide string, allocating
  2508. // memory using new. The caller is responsible for deleting the return
  2509. // value using delete[]. Returns the ANSI string, or NULL if the
  2510. // input is NULL.
  2511. //
  2512. // The returned string is created using the ANSI codepage (CP_ACP) to
  2513. // match the behaviour of the ANSI versions of Win32 calls and the
  2514. // C runtime.
  2515. static const char* Utf16ToAnsi(LPCWSTR utf16_str);
  2516. #endif
  2517. // Compares two C strings. Returns true iff they have the same content.
  2518. //
  2519. // Unlike strcmp(), this function can handle NULL argument(s). A
  2520. // NULL C string is considered different to any non-NULL C string,
  2521. // including the empty string.
  2522. static bool CStringEquals(const char* lhs, const char* rhs);
  2523. // Converts a wide C string to a String using the UTF-8 encoding.
  2524. // NULL will be converted to "(null)". If an error occurred during
  2525. // the conversion, "(failed to convert from wide string)" is
  2526. // returned.
  2527. static String ShowWideCString(const wchar_t* wide_c_str);
  2528. // Similar to ShowWideCString(), except that this function encloses
  2529. // the converted string in double quotes.
  2530. static String ShowWideCStringQuoted(const wchar_t* wide_c_str);
  2531. // Compares two wide C strings. Returns true iff they have the same
  2532. // content.
  2533. //
  2534. // Unlike wcscmp(), this function can handle NULL argument(s). A
  2535. // NULL C string is considered different to any non-NULL C string,
  2536. // including the empty string.
  2537. static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
  2538. // Compares two C strings, ignoring case. Returns true iff they
  2539. // have the same content.
  2540. //
  2541. // Unlike strcasecmp(), this function can handle NULL argument(s).
  2542. // A NULL C string is considered different to any non-NULL C string,
  2543. // including the empty string.
  2544. static bool CaseInsensitiveCStringEquals(const char* lhs,
  2545. const char* rhs);
  2546. // Compares two wide C strings, ignoring case. Returns true iff they
  2547. // have the same content.
  2548. //
  2549. // Unlike wcscasecmp(), this function can handle NULL argument(s).
  2550. // A NULL C string is considered different to any non-NULL wide C string,
  2551. // including the empty string.
  2552. // NB: The implementations on different platforms slightly differ.
  2553. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
  2554. // environment variable. On GNU platform this method uses wcscasecmp
  2555. // which compares according to LC_CTYPE category of the current locale.
  2556. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
  2557. // current locale.
  2558. static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
  2559. const wchar_t* rhs);
  2560. // Formats a list of arguments to a String, using the same format
  2561. // spec string as for printf.
  2562. //
  2563. // We do not use the StringPrintf class as it is not universally
  2564. // available.
  2565. //
  2566. // The result is limited to 4096 characters (including the tailing
  2567. // 0). If 4096 characters are not enough to format the input,
  2568. // "<buffer exceeded>" is returned.
  2569. static String Format(const char* format, ...);
  2570. // C'tors
  2571. // The default c'tor constructs a NULL string.
  2572. String() : c_str_(NULL), length_(0) {}
  2573. // Constructs a String by cloning a 0-terminated C string.
  2574. String(const char* a_c_str) { // NOLINT
  2575. if (a_c_str == NULL) {
  2576. c_str_ = NULL;
  2577. length_ = 0;
  2578. } else {
  2579. ConstructNonNull(a_c_str, strlen(a_c_str));
  2580. }
  2581. }
  2582. // Constructs a String by copying a given number of chars from a
  2583. // buffer. E.g. String("hello", 3) creates the string "hel",
  2584. // String("a\0bcd", 4) creates "a\0bc", String(NULL, 0) creates "",
  2585. // and String(NULL, 1) results in access violation.
  2586. String(const char* buffer, size_t a_length) {
  2587. ConstructNonNull(buffer, a_length);
  2588. }
  2589. // The copy c'tor creates a new copy of the string. The two
  2590. // String objects do not share content.
  2591. String(const String& str) : c_str_(NULL), length_(0) { *this = str; }
  2592. // D'tor. String is intended to be a final class, so the d'tor
  2593. // doesn't need to be virtual.
  2594. ~String() { delete[] c_str_; }
  2595. // Allows a String to be implicitly converted to an ::std::string or
  2596. // ::string, and vice versa. Converting a String containing a NULL
  2597. // pointer to ::std::string or ::string is undefined behavior.
  2598. // Converting a ::std::string or ::string containing an embedded NUL
  2599. // character to a String will result in the prefix up to the first
  2600. // NUL character.
  2601. String(const ::std::string& str) {
  2602. ConstructNonNull(str.c_str(), str.length());
  2603. }
  2604. operator ::std::string() const { return ::std::string(c_str(), length()); }
  2605. #if GTEST_HAS_GLOBAL_STRING
  2606. String(const ::string& str) {
  2607. ConstructNonNull(str.c_str(), str.length());
  2608. }
  2609. operator ::string() const { return ::string(c_str(), length()); }
  2610. #endif // GTEST_HAS_GLOBAL_STRING
  2611. // Returns true iff this is an empty string (i.e. "").
  2612. bool empty() const { return (c_str() != NULL) && (length() == 0); }
  2613. // Compares this with another String.
  2614. // Returns < 0 if this is less than rhs, 0 if this is equal to rhs, or > 0
  2615. // if this is greater than rhs.
  2616. int Compare(const String& rhs) const;
  2617. // Returns true iff this String equals the given C string. A NULL
  2618. // string and a non-NULL string are considered not equal.
  2619. bool operator==(const char* a_c_str) const { return Compare(a_c_str) == 0; }
  2620. // Returns true iff this String is less than the given String. A
  2621. // NULL string is considered less than "".
  2622. bool operator<(const String& rhs) const { return Compare(rhs) < 0; }
  2623. // Returns true iff this String doesn't equal the given C string. A NULL
  2624. // string and a non-NULL string are considered not equal.
  2625. bool operator!=(const char* a_c_str) const { return !(*this == a_c_str); }
  2626. // Returns true iff this String ends with the given suffix. *Any*
  2627. // String is considered to end with a NULL or empty suffix.
  2628. bool EndsWith(const char* suffix) const;
  2629. // Returns true iff this String ends with the given suffix, not considering
  2630. // case. Any String is considered to end with a NULL or empty suffix.
  2631. bool EndsWithCaseInsensitive(const char* suffix) const;
  2632. // Returns the length of the encapsulated string, or 0 if the
  2633. // string is NULL.
  2634. size_t length() const { return length_; }
  2635. // Gets the 0-terminated C string this String object represents.
  2636. // The String object still owns the string. Therefore the caller
  2637. // should NOT delete the return value.
  2638. const char* c_str() const { return c_str_; }
  2639. // Assigns a C string to this object. Self-assignment works.
  2640. const String& operator=(const char* a_c_str) {
  2641. return *this = String(a_c_str);
  2642. }
  2643. // Assigns a String object to this object. Self-assignment works.
  2644. const String& operator=(const String& rhs) {
  2645. if (this != &rhs) {
  2646. delete[] c_str_;
  2647. if (rhs.c_str() == NULL) {
  2648. c_str_ = NULL;
  2649. length_ = 0;
  2650. } else {
  2651. ConstructNonNull(rhs.c_str(), rhs.length());
  2652. }
  2653. }
  2654. return *this;
  2655. }
  2656. private:
  2657. // Constructs a non-NULL String from the given content. This
  2658. // function can only be called when c_str_ has not been allocated.
  2659. // ConstructNonNull(NULL, 0) results in an empty string ("").
  2660. // ConstructNonNull(NULL, non_zero) is undefined behavior.
  2661. void ConstructNonNull(const char* buffer, size_t a_length) {
  2662. char* const str = new char[a_length + 1];
  2663. memcpy(str, buffer, a_length);
  2664. str[a_length] = '\0';
  2665. c_str_ = str;
  2666. length_ = a_length;
  2667. }
  2668. const char* c_str_;
  2669. size_t length_;
  2670. }; // class String
  2671. // Streams a String to an ostream. Each '\0' character in the String
  2672. // is replaced with "\\0".
  2673. inline ::std::ostream& operator<<(::std::ostream& os, const String& str) {
  2674. if (str.c_str() == NULL) {
  2675. os << "(null)";
  2676. } else {
  2677. const char* const c_str = str.c_str();
  2678. for (size_t i = 0; i != str.length(); i++) {
  2679. if (c_str[i] == '\0') {
  2680. os << "\\0";
  2681. } else {
  2682. os << c_str[i];
  2683. }
  2684. }
  2685. }
  2686. return os;
  2687. }
  2688. // Gets the content of the stringstream's buffer as a String. Each '\0'
  2689. // character in the buffer is replaced with "\\0".
  2690. GTEST_API_ String StringStreamToString(::std::stringstream* stream);
  2691. // Converts a streamable value to a String. A NULL pointer is
  2692. // converted to "(null)". When the input value is a ::string,
  2693. // ::std::string, ::wstring, or ::std::wstring object, each NUL
  2694. // character in it is replaced with "\\0".
  2695. // Declared here but defined in gtest.h, so that it has access
  2696. // to the definition of the Message class, required by the ARM
  2697. // compiler.
  2698. template <typename T>
  2699. String StreamableToString(const T& streamable);
  2700. } // namespace internal
  2701. } // namespace testing
  2702. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
  2703. // Copyright 2008, Google Inc.
  2704. // All rights reserved.
  2705. //
  2706. // Redistribution and use in source and binary forms, with or without
  2707. // modification, are permitted provided that the following conditions are
  2708. // met:
  2709. //
  2710. // * Redistributions of source code must retain the above copyright
  2711. // notice, this list of conditions and the following disclaimer.
  2712. // * Redistributions in binary form must reproduce the above
  2713. // copyright notice, this list of conditions and the following disclaimer
  2714. // in the documentation and/or other materials provided with the
  2715. // distribution.
  2716. // * Neither the name of Google Inc. nor the names of its
  2717. // contributors may be used to endorse or promote products derived from
  2718. // this software without specific prior written permission.
  2719. //
  2720. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  2721. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  2722. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  2723. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  2724. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  2725. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  2726. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  2727. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  2728. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  2729. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  2730. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2731. //
  2732. // Author: [email protected] (Keith Ray)
  2733. //
  2734. // Google Test filepath utilities
  2735. //
  2736. // This header file declares classes and functions used internally by
  2737. // Google Test. They are subject to change without notice.
  2738. //
  2739. // This file is #included in <gtest/internal/gtest-internal.h>.
  2740. // Do not include this header file separately!
  2741. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
  2742. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
  2743. namespace testing {
  2744. namespace internal {
  2745. // FilePath - a class for file and directory pathname manipulation which
  2746. // handles platform-specific conventions (like the pathname separator).
  2747. // Used for helper functions for naming files in a directory for xml output.
  2748. // Except for Set methods, all methods are const or static, which provides an
  2749. // "immutable value object" -- useful for peace of mind.
  2750. // A FilePath with a value ending in a path separator ("like/this/") represents
  2751. // a directory, otherwise it is assumed to represent a file. In either case,
  2752. // it may or may not represent an actual file or directory in the file system.
  2753. // Names are NOT checked for syntax correctness -- no checking for illegal
  2754. // characters, malformed paths, etc.
  2755. class GTEST_API_ FilePath {
  2756. public:
  2757. FilePath() : pathname_("") { }
  2758. FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
  2759. explicit FilePath(const char* pathname) : pathname_(pathname) {
  2760. Normalize();
  2761. }
  2762. explicit FilePath(const String& pathname) : pathname_(pathname) {
  2763. Normalize();
  2764. }
  2765. FilePath& operator=(const FilePath& rhs) {
  2766. Set(rhs);
  2767. return *this;
  2768. }
  2769. void Set(const FilePath& rhs) {
  2770. pathname_ = rhs.pathname_;
  2771. }
  2772. String ToString() const { return pathname_; }
  2773. const char* c_str() const { return pathname_.c_str(); }
  2774. // Returns the current working directory, or "" if unsuccessful.
  2775. static FilePath GetCurrentDir();
  2776. // Given directory = "dir", base_name = "test", number = 0,
  2777. // extension = "xml", returns "dir/test.xml". If number is greater
  2778. // than zero (e.g., 12), returns "dir/test_12.xml".
  2779. // On Windows platform, uses \ as the separator rather than /.
  2780. static FilePath MakeFileName(const FilePath& directory,
  2781. const FilePath& base_name,
  2782. int number,
  2783. const char* extension);
  2784. // Given directory = "dir", relative_path = "test.xml",
  2785. // returns "dir/test.xml".
  2786. // On Windows, uses \ as the separator rather than /.
  2787. static FilePath ConcatPaths(const FilePath& directory,
  2788. const FilePath& relative_path);
  2789. // Returns a pathname for a file that does not currently exist. The pathname
  2790. // will be directory/base_name.extension or
  2791. // directory/base_name_<number>.extension if directory/base_name.extension
  2792. // already exists. The number will be incremented until a pathname is found
  2793. // that does not already exist.
  2794. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
  2795. // There could be a race condition if two or more processes are calling this
  2796. // function at the same time -- they could both pick the same filename.
  2797. static FilePath GenerateUniqueFileName(const FilePath& directory,
  2798. const FilePath& base_name,
  2799. const char* extension);
  2800. // Returns true iff the path is NULL or "".
  2801. bool IsEmpty() const { return c_str() == NULL || *c_str() == '\0'; }
  2802. // If input name has a trailing separator character, removes it and returns
  2803. // the name, otherwise return the name string unmodified.
  2804. // On Windows platform, uses \ as the separator, other platforms use /.
  2805. FilePath RemoveTrailingPathSeparator() const;
  2806. // Returns a copy of the FilePath with the directory part removed.
  2807. // Example: FilePath("path/to/file").RemoveDirectoryName() returns
  2808. // FilePath("file"). If there is no directory part ("just_a_file"), it returns
  2809. // the FilePath unmodified. If there is no file part ("just_a_dir/") it
  2810. // returns an empty FilePath ("").
  2811. // On Windows platform, '\' is the path separator, otherwise it is '/'.
  2812. FilePath RemoveDirectoryName() const;
  2813. // RemoveFileName returns the directory path with the filename removed.
  2814. // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
  2815. // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
  2816. // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
  2817. // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
  2818. // On Windows platform, '\' is the path separator, otherwise it is '/'.
  2819. FilePath RemoveFileName() const;
  2820. // Returns a copy of the FilePath with the case-insensitive extension removed.
  2821. // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
  2822. // FilePath("dir/file"). If a case-insensitive extension is not
  2823. // found, returns a copy of the original FilePath.
  2824. FilePath RemoveExtension(const char* extension) const;
  2825. // Creates directories so that path exists. Returns true if successful or if
  2826. // the directories already exist; returns false if unable to create
  2827. // directories for any reason. Will also return false if the FilePath does
  2828. // not represent a directory (that is, it doesn't end with a path separator).
  2829. bool CreateDirectoriesRecursively() const;
  2830. // Create the directory so that path exists. Returns true if successful or
  2831. // if the directory already exists; returns false if unable to create the
  2832. // directory for any reason, including if the parent directory does not
  2833. // exist. Not named "CreateDirectory" because that's a macro on Windows.
  2834. bool CreateFolder() const;
  2835. // Returns true if FilePath describes something in the file-system,
  2836. // either a file, directory, or whatever, and that something exists.
  2837. bool FileOrDirectoryExists() const;
  2838. // Returns true if pathname describes a directory in the file-system
  2839. // that exists.
  2840. bool DirectoryExists() const;
  2841. // Returns true if FilePath ends with a path separator, which indicates that
  2842. // it is intended to represent a directory. Returns false otherwise.
  2843. // This does NOT check that a directory (or file) actually exists.
  2844. bool IsDirectory() const;
  2845. // Returns true if pathname describes a root directory. (Windows has one
  2846. // root directory per disk drive.)
  2847. bool IsRootDirectory() const;
  2848. // Returns true if pathname describes an absolute path.
  2849. bool IsAbsolutePath() const;
  2850. private:
  2851. // Replaces multiple consecutive separators with a single separator.
  2852. // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
  2853. // redundancies that might be in a pathname involving "." or "..".
  2854. //
  2855. // A pathname with multiple consecutive separators may occur either through
  2856. // user error or as a result of some scripts or APIs that generate a pathname
  2857. // with a trailing separator. On other platforms the same API or script
  2858. // may NOT generate a pathname with a trailing "/". Then elsewhere that
  2859. // pathname may have another "/" and pathname components added to it,
  2860. // without checking for the separator already being there.
  2861. // The script language and operating system may allow paths like "foo//bar"
  2862. // but some of the functions in FilePath will not handle that correctly. In
  2863. // particular, RemoveTrailingPathSeparator() only removes one separator, and
  2864. // it is called in CreateDirectoriesRecursively() assuming that it will change
  2865. // a pathname from directory syntax (trailing separator) to filename syntax.
  2866. //
  2867. // On Windows this method also replaces the alternate path separator '/' with
  2868. // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
  2869. // "bar\\foo".
  2870. void Normalize();
  2871. // Returns a pointer to the last occurence of a valid path separator in
  2872. // the FilePath. On Windows, for example, both '/' and '\' are valid path
  2873. // separators. Returns NULL if no path separator was found.
  2874. const char* FindLastPathSeparator() const;
  2875. String pathname_;
  2876. }; // class FilePath
  2877. } // namespace internal
  2878. } // namespace testing
  2879. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
  2880. // This file was GENERATED by command:
  2881. // pump.py gtest-type-util.h.pump
  2882. // DO NOT EDIT BY HAND!!!
  2883. // Copyright 2008 Google Inc.
  2884. // All Rights Reserved.
  2885. //
  2886. // Redistribution and use in source and binary forms, with or without
  2887. // modification, are permitted provided that the following conditions are
  2888. // met:
  2889. //
  2890. // * Redistributions of source code must retain the above copyright
  2891. // notice, this list of conditions and the following disclaimer.
  2892. // * Redistributions in binary form must reproduce the above
  2893. // copyright notice, this list of conditions and the following disclaimer
  2894. // in the documentation and/or other materials provided with the
  2895. // distribution.
  2896. // * Neither the name of Google Inc. nor the names of its
  2897. // contributors may be used to endorse or promote products derived from
  2898. // this software without specific prior written permission.
  2899. //
  2900. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  2901. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  2902. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  2903. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  2904. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  2905. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  2906. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  2907. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  2908. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  2909. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  2910. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2911. //
  2912. // Author: [email protected] (Zhanyong Wan)
  2913. // Type utilities needed for implementing typed and type-parameterized
  2914. // tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
  2915. //
  2916. // Currently we support at most 50 types in a list, and at most 50
  2917. // type-parameterized tests in one type-parameterized test case.
  2918. // Please contact [email protected] if you need
  2919. // more.
  2920. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
  2921. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
  2922. // #ifdef __GNUC__ is too general here. It is possible to use gcc without using
  2923. // libstdc++ (which is where cxxabi.h comes from).
  2924. # ifdef __GLIBCXX__
  2925. # include <cxxabi.h>
  2926. # elif defined(__HP_aCC)
  2927. # include <acxx_demangle.h>
  2928. # endif // __GLIBCXX__
  2929. namespace testing {
  2930. namespace internal {
  2931. // GetTypeName<T>() returns a human-readable name of type T.
  2932. // NB: This function is also used in Google Mock, so don't move it inside of
  2933. // the typed-test-only section below.
  2934. template <typename T>
  2935. String GetTypeName() {
  2936. # if GTEST_HAS_RTTI
  2937. const char* const name = typeid(T).name();
  2938. # if defined(__GLIBCXX__) || defined(__HP_aCC)
  2939. int status = 0;
  2940. // gcc's implementation of typeid(T).name() mangles the type name,
  2941. // so we have to demangle it.
  2942. # ifdef __GLIBCXX__
  2943. using abi::__cxa_demangle;
  2944. # endif // __GLIBCXX__
  2945. char* const readable_name = __cxa_demangle(name, 0, 0, &status);
  2946. const String name_str(status == 0 ? readable_name : name);
  2947. free(readable_name);
  2948. return name_str;
  2949. # else
  2950. return name;
  2951. # endif // __GLIBCXX__ || __HP_aCC
  2952. # else
  2953. return "<type>";
  2954. # endif // GTEST_HAS_RTTI
  2955. }
  2956. #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  2957. // AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
  2958. // type. This can be used as a compile-time assertion to ensure that
  2959. // two types are equal.
  2960. template <typename T1, typename T2>
  2961. struct AssertTypeEq;
  2962. template <typename T>
  2963. struct AssertTypeEq<T, T> {
  2964. typedef bool type;
  2965. };
  2966. // A unique type used as the default value for the arguments of class
  2967. // template Types. This allows us to simulate variadic templates
  2968. // (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
  2969. // support directly.
  2970. struct None {};
  2971. // The following family of struct and struct templates are used to
  2972. // represent type lists. In particular, TypesN<T1, T2, ..., TN>
  2973. // represents a type list with N types (T1, T2, ..., and TN) in it.
  2974. // Except for Types0, every struct in the family has two member types:
  2975. // Head for the first type in the list, and Tail for the rest of the
  2976. // list.
  2977. // The empty type list.
  2978. struct Types0 {};
  2979. // Type lists of length 1, 2, 3, and so on.
  2980. template <typename T1>
  2981. struct Types1 {
  2982. typedef T1 Head;
  2983. typedef Types0 Tail;
  2984. };
  2985. template <typename T1, typename T2>
  2986. struct Types2 {
  2987. typedef T1 Head;
  2988. typedef Types1<T2> Tail;
  2989. };
  2990. template <typename T1, typename T2, typename T3>
  2991. struct Types3 {
  2992. typedef T1 Head;
  2993. typedef Types2<T2, T3> Tail;
  2994. };
  2995. template <typename T1, typename T2, typename T3, typename T4>
  2996. struct Types4 {
  2997. typedef T1 Head;
  2998. typedef Types3<T2, T3, T4> Tail;
  2999. };
  3000. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  3001. struct Types5 {
  3002. typedef T1 Head;
  3003. typedef Types4<T2, T3, T4, T5> Tail;
  3004. };
  3005. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3006. typename T6>
  3007. struct Types6 {
  3008. typedef T1 Head;
  3009. typedef Types5<T2, T3, T4, T5, T6> Tail;
  3010. };
  3011. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3012. typename T6, typename T7>
  3013. struct Types7 {
  3014. typedef T1 Head;
  3015. typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
  3016. };
  3017. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3018. typename T6, typename T7, typename T8>
  3019. struct Types8 {
  3020. typedef T1 Head;
  3021. typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
  3022. };
  3023. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3024. typename T6, typename T7, typename T8, typename T9>
  3025. struct Types9 {
  3026. typedef T1 Head;
  3027. typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
  3028. };
  3029. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3030. typename T6, typename T7, typename T8, typename T9, typename T10>
  3031. struct Types10 {
  3032. typedef T1 Head;
  3033. typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
  3034. };
  3035. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3036. typename T6, typename T7, typename T8, typename T9, typename T10,
  3037. typename T11>
  3038. struct Types11 {
  3039. typedef T1 Head;
  3040. typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
  3041. };
  3042. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3043. typename T6, typename T7, typename T8, typename T9, typename T10,
  3044. typename T11, typename T12>
  3045. struct Types12 {
  3046. typedef T1 Head;
  3047. typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
  3048. };
  3049. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3050. typename T6, typename T7, typename T8, typename T9, typename T10,
  3051. typename T11, typename T12, typename T13>
  3052. struct Types13 {
  3053. typedef T1 Head;
  3054. typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
  3055. };
  3056. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3057. typename T6, typename T7, typename T8, typename T9, typename T10,
  3058. typename T11, typename T12, typename T13, typename T14>
  3059. struct Types14 {
  3060. typedef T1 Head;
  3061. typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
  3062. };
  3063. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3064. typename T6, typename T7, typename T8, typename T9, typename T10,
  3065. typename T11, typename T12, typename T13, typename T14, typename T15>
  3066. struct Types15 {
  3067. typedef T1 Head;
  3068. typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  3069. T15> Tail;
  3070. };
  3071. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3072. typename T6, typename T7, typename T8, typename T9, typename T10,
  3073. typename T11, typename T12, typename T13, typename T14, typename T15,
  3074. typename T16>
  3075. struct Types16 {
  3076. typedef T1 Head;
  3077. typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3078. T16> Tail;
  3079. };
  3080. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3081. typename T6, typename T7, typename T8, typename T9, typename T10,
  3082. typename T11, typename T12, typename T13, typename T14, typename T15,
  3083. typename T16, typename T17>
  3084. struct Types17 {
  3085. typedef T1 Head;
  3086. typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3087. T16, T17> Tail;
  3088. };
  3089. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3090. typename T6, typename T7, typename T8, typename T9, typename T10,
  3091. typename T11, typename T12, typename T13, typename T14, typename T15,
  3092. typename T16, typename T17, typename T18>
  3093. struct Types18 {
  3094. typedef T1 Head;
  3095. typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3096. T16, T17, T18> Tail;
  3097. };
  3098. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3099. typename T6, typename T7, typename T8, typename T9, typename T10,
  3100. typename T11, typename T12, typename T13, typename T14, typename T15,
  3101. typename T16, typename T17, typename T18, typename T19>
  3102. struct Types19 {
  3103. typedef T1 Head;
  3104. typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3105. T16, T17, T18, T19> Tail;
  3106. };
  3107. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3108. typename T6, typename T7, typename T8, typename T9, typename T10,
  3109. typename T11, typename T12, typename T13, typename T14, typename T15,
  3110. typename T16, typename T17, typename T18, typename T19, typename T20>
  3111. struct Types20 {
  3112. typedef T1 Head;
  3113. typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3114. T16, T17, T18, T19, T20> Tail;
  3115. };
  3116. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3117. typename T6, typename T7, typename T8, typename T9, typename T10,
  3118. typename T11, typename T12, typename T13, typename T14, typename T15,
  3119. typename T16, typename T17, typename T18, typename T19, typename T20,
  3120. typename T21>
  3121. struct Types21 {
  3122. typedef T1 Head;
  3123. typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3124. T16, T17, T18, T19, T20, T21> Tail;
  3125. };
  3126. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3127. typename T6, typename T7, typename T8, typename T9, typename T10,
  3128. typename T11, typename T12, typename T13, typename T14, typename T15,
  3129. typename T16, typename T17, typename T18, typename T19, typename T20,
  3130. typename T21, typename T22>
  3131. struct Types22 {
  3132. typedef T1 Head;
  3133. typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3134. T16, T17, T18, T19, T20, T21, T22> Tail;
  3135. };
  3136. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3137. typename T6, typename T7, typename T8, typename T9, typename T10,
  3138. typename T11, typename T12, typename T13, typename T14, typename T15,
  3139. typename T16, typename T17, typename T18, typename T19, typename T20,
  3140. typename T21, typename T22, typename T23>
  3141. struct Types23 {
  3142. typedef T1 Head;
  3143. typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3144. T16, T17, T18, T19, T20, T21, T22, T23> Tail;
  3145. };
  3146. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3147. typename T6, typename T7, typename T8, typename T9, typename T10,
  3148. typename T11, typename T12, typename T13, typename T14, typename T15,
  3149. typename T16, typename T17, typename T18, typename T19, typename T20,
  3150. typename T21, typename T22, typename T23, typename T24>
  3151. struct Types24 {
  3152. typedef T1 Head;
  3153. typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3154. T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
  3155. };
  3156. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3157. typename T6, typename T7, typename T8, typename T9, typename T10,
  3158. typename T11, typename T12, typename T13, typename T14, typename T15,
  3159. typename T16, typename T17, typename T18, typename T19, typename T20,
  3160. typename T21, typename T22, typename T23, typename T24, typename T25>
  3161. struct Types25 {
  3162. typedef T1 Head;
  3163. typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3164. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
  3165. };
  3166. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3167. typename T6, typename T7, typename T8, typename T9, typename T10,
  3168. typename T11, typename T12, typename T13, typename T14, typename T15,
  3169. typename T16, typename T17, typename T18, typename T19, typename T20,
  3170. typename T21, typename T22, typename T23, typename T24, typename T25,
  3171. typename T26>
  3172. struct Types26 {
  3173. typedef T1 Head;
  3174. typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3175. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
  3176. };
  3177. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3178. typename T6, typename T7, typename T8, typename T9, typename T10,
  3179. typename T11, typename T12, typename T13, typename T14, typename T15,
  3180. typename T16, typename T17, typename T18, typename T19, typename T20,
  3181. typename T21, typename T22, typename T23, typename T24, typename T25,
  3182. typename T26, typename T27>
  3183. struct Types27 {
  3184. typedef T1 Head;
  3185. typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3186. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
  3187. };
  3188. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3189. typename T6, typename T7, typename T8, typename T9, typename T10,
  3190. typename T11, typename T12, typename T13, typename T14, typename T15,
  3191. typename T16, typename T17, typename T18, typename T19, typename T20,
  3192. typename T21, typename T22, typename T23, typename T24, typename T25,
  3193. typename T26, typename T27, typename T28>
  3194. struct Types28 {
  3195. typedef T1 Head;
  3196. typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3197. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
  3198. };
  3199. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3200. typename T6, typename T7, typename T8, typename T9, typename T10,
  3201. typename T11, typename T12, typename T13, typename T14, typename T15,
  3202. typename T16, typename T17, typename T18, typename T19, typename T20,
  3203. typename T21, typename T22, typename T23, typename T24, typename T25,
  3204. typename T26, typename T27, typename T28, typename T29>
  3205. struct Types29 {
  3206. typedef T1 Head;
  3207. typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3208. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  3209. T29> Tail;
  3210. };
  3211. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3212. typename T6, typename T7, typename T8, typename T9, typename T10,
  3213. typename T11, typename T12, typename T13, typename T14, typename T15,
  3214. typename T16, typename T17, typename T18, typename T19, typename T20,
  3215. typename T21, typename T22, typename T23, typename T24, typename T25,
  3216. typename T26, typename T27, typename T28, typename T29, typename T30>
  3217. struct Types30 {
  3218. typedef T1 Head;
  3219. typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3220. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3221. T30> Tail;
  3222. };
  3223. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3224. typename T6, typename T7, typename T8, typename T9, typename T10,
  3225. typename T11, typename T12, typename T13, typename T14, typename T15,
  3226. typename T16, typename T17, typename T18, typename T19, typename T20,
  3227. typename T21, typename T22, typename T23, typename T24, typename T25,
  3228. typename T26, typename T27, typename T28, typename T29, typename T30,
  3229. typename T31>
  3230. struct Types31 {
  3231. typedef T1 Head;
  3232. typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3233. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3234. T30, T31> Tail;
  3235. };
  3236. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3237. typename T6, typename T7, typename T8, typename T9, typename T10,
  3238. typename T11, typename T12, typename T13, typename T14, typename T15,
  3239. typename T16, typename T17, typename T18, typename T19, typename T20,
  3240. typename T21, typename T22, typename T23, typename T24, typename T25,
  3241. typename T26, typename T27, typename T28, typename T29, typename T30,
  3242. typename T31, typename T32>
  3243. struct Types32 {
  3244. typedef T1 Head;
  3245. typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3246. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3247. T30, T31, T32> Tail;
  3248. };
  3249. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3250. typename T6, typename T7, typename T8, typename T9, typename T10,
  3251. typename T11, typename T12, typename T13, typename T14, typename T15,
  3252. typename T16, typename T17, typename T18, typename T19, typename T20,
  3253. typename T21, typename T22, typename T23, typename T24, typename T25,
  3254. typename T26, typename T27, typename T28, typename T29, typename T30,
  3255. typename T31, typename T32, typename T33>
  3256. struct Types33 {
  3257. typedef T1 Head;
  3258. typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3259. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3260. T30, T31, T32, T33> Tail;
  3261. };
  3262. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3263. typename T6, typename T7, typename T8, typename T9, typename T10,
  3264. typename T11, typename T12, typename T13, typename T14, typename T15,
  3265. typename T16, typename T17, typename T18, typename T19, typename T20,
  3266. typename T21, typename T22, typename T23, typename T24, typename T25,
  3267. typename T26, typename T27, typename T28, typename T29, typename T30,
  3268. typename T31, typename T32, typename T33, typename T34>
  3269. struct Types34 {
  3270. typedef T1 Head;
  3271. typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3272. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3273. T30, T31, T32, T33, T34> Tail;
  3274. };
  3275. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3276. typename T6, typename T7, typename T8, typename T9, typename T10,
  3277. typename T11, typename T12, typename T13, typename T14, typename T15,
  3278. typename T16, typename T17, typename T18, typename T19, typename T20,
  3279. typename T21, typename T22, typename T23, typename T24, typename T25,
  3280. typename T26, typename T27, typename T28, typename T29, typename T30,
  3281. typename T31, typename T32, typename T33, typename T34, typename T35>
  3282. struct Types35 {
  3283. typedef T1 Head;
  3284. typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3285. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3286. T30, T31, T32, T33, T34, T35> Tail;
  3287. };
  3288. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3289. typename T6, typename T7, typename T8, typename T9, typename T10,
  3290. typename T11, typename T12, typename T13, typename T14, typename T15,
  3291. typename T16, typename T17, typename T18, typename T19, typename T20,
  3292. typename T21, typename T22, typename T23, typename T24, typename T25,
  3293. typename T26, typename T27, typename T28, typename T29, typename T30,
  3294. typename T31, typename T32, typename T33, typename T34, typename T35,
  3295. typename T36>
  3296. struct Types36 {
  3297. typedef T1 Head;
  3298. typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3299. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3300. T30, T31, T32, T33, T34, T35, T36> Tail;
  3301. };
  3302. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3303. typename T6, typename T7, typename T8, typename T9, typename T10,
  3304. typename T11, typename T12, typename T13, typename T14, typename T15,
  3305. typename T16, typename T17, typename T18, typename T19, typename T20,
  3306. typename T21, typename T22, typename T23, typename T24, typename T25,
  3307. typename T26, typename T27, typename T28, typename T29, typename T30,
  3308. typename T31, typename T32, typename T33, typename T34, typename T35,
  3309. typename T36, typename T37>
  3310. struct Types37 {
  3311. typedef T1 Head;
  3312. typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3313. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3314. T30, T31, T32, T33, T34, T35, T36, T37> Tail;
  3315. };
  3316. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3317. typename T6, typename T7, typename T8, typename T9, typename T10,
  3318. typename T11, typename T12, typename T13, typename T14, typename T15,
  3319. typename T16, typename T17, typename T18, typename T19, typename T20,
  3320. typename T21, typename T22, typename T23, typename T24, typename T25,
  3321. typename T26, typename T27, typename T28, typename T29, typename T30,
  3322. typename T31, typename T32, typename T33, typename T34, typename T35,
  3323. typename T36, typename T37, typename T38>
  3324. struct Types38 {
  3325. typedef T1 Head;
  3326. typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3327. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3328. T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
  3329. };
  3330. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3331. typename T6, typename T7, typename T8, typename T9, typename T10,
  3332. typename T11, typename T12, typename T13, typename T14, typename T15,
  3333. typename T16, typename T17, typename T18, typename T19, typename T20,
  3334. typename T21, typename T22, typename T23, typename T24, typename T25,
  3335. typename T26, typename T27, typename T28, typename T29, typename T30,
  3336. typename T31, typename T32, typename T33, typename T34, typename T35,
  3337. typename T36, typename T37, typename T38, typename T39>
  3338. struct Types39 {
  3339. typedef T1 Head;
  3340. typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3341. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3342. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
  3343. };
  3344. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3345. typename T6, typename T7, typename T8, typename T9, typename T10,
  3346. typename T11, typename T12, typename T13, typename T14, typename T15,
  3347. typename T16, typename T17, typename T18, typename T19, typename T20,
  3348. typename T21, typename T22, typename T23, typename T24, typename T25,
  3349. typename T26, typename T27, typename T28, typename T29, typename T30,
  3350. typename T31, typename T32, typename T33, typename T34, typename T35,
  3351. typename T36, typename T37, typename T38, typename T39, typename T40>
  3352. struct Types40 {
  3353. typedef T1 Head;
  3354. typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3355. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3356. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
  3357. };
  3358. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3359. typename T6, typename T7, typename T8, typename T9, typename T10,
  3360. typename T11, typename T12, typename T13, typename T14, typename T15,
  3361. typename T16, typename T17, typename T18, typename T19, typename T20,
  3362. typename T21, typename T22, typename T23, typename T24, typename T25,
  3363. typename T26, typename T27, typename T28, typename T29, typename T30,
  3364. typename T31, typename T32, typename T33, typename T34, typename T35,
  3365. typename T36, typename T37, typename T38, typename T39, typename T40,
  3366. typename T41>
  3367. struct Types41 {
  3368. typedef T1 Head;
  3369. typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3370. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3371. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
  3372. };
  3373. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3374. typename T6, typename T7, typename T8, typename T9, typename T10,
  3375. typename T11, typename T12, typename T13, typename T14, typename T15,
  3376. typename T16, typename T17, typename T18, typename T19, typename T20,
  3377. typename T21, typename T22, typename T23, typename T24, typename T25,
  3378. typename T26, typename T27, typename T28, typename T29, typename T30,
  3379. typename T31, typename T32, typename T33, typename T34, typename T35,
  3380. typename T36, typename T37, typename T38, typename T39, typename T40,
  3381. typename T41, typename T42>
  3382. struct Types42 {
  3383. typedef T1 Head;
  3384. typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3385. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3386. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
  3387. };
  3388. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3389. typename T6, typename T7, typename T8, typename T9, typename T10,
  3390. typename T11, typename T12, typename T13, typename T14, typename T15,
  3391. typename T16, typename T17, typename T18, typename T19, typename T20,
  3392. typename T21, typename T22, typename T23, typename T24, typename T25,
  3393. typename T26, typename T27, typename T28, typename T29, typename T30,
  3394. typename T31, typename T32, typename T33, typename T34, typename T35,
  3395. typename T36, typename T37, typename T38, typename T39, typename T40,
  3396. typename T41, typename T42, typename T43>
  3397. struct Types43 {
  3398. typedef T1 Head;
  3399. typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3400. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3401. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  3402. T43> Tail;
  3403. };
  3404. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3405. typename T6, typename T7, typename T8, typename T9, typename T10,
  3406. typename T11, typename T12, typename T13, typename T14, typename T15,
  3407. typename T16, typename T17, typename T18, typename T19, typename T20,
  3408. typename T21, typename T22, typename T23, typename T24, typename T25,
  3409. typename T26, typename T27, typename T28, typename T29, typename T30,
  3410. typename T31, typename T32, typename T33, typename T34, typename T35,
  3411. typename T36, typename T37, typename T38, typename T39, typename T40,
  3412. typename T41, typename T42, typename T43, typename T44>
  3413. struct Types44 {
  3414. typedef T1 Head;
  3415. typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3416. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3417. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3418. T44> Tail;
  3419. };
  3420. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3421. typename T6, typename T7, typename T8, typename T9, typename T10,
  3422. typename T11, typename T12, typename T13, typename T14, typename T15,
  3423. typename T16, typename T17, typename T18, typename T19, typename T20,
  3424. typename T21, typename T22, typename T23, typename T24, typename T25,
  3425. typename T26, typename T27, typename T28, typename T29, typename T30,
  3426. typename T31, typename T32, typename T33, typename T34, typename T35,
  3427. typename T36, typename T37, typename T38, typename T39, typename T40,
  3428. typename T41, typename T42, typename T43, typename T44, typename T45>
  3429. struct Types45 {
  3430. typedef T1 Head;
  3431. typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3432. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3433. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3434. T44, T45> Tail;
  3435. };
  3436. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3437. typename T6, typename T7, typename T8, typename T9, typename T10,
  3438. typename T11, typename T12, typename T13, typename T14, typename T15,
  3439. typename T16, typename T17, typename T18, typename T19, typename T20,
  3440. typename T21, typename T22, typename T23, typename T24, typename T25,
  3441. typename T26, typename T27, typename T28, typename T29, typename T30,
  3442. typename T31, typename T32, typename T33, typename T34, typename T35,
  3443. typename T36, typename T37, typename T38, typename T39, typename T40,
  3444. typename T41, typename T42, typename T43, typename T44, typename T45,
  3445. typename T46>
  3446. struct Types46 {
  3447. typedef T1 Head;
  3448. typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3449. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3450. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3451. T44, T45, T46> Tail;
  3452. };
  3453. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3454. typename T6, typename T7, typename T8, typename T9, typename T10,
  3455. typename T11, typename T12, typename T13, typename T14, typename T15,
  3456. typename T16, typename T17, typename T18, typename T19, typename T20,
  3457. typename T21, typename T22, typename T23, typename T24, typename T25,
  3458. typename T26, typename T27, typename T28, typename T29, typename T30,
  3459. typename T31, typename T32, typename T33, typename T34, typename T35,
  3460. typename T36, typename T37, typename T38, typename T39, typename T40,
  3461. typename T41, typename T42, typename T43, typename T44, typename T45,
  3462. typename T46, typename T47>
  3463. struct Types47 {
  3464. typedef T1 Head;
  3465. typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3466. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3467. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3468. T44, T45, T46, T47> Tail;
  3469. };
  3470. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3471. typename T6, typename T7, typename T8, typename T9, typename T10,
  3472. typename T11, typename T12, typename T13, typename T14, typename T15,
  3473. typename T16, typename T17, typename T18, typename T19, typename T20,
  3474. typename T21, typename T22, typename T23, typename T24, typename T25,
  3475. typename T26, typename T27, typename T28, typename T29, typename T30,
  3476. typename T31, typename T32, typename T33, typename T34, typename T35,
  3477. typename T36, typename T37, typename T38, typename T39, typename T40,
  3478. typename T41, typename T42, typename T43, typename T44, typename T45,
  3479. typename T46, typename T47, typename T48>
  3480. struct Types48 {
  3481. typedef T1 Head;
  3482. typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3483. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3484. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3485. T44, T45, T46, T47, T48> Tail;
  3486. };
  3487. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3488. typename T6, typename T7, typename T8, typename T9, typename T10,
  3489. typename T11, typename T12, typename T13, typename T14, typename T15,
  3490. typename T16, typename T17, typename T18, typename T19, typename T20,
  3491. typename T21, typename T22, typename T23, typename T24, typename T25,
  3492. typename T26, typename T27, typename T28, typename T29, typename T30,
  3493. typename T31, typename T32, typename T33, typename T34, typename T35,
  3494. typename T36, typename T37, typename T38, typename T39, typename T40,
  3495. typename T41, typename T42, typename T43, typename T44, typename T45,
  3496. typename T46, typename T47, typename T48, typename T49>
  3497. struct Types49 {
  3498. typedef T1 Head;
  3499. typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3500. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3501. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3502. T44, T45, T46, T47, T48, T49> Tail;
  3503. };
  3504. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3505. typename T6, typename T7, typename T8, typename T9, typename T10,
  3506. typename T11, typename T12, typename T13, typename T14, typename T15,
  3507. typename T16, typename T17, typename T18, typename T19, typename T20,
  3508. typename T21, typename T22, typename T23, typename T24, typename T25,
  3509. typename T26, typename T27, typename T28, typename T29, typename T30,
  3510. typename T31, typename T32, typename T33, typename T34, typename T35,
  3511. typename T36, typename T37, typename T38, typename T39, typename T40,
  3512. typename T41, typename T42, typename T43, typename T44, typename T45,
  3513. typename T46, typename T47, typename T48, typename T49, typename T50>
  3514. struct Types50 {
  3515. typedef T1 Head;
  3516. typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3517. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3518. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3519. T44, T45, T46, T47, T48, T49, T50> Tail;
  3520. };
  3521. } // namespace internal
  3522. // We don't want to require the users to write TypesN<...> directly,
  3523. // as that would require them to count the length. Types<...> is much
  3524. // easier to write, but generates horrible messages when there is a
  3525. // compiler error, as gcc insists on printing out each template
  3526. // argument, even if it has the default value (this means Types<int>
  3527. // will appear as Types<int, None, None, ..., None> in the compiler
  3528. // errors).
  3529. //
  3530. // Our solution is to combine the best part of the two approaches: a
  3531. // user would write Types<T1, ..., TN>, and Google Test will translate
  3532. // that to TypesN<T1, ..., TN> internally to make error messages
  3533. // readable. The translation is done by the 'type' member of the
  3534. // Types template.
  3535. template <typename T1 = internal::None, typename T2 = internal::None,
  3536. typename T3 = internal::None, typename T4 = internal::None,
  3537. typename T5 = internal::None, typename T6 = internal::None,
  3538. typename T7 = internal::None, typename T8 = internal::None,
  3539. typename T9 = internal::None, typename T10 = internal::None,
  3540. typename T11 = internal::None, typename T12 = internal::None,
  3541. typename T13 = internal::None, typename T14 = internal::None,
  3542. typename T15 = internal::None, typename T16 = internal::None,
  3543. typename T17 = internal::None, typename T18 = internal::None,
  3544. typename T19 = internal::None, typename T20 = internal::None,
  3545. typename T21 = internal::None, typename T22 = internal::None,
  3546. typename T23 = internal::None, typename T24 = internal::None,
  3547. typename T25 = internal::None, typename T26 = internal::None,
  3548. typename T27 = internal::None, typename T28 = internal::None,
  3549. typename T29 = internal::None, typename T30 = internal::None,
  3550. typename T31 = internal::None, typename T32 = internal::None,
  3551. typename T33 = internal::None, typename T34 = internal::None,
  3552. typename T35 = internal::None, typename T36 = internal::None,
  3553. typename T37 = internal::None, typename T38 = internal::None,
  3554. typename T39 = internal::None, typename T40 = internal::None,
  3555. typename T41 = internal::None, typename T42 = internal::None,
  3556. typename T43 = internal::None, typename T44 = internal::None,
  3557. typename T45 = internal::None, typename T46 = internal::None,
  3558. typename T47 = internal::None, typename T48 = internal::None,
  3559. typename T49 = internal::None, typename T50 = internal::None>
  3560. struct Types {
  3561. typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3562. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  3563. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  3564. T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
  3565. };
  3566. template <>
  3567. struct Types<internal::None, internal::None, internal::None, internal::None,
  3568. internal::None, internal::None, internal::None, internal::None,
  3569. internal::None, internal::None, internal::None, internal::None,
  3570. internal::None, internal::None, internal::None, internal::None,
  3571. internal::None, internal::None, internal::None, internal::None,
  3572. internal::None, internal::None, internal::None, internal::None,
  3573. internal::None, internal::None, internal::None, internal::None,
  3574. internal::None, internal::None, internal::None, internal::None,
  3575. internal::None, internal::None, internal::None, internal::None,
  3576. internal::None, internal::None, internal::None, internal::None,
  3577. internal::None, internal::None, internal::None, internal::None,
  3578. internal::None, internal::None, internal::None, internal::None,
  3579. internal::None, internal::None> {
  3580. typedef internal::Types0 type;
  3581. };
  3582. template <typename T1>
  3583. struct Types<T1, internal::None, internal::None, internal::None,
  3584. internal::None, internal::None, internal::None, internal::None,
  3585. internal::None, internal::None, internal::None, internal::None,
  3586. internal::None, internal::None, internal::None, internal::None,
  3587. internal::None, internal::None, internal::None, internal::None,
  3588. internal::None, internal::None, internal::None, internal::None,
  3589. internal::None, internal::None, internal::None, internal::None,
  3590. internal::None, internal::None, internal::None, internal::None,
  3591. internal::None, internal::None, internal::None, internal::None,
  3592. internal::None, internal::None, internal::None, internal::None,
  3593. internal::None, internal::None, internal::None, internal::None,
  3594. internal::None, internal::None, internal::None, internal::None,
  3595. internal::None, internal::None> {
  3596. typedef internal::Types1<T1> type;
  3597. };
  3598. template <typename T1, typename T2>
  3599. struct Types<T1, T2, internal::None, internal::None, internal::None,
  3600. internal::None, internal::None, internal::None, internal::None,
  3601. internal::None, internal::None, internal::None, internal::None,
  3602. internal::None, internal::None, internal::None, internal::None,
  3603. internal::None, internal::None, internal::None, internal::None,
  3604. internal::None, internal::None, internal::None, internal::None,
  3605. internal::None, internal::None, internal::None, internal::None,
  3606. internal::None, internal::None, internal::None, internal::None,
  3607. internal::None, internal::None, internal::None, internal::None,
  3608. internal::None, internal::None, internal::None, internal::None,
  3609. internal::None, internal::None, internal::None, internal::None,
  3610. internal::None, internal::None, internal::None, internal::None,
  3611. internal::None> {
  3612. typedef internal::Types2<T1, T2> type;
  3613. };
  3614. template <typename T1, typename T2, typename T3>
  3615. struct Types<T1, T2, T3, internal::None, internal::None, internal::None,
  3616. internal::None, internal::None, internal::None, internal::None,
  3617. internal::None, internal::None, internal::None, internal::None,
  3618. internal::None, internal::None, internal::None, internal::None,
  3619. internal::None, internal::None, internal::None, internal::None,
  3620. internal::None, internal::None, internal::None, internal::None,
  3621. internal::None, internal::None, internal::None, internal::None,
  3622. internal::None, internal::None, internal::None, internal::None,
  3623. internal::None, internal::None, internal::None, internal::None,
  3624. internal::None, internal::None, internal::None, internal::None,
  3625. internal::None, internal::None, internal::None, internal::None,
  3626. internal::None, internal::None, internal::None, internal::None> {
  3627. typedef internal::Types3<T1, T2, T3> type;
  3628. };
  3629. template <typename T1, typename T2, typename T3, typename T4>
  3630. struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,
  3631. internal::None, internal::None, internal::None, internal::None,
  3632. internal::None, internal::None, internal::None, internal::None,
  3633. internal::None, internal::None, internal::None, internal::None,
  3634. internal::None, internal::None, internal::None, internal::None,
  3635. internal::None, internal::None, internal::None, internal::None,
  3636. internal::None, internal::None, internal::None, internal::None,
  3637. internal::None, internal::None, internal::None, internal::None,
  3638. internal::None, internal::None, internal::None, internal::None,
  3639. internal::None, internal::None, internal::None, internal::None,
  3640. internal::None, internal::None, internal::None, internal::None,
  3641. internal::None, internal::None, internal::None> {
  3642. typedef internal::Types4<T1, T2, T3, T4> type;
  3643. };
  3644. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  3645. struct Types<T1, T2, T3, T4, T5, internal::None, internal::None,
  3646. internal::None, internal::None, internal::None, internal::None,
  3647. internal::None, internal::None, internal::None, internal::None,
  3648. internal::None, internal::None, internal::None, internal::None,
  3649. internal::None, internal::None, internal::None, internal::None,
  3650. internal::None, internal::None, internal::None, internal::None,
  3651. internal::None, internal::None, internal::None, internal::None,
  3652. internal::None, internal::None, internal::None, internal::None,
  3653. internal::None, internal::None, internal::None, internal::None,
  3654. internal::None, internal::None, internal::None, internal::None,
  3655. internal::None, internal::None, internal::None, internal::None,
  3656. internal::None, internal::None, internal::None> {
  3657. typedef internal::Types5<T1, T2, T3, T4, T5> type;
  3658. };
  3659. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3660. typename T6>
  3661. struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,
  3662. internal::None, internal::None, internal::None, internal::None,
  3663. internal::None, internal::None, internal::None, internal::None,
  3664. internal::None, internal::None, internal::None, internal::None,
  3665. internal::None, internal::None, internal::None, internal::None,
  3666. internal::None, internal::None, internal::None, internal::None,
  3667. internal::None, internal::None, internal::None, internal::None,
  3668. internal::None, internal::None, internal::None, internal::None,
  3669. internal::None, internal::None, internal::None, internal::None,
  3670. internal::None, internal::None, internal::None, internal::None,
  3671. internal::None, internal::None, internal::None, internal::None,
  3672. internal::None, internal::None> {
  3673. typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
  3674. };
  3675. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3676. typename T6, typename T7>
  3677. struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,
  3678. internal::None, internal::None, internal::None, internal::None,
  3679. internal::None, internal::None, internal::None, internal::None,
  3680. internal::None, internal::None, internal::None, internal::None,
  3681. internal::None, internal::None, internal::None, internal::None,
  3682. internal::None, internal::None, internal::None, internal::None,
  3683. internal::None, internal::None, internal::None, internal::None,
  3684. internal::None, internal::None, internal::None, internal::None,
  3685. internal::None, internal::None, internal::None, internal::None,
  3686. internal::None, internal::None, internal::None, internal::None,
  3687. internal::None, internal::None, internal::None, internal::None,
  3688. internal::None> {
  3689. typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
  3690. };
  3691. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3692. typename T6, typename T7, typename T8>
  3693. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,
  3694. internal::None, internal::None, internal::None, internal::None,
  3695. internal::None, internal::None, internal::None, internal::None,
  3696. internal::None, internal::None, internal::None, internal::None,
  3697. internal::None, internal::None, internal::None, internal::None,
  3698. internal::None, internal::None, internal::None, internal::None,
  3699. internal::None, internal::None, internal::None, internal::None,
  3700. internal::None, internal::None, internal::None, internal::None,
  3701. internal::None, internal::None, internal::None, internal::None,
  3702. internal::None, internal::None, internal::None, internal::None,
  3703. internal::None, internal::None, internal::None, internal::None> {
  3704. typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
  3705. };
  3706. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3707. typename T6, typename T7, typename T8, typename T9>
  3708. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,
  3709. internal::None, internal::None, internal::None, internal::None,
  3710. internal::None, internal::None, internal::None, internal::None,
  3711. internal::None, internal::None, internal::None, internal::None,
  3712. internal::None, internal::None, internal::None, internal::None,
  3713. internal::None, internal::None, internal::None, internal::None,
  3714. internal::None, internal::None, internal::None, internal::None,
  3715. internal::None, internal::None, internal::None, internal::None,
  3716. internal::None, internal::None, internal::None, internal::None,
  3717. internal::None, internal::None, internal::None, internal::None,
  3718. internal::None, internal::None, internal::None, internal::None> {
  3719. typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
  3720. };
  3721. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3722. typename T6, typename T7, typename T8, typename T9, typename T10>
  3723. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,
  3724. internal::None, internal::None, internal::None, internal::None,
  3725. internal::None, internal::None, internal::None, internal::None,
  3726. internal::None, internal::None, internal::None, internal::None,
  3727. internal::None, internal::None, internal::None, internal::None,
  3728. internal::None, internal::None, internal::None, internal::None,
  3729. internal::None, internal::None, internal::None, internal::None,
  3730. internal::None, internal::None, internal::None, internal::None,
  3731. internal::None, internal::None, internal::None, internal::None,
  3732. internal::None, internal::None, internal::None, internal::None,
  3733. internal::None, internal::None, internal::None> {
  3734. typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
  3735. };
  3736. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3737. typename T6, typename T7, typename T8, typename T9, typename T10,
  3738. typename T11>
  3739. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,
  3740. internal::None, internal::None, internal::None, internal::None,
  3741. internal::None, internal::None, internal::None, internal::None,
  3742. internal::None, internal::None, internal::None, internal::None,
  3743. internal::None, internal::None, internal::None, internal::None,
  3744. internal::None, internal::None, internal::None, internal::None,
  3745. internal::None, internal::None, internal::None, internal::None,
  3746. internal::None, internal::None, internal::None, internal::None,
  3747. internal::None, internal::None, internal::None, internal::None,
  3748. internal::None, internal::None, internal::None, internal::None,
  3749. internal::None, internal::None> {
  3750. typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
  3751. };
  3752. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3753. typename T6, typename T7, typename T8, typename T9, typename T10,
  3754. typename T11, typename T12>
  3755. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,
  3756. internal::None, internal::None, internal::None, internal::None,
  3757. internal::None, internal::None, internal::None, internal::None,
  3758. internal::None, internal::None, internal::None, internal::None,
  3759. internal::None, internal::None, internal::None, internal::None,
  3760. internal::None, internal::None, internal::None, internal::None,
  3761. internal::None, internal::None, internal::None, internal::None,
  3762. internal::None, internal::None, internal::None, internal::None,
  3763. internal::None, internal::None, internal::None, internal::None,
  3764. internal::None, internal::None, internal::None, internal::None,
  3765. internal::None> {
  3766. typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  3767. T12> type;
  3768. };
  3769. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3770. typename T6, typename T7, typename T8, typename T9, typename T10,
  3771. typename T11, typename T12, typename T13>
  3772. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  3773. internal::None, internal::None, internal::None, internal::None,
  3774. internal::None, internal::None, internal::None, internal::None,
  3775. internal::None, internal::None, internal::None, internal::None,
  3776. internal::None, internal::None, internal::None, internal::None,
  3777. internal::None, internal::None, internal::None, internal::None,
  3778. internal::None, internal::None, internal::None, internal::None,
  3779. internal::None, internal::None, internal::None, internal::None,
  3780. internal::None, internal::None, internal::None, internal::None,
  3781. internal::None, internal::None, internal::None, internal::None,
  3782. internal::None> {
  3783. typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3784. T13> type;
  3785. };
  3786. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3787. typename T6, typename T7, typename T8, typename T9, typename T10,
  3788. typename T11, typename T12, typename T13, typename T14>
  3789. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  3790. internal::None, internal::None, internal::None, internal::None,
  3791. internal::None, internal::None, internal::None, internal::None,
  3792. internal::None, internal::None, internal::None, internal::None,
  3793. internal::None, internal::None, internal::None, internal::None,
  3794. internal::None, internal::None, internal::None, internal::None,
  3795. internal::None, internal::None, internal::None, internal::None,
  3796. internal::None, internal::None, internal::None, internal::None,
  3797. internal::None, internal::None, internal::None, internal::None,
  3798. internal::None, internal::None, internal::None, internal::None> {
  3799. typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3800. T13, T14> type;
  3801. };
  3802. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3803. typename T6, typename T7, typename T8, typename T9, typename T10,
  3804. typename T11, typename T12, typename T13, typename T14, typename T15>
  3805. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3806. internal::None, internal::None, internal::None, internal::None,
  3807. internal::None, internal::None, internal::None, internal::None,
  3808. internal::None, internal::None, internal::None, internal::None,
  3809. internal::None, internal::None, internal::None, internal::None,
  3810. internal::None, internal::None, internal::None, internal::None,
  3811. internal::None, internal::None, internal::None, internal::None,
  3812. internal::None, internal::None, internal::None, internal::None,
  3813. internal::None, internal::None, internal::None, internal::None,
  3814. internal::None, internal::None, internal::None> {
  3815. typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3816. T13, T14, T15> type;
  3817. };
  3818. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3819. typename T6, typename T7, typename T8, typename T9, typename T10,
  3820. typename T11, typename T12, typename T13, typename T14, typename T15,
  3821. typename T16>
  3822. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3823. T16, internal::None, internal::None, internal::None, internal::None,
  3824. internal::None, internal::None, internal::None, internal::None,
  3825. internal::None, internal::None, internal::None, internal::None,
  3826. internal::None, internal::None, internal::None, internal::None,
  3827. internal::None, internal::None, internal::None, internal::None,
  3828. internal::None, internal::None, internal::None, internal::None,
  3829. internal::None, internal::None, internal::None, internal::None,
  3830. internal::None, internal::None, internal::None, internal::None,
  3831. internal::None, internal::None> {
  3832. typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3833. T13, T14, T15, T16> type;
  3834. };
  3835. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3836. typename T6, typename T7, typename T8, typename T9, typename T10,
  3837. typename T11, typename T12, typename T13, typename T14, typename T15,
  3838. typename T16, typename T17>
  3839. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3840. T16, T17, internal::None, internal::None, internal::None, internal::None,
  3841. internal::None, internal::None, internal::None, internal::None,
  3842. internal::None, internal::None, internal::None, internal::None,
  3843. internal::None, internal::None, internal::None, internal::None,
  3844. internal::None, internal::None, internal::None, internal::None,
  3845. internal::None, internal::None, internal::None, internal::None,
  3846. internal::None, internal::None, internal::None, internal::None,
  3847. internal::None, internal::None, internal::None, internal::None,
  3848. internal::None> {
  3849. typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3850. T13, T14, T15, T16, T17> type;
  3851. };
  3852. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3853. typename T6, typename T7, typename T8, typename T9, typename T10,
  3854. typename T11, typename T12, typename T13, typename T14, typename T15,
  3855. typename T16, typename T17, typename T18>
  3856. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3857. T16, T17, T18, internal::None, internal::None, internal::None,
  3858. internal::None, internal::None, internal::None, internal::None,
  3859. internal::None, internal::None, internal::None, internal::None,
  3860. internal::None, internal::None, internal::None, internal::None,
  3861. internal::None, internal::None, internal::None, internal::None,
  3862. internal::None, internal::None, internal::None, internal::None,
  3863. internal::None, internal::None, internal::None, internal::None,
  3864. internal::None, internal::None, internal::None, internal::None,
  3865. internal::None> {
  3866. typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3867. T13, T14, T15, T16, T17, T18> type;
  3868. };
  3869. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3870. typename T6, typename T7, typename T8, typename T9, typename T10,
  3871. typename T11, typename T12, typename T13, typename T14, typename T15,
  3872. typename T16, typename T17, typename T18, typename T19>
  3873. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3874. T16, T17, T18, T19, internal::None, internal::None, internal::None,
  3875. internal::None, internal::None, internal::None, internal::None,
  3876. internal::None, internal::None, internal::None, internal::None,
  3877. internal::None, internal::None, internal::None, internal::None,
  3878. internal::None, internal::None, internal::None, internal::None,
  3879. internal::None, internal::None, internal::None, internal::None,
  3880. internal::None, internal::None, internal::None, internal::None,
  3881. internal::None, internal::None, internal::None, internal::None> {
  3882. typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3883. T13, T14, T15, T16, T17, T18, T19> type;
  3884. };
  3885. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3886. typename T6, typename T7, typename T8, typename T9, typename T10,
  3887. typename T11, typename T12, typename T13, typename T14, typename T15,
  3888. typename T16, typename T17, typename T18, typename T19, typename T20>
  3889. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3890. T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,
  3891. internal::None, internal::None, internal::None, internal::None,
  3892. internal::None, internal::None, internal::None, internal::None,
  3893. internal::None, internal::None, internal::None, internal::None,
  3894. internal::None, internal::None, internal::None, internal::None,
  3895. internal::None, internal::None, internal::None, internal::None,
  3896. internal::None, internal::None, internal::None, internal::None,
  3897. internal::None, internal::None, internal::None> {
  3898. typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3899. T13, T14, T15, T16, T17, T18, T19, T20> type;
  3900. };
  3901. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3902. typename T6, typename T7, typename T8, typename T9, typename T10,
  3903. typename T11, typename T12, typename T13, typename T14, typename T15,
  3904. typename T16, typename T17, typename T18, typename T19, typename T20,
  3905. typename T21>
  3906. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3907. T16, T17, T18, T19, T20, T21, internal::None, internal::None,
  3908. internal::None, internal::None, internal::None, internal::None,
  3909. internal::None, internal::None, internal::None, internal::None,
  3910. internal::None, internal::None, internal::None, internal::None,
  3911. internal::None, internal::None, internal::None, internal::None,
  3912. internal::None, internal::None, internal::None, internal::None,
  3913. internal::None, internal::None, internal::None, internal::None,
  3914. internal::None, internal::None, internal::None> {
  3915. typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3916. T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
  3917. };
  3918. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3919. typename T6, typename T7, typename T8, typename T9, typename T10,
  3920. typename T11, typename T12, typename T13, typename T14, typename T15,
  3921. typename T16, typename T17, typename T18, typename T19, typename T20,
  3922. typename T21, typename T22>
  3923. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3924. T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None,
  3925. internal::None, internal::None, internal::None, internal::None,
  3926. internal::None, internal::None, internal::None, internal::None,
  3927. internal::None, internal::None, internal::None, internal::None,
  3928. internal::None, internal::None, internal::None, internal::None,
  3929. internal::None, internal::None, internal::None, internal::None,
  3930. internal::None, internal::None, internal::None, internal::None,
  3931. internal::None, internal::None> {
  3932. typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3933. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
  3934. };
  3935. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3936. typename T6, typename T7, typename T8, typename T9, typename T10,
  3937. typename T11, typename T12, typename T13, typename T14, typename T15,
  3938. typename T16, typename T17, typename T18, typename T19, typename T20,
  3939. typename T21, typename T22, typename T23>
  3940. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3941. T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None,
  3942. internal::None, internal::None, internal::None, internal::None,
  3943. internal::None, internal::None, internal::None, internal::None,
  3944. internal::None, internal::None, internal::None, internal::None,
  3945. internal::None, internal::None, internal::None, internal::None,
  3946. internal::None, internal::None, internal::None, internal::None,
  3947. internal::None, internal::None, internal::None, internal::None,
  3948. internal::None> {
  3949. typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3950. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
  3951. };
  3952. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3953. typename T6, typename T7, typename T8, typename T9, typename T10,
  3954. typename T11, typename T12, typename T13, typename T14, typename T15,
  3955. typename T16, typename T17, typename T18, typename T19, typename T20,
  3956. typename T21, typename T22, typename T23, typename T24>
  3957. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3958. T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,
  3959. internal::None, internal::None, internal::None, internal::None,
  3960. internal::None, internal::None, internal::None, internal::None,
  3961. internal::None, internal::None, internal::None, internal::None,
  3962. internal::None, internal::None, internal::None, internal::None,
  3963. internal::None, internal::None, internal::None, internal::None,
  3964. internal::None, internal::None, internal::None, internal::None,
  3965. internal::None> {
  3966. typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3967. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
  3968. };
  3969. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3970. typename T6, typename T7, typename T8, typename T9, typename T10,
  3971. typename T11, typename T12, typename T13, typename T14, typename T15,
  3972. typename T16, typename T17, typename T18, typename T19, typename T20,
  3973. typename T21, typename T22, typename T23, typename T24, typename T25>
  3974. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3975. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,
  3976. internal::None, internal::None, internal::None, internal::None,
  3977. internal::None, internal::None, internal::None, internal::None,
  3978. internal::None, internal::None, internal::None, internal::None,
  3979. internal::None, internal::None, internal::None, internal::None,
  3980. internal::None, internal::None, internal::None, internal::None,
  3981. internal::None, internal::None, internal::None, internal::None> {
  3982. typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3983. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
  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, typename T13, typename T14, typename T15,
  3988. typename T16, typename T17, typename T18, typename T19, typename T20,
  3989. typename T21, typename T22, typename T23, typename T24, typename T25,
  3990. typename T26>
  3991. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3992. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,
  3993. internal::None, internal::None, internal::None, internal::None,
  3994. internal::None, internal::None, internal::None, internal::None,
  3995. internal::None, internal::None, internal::None, internal::None,
  3996. internal::None, internal::None, internal::None, internal::None,
  3997. internal::None, internal::None, internal::None, internal::None,
  3998. internal::None, internal::None, internal::None> {
  3999. typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4000. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  4001. T26> type;
  4002. };
  4003. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4004. typename T6, typename T7, typename T8, typename T9, typename T10,
  4005. typename T11, typename T12, typename T13, typename T14, typename T15,
  4006. typename T16, typename T17, typename T18, typename T19, typename T20,
  4007. typename T21, typename T22, typename T23, typename T24, typename T25,
  4008. typename T26, typename T27>
  4009. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4010. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,
  4011. internal::None, internal::None, internal::None, internal::None,
  4012. internal::None, internal::None, internal::None, internal::None,
  4013. internal::None, internal::None, internal::None, internal::None,
  4014. internal::None, internal::None, internal::None, internal::None,
  4015. internal::None, internal::None, internal::None, internal::None,
  4016. internal::None, internal::None> {
  4017. typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4018. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4019. T27> type;
  4020. };
  4021. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4022. typename T6, typename T7, typename T8, typename T9, typename T10,
  4023. typename T11, typename T12, typename T13, typename T14, typename T15,
  4024. typename T16, typename T17, typename T18, typename T19, typename T20,
  4025. typename T21, typename T22, typename T23, typename T24, typename T25,
  4026. typename T26, typename T27, typename T28>
  4027. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4028. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4029. internal::None, internal::None, internal::None, internal::None,
  4030. internal::None, internal::None, internal::None, internal::None,
  4031. internal::None, internal::None, internal::None, internal::None,
  4032. internal::None, internal::None, internal::None, internal::None,
  4033. internal::None, internal::None, internal::None, internal::None,
  4034. internal::None, internal::None> {
  4035. typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4036. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4037. T27, T28> type;
  4038. };
  4039. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4040. typename T6, typename T7, typename T8, typename T9, typename T10,
  4041. typename T11, typename T12, typename T13, typename T14, typename T15,
  4042. typename T16, typename T17, typename T18, typename T19, typename T20,
  4043. typename T21, typename T22, typename T23, typename T24, typename T25,
  4044. typename T26, typename T27, typename T28, typename T29>
  4045. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4046. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4047. internal::None, internal::None, internal::None, internal::None,
  4048. internal::None, internal::None, internal::None, internal::None,
  4049. internal::None, internal::None, internal::None, internal::None,
  4050. internal::None, internal::None, internal::None, internal::None,
  4051. internal::None, internal::None, internal::None, internal::None,
  4052. internal::None> {
  4053. typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4054. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4055. T27, T28, T29> type;
  4056. };
  4057. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4058. typename T6, typename T7, typename T8, typename T9, typename T10,
  4059. typename T11, typename T12, typename T13, typename T14, typename T15,
  4060. typename T16, typename T17, typename T18, typename T19, typename T20,
  4061. typename T21, typename T22, typename T23, typename T24, typename T25,
  4062. typename T26, typename T27, typename T28, typename T29, typename T30>
  4063. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4064. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4065. internal::None, internal::None, internal::None, internal::None,
  4066. internal::None, internal::None, internal::None, internal::None,
  4067. internal::None, internal::None, internal::None, internal::None,
  4068. internal::None, internal::None, internal::None, internal::None,
  4069. internal::None, internal::None, internal::None, internal::None> {
  4070. typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4071. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4072. T27, T28, T29, T30> type;
  4073. };
  4074. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4075. typename T6, typename T7, typename T8, typename T9, typename T10,
  4076. typename T11, typename T12, typename T13, typename T14, typename T15,
  4077. typename T16, typename T17, typename T18, typename T19, typename T20,
  4078. typename T21, typename T22, typename T23, typename T24, typename T25,
  4079. typename T26, typename T27, typename T28, typename T29, typename T30,
  4080. typename T31>
  4081. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4082. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4083. T31, internal::None, internal::None, internal::None, internal::None,
  4084. internal::None, internal::None, internal::None, internal::None,
  4085. internal::None, internal::None, internal::None, internal::None,
  4086. internal::None, internal::None, internal::None, internal::None,
  4087. internal::None, internal::None, internal::None> {
  4088. typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4089. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4090. T27, T28, T29, T30, T31> type;
  4091. };
  4092. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4093. typename T6, typename T7, typename T8, typename T9, typename T10,
  4094. typename T11, typename T12, typename T13, typename T14, typename T15,
  4095. typename T16, typename T17, typename T18, typename T19, typename T20,
  4096. typename T21, typename T22, typename T23, typename T24, typename T25,
  4097. typename T26, typename T27, typename T28, typename T29, typename T30,
  4098. typename T31, typename T32>
  4099. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4100. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4101. T31, T32, internal::None, internal::None, internal::None, internal::None,
  4102. internal::None, internal::None, internal::None, internal::None,
  4103. internal::None, internal::None, internal::None, internal::None,
  4104. internal::None, internal::None, internal::None, internal::None,
  4105. internal::None, internal::None> {
  4106. typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4107. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4108. T27, T28, T29, T30, T31, T32> type;
  4109. };
  4110. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4111. typename T6, typename T7, typename T8, typename T9, typename T10,
  4112. typename T11, typename T12, typename T13, typename T14, typename T15,
  4113. typename T16, typename T17, typename T18, typename T19, typename T20,
  4114. typename T21, typename T22, typename T23, typename T24, typename T25,
  4115. typename T26, typename T27, typename T28, typename T29, typename T30,
  4116. typename T31, typename T32, typename T33>
  4117. struct Types<T1, 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, T27, T28, T29, T30,
  4119. T31, T32, T33, internal::None, internal::None, internal::None,
  4120. internal::None, internal::None, internal::None, internal::None,
  4121. internal::None, internal::None, internal::None, internal::None,
  4122. internal::None, internal::None, internal::None, internal::None,
  4123. internal::None, internal::None> {
  4124. typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4125. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4126. T27, T28, T29, T30, T31, T32, T33> type;
  4127. };
  4128. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4129. typename T6, typename T7, typename T8, typename T9, typename T10,
  4130. typename T11, typename T12, typename T13, typename T14, typename T15,
  4131. typename T16, typename T17, typename T18, typename T19, typename T20,
  4132. typename T21, typename T22, typename T23, typename T24, typename T25,
  4133. typename T26, typename T27, typename T28, typename T29, typename T30,
  4134. typename T31, typename T32, typename T33, typename T34>
  4135. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4136. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4137. T31, T32, T33, T34, internal::None, internal::None, internal::None,
  4138. internal::None, internal::None, internal::None, internal::None,
  4139. internal::None, internal::None, internal::None, internal::None,
  4140. internal::None, internal::None, internal::None, internal::None,
  4141. internal::None> {
  4142. typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4143. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4144. T27, T28, T29, T30, T31, T32, T33, T34> type;
  4145. };
  4146. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4147. typename T6, typename T7, typename T8, typename T9, typename T10,
  4148. typename T11, typename T12, typename T13, typename T14, typename T15,
  4149. typename T16, typename T17, typename T18, typename T19, typename T20,
  4150. typename T21, typename T22, typename T23, typename T24, typename T25,
  4151. typename T26, typename T27, typename T28, typename T29, typename T30,
  4152. typename T31, typename T32, typename T33, typename T34, typename T35>
  4153. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4154. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4155. T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
  4156. internal::None, internal::None, internal::None, internal::None,
  4157. internal::None, internal::None, internal::None, internal::None,
  4158. internal::None, internal::None, internal::None, internal::None> {
  4159. typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4160. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4161. T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
  4162. };
  4163. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4164. typename T6, typename T7, typename T8, typename T9, typename T10,
  4165. typename T11, typename T12, typename T13, typename T14, typename T15,
  4166. typename T16, typename T17, typename T18, typename T19, typename T20,
  4167. typename T21, typename T22, typename T23, typename T24, typename T25,
  4168. typename T26, typename T27, typename T28, typename T29, typename T30,
  4169. typename T31, typename T32, typename T33, typename T34, typename T35,
  4170. typename T36>
  4171. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4172. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4173. T31, T32, T33, T34, T35, T36, internal::None, internal::None,
  4174. internal::None, internal::None, internal::None, internal::None,
  4175. internal::None, internal::None, internal::None, internal::None,
  4176. internal::None, internal::None, internal::None, internal::None> {
  4177. typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4178. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4179. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
  4180. };
  4181. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4182. typename T6, typename T7, typename T8, typename T9, typename T10,
  4183. typename T11, typename T12, typename T13, typename T14, typename T15,
  4184. typename T16, typename T17, typename T18, typename T19, typename T20,
  4185. typename T21, typename T22, typename T23, typename T24, typename T25,
  4186. typename T26, typename T27, typename T28, typename T29, typename T30,
  4187. typename T31, typename T32, typename T33, typename T34, typename T35,
  4188. typename T36, typename T37>
  4189. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4190. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4191. T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
  4192. internal::None, internal::None, internal::None, internal::None,
  4193. internal::None, internal::None, internal::None, internal::None,
  4194. internal::None, internal::None, internal::None> {
  4195. typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4196. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4197. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
  4198. };
  4199. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4200. typename T6, typename T7, typename T8, typename T9, typename T10,
  4201. typename T11, typename T12, typename T13, typename T14, typename T15,
  4202. typename T16, typename T17, typename T18, typename T19, typename T20,
  4203. typename T21, typename T22, typename T23, typename T24, typename T25,
  4204. typename T26, typename T27, typename T28, typename T29, typename T30,
  4205. typename T31, typename T32, typename T33, typename T34, typename T35,
  4206. typename T36, typename T37, typename T38>
  4207. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4208. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4209. T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
  4210. internal::None, internal::None, internal::None, internal::None,
  4211. internal::None, internal::None, internal::None, internal::None,
  4212. internal::None, internal::None> {
  4213. typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4214. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4215. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
  4216. };
  4217. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4218. typename T6, typename T7, typename T8, typename T9, typename T10,
  4219. typename T11, typename T12, typename T13, typename T14, typename T15,
  4220. typename T16, typename T17, typename T18, typename T19, typename T20,
  4221. typename T21, typename T22, typename T23, typename T24, typename T25,
  4222. typename T26, typename T27, typename T28, typename T29, typename T30,
  4223. typename T31, typename T32, typename T33, typename T34, typename T35,
  4224. typename T36, typename T37, typename T38, typename T39>
  4225. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4226. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4227. T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
  4228. internal::None, internal::None, internal::None, internal::None,
  4229. internal::None, internal::None, internal::None, internal::None,
  4230. internal::None, internal::None> {
  4231. typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4232. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4233. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
  4234. };
  4235. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4236. typename T6, typename T7, typename T8, typename T9, typename T10,
  4237. typename T11, typename T12, typename T13, typename T14, typename T15,
  4238. typename T16, typename T17, typename T18, typename T19, typename T20,
  4239. typename T21, typename T22, typename T23, typename T24, typename T25,
  4240. typename T26, typename T27, typename T28, typename T29, typename T30,
  4241. typename T31, typename T32, typename T33, typename T34, typename T35,
  4242. typename T36, typename T37, typename T38, typename T39, typename T40>
  4243. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4244. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4245. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
  4246. internal::None, internal::None, internal::None, internal::None,
  4247. internal::None, internal::None, internal::None, internal::None,
  4248. internal::None> {
  4249. typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4250. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4251. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  4252. T40> type;
  4253. };
  4254. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4255. typename T6, typename T7, typename T8, typename T9, typename T10,
  4256. typename T11, typename T12, typename T13, typename T14, typename T15,
  4257. typename T16, typename T17, typename T18, typename T19, typename T20,
  4258. typename T21, typename T22, typename T23, typename T24, typename T25,
  4259. typename T26, typename T27, typename T28, typename T29, typename T30,
  4260. typename T31, typename T32, typename T33, typename T34, typename T35,
  4261. typename T36, typename T37, typename T38, typename T39, typename T40,
  4262. typename T41>
  4263. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4264. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4265. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
  4266. internal::None, internal::None, internal::None, internal::None,
  4267. internal::None, internal::None, internal::None, internal::None> {
  4268. typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4269. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4270. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4271. T41> type;
  4272. };
  4273. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4274. typename T6, typename T7, typename T8, typename T9, typename T10,
  4275. typename T11, typename T12, typename T13, typename T14, typename T15,
  4276. typename T16, typename T17, typename T18, typename T19, typename T20,
  4277. typename T21, typename T22, typename T23, typename T24, typename T25,
  4278. typename T26, typename T27, 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, typename T40,
  4281. typename T41, typename T42>
  4282. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4283. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4284. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
  4285. internal::None, internal::None, internal::None, internal::None,
  4286. internal::None, internal::None, internal::None> {
  4287. typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4288. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4289. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4290. T41, T42> type;
  4291. };
  4292. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4293. typename T6, typename T7, typename T8, typename T9, typename T10,
  4294. typename T11, typename T12, typename T13, typename T14, typename T15,
  4295. typename T16, typename T17, typename T18, typename T19, typename T20,
  4296. typename T21, typename T22, typename T23, typename T24, typename T25,
  4297. typename T26, typename T27, typename T28, typename T29, typename T30,
  4298. typename T31, typename T32, typename T33, typename T34, typename T35,
  4299. typename T36, typename T37, typename T38, typename T39, typename T40,
  4300. typename T41, typename T42, typename T43>
  4301. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4302. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4303. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  4304. internal::None, internal::None, internal::None, internal::None,
  4305. internal::None, internal::None, internal::None> {
  4306. typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4307. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4308. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4309. T41, T42, T43> type;
  4310. };
  4311. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4312. typename T6, typename T7, typename T8, typename T9, typename T10,
  4313. typename T11, typename T12, typename T13, typename T14, typename T15,
  4314. typename T16, typename T17, typename T18, typename T19, typename T20,
  4315. typename T21, typename T22, typename T23, typename T24, typename T25,
  4316. typename T26, typename T27, typename T28, typename T29, typename T30,
  4317. typename T31, typename T32, typename T33, typename T34, typename T35,
  4318. typename T36, typename T37, typename T38, typename T39, typename T40,
  4319. typename T41, typename T42, typename T43, typename T44>
  4320. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4321. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4322. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  4323. internal::None, internal::None, internal::None, internal::None,
  4324. internal::None, internal::None> {
  4325. typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4326. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4327. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4328. T41, T42, T43, T44> type;
  4329. };
  4330. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4331. typename T6, typename T7, typename T8, typename T9, typename T10,
  4332. typename T11, typename T12, typename T13, typename T14, typename T15,
  4333. typename T16, typename T17, typename T18, typename T19, typename T20,
  4334. typename T21, typename T22, typename T23, typename T24, typename T25,
  4335. typename T26, typename T27, typename T28, typename T29, typename T30,
  4336. typename T31, typename T32, typename T33, typename T34, typename T35,
  4337. typename T36, typename T37, typename T38, typename T39, typename T40,
  4338. typename T41, typename T42, typename T43, typename T44, typename T45>
  4339. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4340. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4341. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  4342. internal::None, internal::None, internal::None, internal::None,
  4343. internal::None> {
  4344. typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4345. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4346. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4347. T41, T42, T43, T44, T45> type;
  4348. };
  4349. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4350. typename T6, typename T7, typename T8, typename T9, typename T10,
  4351. typename T11, typename T12, typename T13, typename T14, typename T15,
  4352. typename T16, typename T17, typename T18, typename T19, typename T20,
  4353. typename T21, typename T22, typename T23, typename T24, typename T25,
  4354. typename T26, typename T27, typename T28, typename T29, typename T30,
  4355. typename T31, typename T32, typename T33, typename T34, typename T35,
  4356. typename T36, typename T37, typename T38, typename T39, typename T40,
  4357. typename T41, typename T42, typename T43, typename T44, typename T45,
  4358. typename T46>
  4359. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4360. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4361. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  4362. T46, internal::None, internal::None, internal::None, internal::None> {
  4363. typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4364. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4365. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4366. T41, T42, T43, T44, T45, T46> type;
  4367. };
  4368. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4369. typename T6, typename T7, typename T8, typename T9, typename T10,
  4370. typename T11, typename T12, typename T13, typename T14, typename T15,
  4371. typename T16, typename T17, typename T18, typename T19, typename T20,
  4372. typename T21, typename T22, typename T23, typename T24, typename T25,
  4373. typename T26, typename T27, typename T28, typename T29, typename T30,
  4374. typename T31, typename T32, typename T33, typename T34, typename T35,
  4375. typename T36, typename T37, typename T38, typename T39, typename T40,
  4376. typename T41, typename T42, typename T43, typename T44, typename T45,
  4377. typename T46, typename T47>
  4378. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4379. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4380. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  4381. T46, T47, internal::None, internal::None, internal::None> {
  4382. typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4383. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4384. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4385. T41, T42, T43, T44, T45, T46, T47> type;
  4386. };
  4387. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4388. typename T6, typename T7, typename T8, typename T9, typename T10,
  4389. typename T11, typename T12, typename T13, typename T14, typename T15,
  4390. typename T16, typename T17, typename T18, typename T19, typename T20,
  4391. typename T21, typename T22, typename T23, typename T24, typename T25,
  4392. typename T26, typename T27, typename T28, typename T29, typename T30,
  4393. typename T31, typename T32, typename T33, typename T34, typename T35,
  4394. typename T36, typename T37, typename T38, typename T39, typename T40,
  4395. typename T41, typename T42, typename T43, typename T44, typename T45,
  4396. typename T46, typename T47, typename T48>
  4397. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4398. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4399. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  4400. T46, T47, T48, internal::None, internal::None> {
  4401. typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4402. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4403. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4404. T41, T42, T43, T44, T45, T46, T47, T48> type;
  4405. };
  4406. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4407. typename T6, typename T7, typename T8, typename T9, typename T10,
  4408. typename T11, typename T12, typename T13, typename T14, typename T15,
  4409. typename T16, typename T17, typename T18, typename T19, typename T20,
  4410. typename T21, typename T22, typename T23, typename T24, typename T25,
  4411. typename T26, typename T27, typename T28, typename T29, typename T30,
  4412. typename T31, typename T32, typename T33, typename T34, typename T35,
  4413. typename T36, typename T37, typename T38, typename T39, typename T40,
  4414. typename T41, typename T42, typename T43, typename T44, typename T45,
  4415. typename T46, typename T47, typename T48, typename T49>
  4416. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4417. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4418. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  4419. T46, T47, T48, T49, internal::None> {
  4420. typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4421. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4422. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4423. T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
  4424. };
  4425. namespace internal {
  4426. # define GTEST_TEMPLATE_ template <typename T> class
  4427. // The template "selector" struct TemplateSel<Tmpl> is used to
  4428. // represent Tmpl, which must be a class template with one type
  4429. // parameter, as a type. TemplateSel<Tmpl>::Bind<T>::type is defined
  4430. // as the type Tmpl<T>. This allows us to actually instantiate the
  4431. // template "selected" by TemplateSel<Tmpl>.
  4432. //
  4433. // This trick is necessary for simulating typedef for class templates,
  4434. // which C++ doesn't support directly.
  4435. template <GTEST_TEMPLATE_ Tmpl>
  4436. struct TemplateSel {
  4437. template <typename T>
  4438. struct Bind {
  4439. typedef Tmpl<T> type;
  4440. };
  4441. };
  4442. # define GTEST_BIND_(TmplSel, T) \
  4443. TmplSel::template Bind<T>::type
  4444. // A unique struct template used as the default value for the
  4445. // arguments of class template Templates. This allows us to simulate
  4446. // variadic templates (e.g. Templates<int>, Templates<int, double>,
  4447. // and etc), which C++ doesn't support directly.
  4448. template <typename T>
  4449. struct NoneT {};
  4450. // The following family of struct and struct templates are used to
  4451. // represent template lists. In particular, TemplatesN<T1, T2, ...,
  4452. // TN> represents a list of N templates (T1, T2, ..., and TN). Except
  4453. // for Templates0, every struct in the family has two member types:
  4454. // Head for the selector of the first template in the list, and Tail
  4455. // for the rest of the list.
  4456. // The empty template list.
  4457. struct Templates0 {};
  4458. // Template lists of length 1, 2, 3, and so on.
  4459. template <GTEST_TEMPLATE_ T1>
  4460. struct Templates1 {
  4461. typedef TemplateSel<T1> Head;
  4462. typedef Templates0 Tail;
  4463. };
  4464. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
  4465. struct Templates2 {
  4466. typedef TemplateSel<T1> Head;
  4467. typedef Templates1<T2> Tail;
  4468. };
  4469. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
  4470. struct Templates3 {
  4471. typedef TemplateSel<T1> Head;
  4472. typedef Templates2<T2, T3> Tail;
  4473. };
  4474. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4475. GTEST_TEMPLATE_ T4>
  4476. struct Templates4 {
  4477. typedef TemplateSel<T1> Head;
  4478. typedef Templates3<T2, T3, T4> Tail;
  4479. };
  4480. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4481. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
  4482. struct Templates5 {
  4483. typedef TemplateSel<T1> Head;
  4484. typedef Templates4<T2, T3, T4, T5> Tail;
  4485. };
  4486. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4487. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
  4488. struct Templates6 {
  4489. typedef TemplateSel<T1> Head;
  4490. typedef Templates5<T2, T3, T4, T5, T6> Tail;
  4491. };
  4492. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4493. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4494. GTEST_TEMPLATE_ T7>
  4495. struct Templates7 {
  4496. typedef TemplateSel<T1> Head;
  4497. typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
  4498. };
  4499. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4500. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4501. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
  4502. struct Templates8 {
  4503. typedef TemplateSel<T1> Head;
  4504. typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
  4505. };
  4506. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4507. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4508. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
  4509. struct Templates9 {
  4510. typedef TemplateSel<T1> Head;
  4511. typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
  4512. };
  4513. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4514. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4515. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4516. GTEST_TEMPLATE_ T10>
  4517. struct Templates10 {
  4518. typedef TemplateSel<T1> Head;
  4519. typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
  4520. };
  4521. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4522. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4523. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4524. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
  4525. struct Templates11 {
  4526. typedef TemplateSel<T1> Head;
  4527. typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
  4528. };
  4529. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4530. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4531. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4532. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
  4533. struct Templates12 {
  4534. typedef TemplateSel<T1> Head;
  4535. typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
  4536. };
  4537. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4538. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4539. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4540. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4541. GTEST_TEMPLATE_ T13>
  4542. struct Templates13 {
  4543. typedef TemplateSel<T1> Head;
  4544. typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
  4545. };
  4546. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4547. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4548. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4549. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4550. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
  4551. struct Templates14 {
  4552. typedef TemplateSel<T1> Head;
  4553. typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  4554. T14> Tail;
  4555. };
  4556. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4557. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4558. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4559. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4560. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
  4561. struct Templates15 {
  4562. typedef TemplateSel<T1> Head;
  4563. typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4564. T15> Tail;
  4565. };
  4566. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4567. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4568. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4569. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4570. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4571. GTEST_TEMPLATE_ T16>
  4572. struct Templates16 {
  4573. typedef TemplateSel<T1> Head;
  4574. typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4575. T15, T16> Tail;
  4576. };
  4577. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4578. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4579. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4580. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4581. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4582. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
  4583. struct Templates17 {
  4584. typedef TemplateSel<T1> Head;
  4585. typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4586. T15, T16, T17> Tail;
  4587. };
  4588. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4589. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4590. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4591. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4592. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4593. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
  4594. struct Templates18 {
  4595. typedef TemplateSel<T1> Head;
  4596. typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4597. T15, T16, T17, T18> Tail;
  4598. };
  4599. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4600. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4601. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4602. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4603. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4604. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4605. GTEST_TEMPLATE_ T19>
  4606. struct Templates19 {
  4607. typedef TemplateSel<T1> Head;
  4608. typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4609. T15, T16, T17, T18, T19> Tail;
  4610. };
  4611. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4612. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4613. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4614. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4615. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4616. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4617. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
  4618. struct Templates20 {
  4619. typedef TemplateSel<T1> Head;
  4620. typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4621. T15, T16, T17, T18, T19, T20> Tail;
  4622. };
  4623. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4624. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4625. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4626. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4627. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4628. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4629. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
  4630. struct Templates21 {
  4631. typedef TemplateSel<T1> Head;
  4632. typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4633. T15, T16, T17, T18, T19, T20, T21> Tail;
  4634. };
  4635. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4636. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4637. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4638. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4639. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4640. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4641. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4642. GTEST_TEMPLATE_ T22>
  4643. struct Templates22 {
  4644. typedef TemplateSel<T1> Head;
  4645. typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4646. T15, T16, T17, T18, T19, T20, T21, T22> Tail;
  4647. };
  4648. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4649. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4650. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4651. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4652. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4653. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4654. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4655. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
  4656. struct Templates23 {
  4657. typedef TemplateSel<T1> Head;
  4658. typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4659. T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
  4660. };
  4661. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4662. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4663. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4664. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4665. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4666. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4667. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4668. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
  4669. struct Templates24 {
  4670. typedef TemplateSel<T1> Head;
  4671. typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4672. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
  4673. };
  4674. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4675. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4676. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4677. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4678. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4679. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4680. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4681. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4682. GTEST_TEMPLATE_ T25>
  4683. struct Templates25 {
  4684. typedef TemplateSel<T1> Head;
  4685. typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4686. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
  4687. };
  4688. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4689. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4690. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4691. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4692. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4693. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4694. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4695. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4696. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
  4697. struct Templates26 {
  4698. typedef TemplateSel<T1> Head;
  4699. typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4700. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
  4701. };
  4702. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4703. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4704. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4705. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4706. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4707. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4708. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4709. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4710. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
  4711. struct Templates27 {
  4712. typedef TemplateSel<T1> Head;
  4713. typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4714. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
  4715. };
  4716. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4717. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4718. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4719. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4720. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4721. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4722. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4723. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4724. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4725. GTEST_TEMPLATE_ T28>
  4726. struct Templates28 {
  4727. typedef TemplateSel<T1> Head;
  4728. typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4729. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  4730. T28> Tail;
  4731. };
  4732. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4733. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4734. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4735. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4736. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4737. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4738. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4739. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4740. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4741. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
  4742. struct Templates29 {
  4743. typedef TemplateSel<T1> Head;
  4744. typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4745. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4746. T29> Tail;
  4747. };
  4748. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4749. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4750. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4751. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4752. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4753. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4754. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4755. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4756. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4757. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
  4758. struct Templates30 {
  4759. typedef TemplateSel<T1> Head;
  4760. typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4761. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4762. T29, T30> Tail;
  4763. };
  4764. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4765. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4766. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4767. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4768. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4769. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4770. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4771. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4772. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4773. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4774. GTEST_TEMPLATE_ T31>
  4775. struct Templates31 {
  4776. typedef TemplateSel<T1> Head;
  4777. typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4778. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4779. T29, T30, T31> Tail;
  4780. };
  4781. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4782. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4783. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4784. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4785. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4786. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4787. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4788. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4789. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4790. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4791. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
  4792. struct Templates32 {
  4793. typedef TemplateSel<T1> Head;
  4794. typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4795. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4796. T29, T30, T31, T32> Tail;
  4797. };
  4798. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4799. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4800. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4801. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4802. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4803. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4804. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4805. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4806. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4807. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4808. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
  4809. struct Templates33 {
  4810. typedef TemplateSel<T1> Head;
  4811. typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4812. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4813. T29, T30, T31, T32, T33> Tail;
  4814. };
  4815. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4816. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4817. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4818. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4819. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4820. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4821. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4822. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4823. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4824. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4825. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4826. GTEST_TEMPLATE_ T34>
  4827. struct Templates34 {
  4828. typedef TemplateSel<T1> Head;
  4829. typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4830. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4831. T29, T30, T31, T32, T33, T34> Tail;
  4832. };
  4833. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4834. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4835. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4836. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4837. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4838. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4839. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4840. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4841. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4842. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4843. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4844. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
  4845. struct Templates35 {
  4846. typedef TemplateSel<T1> Head;
  4847. typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4848. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4849. T29, T30, T31, T32, T33, T34, T35> Tail;
  4850. };
  4851. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4852. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4853. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4854. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4855. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4856. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4857. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4858. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4859. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4860. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4861. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4862. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
  4863. struct Templates36 {
  4864. typedef TemplateSel<T1> Head;
  4865. typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4866. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4867. T29, T30, T31, T32, T33, T34, T35, T36> Tail;
  4868. };
  4869. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4870. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4871. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4872. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4873. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4874. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4875. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4876. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4877. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4878. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4879. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4880. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  4881. GTEST_TEMPLATE_ T37>
  4882. struct Templates37 {
  4883. typedef TemplateSel<T1> Head;
  4884. typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4885. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4886. T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
  4887. };
  4888. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4889. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4890. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4891. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4892. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4893. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4894. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4895. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4896. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4897. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4898. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4899. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  4900. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
  4901. struct Templates38 {
  4902. typedef TemplateSel<T1> Head;
  4903. typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4904. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4905. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
  4906. };
  4907. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4908. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4909. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4910. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4911. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4912. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4913. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4914. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4915. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4916. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4917. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4918. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  4919. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
  4920. struct Templates39 {
  4921. typedef TemplateSel<T1> Head;
  4922. typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4923. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4924. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
  4925. };
  4926. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4927. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4928. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4929. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4930. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4931. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4932. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4933. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4934. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4935. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4936. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4937. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  4938. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  4939. GTEST_TEMPLATE_ T40>
  4940. struct Templates40 {
  4941. typedef TemplateSel<T1> Head;
  4942. typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4943. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4944. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
  4945. };
  4946. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4947. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4948. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4949. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4950. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4951. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4952. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4953. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4954. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4955. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4956. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4957. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  4958. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  4959. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
  4960. struct Templates41 {
  4961. typedef TemplateSel<T1> Head;
  4962. typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4963. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4964. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
  4965. };
  4966. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4967. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4968. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4969. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4970. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4971. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4972. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4973. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4974. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4975. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4976. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4977. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  4978. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  4979. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
  4980. struct Templates42 {
  4981. typedef TemplateSel<T1> Head;
  4982. typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4983. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4984. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  4985. T42> Tail;
  4986. };
  4987. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4988. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4989. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4990. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4991. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4992. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4993. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4994. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4995. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4996. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4997. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4998. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  4999. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5000. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5001. GTEST_TEMPLATE_ T43>
  5002. struct Templates43 {
  5003. typedef TemplateSel<T1> Head;
  5004. typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5005. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5006. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5007. T43> Tail;
  5008. };
  5009. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5010. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5011. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5012. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5013. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5014. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5015. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5016. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5017. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5018. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5019. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5020. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5021. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5022. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5023. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
  5024. struct Templates44 {
  5025. typedef TemplateSel<T1> Head;
  5026. typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5027. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5028. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5029. T43, T44> Tail;
  5030. };
  5031. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5032. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5033. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5034. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5035. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5036. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5037. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5038. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5039. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5040. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5041. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5042. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5043. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5044. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5045. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
  5046. struct Templates45 {
  5047. typedef TemplateSel<T1> Head;
  5048. typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5049. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5050. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5051. T43, T44, T45> Tail;
  5052. };
  5053. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5054. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5055. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5056. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5057. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5058. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5059. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5060. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5061. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5062. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5063. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5064. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5065. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5066. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5067. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5068. GTEST_TEMPLATE_ T46>
  5069. struct Templates46 {
  5070. typedef TemplateSel<T1> Head;
  5071. typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5072. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5073. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5074. T43, T44, T45, T46> Tail;
  5075. };
  5076. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5077. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5078. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5079. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5080. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5081. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5082. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5083. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5084. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5085. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5086. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5087. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5088. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5089. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5090. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5091. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
  5092. struct Templates47 {
  5093. typedef TemplateSel<T1> Head;
  5094. typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5095. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5096. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5097. T43, T44, T45, T46, T47> Tail;
  5098. };
  5099. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5100. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5101. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5102. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5103. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5104. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5105. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5106. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5107. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5108. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5109. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5110. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5111. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5112. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5113. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5114. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
  5115. struct Templates48 {
  5116. typedef TemplateSel<T1> Head;
  5117. typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5118. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5119. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5120. T43, T44, T45, T46, T47, T48> Tail;
  5121. };
  5122. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5123. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5124. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5125. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5126. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5127. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5128. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5129. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5130. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5131. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5132. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5133. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5134. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5135. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5136. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5137. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
  5138. GTEST_TEMPLATE_ T49>
  5139. struct Templates49 {
  5140. typedef TemplateSel<T1> Head;
  5141. typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5142. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5143. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5144. T43, T44, T45, T46, T47, T48, T49> Tail;
  5145. };
  5146. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5147. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5148. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5149. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5150. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5151. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5152. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5153. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5154. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5155. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5156. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5157. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5158. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5159. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5160. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5161. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
  5162. GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
  5163. struct Templates50 {
  5164. typedef TemplateSel<T1> Head;
  5165. typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5166. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5167. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5168. T43, T44, T45, T46, T47, T48, T49, T50> Tail;
  5169. };
  5170. // We don't want to require the users to write TemplatesN<...> directly,
  5171. // as that would require them to count the length. Templates<...> is much
  5172. // easier to write, but generates horrible messages when there is a
  5173. // compiler error, as gcc insists on printing out each template
  5174. // argument, even if it has the default value (this means Templates<list>
  5175. // will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
  5176. // errors).
  5177. //
  5178. // Our solution is to combine the best part of the two approaches: a
  5179. // user would write Templates<T1, ..., TN>, and Google Test will translate
  5180. // that to TemplatesN<T1, ..., TN> internally to make error messages
  5181. // readable. The translation is done by the 'type' member of the
  5182. // Templates template.
  5183. template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
  5184. GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
  5185. GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
  5186. GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
  5187. GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
  5188. GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
  5189. GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
  5190. GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
  5191. GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
  5192. GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
  5193. GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
  5194. GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
  5195. GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
  5196. GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
  5197. GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
  5198. GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
  5199. GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
  5200. GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
  5201. GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
  5202. GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
  5203. GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
  5204. GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
  5205. GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
  5206. GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
  5207. GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
  5208. struct Templates {
  5209. typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5210. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5211. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5212. T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
  5213. };
  5214. template <>
  5215. struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5216. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5217. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5218. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5219. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5220. NoneT> {
  5221. typedef Templates0 type;
  5222. };
  5223. template <GTEST_TEMPLATE_ T1>
  5224. struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5225. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5226. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5227. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5228. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5229. NoneT> {
  5230. typedef Templates1<T1> type;
  5231. };
  5232. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
  5233. struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5234. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5235. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5236. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5237. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5238. NoneT> {
  5239. typedef Templates2<T1, T2> type;
  5240. };
  5241. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
  5242. struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5243. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5244. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5245. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5246. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5247. typedef Templates3<T1, T2, T3> type;
  5248. };
  5249. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5250. GTEST_TEMPLATE_ T4>
  5251. struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5252. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5253. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5254. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5255. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5256. typedef Templates4<T1, T2, T3, T4> type;
  5257. };
  5258. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5259. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
  5260. struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5261. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5262. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5263. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5264. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5265. typedef Templates5<T1, T2, T3, T4, T5> type;
  5266. };
  5267. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5268. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
  5269. struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
  5270. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5271. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5272. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5273. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5274. typedef Templates6<T1, T2, T3, T4, T5, T6> type;
  5275. };
  5276. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5277. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5278. GTEST_TEMPLATE_ T7>
  5279. struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
  5280. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5281. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5282. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5283. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5284. typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
  5285. };
  5286. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5287. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5288. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
  5289. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
  5290. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5291. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5292. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5293. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5294. typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
  5295. };
  5296. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5297. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5298. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
  5299. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
  5300. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5301. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5302. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5303. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5304. typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
  5305. };
  5306. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5307. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5308. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5309. GTEST_TEMPLATE_ T10>
  5310. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
  5311. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5312. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5313. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5314. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5315. typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
  5316. };
  5317. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5318. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5319. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5320. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
  5321. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
  5322. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5323. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5324. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5325. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5326. typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
  5327. };
  5328. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5329. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5330. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5331. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
  5332. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
  5333. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5334. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5335. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5336. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5337. typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
  5338. };
  5339. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5340. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5341. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5342. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5343. GTEST_TEMPLATE_ T13>
  5344. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
  5345. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5346. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5347. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5348. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5349. typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5350. T13> type;
  5351. };
  5352. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5353. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5354. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5355. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5356. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
  5357. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5358. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5359. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5360. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5361. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5362. typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5363. T14> type;
  5364. };
  5365. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5366. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5367. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5368. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5369. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
  5370. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5371. T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5372. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5373. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5374. NoneT, NoneT, NoneT, NoneT, NoneT> {
  5375. typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5376. T14, T15> type;
  5377. };
  5378. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5379. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5380. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5381. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5382. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5383. GTEST_TEMPLATE_ T16>
  5384. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5385. T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5386. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5387. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5388. NoneT, NoneT, NoneT, NoneT, NoneT> {
  5389. typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5390. T14, T15, T16> type;
  5391. };
  5392. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5393. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5394. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5395. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5396. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5397. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
  5398. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5399. T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5400. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5401. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5402. NoneT, NoneT, NoneT, NoneT, NoneT> {
  5403. typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5404. T14, T15, T16, T17> type;
  5405. };
  5406. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5407. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5408. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5409. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5410. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5411. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
  5412. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5413. T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5414. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5415. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5416. NoneT, NoneT, NoneT, NoneT> {
  5417. typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5418. T14, T15, T16, T17, T18> type;
  5419. };
  5420. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5421. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5422. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5423. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5424. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5425. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5426. GTEST_TEMPLATE_ T19>
  5427. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5428. T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5429. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5430. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5431. NoneT, NoneT, NoneT, NoneT> {
  5432. typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5433. T14, T15, T16, T17, T18, T19> type;
  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, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5438. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5439. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5440. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5441. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
  5442. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5443. T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5444. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5445. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5446. NoneT, NoneT, NoneT, NoneT> {
  5447. typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5448. T14, T15, T16, T17, T18, T19, T20> type;
  5449. };
  5450. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5451. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5452. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5453. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5454. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5455. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5456. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
  5457. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5458. T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
  5459. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5460. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5461. NoneT, NoneT, NoneT, NoneT> {
  5462. typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5463. T14, T15, T16, T17, T18, T19, T20, T21> type;
  5464. };
  5465. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5466. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5467. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5468. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5469. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5470. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5471. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5472. GTEST_TEMPLATE_ T22>
  5473. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5474. T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
  5475. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5476. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5477. NoneT, NoneT, NoneT> {
  5478. typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5479. T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
  5480. };
  5481. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5482. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5483. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5484. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5485. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5486. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5487. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5488. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
  5489. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5490. T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
  5491. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5492. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5493. NoneT, NoneT, NoneT> {
  5494. typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5495. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
  5496. };
  5497. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5498. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5499. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5500. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5501. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5502. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5503. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5504. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
  5505. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5506. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
  5507. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5508. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5509. NoneT, NoneT, NoneT> {
  5510. typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5511. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
  5512. };
  5513. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5514. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5515. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5516. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5517. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5518. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5519. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5520. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5521. GTEST_TEMPLATE_ T25>
  5522. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5523. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
  5524. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5525. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5526. NoneT, NoneT> {
  5527. typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5528. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
  5529. };
  5530. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5531. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5532. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5533. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5534. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5535. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5536. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5537. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5538. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
  5539. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5540. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
  5541. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5542. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5543. NoneT, NoneT> {
  5544. typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5545. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
  5546. };
  5547. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5548. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5549. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5550. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5551. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5552. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5553. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5554. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5555. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
  5556. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5557. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
  5558. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5559. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5560. NoneT, NoneT> {
  5561. typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5562. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5563. T27> type;
  5564. };
  5565. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5566. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5567. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5568. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5569. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5570. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5571. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5572. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5573. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5574. GTEST_TEMPLATE_ T28>
  5575. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5576. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5577. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5578. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5579. NoneT, NoneT> {
  5580. typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5581. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5582. T28> type;
  5583. };
  5584. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5585. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5586. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5587. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5588. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5589. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5590. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5591. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5592. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5593. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
  5594. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5595. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5596. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5597. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5598. NoneT> {
  5599. typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5600. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5601. T28, T29> type;
  5602. };
  5603. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5604. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5605. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5606. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5607. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5608. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5609. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5610. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5611. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5612. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
  5613. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5614. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5615. T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5616. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5617. typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5618. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5619. T28, T29, T30> type;
  5620. };
  5621. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5622. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5623. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5624. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5625. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5626. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5627. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5628. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5629. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5630. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5631. GTEST_TEMPLATE_ T31>
  5632. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5633. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5634. T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5635. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5636. typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5637. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5638. T28, T29, T30, T31> type;
  5639. };
  5640. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5641. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5642. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5643. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5644. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5645. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5646. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5647. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5648. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5649. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5650. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
  5651. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5652. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5653. T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5654. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5655. typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5656. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5657. T28, T29, T30, T31, T32> type;
  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, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5669. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
  5670. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5671. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5672. T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5673. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5674. typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5675. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5676. T28, T29, T30, T31, T32, T33> type;
  5677. };
  5678. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5679. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5680. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5681. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5682. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5683. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5684. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5685. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5686. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5687. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5688. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5689. GTEST_TEMPLATE_ T34>
  5690. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5691. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5692. T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5693. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5694. typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5695. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5696. T28, T29, T30, T31, T32, T33, T34> type;
  5697. };
  5698. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5699. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5700. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5701. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5702. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5703. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5704. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5705. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5706. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5707. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5708. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5709. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
  5710. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5711. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5712. T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5713. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5714. typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5715. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5716. T28, T29, T30, T31, T32, T33, T34, T35> type;
  5717. };
  5718. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5719. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5720. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5721. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5722. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5723. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5724. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5725. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5726. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5727. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5728. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5729. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
  5730. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5731. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5732. T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
  5733. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5734. typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5735. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5736. T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
  5737. };
  5738. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5739. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5740. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5741. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5742. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5743. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5744. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5745. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5746. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5747. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5748. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5749. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5750. GTEST_TEMPLATE_ T37>
  5751. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5752. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5753. T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
  5754. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5755. typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5756. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5757. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
  5758. };
  5759. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5760. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5761. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5762. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5763. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5764. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5765. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5766. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5767. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5768. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5769. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5770. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5771. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
  5772. struct Templates<T1, 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, T29,
  5774. T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
  5775. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5776. typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5777. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5778. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
  5779. };
  5780. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5781. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5782. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5783. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5784. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5785. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5786. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5787. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5788. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5789. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5790. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5791. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5792. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
  5793. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5794. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5795. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
  5796. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5797. typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5798. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5799. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
  5800. };
  5801. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5802. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5803. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5804. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5805. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5806. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5807. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5808. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5809. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5810. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5811. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5812. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5813. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5814. GTEST_TEMPLATE_ T40>
  5815. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5816. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5817. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
  5818. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5819. typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5820. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5821. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
  5822. };
  5823. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5824. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5825. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5826. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5827. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5828. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5829. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5830. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5831. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5832. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5833. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5834. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5835. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5836. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
  5837. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5838. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5839. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
  5840. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5841. typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5842. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5843. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  5844. T41> type;
  5845. };
  5846. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5847. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5848. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5849. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5850. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5851. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5852. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5853. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5854. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5855. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5856. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5857. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5858. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5859. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
  5860. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5861. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5862. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
  5863. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5864. typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5865. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5866. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5867. T42> type;
  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, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5883. GTEST_TEMPLATE_ T43>
  5884. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5885. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5886. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  5887. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5888. typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5889. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5890. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5891. T42, T43> type;
  5892. };
  5893. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5894. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5895. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5896. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5897. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5898. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5899. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5900. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5901. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5902. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5903. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5904. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5905. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5906. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5907. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
  5908. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5909. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5910. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  5911. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5912. typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5913. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5914. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5915. T42, T43, T44> type;
  5916. };
  5917. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5918. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5919. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5920. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5921. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5922. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5923. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5924. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5925. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5926. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5927. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5928. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5929. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5930. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5931. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
  5932. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5933. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5934. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  5935. T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5936. typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5937. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5938. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5939. T42, T43, T44, T45> type;
  5940. };
  5941. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5942. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5943. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5944. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5945. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5946. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5947. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5948. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5949. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5950. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5951. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5952. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5953. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5954. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5955. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5956. GTEST_TEMPLATE_ T46>
  5957. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5958. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5959. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  5960. T45, T46, NoneT, NoneT, NoneT, NoneT> {
  5961. typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5962. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5963. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5964. T42, T43, T44, T45, T46> type;
  5965. };
  5966. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5967. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5968. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5969. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5970. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5971. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5972. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5973. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5974. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5975. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5976. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5977. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5978. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5979. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5980. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5981. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
  5982. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5983. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5984. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  5985. T45, T46, T47, NoneT, NoneT, NoneT> {
  5986. typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5987. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5988. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5989. T42, T43, T44, T45, T46, T47> type;
  5990. };
  5991. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5992. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5993. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5994. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5995. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5996. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5997. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5998. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5999. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6000. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6001. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6002. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6003. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6004. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6005. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6006. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
  6007. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6008. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6009. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  6010. T45, T46, T47, T48, NoneT, NoneT> {
  6011. typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6012. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6013. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6014. T42, T43, T44, T45, T46, T47, T48> type;
  6015. };
  6016. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6017. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6018. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6019. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6020. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6021. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6022. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6023. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6024. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6025. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6026. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6027. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6028. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6029. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6030. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6031. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
  6032. GTEST_TEMPLATE_ T49>
  6033. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6034. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6035. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  6036. T45, T46, T47, T48, T49, NoneT> {
  6037. typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6038. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6039. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6040. T42, T43, T44, T45, T46, T47, T48, T49> type;
  6041. };
  6042. // The TypeList template makes it possible to use either a single type
  6043. // or a Types<...> list in TYPED_TEST_CASE() and
  6044. // INSTANTIATE_TYPED_TEST_CASE_P().
  6045. template <typename T>
  6046. struct TypeList { typedef Types1<T> type; };
  6047. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  6048. typename T6, typename T7, typename T8, typename T9, typename T10,
  6049. typename T11, typename T12, typename T13, typename T14, typename T15,
  6050. typename T16, typename T17, typename T18, typename T19, typename T20,
  6051. typename T21, typename T22, typename T23, typename T24, typename T25,
  6052. typename T26, typename T27, typename T28, typename T29, typename T30,
  6053. typename T31, typename T32, typename T33, typename T34, typename T35,
  6054. typename T36, typename T37, typename T38, typename T39, typename T40,
  6055. typename T41, typename T42, typename T43, typename T44, typename T45,
  6056. typename T46, typename T47, typename T48, typename T49, typename T50>
  6057. struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6058. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6059. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  6060. T44, T45, T46, T47, T48, T49, T50> > {
  6061. typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  6062. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  6063. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  6064. T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
  6065. };
  6066. #endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  6067. } // namespace internal
  6068. } // namespace testing
  6069. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
  6070. // Due to C++ preprocessor weirdness, we need double indirection to
  6071. // concatenate two tokens when one of them is __LINE__. Writing
  6072. //
  6073. // foo ## __LINE__
  6074. //
  6075. // will result in the token foo__LINE__, instead of foo followed by
  6076. // the current line number. For more details, see
  6077. // http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
  6078. #define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
  6079. #define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
  6080. // Google Test defines the testing::Message class to allow construction of
  6081. // test messages via the << operator. The idea is that anything
  6082. // streamable to std::ostream can be streamed to a testing::Message.
  6083. // This allows a user to use his own types in Google Test assertions by
  6084. // overloading the << operator.
  6085. //
  6086. // util/gtl/stl_logging-inl.h overloads << for STL containers. These
  6087. // overloads cannot be defined in the std namespace, as that will be
  6088. // undefined behavior. Therefore, they are defined in the global
  6089. // namespace instead.
  6090. //
  6091. // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
  6092. // overloads are visible in either the std namespace or the global
  6093. // namespace, but not other namespaces, including the testing
  6094. // namespace which Google Test's Message class is in.
  6095. //
  6096. // To allow STL containers (and other types that has a << operator
  6097. // defined in the global namespace) to be used in Google Test assertions,
  6098. // testing::Message must access the custom << operator from the global
  6099. // namespace. Hence this helper function.
  6100. //
  6101. // Note: Jeffrey Yasskin suggested an alternative fix by "using
  6102. // ::operator<<;" in the definition of Message's operator<<. That fix
  6103. // doesn't require a helper function, but unfortunately doesn't
  6104. // compile with MSVC.
  6105. template <typename T>
  6106. inline void GTestStreamToHelper(std::ostream* os, const T& val) {
  6107. *os << val;
  6108. }
  6109. class ProtocolMessage;
  6110. namespace proto2 { class Message; }
  6111. namespace testing {
  6112. // Forward declarations.
  6113. class AssertionResult; // Result of an assertion.
  6114. class Message; // Represents a failure message.
  6115. class Test; // Represents a test.
  6116. class TestInfo; // Information about a test.
  6117. class TestPartResult; // Result of a test part.
  6118. class UnitTest; // A collection of test cases.
  6119. template <typename T>
  6120. ::std::string PrintToString(const T& value);
  6121. namespace internal {
  6122. struct TraceInfo; // Information about a trace point.
  6123. class ScopedTrace; // Implements scoped trace.
  6124. class TestInfoImpl; // Opaque implementation of TestInfo
  6125. class UnitTestImpl; // Opaque implementation of UnitTest
  6126. // How many times InitGoogleTest() has been called.
  6127. extern int g_init_gtest_count;
  6128. // The text used in failure messages to indicate the start of the
  6129. // stack trace.
  6130. GTEST_API_ extern const char kStackTraceMarker[];
  6131. // A secret type that Google Test users don't know about. It has no
  6132. // definition on purpose. Therefore it's impossible to create a
  6133. // Secret object, which is what we want.
  6134. class Secret;
  6135. // Two overloaded helpers for checking at compile time whether an
  6136. // expression is a null pointer literal (i.e. NULL or any 0-valued
  6137. // compile-time integral constant). Their return values have
  6138. // different sizes, so we can use sizeof() to test which version is
  6139. // picked by the compiler. These helpers have no implementations, as
  6140. // we only need their signatures.
  6141. //
  6142. // Given IsNullLiteralHelper(x), the compiler will pick the first
  6143. // version if x can be implicitly converted to Secret*, and pick the
  6144. // second version otherwise. Since Secret is a secret and incomplete
  6145. // type, the only expression a user can write that has type Secret* is
  6146. // a null pointer literal. Therefore, we know that x is a null
  6147. // pointer literal if and only if the first version is picked by the
  6148. // compiler.
  6149. char IsNullLiteralHelper(Secret* p);
  6150. char (&IsNullLiteralHelper(...))[2]; // NOLINT
  6151. // A compile-time bool constant that is true if and only if x is a
  6152. // null pointer literal (i.e. NULL or any 0-valued compile-time
  6153. // integral constant).
  6154. #ifdef GTEST_ELLIPSIS_NEEDS_POD_
  6155. // We lose support for NULL detection where the compiler doesn't like
  6156. // passing non-POD classes through ellipsis (...).
  6157. # define GTEST_IS_NULL_LITERAL_(x) false
  6158. #else
  6159. # define GTEST_IS_NULL_LITERAL_(x) \
  6160. (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
  6161. #endif // GTEST_ELLIPSIS_NEEDS_POD_
  6162. // Appends the user-supplied message to the Google-Test-generated message.
  6163. GTEST_API_ String AppendUserMessage(const String& gtest_msg,
  6164. const Message& user_msg);
  6165. // A helper class for creating scoped traces in user programs.
  6166. class GTEST_API_ ScopedTrace {
  6167. public:
  6168. // The c'tor pushes the given source file location and message onto
  6169. // a trace stack maintained by Google Test.
  6170. ScopedTrace(const char* file, int line, const Message& message);
  6171. // The d'tor pops the info pushed by the c'tor.
  6172. //
  6173. // Note that the d'tor is not virtual in order to be efficient.
  6174. // Don't inherit from ScopedTrace!
  6175. ~ScopedTrace();
  6176. private:
  6177. GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
  6178. } GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its
  6179. // c'tor and d'tor. Therefore it doesn't
  6180. // need to be used otherwise.
  6181. // Converts a streamable value to a String. A NULL pointer is
  6182. // converted to "(null)". When the input value is a ::string,
  6183. // ::std::string, ::wstring, or ::std::wstring object, each NUL
  6184. // character in it is replaced with "\\0".
  6185. // Declared here but defined in gtest.h, so that it has access
  6186. // to the definition of the Message class, required by the ARM
  6187. // compiler.
  6188. template <typename T>
  6189. String StreamableToString(const T& streamable);
  6190. // The Symbian compiler has a bug that prevents it from selecting the
  6191. // correct overload of FormatForComparisonFailureMessage (see below)
  6192. // unless we pass the first argument by reference. If we do that,
  6193. // however, Visual Age C++ 10.1 generates a compiler error. Therefore
  6194. // we only apply the work-around for Symbian.
  6195. #if defined(__SYMBIAN32__)
  6196. # define GTEST_CREF_WORKAROUND_ const&
  6197. #else
  6198. # define GTEST_CREF_WORKAROUND_
  6199. #endif
  6200. // When this operand is a const char* or char*, if the other operand
  6201. // is a ::std::string or ::string, we print this operand as a C string
  6202. // rather than a pointer (we do the same for wide strings); otherwise
  6203. // we print it as a pointer to be safe.
  6204. // This internal macro is used to avoid duplicated code.
  6205. #define GTEST_FORMAT_IMPL_(operand2_type, operand1_printer)\
  6206. inline String FormatForComparisonFailureMessage(\
  6207. operand2_type::value_type* GTEST_CREF_WORKAROUND_ str, \
  6208. const operand2_type& /*operand2*/) {\
  6209. return operand1_printer(str);\
  6210. }\
  6211. inline String FormatForComparisonFailureMessage(\
  6212. const operand2_type::value_type* GTEST_CREF_WORKAROUND_ str, \
  6213. const operand2_type& /*operand2*/) {\
  6214. return operand1_printer(str);\
  6215. }
  6216. GTEST_FORMAT_IMPL_(::std::string, String::ShowCStringQuoted)
  6217. #if GTEST_HAS_STD_WSTRING
  6218. GTEST_FORMAT_IMPL_(::std::wstring, String::ShowWideCStringQuoted)
  6219. #endif // GTEST_HAS_STD_WSTRING
  6220. #if GTEST_HAS_GLOBAL_STRING
  6221. GTEST_FORMAT_IMPL_(::string, String::ShowCStringQuoted)
  6222. #endif // GTEST_HAS_GLOBAL_STRING
  6223. #if GTEST_HAS_GLOBAL_WSTRING
  6224. GTEST_FORMAT_IMPL_(::wstring, String::ShowWideCStringQuoted)
  6225. #endif // GTEST_HAS_GLOBAL_WSTRING
  6226. #undef GTEST_FORMAT_IMPL_
  6227. // The next four overloads handle the case where the operand being
  6228. // printed is a char/wchar_t pointer and the other operand is not a
  6229. // string/wstring object. In such cases, we just print the operand as
  6230. // a pointer to be safe.
  6231. #define GTEST_FORMAT_CHAR_PTR_IMPL_(CharType) \
  6232. template <typename T> \
  6233. String FormatForComparisonFailureMessage(CharType* GTEST_CREF_WORKAROUND_ p, \
  6234. const T&) { \
  6235. return PrintToString(static_cast<const void*>(p)); \
  6236. }
  6237. GTEST_FORMAT_CHAR_PTR_IMPL_(char)
  6238. GTEST_FORMAT_CHAR_PTR_IMPL_(const char)
  6239. GTEST_FORMAT_CHAR_PTR_IMPL_(wchar_t)
  6240. GTEST_FORMAT_CHAR_PTR_IMPL_(const wchar_t)
  6241. #undef GTEST_FORMAT_CHAR_PTR_IMPL_
  6242. // Constructs and returns the message for an equality assertion
  6243. // (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
  6244. //
  6245. // The first four parameters are the expressions used in the assertion
  6246. // and their values, as strings. For example, for ASSERT_EQ(foo, bar)
  6247. // where foo is 5 and bar is 6, we have:
  6248. //
  6249. // expected_expression: "foo"
  6250. // actual_expression: "bar"
  6251. // expected_value: "5"
  6252. // actual_value: "6"
  6253. //
  6254. // The ignoring_case parameter is true iff the assertion is a
  6255. // *_STRCASEEQ*. When it's true, the string " (ignoring case)" will
  6256. // be inserted into the message.
  6257. GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
  6258. const char* actual_expression,
  6259. const String& expected_value,
  6260. const String& actual_value,
  6261. bool ignoring_case);
  6262. // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
  6263. GTEST_API_ String GetBoolAssertionFailureMessage(
  6264. const AssertionResult& assertion_result,
  6265. const char* expression_text,
  6266. const char* actual_predicate_value,
  6267. const char* expected_predicate_value);
  6268. // This template class represents an IEEE floating-point number
  6269. // (either single-precision or double-precision, depending on the
  6270. // template parameters).
  6271. //
  6272. // The purpose of this class is to do more sophisticated number
  6273. // comparison. (Due to round-off error, etc, it's very unlikely that
  6274. // two floating-points will be equal exactly. Hence a naive
  6275. // comparison by the == operation often doesn't work.)
  6276. //
  6277. // Format of IEEE floating-point:
  6278. //
  6279. // The most-significant bit being the leftmost, an IEEE
  6280. // floating-point looks like
  6281. //
  6282. // sign_bit exponent_bits fraction_bits
  6283. //
  6284. // Here, sign_bit is a single bit that designates the sign of the
  6285. // number.
  6286. //
  6287. // For float, there are 8 exponent bits and 23 fraction bits.
  6288. //
  6289. // For double, there are 11 exponent bits and 52 fraction bits.
  6290. //
  6291. // More details can be found at
  6292. // http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
  6293. //
  6294. // Template parameter:
  6295. //
  6296. // RawType: the raw floating-point type (either float or double)
  6297. template <typename RawType>
  6298. class FloatingPoint {
  6299. public:
  6300. // Defines the unsigned integer type that has the same size as the
  6301. // floating point number.
  6302. typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
  6303. // Constants.
  6304. // # of bits in a number.
  6305. static const size_t kBitCount = 8*sizeof(RawType);
  6306. // # of fraction bits in a number.
  6307. static const size_t kFractionBitCount =
  6308. std::numeric_limits<RawType>::digits - 1;
  6309. // # of exponent bits in a number.
  6310. static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
  6311. // The mask for the sign bit.
  6312. static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
  6313. // The mask for the fraction bits.
  6314. static const Bits kFractionBitMask =
  6315. ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
  6316. // The mask for the exponent bits.
  6317. static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
  6318. // How many ULP's (Units in the Last Place) we want to tolerate when
  6319. // comparing two numbers. The larger the value, the more error we
  6320. // allow. A 0 value means that two numbers must be exactly the same
  6321. // to be considered equal.
  6322. //
  6323. // The maximum error of a single floating-point operation is 0.5
  6324. // units in the last place. On Intel CPU's, all floating-point
  6325. // calculations are done with 80-bit precision, while double has 64
  6326. // bits. Therefore, 4 should be enough for ordinary use.
  6327. //
  6328. // See the following article for more details on ULP:
  6329. // http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm.
  6330. static const size_t kMaxUlps = 4;
  6331. // Constructs a FloatingPoint from a raw floating-point number.
  6332. //
  6333. // On an Intel CPU, passing a non-normalized NAN (Not a Number)
  6334. // around may change its bits, although the new value is guaranteed
  6335. // to be also a NAN. Therefore, don't expect this constructor to
  6336. // preserve the bits in x when x is a NAN.
  6337. explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
  6338. // Static methods
  6339. // Reinterprets a bit pattern as a floating-point number.
  6340. //
  6341. // This function is needed to test the AlmostEquals() method.
  6342. static RawType ReinterpretBits(const Bits bits) {
  6343. FloatingPoint fp(0);
  6344. fp.u_.bits_ = bits;
  6345. return fp.u_.value_;
  6346. }
  6347. // Returns the floating-point number that represent positive infinity.
  6348. static RawType Infinity() {
  6349. return ReinterpretBits(kExponentBitMask);
  6350. }
  6351. // Non-static methods
  6352. // Returns the bits that represents this number.
  6353. const Bits &bits() const { return u_.bits_; }
  6354. // Returns the exponent bits of this number.
  6355. Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
  6356. // Returns the fraction bits of this number.
  6357. Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
  6358. // Returns the sign bit of this number.
  6359. Bits sign_bit() const { return kSignBitMask & u_.bits_; }
  6360. // Returns true iff this is NAN (not a number).
  6361. bool is_nan() const {
  6362. // It's a NAN if the exponent bits are all ones and the fraction
  6363. // bits are not entirely zeros.
  6364. return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
  6365. }
  6366. // Returns true iff this number is at most kMaxUlps ULP's away from
  6367. // rhs. In particular, this function:
  6368. //
  6369. // - returns false if either number is (or both are) NAN.
  6370. // - treats really large numbers as almost equal to infinity.
  6371. // - thinks +0.0 and -0.0 are 0 DLP's apart.
  6372. bool AlmostEquals(const FloatingPoint& rhs) const {
  6373. // The IEEE standard says that any comparison operation involving
  6374. // a NAN must return false.
  6375. if (is_nan() || rhs.is_nan()) return false;
  6376. return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
  6377. <= kMaxUlps;
  6378. }
  6379. private:
  6380. // The data type used to store the actual floating-point number.
  6381. union FloatingPointUnion {
  6382. RawType value_; // The raw floating-point number.
  6383. Bits bits_; // The bits that represent the number.
  6384. };
  6385. // Converts an integer from the sign-and-magnitude representation to
  6386. // the biased representation. More precisely, let N be 2 to the
  6387. // power of (kBitCount - 1), an integer x is represented by the
  6388. // unsigned number x + N.
  6389. //
  6390. // For instance,
  6391. //
  6392. // -N + 1 (the most negative number representable using
  6393. // sign-and-magnitude) is represented by 1;
  6394. // 0 is represented by N; and
  6395. // N - 1 (the biggest number representable using
  6396. // sign-and-magnitude) is represented by 2N - 1.
  6397. //
  6398. // Read http://en.wikipedia.org/wiki/Signed_number_representations
  6399. // for more details on signed number representations.
  6400. static Bits SignAndMagnitudeToBiased(const Bits &sam) {
  6401. if (kSignBitMask & sam) {
  6402. // sam represents a negative number.
  6403. return ~sam + 1;
  6404. } else {
  6405. // sam represents a positive number.
  6406. return kSignBitMask | sam;
  6407. }
  6408. }
  6409. // Given two numbers in the sign-and-magnitude representation,
  6410. // returns the distance between them as an unsigned number.
  6411. static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
  6412. const Bits &sam2) {
  6413. const Bits biased1 = SignAndMagnitudeToBiased(sam1);
  6414. const Bits biased2 = SignAndMagnitudeToBiased(sam2);
  6415. return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
  6416. }
  6417. FloatingPointUnion u_;
  6418. };
  6419. // Typedefs the instances of the FloatingPoint template class that we
  6420. // care to use.
  6421. typedef FloatingPoint<float> Float;
  6422. typedef FloatingPoint<double> Double;
  6423. // In order to catch the mistake of putting tests that use different
  6424. // test fixture classes in the same test case, we need to assign
  6425. // unique IDs to fixture classes and compare them. The TypeId type is
  6426. // used to hold such IDs. The user should treat TypeId as an opaque
  6427. // type: the only operation allowed on TypeId values is to compare
  6428. // them for equality using the == operator.
  6429. typedef const void* TypeId;
  6430. template <typename T>
  6431. class TypeIdHelper {
  6432. public:
  6433. // dummy_ must not have a const type. Otherwise an overly eager
  6434. // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
  6435. // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
  6436. static bool dummy_;
  6437. };
  6438. template <typename T>
  6439. bool TypeIdHelper<T>::dummy_ = false;
  6440. // GetTypeId<T>() returns the ID of type T. Different values will be
  6441. // returned for different types. Calling the function twice with the
  6442. // same type argument is guaranteed to return the same ID.
  6443. template <typename T>
  6444. TypeId GetTypeId() {
  6445. // The compiler is required to allocate a different
  6446. // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
  6447. // the template. Therefore, the address of dummy_ is guaranteed to
  6448. // be unique.
  6449. return &(TypeIdHelper<T>::dummy_);
  6450. }
  6451. // Returns the type ID of ::testing::Test. Always call this instead
  6452. // of GetTypeId< ::testing::Test>() to get the type ID of
  6453. // ::testing::Test, as the latter may give the wrong result due to a
  6454. // suspected linker bug when compiling Google Test as a Mac OS X
  6455. // framework.
  6456. GTEST_API_ TypeId GetTestTypeId();
  6457. // Defines the abstract factory interface that creates instances
  6458. // of a Test object.
  6459. class TestFactoryBase {
  6460. public:
  6461. virtual ~TestFactoryBase() {}
  6462. // Creates a test instance to run. The instance is both created and destroyed
  6463. // within TestInfoImpl::Run()
  6464. virtual Test* CreateTest() = 0;
  6465. protected:
  6466. TestFactoryBase() {}
  6467. private:
  6468. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
  6469. };
  6470. // This class provides implementation of TeastFactoryBase interface.
  6471. // It is used in TEST and TEST_F macros.
  6472. template <class TestClass>
  6473. class TestFactoryImpl : public TestFactoryBase {
  6474. public:
  6475. virtual Test* CreateTest() { return new TestClass; }
  6476. };
  6477. #if GTEST_OS_WINDOWS
  6478. // Predicate-formatters for implementing the HRESULT checking macros
  6479. // {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
  6480. // We pass a long instead of HRESULT to avoid causing an
  6481. // include dependency for the HRESULT type.
  6482. GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
  6483. long hr); // NOLINT
  6484. GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
  6485. long hr); // NOLINT
  6486. #endif // GTEST_OS_WINDOWS
  6487. // Types of SetUpTestCase() and TearDownTestCase() functions.
  6488. typedef void (*SetUpTestCaseFunc)();
  6489. typedef void (*TearDownTestCaseFunc)();
  6490. // Creates a new TestInfo object and registers it with Google Test;
  6491. // returns the created object.
  6492. //
  6493. // Arguments:
  6494. //
  6495. // test_case_name: name of the test case
  6496. // name: name of the test
  6497. // type_param the name of the test's type parameter, or NULL if
  6498. // this is not a typed or a type-parameterized test.
  6499. // value_param text representation of the test's value parameter,
  6500. // or NULL if this is not a type-parameterized test.
  6501. // fixture_class_id: ID of the test fixture class
  6502. // set_up_tc: pointer to the function that sets up the test case
  6503. // tear_down_tc: pointer to the function that tears down the test case
  6504. // factory: pointer to the factory that creates a test object.
  6505. // The newly created TestInfo instance will assume
  6506. // ownership of the factory object.
  6507. GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
  6508. const char* test_case_name, const char* name,
  6509. const char* type_param,
  6510. const char* value_param,
  6511. TypeId fixture_class_id,
  6512. SetUpTestCaseFunc set_up_tc,
  6513. TearDownTestCaseFunc tear_down_tc,
  6514. TestFactoryBase* factory);
  6515. // If *pstr starts with the given prefix, modifies *pstr to be right
  6516. // past the prefix and returns true; otherwise leaves *pstr unchanged
  6517. // and returns false. None of pstr, *pstr, and prefix can be NULL.
  6518. GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
  6519. #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  6520. // State of the definition of a type-parameterized test case.
  6521. class GTEST_API_ TypedTestCasePState {
  6522. public:
  6523. TypedTestCasePState() : registered_(false) {}
  6524. // Adds the given test name to defined_test_names_ and return true
  6525. // if the test case hasn't been registered; otherwise aborts the
  6526. // program.
  6527. bool AddTestName(const char* file, int line, const char* case_name,
  6528. const char* test_name) {
  6529. if (registered_) {
  6530. fprintf(stderr, "%s Test %s must be defined before "
  6531. "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
  6532. FormatFileLocation(file, line).c_str(), test_name, case_name);
  6533. fflush(stderr);
  6534. posix::Abort();
  6535. }
  6536. defined_test_names_.insert(test_name);
  6537. return true;
  6538. }
  6539. // Verifies that registered_tests match the test names in
  6540. // defined_test_names_; returns registered_tests if successful, or
  6541. // aborts the program otherwise.
  6542. const char* VerifyRegisteredTestNames(
  6543. const char* file, int line, const char* registered_tests);
  6544. private:
  6545. bool registered_;
  6546. ::std::set<const char*> defined_test_names_;
  6547. };
  6548. // Skips to the first non-space char after the first comma in 'str';
  6549. // returns NULL if no comma is found in 'str'.
  6550. inline const char* SkipComma(const char* str) {
  6551. const char* comma = strchr(str, ',');
  6552. if (comma == NULL) {
  6553. return NULL;
  6554. }
  6555. while (IsSpace(*(++comma))) {}
  6556. return comma;
  6557. }
  6558. // Returns the prefix of 'str' before the first comma in it; returns
  6559. // the entire string if it contains no comma.
  6560. inline String GetPrefixUntilComma(const char* str) {
  6561. const char* comma = strchr(str, ',');
  6562. return comma == NULL ? String(str) : String(str, comma - str);
  6563. }
  6564. // TypeParameterizedTest<Fixture, TestSel, Types>::Register()
  6565. // registers a list of type-parameterized tests with Google Test. The
  6566. // return value is insignificant - we just need to return something
  6567. // such that we can call this function in a namespace scope.
  6568. //
  6569. // Implementation note: The GTEST_TEMPLATE_ macro declares a template
  6570. // template parameter. It's defined in gtest-type-util.h.
  6571. template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
  6572. class TypeParameterizedTest {
  6573. public:
  6574. // 'index' is the index of the test in the type list 'Types'
  6575. // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
  6576. // Types). Valid values for 'index' are [0, N - 1] where N is the
  6577. // length of Types.
  6578. static bool Register(const char* prefix, const char* case_name,
  6579. const char* test_names, int index) {
  6580. typedef typename Types::Head Type;
  6581. typedef Fixture<Type> FixtureClass;
  6582. typedef typename GTEST_BIND_(TestSel, Type) TestClass;
  6583. // First, registers the first type-parameterized test in the type
  6584. // list.
  6585. MakeAndRegisterTestInfo(
  6586. String::Format("%s%s%s/%d", prefix, prefix[0] == '\0' ? "" : "/",
  6587. case_name, index).c_str(),
  6588. GetPrefixUntilComma(test_names).c_str(),
  6589. GetTypeName<Type>().c_str(),
  6590. NULL, // No value parameter.
  6591. GetTypeId<FixtureClass>(),
  6592. TestClass::SetUpTestCase,
  6593. TestClass::TearDownTestCase,
  6594. new TestFactoryImpl<TestClass>);
  6595. // Next, recurses (at compile time) with the tail of the type list.
  6596. return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
  6597. ::Register(prefix, case_name, test_names, index + 1);
  6598. }
  6599. };
  6600. // The base case for the compile time recursion.
  6601. template <GTEST_TEMPLATE_ Fixture, class TestSel>
  6602. class TypeParameterizedTest<Fixture, TestSel, Types0> {
  6603. public:
  6604. static bool Register(const char* /*prefix*/, const char* /*case_name*/,
  6605. const char* /*test_names*/, int /*index*/) {
  6606. return true;
  6607. }
  6608. };
  6609. // TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
  6610. // registers *all combinations* of 'Tests' and 'Types' with Google
  6611. // Test. The return value is insignificant - we just need to return
  6612. // something such that we can call this function in a namespace scope.
  6613. template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
  6614. class TypeParameterizedTestCase {
  6615. public:
  6616. static bool Register(const char* prefix, const char* case_name,
  6617. const char* test_names) {
  6618. typedef typename Tests::Head Head;
  6619. // First, register the first test in 'Test' for each type in 'Types'.
  6620. TypeParameterizedTest<Fixture, Head, Types>::Register(
  6621. prefix, case_name, test_names, 0);
  6622. // Next, recurses (at compile time) with the tail of the test list.
  6623. return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
  6624. ::Register(prefix, case_name, SkipComma(test_names));
  6625. }
  6626. };
  6627. // The base case for the compile time recursion.
  6628. template <GTEST_TEMPLATE_ Fixture, typename Types>
  6629. class TypeParameterizedTestCase<Fixture, Templates0, Types> {
  6630. public:
  6631. static bool Register(const char* /*prefix*/, const char* /*case_name*/,
  6632. const char* /*test_names*/) {
  6633. return true;
  6634. }
  6635. };
  6636. #endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  6637. // Returns the current OS stack trace as a String.
  6638. //
  6639. // The maximum number of stack frames to be included is specified by
  6640. // the gtest_stack_trace_depth flag. The skip_count parameter
  6641. // specifies the number of top frames to be skipped, which doesn't
  6642. // count against the number of frames to be included.
  6643. //
  6644. // For example, if Foo() calls Bar(), which in turn calls
  6645. // GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
  6646. // the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
  6647. GTEST_API_ String GetCurrentOsStackTraceExceptTop(UnitTest* unit_test,
  6648. int skip_count);
  6649. // Helpers for suppressing warnings on unreachable code or constant
  6650. // condition.
  6651. // Always returns true.
  6652. GTEST_API_ bool AlwaysTrue();
  6653. // Always returns false.
  6654. inline bool AlwaysFalse() { return !AlwaysTrue(); }
  6655. // Helper for suppressing false warning from Clang on a const char*
  6656. // variable declared in a conditional expression always being NULL in
  6657. // the else branch.
  6658. struct GTEST_API_ ConstCharPtr {
  6659. ConstCharPtr(const char* str) : value(str) {}
  6660. operator bool() const { return true; }
  6661. const char* value;
  6662. };
  6663. // A simple Linear Congruential Generator for generating random
  6664. // numbers with a uniform distribution. Unlike rand() and srand(), it
  6665. // doesn't use global state (and therefore can't interfere with user
  6666. // code). Unlike rand_r(), it's portable. An LCG isn't very random,
  6667. // but it's good enough for our purposes.
  6668. class GTEST_API_ Random {
  6669. public:
  6670. static const UInt32 kMaxRange = 1u << 31;
  6671. explicit Random(UInt32 seed) : state_(seed) {}
  6672. void Reseed(UInt32 seed) { state_ = seed; }
  6673. // Generates a random number from [0, range). Crashes if 'range' is
  6674. // 0 or greater than kMaxRange.
  6675. UInt32 Generate(UInt32 range);
  6676. private:
  6677. UInt32 state_;
  6678. GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
  6679. };
  6680. // Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
  6681. // compiler error iff T1 and T2 are different types.
  6682. template <typename T1, typename T2>
  6683. struct CompileAssertTypesEqual;
  6684. template <typename T>
  6685. struct CompileAssertTypesEqual<T, T> {
  6686. };
  6687. // Removes the reference from a type if it is a reference type,
  6688. // otherwise leaves it unchanged. This is the same as
  6689. // tr1::remove_reference, which is not widely available yet.
  6690. template <typename T>
  6691. struct RemoveReference { typedef T type; }; // NOLINT
  6692. template <typename T>
  6693. struct RemoveReference<T&> { typedef T type; }; // NOLINT
  6694. // A handy wrapper around RemoveReference that works when the argument
  6695. // T depends on template parameters.
  6696. #define GTEST_REMOVE_REFERENCE_(T) \
  6697. typename ::testing::internal::RemoveReference<T>::type
  6698. // Removes const from a type if it is a const type, otherwise leaves
  6699. // it unchanged. This is the same as tr1::remove_const, which is not
  6700. // widely available yet.
  6701. template <typename T>
  6702. struct RemoveConst { typedef T type; }; // NOLINT
  6703. template <typename T>
  6704. struct RemoveConst<const T> { typedef T type; }; // NOLINT
  6705. // MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
  6706. // definition to fail to remove the const in 'const int[3]' and 'const
  6707. // char[3][4]'. The following specialization works around the bug.
  6708. // However, it causes trouble with GCC and thus needs to be
  6709. // conditionally compiled.
  6710. #if defined(_MSC_VER) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
  6711. template <typename T, size_t N>
  6712. struct RemoveConst<const T[N]> {
  6713. typedef typename RemoveConst<T>::type type[N];
  6714. };
  6715. #endif
  6716. // A handy wrapper around RemoveConst that works when the argument
  6717. // T depends on template parameters.
  6718. #define GTEST_REMOVE_CONST_(T) \
  6719. typename ::testing::internal::RemoveConst<T>::type
  6720. // Turns const U&, U&, const U, and U all into U.
  6721. #define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
  6722. GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
  6723. // Adds reference to a type if it is not a reference type,
  6724. // otherwise leaves it unchanged. This is the same as
  6725. // tr1::add_reference, which is not widely available yet.
  6726. template <typename T>
  6727. struct AddReference { typedef T& type; }; // NOLINT
  6728. template <typename T>
  6729. struct AddReference<T&> { typedef T& type; }; // NOLINT
  6730. // A handy wrapper around AddReference that works when the argument T
  6731. // depends on template parameters.
  6732. #define GTEST_ADD_REFERENCE_(T) \
  6733. typename ::testing::internal::AddReference<T>::type
  6734. // Adds a reference to const on top of T as necessary. For example,
  6735. // it transforms
  6736. //
  6737. // char ==> const char&
  6738. // const char ==> const char&
  6739. // char& ==> const char&
  6740. // const char& ==> const char&
  6741. //
  6742. // The argument T must depend on some template parameters.
  6743. #define GTEST_REFERENCE_TO_CONST_(T) \
  6744. GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T))
  6745. // ImplicitlyConvertible<From, To>::value is a compile-time bool
  6746. // constant that's true iff type From can be implicitly converted to
  6747. // type To.
  6748. template <typename From, typename To>
  6749. class ImplicitlyConvertible {
  6750. private:
  6751. // We need the following helper functions only for their types.
  6752. // They have no implementations.
  6753. // MakeFrom() is an expression whose type is From. We cannot simply
  6754. // use From(), as the type From may not have a public default
  6755. // constructor.
  6756. static From MakeFrom();
  6757. // These two functions are overloaded. Given an expression
  6758. // Helper(x), the compiler will pick the first version if x can be
  6759. // implicitly converted to type To; otherwise it will pick the
  6760. // second version.
  6761. //
  6762. // The first version returns a value of size 1, and the second
  6763. // version returns a value of size 2. Therefore, by checking the
  6764. // size of Helper(x), which can be done at compile time, we can tell
  6765. // which version of Helper() is used, and hence whether x can be
  6766. // implicitly converted to type To.
  6767. static char Helper(To);
  6768. static char (&Helper(...))[2]; // NOLINT
  6769. // We have to put the 'public' section after the 'private' section,
  6770. // or MSVC refuses to compile the code.
  6771. public:
  6772. // MSVC warns about implicitly converting from double to int for
  6773. // possible loss of data, so we need to temporarily disable the
  6774. // warning.
  6775. #ifdef _MSC_VER
  6776. # pragma warning(push) // Saves the current warning state.
  6777. # pragma warning(disable:4244) // Temporarily disables warning 4244.
  6778. static const bool value =
  6779. sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
  6780. # pragma warning(pop) // Restores the warning state.
  6781. #elif defined(__BORLANDC__)
  6782. // C++Builder cannot use member overload resolution during template
  6783. // instantiation. The simplest workaround is to use its C++0x type traits
  6784. // functions (C++Builder 2009 and above only).
  6785. static const bool value = __is_convertible(From, To);
  6786. #else
  6787. static const bool value =
  6788. sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
  6789. #endif // _MSV_VER
  6790. };
  6791. template <typename From, typename To>
  6792. const bool ImplicitlyConvertible<From, To>::value;
  6793. // IsAProtocolMessage<T>::value is a compile-time bool constant that's
  6794. // true iff T is type ProtocolMessage, proto2::Message, or a subclass
  6795. // of those.
  6796. template <typename T>
  6797. struct IsAProtocolMessage
  6798. : public bool_constant<
  6799. ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
  6800. ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
  6801. };
  6802. // When the compiler sees expression IsContainerTest<C>(0), if C is an
  6803. // STL-style container class, the first overload of IsContainerTest
  6804. // will be viable (since both C::iterator* and C::const_iterator* are
  6805. // valid types and NULL can be implicitly converted to them). It will
  6806. // be picked over the second overload as 'int' is a perfect match for
  6807. // the type of argument 0. If C::iterator or C::const_iterator is not
  6808. // a valid type, the first overload is not viable, and the second
  6809. // overload will be picked. Therefore, we can determine whether C is
  6810. // a container class by checking the type of IsContainerTest<C>(0).
  6811. // The value of the expression is insignificant.
  6812. //
  6813. // Note that we look for both C::iterator and C::const_iterator. The
  6814. // reason is that C++ injects the name of a class as a member of the
  6815. // class itself (e.g. you can refer to class iterator as either
  6816. // 'iterator' or 'iterator::iterator'). If we look for C::iterator
  6817. // only, for example, we would mistakenly think that a class named
  6818. // iterator is an STL container.
  6819. //
  6820. // Also note that the simpler approach of overloading
  6821. // IsContainerTest(typename C::const_iterator*) and
  6822. // IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
  6823. typedef int IsContainer;
  6824. template <class C>
  6825. IsContainer IsContainerTest(int /* dummy */,
  6826. typename C::iterator* /* it */ = NULL,
  6827. typename C::const_iterator* /* const_it */ = NULL) {
  6828. return 0;
  6829. }
  6830. typedef char IsNotContainer;
  6831. template <class C>
  6832. IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
  6833. // EnableIf<condition>::type is void when 'Cond' is true, and
  6834. // undefined when 'Cond' is false. To use SFINAE to make a function
  6835. // overload only apply when a particular expression is true, add
  6836. // "typename EnableIf<expression>::type* = 0" as the last parameter.
  6837. template<bool> struct EnableIf;
  6838. template<> struct EnableIf<true> { typedef void type; }; // NOLINT
  6839. // Utilities for native arrays.
  6840. // ArrayEq() compares two k-dimensional native arrays using the
  6841. // elements' operator==, where k can be any integer >= 0. When k is
  6842. // 0, ArrayEq() degenerates into comparing a single pair of values.
  6843. template <typename T, typename U>
  6844. bool ArrayEq(const T* lhs, size_t size, const U* rhs);
  6845. // This generic version is used when k is 0.
  6846. template <typename T, typename U>
  6847. inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
  6848. // This overload is used when k >= 1.
  6849. template <typename T, typename U, size_t N>
  6850. inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
  6851. return internal::ArrayEq(lhs, N, rhs);
  6852. }
  6853. // This helper reduces code bloat. If we instead put its logic inside
  6854. // the previous ArrayEq() function, arrays with different sizes would
  6855. // lead to different copies of the template code.
  6856. template <typename T, typename U>
  6857. bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
  6858. for (size_t i = 0; i != size; i++) {
  6859. if (!internal::ArrayEq(lhs[i], rhs[i]))
  6860. return false;
  6861. }
  6862. return true;
  6863. }
  6864. // Finds the first element in the iterator range [begin, end) that
  6865. // equals elem. Element may be a native array type itself.
  6866. template <typename Iter, typename Element>
  6867. Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
  6868. for (Iter it = begin; it != end; ++it) {
  6869. if (internal::ArrayEq(*it, elem))
  6870. return it;
  6871. }
  6872. return end;
  6873. }
  6874. // CopyArray() copies a k-dimensional native array using the elements'
  6875. // operator=, where k can be any integer >= 0. When k is 0,
  6876. // CopyArray() degenerates into copying a single value.
  6877. template <typename T, typename U>
  6878. void CopyArray(const T* from, size_t size, U* to);
  6879. // This generic version is used when k is 0.
  6880. template <typename T, typename U>
  6881. inline void CopyArray(const T& from, U* to) { *to = from; }
  6882. // This overload is used when k >= 1.
  6883. template <typename T, typename U, size_t N>
  6884. inline void CopyArray(const T(&from)[N], U(*to)[N]) {
  6885. internal::CopyArray(from, N, *to);
  6886. }
  6887. // This helper reduces code bloat. If we instead put its logic inside
  6888. // the previous CopyArray() function, arrays with different sizes
  6889. // would lead to different copies of the template code.
  6890. template <typename T, typename U>
  6891. void CopyArray(const T* from, size_t size, U* to) {
  6892. for (size_t i = 0; i != size; i++) {
  6893. internal::CopyArray(from[i], to + i);
  6894. }
  6895. }
  6896. // The relation between an NativeArray object (see below) and the
  6897. // native array it represents.
  6898. enum RelationToSource {
  6899. kReference, // The NativeArray references the native array.
  6900. kCopy // The NativeArray makes a copy of the native array and
  6901. // owns the copy.
  6902. };
  6903. // Adapts a native array to a read-only STL-style container. Instead
  6904. // of the complete STL container concept, this adaptor only implements
  6905. // members useful for Google Mock's container matchers. New members
  6906. // should be added as needed. To simplify the implementation, we only
  6907. // support Element being a raw type (i.e. having no top-level const or
  6908. // reference modifier). It's the client's responsibility to satisfy
  6909. // this requirement. Element can be an array type itself (hence
  6910. // multi-dimensional arrays are supported).
  6911. template <typename Element>
  6912. class NativeArray {
  6913. public:
  6914. // STL-style container typedefs.
  6915. typedef Element value_type;
  6916. typedef Element* iterator;
  6917. typedef const Element* const_iterator;
  6918. // Constructs from a native array.
  6919. NativeArray(const Element* array, size_t count, RelationToSource relation) {
  6920. Init(array, count, relation);
  6921. }
  6922. // Copy constructor.
  6923. NativeArray(const NativeArray& rhs) {
  6924. Init(rhs.array_, rhs.size_, rhs.relation_to_source_);
  6925. }
  6926. ~NativeArray() {
  6927. // Ensures that the user doesn't instantiate NativeArray with a
  6928. // const or reference type.
  6929. static_cast<void>(StaticAssertTypeEqHelper<Element,
  6930. GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>());
  6931. if (relation_to_source_ == kCopy)
  6932. delete[] array_;
  6933. }
  6934. // STL-style container methods.
  6935. size_t size() const { return size_; }
  6936. const_iterator begin() const { return array_; }
  6937. const_iterator end() const { return array_ + size_; }
  6938. bool operator==(const NativeArray& rhs) const {
  6939. return size() == rhs.size() &&
  6940. ArrayEq(begin(), size(), rhs.begin());
  6941. }
  6942. private:
  6943. // Initializes this object; makes a copy of the input array if
  6944. // 'relation' is kCopy.
  6945. void Init(const Element* array, size_t a_size, RelationToSource relation) {
  6946. if (relation == kReference) {
  6947. array_ = array;
  6948. } else {
  6949. Element* const copy = new Element[a_size];
  6950. CopyArray(array, a_size, copy);
  6951. array_ = copy;
  6952. }
  6953. size_ = a_size;
  6954. relation_to_source_ = relation;
  6955. }
  6956. const Element* array_;
  6957. size_t size_;
  6958. RelationToSource relation_to_source_;
  6959. GTEST_DISALLOW_ASSIGN_(NativeArray);
  6960. };
  6961. } // namespace internal
  6962. } // namespace testing
  6963. #define GTEST_MESSAGE_AT_(file, line, message, result_type) \
  6964. ::testing::internal::AssertHelper(result_type, file, line, message) \
  6965. = ::testing::Message()
  6966. #define GTEST_MESSAGE_(message, result_type) \
  6967. GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
  6968. #define GTEST_FATAL_FAILURE_(message) \
  6969. return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
  6970. #define GTEST_NONFATAL_FAILURE_(message) \
  6971. GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
  6972. #define GTEST_SUCCESS_(message) \
  6973. GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
  6974. // Suppresses MSVC warnings 4072 (unreachable code) for the code following
  6975. // statement if it returns or throws (or doesn't return or throw in some
  6976. // situations).
  6977. #define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
  6978. if (::testing::internal::AlwaysTrue()) { statement; }
  6979. #define GTEST_TEST_THROW_(statement, expected_exception, fail) \
  6980. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  6981. if (::testing::internal::ConstCharPtr gtest_msg = "") { \
  6982. bool gtest_caught_expected = false; \
  6983. try { \
  6984. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  6985. } \
  6986. catch (expected_exception const&) { \
  6987. gtest_caught_expected = true; \
  6988. } \
  6989. catch (...) { \
  6990. gtest_msg.value = \
  6991. "Expected: " #statement " throws an exception of type " \
  6992. #expected_exception ".\n Actual: it throws a different type."; \
  6993. goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
  6994. } \
  6995. if (!gtest_caught_expected) { \
  6996. gtest_msg.value = \
  6997. "Expected: " #statement " throws an exception of type " \
  6998. #expected_exception ".\n Actual: it throws nothing."; \
  6999. goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
  7000. } \
  7001. } else \
  7002. GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
  7003. fail(gtest_msg.value)
  7004. #define GTEST_TEST_NO_THROW_(statement, fail) \
  7005. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7006. if (::testing::internal::AlwaysTrue()) { \
  7007. try { \
  7008. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7009. } \
  7010. catch (...) { \
  7011. goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
  7012. } \
  7013. } else \
  7014. GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
  7015. fail("Expected: " #statement " doesn't throw an exception.\n" \
  7016. " Actual: it throws.")
  7017. #define GTEST_TEST_ANY_THROW_(statement, fail) \
  7018. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7019. if (::testing::internal::AlwaysTrue()) { \
  7020. bool gtest_caught_any = false; \
  7021. try { \
  7022. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7023. } \
  7024. catch (...) { \
  7025. gtest_caught_any = true; \
  7026. } \
  7027. if (!gtest_caught_any) { \
  7028. goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
  7029. } \
  7030. } else \
  7031. GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
  7032. fail("Expected: " #statement " throws an exception.\n" \
  7033. " Actual: it doesn't.")
  7034. // Implements Boolean test assertions such as EXPECT_TRUE. expression can be
  7035. // either a boolean expression or an AssertionResult. text is a textual
  7036. // represenation of expression as it was passed into the EXPECT_TRUE.
  7037. #define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
  7038. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7039. if (const ::testing::AssertionResult gtest_ar_ = \
  7040. ::testing::AssertionResult(expression)) \
  7041. ; \
  7042. else \
  7043. fail(::testing::internal::GetBoolAssertionFailureMessage(\
  7044. gtest_ar_, text, #actual, #expected).c_str())
  7045. #define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
  7046. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7047. if (::testing::internal::AlwaysTrue()) { \
  7048. ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
  7049. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7050. if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
  7051. goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
  7052. } \
  7053. } else \
  7054. GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
  7055. fail("Expected: " #statement " doesn't generate new fatal " \
  7056. "failures in the current thread.\n" \
  7057. " Actual: it does.")
  7058. // Expands to the name of the class that implements the given test.
  7059. #define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
  7060. test_case_name##_##test_name##_Test
  7061. // Helper macro for defining tests.
  7062. #define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
  7063. class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
  7064. public:\
  7065. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
  7066. private:\
  7067. virtual void TestBody();\
  7068. static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
  7069. GTEST_DISALLOW_COPY_AND_ASSIGN_(\
  7070. GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
  7071. };\
  7072. \
  7073. ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
  7074. ::test_info_ =\
  7075. ::testing::internal::MakeAndRegisterTestInfo(\
  7076. #test_case_name, #test_name, NULL, NULL, \
  7077. (parent_id), \
  7078. parent_class::SetUpTestCase, \
  7079. parent_class::TearDownTestCase, \
  7080. new ::testing::internal::TestFactoryImpl<\
  7081. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
  7082. void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
  7083. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
  7084. // Copyright 2005, Google Inc.
  7085. // All rights reserved.
  7086. //
  7087. // Redistribution and use in source and binary forms, with or without
  7088. // modification, are permitted provided that the following conditions are
  7089. // met:
  7090. //
  7091. // * Redistributions of source code must retain the above copyright
  7092. // notice, this list of conditions and the following disclaimer.
  7093. // * Redistributions in binary form must reproduce the above
  7094. // copyright notice, this list of conditions and the following disclaimer
  7095. // in the documentation and/or other materials provided with the
  7096. // distribution.
  7097. // * Neither the name of Google Inc. nor the names of its
  7098. // contributors may be used to endorse or promote products derived from
  7099. // this software without specific prior written permission.
  7100. //
  7101. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  7102. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  7103. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  7104. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7105. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  7106. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  7107. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  7108. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  7109. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  7110. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  7111. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  7112. //
  7113. // Author: [email protected] (Zhanyong Wan)
  7114. //
  7115. // The Google C++ Testing Framework (Google Test)
  7116. //
  7117. // This header file defines the public API for death tests. It is
  7118. // #included by gtest.h so a user doesn't need to include this
  7119. // directly.
  7120. #ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
  7121. #define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
  7122. // Copyright 2005, Google Inc.
  7123. // All rights reserved.
  7124. //
  7125. // Redistribution and use in source and binary forms, with or without
  7126. // modification, are permitted provided that the following conditions are
  7127. // met:
  7128. //
  7129. // * Redistributions of source code must retain the above copyright
  7130. // notice, this list of conditions and the following disclaimer.
  7131. // * Redistributions in binary form must reproduce the above
  7132. // copyright notice, this list of conditions and the following disclaimer
  7133. // in the documentation and/or other materials provided with the
  7134. // distribution.
  7135. // * Neither the name of Google Inc. nor the names of its
  7136. // contributors may be used to endorse or promote products derived from
  7137. // this software without specific prior written permission.
  7138. //
  7139. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  7140. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  7141. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  7142. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7143. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  7144. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  7145. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  7146. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  7147. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  7148. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  7149. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  7150. //
  7151. // Authors: [email protected] (Zhanyong Wan), [email protected] (Sean Mcafee)
  7152. //
  7153. // The Google C++ Testing Framework (Google Test)
  7154. //
  7155. // This header file defines internal utilities needed for implementing
  7156. // death tests. They are subject to change without notice.
  7157. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
  7158. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
  7159. #include <stdio.h>
  7160. namespace testing {
  7161. namespace internal {
  7162. GTEST_DECLARE_string_(internal_run_death_test);
  7163. // Names of the flags (needed for parsing Google Test flags).
  7164. const char kDeathTestStyleFlag[] = "death_test_style";
  7165. const char kDeathTestUseFork[] = "death_test_use_fork";
  7166. const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
  7167. #if GTEST_HAS_DEATH_TEST
  7168. // DeathTest is a class that hides much of the complexity of the
  7169. // GTEST_DEATH_TEST_ macro. It is abstract; its static Create method
  7170. // returns a concrete class that depends on the prevailing death test
  7171. // style, as defined by the --gtest_death_test_style and/or
  7172. // --gtest_internal_run_death_test flags.
  7173. // In describing the results of death tests, these terms are used with
  7174. // the corresponding definitions:
  7175. //
  7176. // exit status: The integer exit information in the format specified
  7177. // by wait(2)
  7178. // exit code: The integer code passed to exit(3), _exit(2), or
  7179. // returned from main()
  7180. class GTEST_API_ DeathTest {
  7181. public:
  7182. // Create returns false if there was an error determining the
  7183. // appropriate action to take for the current death test; for example,
  7184. // if the gtest_death_test_style flag is set to an invalid value.
  7185. // The LastMessage method will return a more detailed message in that
  7186. // case. Otherwise, the DeathTest pointer pointed to by the "test"
  7187. // argument is set. If the death test should be skipped, the pointer
  7188. // is set to NULL; otherwise, it is set to the address of a new concrete
  7189. // DeathTest object that controls the execution of the current test.
  7190. static bool Create(const char* statement, const RE* regex,
  7191. const char* file, int line, DeathTest** test);
  7192. DeathTest();
  7193. virtual ~DeathTest() { }
  7194. // A helper class that aborts a death test when it's deleted.
  7195. class ReturnSentinel {
  7196. public:
  7197. explicit ReturnSentinel(DeathTest* test) : test_(test) { }
  7198. ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
  7199. private:
  7200. DeathTest* const test_;
  7201. GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
  7202. } GTEST_ATTRIBUTE_UNUSED_;
  7203. // An enumeration of possible roles that may be taken when a death
  7204. // test is encountered. EXECUTE means that the death test logic should
  7205. // be executed immediately. OVERSEE means that the program should prepare
  7206. // the appropriate environment for a child process to execute the death
  7207. // test, then wait for it to complete.
  7208. enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
  7209. // An enumeration of the three reasons that a test might be aborted.
  7210. enum AbortReason {
  7211. TEST_ENCOUNTERED_RETURN_STATEMENT,
  7212. TEST_THREW_EXCEPTION,
  7213. TEST_DID_NOT_DIE
  7214. };
  7215. // Assumes one of the above roles.
  7216. virtual TestRole AssumeRole() = 0;
  7217. // Waits for the death test to finish and returns its status.
  7218. virtual int Wait() = 0;
  7219. // Returns true if the death test passed; that is, the test process
  7220. // exited during the test, its exit status matches a user-supplied
  7221. // predicate, and its stderr output matches a user-supplied regular
  7222. // expression.
  7223. // The user-supplied predicate may be a macro expression rather
  7224. // than a function pointer or functor, or else Wait and Passed could
  7225. // be combined.
  7226. virtual bool Passed(bool exit_status_ok) = 0;
  7227. // Signals that the death test did not die as expected.
  7228. virtual void Abort(AbortReason reason) = 0;
  7229. // Returns a human-readable outcome message regarding the outcome of
  7230. // the last death test.
  7231. static const char* LastMessage();
  7232. static void set_last_death_test_message(const String& message);
  7233. private:
  7234. // A string containing a description of the outcome of the last death test.
  7235. static String last_death_test_message_;
  7236. GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
  7237. };
  7238. // Factory interface for death tests. May be mocked out for testing.
  7239. class DeathTestFactory {
  7240. public:
  7241. virtual ~DeathTestFactory() { }
  7242. virtual bool Create(const char* statement, const RE* regex,
  7243. const char* file, int line, DeathTest** test) = 0;
  7244. };
  7245. // A concrete DeathTestFactory implementation for normal use.
  7246. class DefaultDeathTestFactory : public DeathTestFactory {
  7247. public:
  7248. virtual bool Create(const char* statement, const RE* regex,
  7249. const char* file, int line, DeathTest** test);
  7250. };
  7251. // Returns true if exit_status describes a process that was terminated
  7252. // by a signal, or exited normally with a nonzero exit code.
  7253. GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
  7254. // Traps C++ exceptions escaping statement and reports them as test
  7255. // failures. Note that trapping SEH exceptions is not implemented here.
  7256. # if GTEST_HAS_EXCEPTIONS
  7257. # define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
  7258. try { \
  7259. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7260. } catch (const ::std::exception& gtest_exception) { \
  7261. fprintf(\
  7262. stderr, \
  7263. "\n%s: Caught std::exception-derived exception escaping the " \
  7264. "death test statement. Exception message: %s\n", \
  7265. ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
  7266. gtest_exception.what()); \
  7267. fflush(stderr); \
  7268. death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
  7269. } catch (...) { \
  7270. death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
  7271. }
  7272. # else
  7273. # define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
  7274. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
  7275. # endif
  7276. // This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
  7277. // ASSERT_EXIT*, and EXPECT_EXIT*.
  7278. # define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
  7279. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7280. if (::testing::internal::AlwaysTrue()) { \
  7281. const ::testing::internal::RE& gtest_regex = (regex); \
  7282. ::testing::internal::DeathTest* gtest_dt; \
  7283. if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \
  7284. __FILE__, __LINE__, &gtest_dt)) { \
  7285. goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
  7286. } \
  7287. if (gtest_dt != NULL) { \
  7288. ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
  7289. gtest_dt_ptr(gtest_dt); \
  7290. switch (gtest_dt->AssumeRole()) { \
  7291. case ::testing::internal::DeathTest::OVERSEE_TEST: \
  7292. if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
  7293. goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
  7294. } \
  7295. break; \
  7296. case ::testing::internal::DeathTest::EXECUTE_TEST: { \
  7297. ::testing::internal::DeathTest::ReturnSentinel \
  7298. gtest_sentinel(gtest_dt); \
  7299. GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
  7300. gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
  7301. break; \
  7302. } \
  7303. default: \
  7304. break; \
  7305. } \
  7306. } \
  7307. } else \
  7308. GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
  7309. fail(::testing::internal::DeathTest::LastMessage())
  7310. // The symbol "fail" here expands to something into which a message
  7311. // can be streamed.
  7312. // A class representing the parsed contents of the
  7313. // --gtest_internal_run_death_test flag, as it existed when
  7314. // RUN_ALL_TESTS was called.
  7315. class InternalRunDeathTestFlag {
  7316. public:
  7317. InternalRunDeathTestFlag(const String& a_file,
  7318. int a_line,
  7319. int an_index,
  7320. int a_write_fd)
  7321. : file_(a_file), line_(a_line), index_(an_index),
  7322. write_fd_(a_write_fd) {}
  7323. ~InternalRunDeathTestFlag() {
  7324. if (write_fd_ >= 0)
  7325. posix::Close(write_fd_);
  7326. }
  7327. String file() const { return file_; }
  7328. int line() const { return line_; }
  7329. int index() const { return index_; }
  7330. int write_fd() const { return write_fd_; }
  7331. private:
  7332. String file_;
  7333. int line_;
  7334. int index_;
  7335. int write_fd_;
  7336. GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
  7337. };
  7338. // Returns a newly created InternalRunDeathTestFlag object with fields
  7339. // initialized from the GTEST_FLAG(internal_run_death_test) flag if
  7340. // the flag is specified; otherwise returns NULL.
  7341. InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
  7342. #else // GTEST_HAS_DEATH_TEST
  7343. // This macro is used for implementing macros such as
  7344. // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
  7345. // death tests are not supported. Those macros must compile on such systems
  7346. // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
  7347. // systems that support death tests. This allows one to write such a macro
  7348. // on a system that does not support death tests and be sure that it will
  7349. // compile on a death-test supporting system.
  7350. //
  7351. // Parameters:
  7352. // statement - A statement that a macro such as EXPECT_DEATH would test
  7353. // for program termination. This macro has to make sure this
  7354. // statement is compiled but not executed, to ensure that
  7355. // EXPECT_DEATH_IF_SUPPORTED compiles with a certain
  7356. // parameter iff EXPECT_DEATH compiles with it.
  7357. // regex - A regex that a macro such as EXPECT_DEATH would use to test
  7358. // the output of statement. This parameter has to be
  7359. // compiled but not evaluated by this macro, to ensure that
  7360. // this macro only accepts expressions that a macro such as
  7361. // EXPECT_DEATH would accept.
  7362. // terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
  7363. // and a return statement for ASSERT_DEATH_IF_SUPPORTED.
  7364. // This ensures that ASSERT_DEATH_IF_SUPPORTED will not
  7365. // compile inside functions where ASSERT_DEATH doesn't
  7366. // compile.
  7367. //
  7368. // The branch that has an always false condition is used to ensure that
  7369. // statement and regex are compiled (and thus syntactically correct) but
  7370. // never executed. The unreachable code macro protects the terminator
  7371. // statement from generating an 'unreachable code' warning in case
  7372. // statement unconditionally returns or throws. The Message constructor at
  7373. // the end allows the syntax of streaming additional messages into the
  7374. // macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
  7375. # define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \
  7376. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7377. if (::testing::internal::AlwaysTrue()) { \
  7378. GTEST_LOG_(WARNING) \
  7379. << "Death tests are not supported on this platform.\n" \
  7380. << "Statement '" #statement "' cannot be verified."; \
  7381. } else if (::testing::internal::AlwaysFalse()) { \
  7382. ::testing::internal::RE::PartialMatch(".*", (regex)); \
  7383. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7384. terminator; \
  7385. } else \
  7386. ::testing::Message()
  7387. #endif // GTEST_HAS_DEATH_TEST
  7388. } // namespace internal
  7389. } // namespace testing
  7390. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
  7391. namespace testing {
  7392. // This flag controls the style of death tests. Valid values are "threadsafe",
  7393. // meaning that the death test child process will re-execute the test binary
  7394. // from the start, running only a single death test, or "fast",
  7395. // meaning that the child process will execute the test logic immediately
  7396. // after forking.
  7397. GTEST_DECLARE_string_(death_test_style);
  7398. #if GTEST_HAS_DEATH_TEST
  7399. // The following macros are useful for writing death tests.
  7400. // Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
  7401. // executed:
  7402. //
  7403. // 1. It generates a warning if there is more than one active
  7404. // thread. This is because it's safe to fork() or clone() only
  7405. // when there is a single thread.
  7406. //
  7407. // 2. The parent process clone()s a sub-process and runs the death
  7408. // test in it; the sub-process exits with code 0 at the end of the
  7409. // death test, if it hasn't exited already.
  7410. //
  7411. // 3. The parent process waits for the sub-process to terminate.
  7412. //
  7413. // 4. The parent process checks the exit code and error message of
  7414. // the sub-process.
  7415. //
  7416. // Examples:
  7417. //
  7418. // ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
  7419. // for (int i = 0; i < 5; i++) {
  7420. // EXPECT_DEATH(server.ProcessRequest(i),
  7421. // "Invalid request .* in ProcessRequest()")
  7422. // << "Failed to die on request " << i);
  7423. // }
  7424. //
  7425. // ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
  7426. //
  7427. // bool KilledBySIGHUP(int exit_code) {
  7428. // return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
  7429. // }
  7430. //
  7431. // ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
  7432. //
  7433. // On the regular expressions used in death tests:
  7434. //
  7435. // On POSIX-compliant systems (*nix), we use the <regex.h> library,
  7436. // which uses the POSIX extended regex syntax.
  7437. //
  7438. // On other platforms (e.g. Windows), we only support a simple regex
  7439. // syntax implemented as part of Google Test. This limited
  7440. // implementation should be enough most of the time when writing
  7441. // death tests; though it lacks many features you can find in PCRE
  7442. // or POSIX extended regex syntax. For example, we don't support
  7443. // union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
  7444. // repetition count ("x{5,7}"), among others.
  7445. //
  7446. // Below is the syntax that we do support. We chose it to be a
  7447. // subset of both PCRE and POSIX extended regex, so it's easy to
  7448. // learn wherever you come from. In the following: 'A' denotes a
  7449. // literal character, period (.), or a single \\ escape sequence;
  7450. // 'x' and 'y' denote regular expressions; 'm' and 'n' are for
  7451. // natural numbers.
  7452. //
  7453. // c matches any literal character c
  7454. // \\d matches any decimal digit
  7455. // \\D matches any character that's not a decimal digit
  7456. // \\f matches \f
  7457. // \\n matches \n
  7458. // \\r matches \r
  7459. // \\s matches any ASCII whitespace, including \n
  7460. // \\S matches any character that's not a whitespace
  7461. // \\t matches \t
  7462. // \\v matches \v
  7463. // \\w matches any letter, _, or decimal digit
  7464. // \\W matches any character that \\w doesn't match
  7465. // \\c matches any literal character c, which must be a punctuation
  7466. // . matches any single character except \n
  7467. // A? matches 0 or 1 occurrences of A
  7468. // A* matches 0 or many occurrences of A
  7469. // A+ matches 1 or many occurrences of A
  7470. // ^ matches the beginning of a string (not that of each line)
  7471. // $ matches the end of a string (not that of each line)
  7472. // xy matches x followed by y
  7473. //
  7474. // If you accidentally use PCRE or POSIX extended regex features
  7475. // not implemented by us, you will get a run-time failure. In that
  7476. // case, please try to rewrite your regular expression within the
  7477. // above syntax.
  7478. //
  7479. // This implementation is *not* meant to be as highly tuned or robust
  7480. // as a compiled regex library, but should perform well enough for a
  7481. // death test, which already incurs significant overhead by launching
  7482. // a child process.
  7483. //
  7484. // Known caveats:
  7485. //
  7486. // A "threadsafe" style death test obtains the path to the test
  7487. // program from argv[0] and re-executes it in the sub-process. For
  7488. // simplicity, the current implementation doesn't search the PATH
  7489. // when launching the sub-process. This means that the user must
  7490. // invoke the test program via a path that contains at least one
  7491. // path separator (e.g. path/to/foo_test and
  7492. // /absolute/path/to/bar_test are fine, but foo_test is not). This
  7493. // is rarely a problem as people usually don't put the test binary
  7494. // directory in PATH.
  7495. //
  7496. // TODO([email protected]): make thread-safe death tests search the PATH.
  7497. // Asserts that a given statement causes the program to exit, with an
  7498. // integer exit status that satisfies predicate, and emitting error output
  7499. // that matches regex.
  7500. # define ASSERT_EXIT(statement, predicate, regex) \
  7501. GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
  7502. // Like ASSERT_EXIT, but continues on to successive tests in the
  7503. // test case, if any:
  7504. # define EXPECT_EXIT(statement, predicate, regex) \
  7505. GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
  7506. // Asserts that a given statement causes the program to exit, either by
  7507. // explicitly exiting with a nonzero exit code or being killed by a
  7508. // signal, and emitting error output that matches regex.
  7509. # define ASSERT_DEATH(statement, regex) \
  7510. ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
  7511. // Like ASSERT_DEATH, but continues on to successive tests in the
  7512. // test case, if any:
  7513. # define EXPECT_DEATH(statement, regex) \
  7514. EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
  7515. // Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
  7516. // Tests that an exit code describes a normal exit with a given exit code.
  7517. class GTEST_API_ ExitedWithCode {
  7518. public:
  7519. explicit ExitedWithCode(int exit_code);
  7520. bool operator()(int exit_status) const;
  7521. private:
  7522. // No implementation - assignment is unsupported.
  7523. void operator=(const ExitedWithCode& other);
  7524. const int exit_code_;
  7525. };
  7526. # if !GTEST_OS_WINDOWS
  7527. // Tests that an exit code describes an exit due to termination by a
  7528. // given signal.
  7529. class GTEST_API_ KilledBySignal {
  7530. public:
  7531. explicit KilledBySignal(int signum);
  7532. bool operator()(int exit_status) const;
  7533. private:
  7534. const int signum_;
  7535. };
  7536. # endif // !GTEST_OS_WINDOWS
  7537. // EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
  7538. // The death testing framework causes this to have interesting semantics,
  7539. // since the sideeffects of the call are only visible in opt mode, and not
  7540. // in debug mode.
  7541. //
  7542. // In practice, this can be used to test functions that utilize the
  7543. // LOG(DFATAL) macro using the following style:
  7544. //
  7545. // int DieInDebugOr12(int* sideeffect) {
  7546. // if (sideeffect) {
  7547. // *sideeffect = 12;
  7548. // }
  7549. // LOG(DFATAL) << "death";
  7550. // return 12;
  7551. // }
  7552. //
  7553. // TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
  7554. // int sideeffect = 0;
  7555. // // Only asserts in dbg.
  7556. // EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
  7557. //
  7558. // #ifdef NDEBUG
  7559. // // opt-mode has sideeffect visible.
  7560. // EXPECT_EQ(12, sideeffect);
  7561. // #else
  7562. // // dbg-mode no visible sideeffect.
  7563. // EXPECT_EQ(0, sideeffect);
  7564. // #endif
  7565. // }
  7566. //
  7567. // This will assert that DieInDebugReturn12InOpt() crashes in debug
  7568. // mode, usually due to a DCHECK or LOG(DFATAL), but returns the
  7569. // appropriate fallback value (12 in this case) in opt mode. If you
  7570. // need to test that a function has appropriate side-effects in opt
  7571. // mode, include assertions against the side-effects. A general
  7572. // pattern for this is:
  7573. //
  7574. // EXPECT_DEBUG_DEATH({
  7575. // // Side-effects here will have an effect after this statement in
  7576. // // opt mode, but none in debug mode.
  7577. // EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
  7578. // }, "death");
  7579. //
  7580. # ifdef NDEBUG
  7581. # define EXPECT_DEBUG_DEATH(statement, regex) \
  7582. do { statement; } while (::testing::internal::AlwaysFalse())
  7583. # define ASSERT_DEBUG_DEATH(statement, regex) \
  7584. do { statement; } while (::testing::internal::AlwaysFalse())
  7585. # else
  7586. # define EXPECT_DEBUG_DEATH(statement, regex) \
  7587. EXPECT_DEATH(statement, regex)
  7588. # define ASSERT_DEBUG_DEATH(statement, regex) \
  7589. ASSERT_DEATH(statement, regex)
  7590. # endif // NDEBUG for EXPECT_DEBUG_DEATH
  7591. #endif // GTEST_HAS_DEATH_TEST
  7592. // EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
  7593. // ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
  7594. // death tests are supported; otherwise they just issue a warning. This is
  7595. // useful when you are combining death test assertions with normal test
  7596. // assertions in one test.
  7597. #if GTEST_HAS_DEATH_TEST
  7598. # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
  7599. EXPECT_DEATH(statement, regex)
  7600. # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
  7601. ASSERT_DEATH(statement, regex)
  7602. #else
  7603. # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
  7604. GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
  7605. # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
  7606. GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)
  7607. #endif
  7608. } // namespace testing
  7609. #endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
  7610. // Copyright 2005, Google Inc.
  7611. // All rights reserved.
  7612. //
  7613. // Redistribution and use in source and binary forms, with or without
  7614. // modification, are permitted provided that the following conditions are
  7615. // met:
  7616. //
  7617. // * Redistributions of source code must retain the above copyright
  7618. // notice, this list of conditions and the following disclaimer.
  7619. // * Redistributions in binary form must reproduce the above
  7620. // copyright notice, this list of conditions and the following disclaimer
  7621. // in the documentation and/or other materials provided with the
  7622. // distribution.
  7623. // * Neither the name of Google Inc. nor the names of its
  7624. // contributors may be used to endorse or promote products derived from
  7625. // this software without specific prior written permission.
  7626. //
  7627. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  7628. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  7629. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  7630. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7631. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  7632. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  7633. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  7634. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  7635. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  7636. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  7637. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  7638. //
  7639. // Author: [email protected] (Zhanyong Wan)
  7640. //
  7641. // The Google C++ Testing Framework (Google Test)
  7642. //
  7643. // This header file defines the Message class.
  7644. //
  7645. // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
  7646. // leave some internal implementation details in this header file.
  7647. // They are clearly marked by comments like this:
  7648. //
  7649. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  7650. //
  7651. // Such code is NOT meant to be used by a user directly, and is subject
  7652. // to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
  7653. // program!
  7654. #ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
  7655. #define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
  7656. #include <limits>
  7657. namespace testing {
  7658. // The Message class works like an ostream repeater.
  7659. //
  7660. // Typical usage:
  7661. //
  7662. // 1. You stream a bunch of values to a Message object.
  7663. // It will remember the text in a stringstream.
  7664. // 2. Then you stream the Message object to an ostream.
  7665. // This causes the text in the Message to be streamed
  7666. // to the ostream.
  7667. //
  7668. // For example;
  7669. //
  7670. // testing::Message foo;
  7671. // foo << 1 << " != " << 2;
  7672. // std::cout << foo;
  7673. //
  7674. // will print "1 != 2".
  7675. //
  7676. // Message is not intended to be inherited from. In particular, its
  7677. // destructor is not virtual.
  7678. //
  7679. // Note that stringstream behaves differently in gcc and in MSVC. You
  7680. // can stream a NULL char pointer to it in the former, but not in the
  7681. // latter (it causes an access violation if you do). The Message
  7682. // class hides this difference by treating a NULL char pointer as
  7683. // "(null)".
  7684. class GTEST_API_ Message {
  7685. private:
  7686. // The type of basic IO manipulators (endl, ends, and flush) for
  7687. // narrow streams.
  7688. typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
  7689. public:
  7690. // Constructs an empty Message.
  7691. // We allocate the stringstream separately because otherwise each use of
  7692. // ASSERT/EXPECT in a procedure adds over 200 bytes to the procedure's
  7693. // stack frame leading to huge stack frames in some cases; gcc does not reuse
  7694. // the stack space.
  7695. Message() : ss_(new ::std::stringstream) {
  7696. // By default, we want there to be enough precision when printing
  7697. // a double to a Message.
  7698. *ss_ << std::setprecision(std::numeric_limits<double>::digits10 + 2);
  7699. }
  7700. // Copy constructor.
  7701. Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT
  7702. *ss_ << msg.GetString();
  7703. }
  7704. // Constructs a Message from a C-string.
  7705. explicit Message(const char* str) : ss_(new ::std::stringstream) {
  7706. *ss_ << str;
  7707. }
  7708. #if GTEST_OS_SYMBIAN
  7709. // Streams a value (either a pointer or not) to this object.
  7710. template <typename T>
  7711. inline Message& operator <<(const T& value) {
  7712. StreamHelper(typename internal::is_pointer<T>::type(), value);
  7713. return *this;
  7714. }
  7715. #else
  7716. // Streams a non-pointer value to this object.
  7717. template <typename T>
  7718. inline Message& operator <<(const T& val) {
  7719. ::GTestStreamToHelper(ss_.get(), val);
  7720. return *this;
  7721. }
  7722. // Streams a pointer value to this object.
  7723. //
  7724. // This function is an overload of the previous one. When you
  7725. // stream a pointer to a Message, this definition will be used as it
  7726. // is more specialized. (The C++ Standard, section
  7727. // [temp.func.order].) If you stream a non-pointer, then the
  7728. // previous definition will be used.
  7729. //
  7730. // The reason for this overload is that streaming a NULL pointer to
  7731. // ostream is undefined behavior. Depending on the compiler, you
  7732. // may get "0", "(nil)", "(null)", or an access violation. To
  7733. // ensure consistent result across compilers, we always treat NULL
  7734. // as "(null)".
  7735. template <typename T>
  7736. inline Message& operator <<(T* const& pointer) { // NOLINT
  7737. if (pointer == NULL) {
  7738. *ss_ << "(null)";
  7739. } else {
  7740. ::GTestStreamToHelper(ss_.get(), pointer);
  7741. }
  7742. return *this;
  7743. }
  7744. #endif // GTEST_OS_SYMBIAN
  7745. // Since the basic IO manipulators are overloaded for both narrow
  7746. // and wide streams, we have to provide this specialized definition
  7747. // of operator <<, even though its body is the same as the
  7748. // templatized version above. Without this definition, streaming
  7749. // endl or other basic IO manipulators to Message will confuse the
  7750. // compiler.
  7751. Message& operator <<(BasicNarrowIoManip val) {
  7752. *ss_ << val;
  7753. return *this;
  7754. }
  7755. // Instead of 1/0, we want to see true/false for bool values.
  7756. Message& operator <<(bool b) {
  7757. return *this << (b ? "true" : "false");
  7758. }
  7759. // These two overloads allow streaming a wide C string to a Message
  7760. // using the UTF-8 encoding.
  7761. Message& operator <<(const wchar_t* wide_c_str) {
  7762. return *this << internal::String::ShowWideCString(wide_c_str);
  7763. }
  7764. Message& operator <<(wchar_t* wide_c_str) {
  7765. return *this << internal::String::ShowWideCString(wide_c_str);
  7766. }
  7767. #if GTEST_HAS_STD_WSTRING
  7768. // Converts the given wide string to a narrow string using the UTF-8
  7769. // encoding, and streams the result to this Message object.
  7770. Message& operator <<(const ::std::wstring& wstr);
  7771. #endif // GTEST_HAS_STD_WSTRING
  7772. #if GTEST_HAS_GLOBAL_WSTRING
  7773. // Converts the given wide string to a narrow string using the UTF-8
  7774. // encoding, and streams the result to this Message object.
  7775. Message& operator <<(const ::wstring& wstr);
  7776. #endif // GTEST_HAS_GLOBAL_WSTRING
  7777. // Gets the text streamed to this object so far as a String.
  7778. // Each '\0' character in the buffer is replaced with "\\0".
  7779. //
  7780. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  7781. internal::String GetString() const {
  7782. return internal::StringStreamToString(ss_.get());
  7783. }
  7784. private:
  7785. #if GTEST_OS_SYMBIAN
  7786. // These are needed as the Nokia Symbian Compiler cannot decide between
  7787. // const T& and const T* in a function template. The Nokia compiler _can_
  7788. // decide between class template specializations for T and T*, so a
  7789. // tr1::type_traits-like is_pointer works, and we can overload on that.
  7790. template <typename T>
  7791. inline void StreamHelper(internal::true_type /*dummy*/, T* pointer) {
  7792. if (pointer == NULL) {
  7793. *ss_ << "(null)";
  7794. } else {
  7795. ::GTestStreamToHelper(ss_.get(), pointer);
  7796. }
  7797. }
  7798. template <typename T>
  7799. inline void StreamHelper(internal::false_type /*dummy*/, const T& value) {
  7800. ::GTestStreamToHelper(ss_.get(), value);
  7801. }
  7802. #endif // GTEST_OS_SYMBIAN
  7803. // We'll hold the text streamed to this object here.
  7804. const internal::scoped_ptr< ::std::stringstream> ss_;
  7805. // We declare (but don't implement) this to prevent the compiler
  7806. // from implementing the assignment operator.
  7807. void operator=(const Message&);
  7808. };
  7809. // Streams a Message to an ostream.
  7810. inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
  7811. return os << sb.GetString();
  7812. }
  7813. } // namespace testing
  7814. #endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
  7815. // This file was GENERATED by command:
  7816. // pump.py gtest-param-test.h.pump
  7817. // DO NOT EDIT BY HAND!!!
  7818. // Copyright 2008, Google Inc.
  7819. // All rights reserved.
  7820. //
  7821. // Redistribution and use in source and binary forms, with or without
  7822. // modification, are permitted provided that the following conditions are
  7823. // met:
  7824. //
  7825. // * Redistributions of source code must retain the above copyright
  7826. // notice, this list of conditions and the following disclaimer.
  7827. // * Redistributions in binary form must reproduce the above
  7828. // copyright notice, this list of conditions and the following disclaimer
  7829. // in the documentation and/or other materials provided with the
  7830. // distribution.
  7831. // * Neither the name of Google Inc. nor the names of its
  7832. // contributors may be used to endorse or promote products derived from
  7833. // this software without specific prior written permission.
  7834. //
  7835. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  7836. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  7837. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  7838. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7839. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  7840. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  7841. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  7842. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  7843. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  7844. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  7845. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  7846. //
  7847. // Authors: [email protected] (Vlad Losev)
  7848. //
  7849. // Macros and functions for implementing parameterized tests
  7850. // in Google C++ Testing Framework (Google Test)
  7851. //
  7852. // This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
  7853. //
  7854. #ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
  7855. #define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
  7856. // Value-parameterized tests allow you to test your code with different
  7857. // parameters without writing multiple copies of the same test.
  7858. //
  7859. // Here is how you use value-parameterized tests:
  7860. #if 0
  7861. // To write value-parameterized tests, first you should define a fixture
  7862. // class. It is usually derived from testing::TestWithParam<T> (see below for
  7863. // another inheritance scheme that's sometimes useful in more complicated
  7864. // class hierarchies), where the type of your parameter values.
  7865. // TestWithParam<T> is itself derived from testing::Test. T can be any
  7866. // copyable type. If it's a raw pointer, you are responsible for managing the
  7867. // lifespan of the pointed values.
  7868. class FooTest : public ::testing::TestWithParam<const char*> {
  7869. // You can implement all the usual class fixture members here.
  7870. };
  7871. // Then, use the TEST_P macro to define as many parameterized tests
  7872. // for this fixture as you want. The _P suffix is for "parameterized"
  7873. // or "pattern", whichever you prefer to think.
  7874. TEST_P(FooTest, DoesBlah) {
  7875. // Inside a test, access the test parameter with the GetParam() method
  7876. // of the TestWithParam<T> class:
  7877. EXPECT_TRUE(foo.Blah(GetParam()));
  7878. ...
  7879. }
  7880. TEST_P(FooTest, HasBlahBlah) {
  7881. ...
  7882. }
  7883. // Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
  7884. // case with any set of parameters you want. Google Test defines a number
  7885. // of functions for generating test parameters. They return what we call
  7886. // (surprise!) parameter generators. Here is a summary of them, which
  7887. // are all in the testing namespace:
  7888. //
  7889. //
  7890. // Range(begin, end [, step]) - Yields values {begin, begin+step,
  7891. // begin+step+step, ...}. The values do not
  7892. // include end. step defaults to 1.
  7893. // Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}.
  7894. // ValuesIn(container) - Yields values from a C-style array, an STL
  7895. // ValuesIn(begin,end) container, or an iterator range [begin, end).
  7896. // Bool() - Yields sequence {false, true}.
  7897. // Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product
  7898. // for the math savvy) of the values generated
  7899. // by the N generators.
  7900. //
  7901. // For more details, see comments at the definitions of these functions below
  7902. // in this file.
  7903. //
  7904. // The following statement will instantiate tests from the FooTest test case
  7905. // each with parameter values "meeny", "miny", and "moe".
  7906. INSTANTIATE_TEST_CASE_P(InstantiationName,
  7907. FooTest,
  7908. Values("meeny", "miny", "moe"));
  7909. // To distinguish different instances of the pattern, (yes, you
  7910. // can instantiate it more then once) the first argument to the
  7911. // INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
  7912. // actual test case name. Remember to pick unique prefixes for different
  7913. // instantiations. The tests from the instantiation above will have
  7914. // these names:
  7915. //
  7916. // * InstantiationName/FooTest.DoesBlah/0 for "meeny"
  7917. // * InstantiationName/FooTest.DoesBlah/1 for "miny"
  7918. // * InstantiationName/FooTest.DoesBlah/2 for "moe"
  7919. // * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
  7920. // * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
  7921. // * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
  7922. //
  7923. // You can use these names in --gtest_filter.
  7924. //
  7925. // This statement will instantiate all tests from FooTest again, each
  7926. // with parameter values "cat" and "dog":
  7927. const char* pets[] = {"cat", "dog"};
  7928. INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
  7929. // The tests from the instantiation above will have these names:
  7930. //
  7931. // * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
  7932. // * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
  7933. // * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
  7934. // * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
  7935. //
  7936. // Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
  7937. // in the given test case, whether their definitions come before or
  7938. // AFTER the INSTANTIATE_TEST_CASE_P statement.
  7939. //
  7940. // Please also note that generator expressions (including parameters to the
  7941. // generators) are evaluated in InitGoogleTest(), after main() has started.
  7942. // This allows the user on one hand, to adjust generator parameters in order
  7943. // to dynamically determine a set of tests to run and on the other hand,
  7944. // give the user a chance to inspect the generated tests with Google Test
  7945. // reflection API before RUN_ALL_TESTS() is executed.
  7946. //
  7947. // You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
  7948. // for more examples.
  7949. //
  7950. // In the future, we plan to publish the API for defining new parameter
  7951. // generators. But for now this interface remains part of the internal
  7952. // implementation and is subject to change.
  7953. //
  7954. //
  7955. // A parameterized test fixture must be derived from testing::Test and from
  7956. // testing::WithParamInterface<T>, where T is the type of the parameter
  7957. // values. Inheriting from TestWithParam<T> satisfies that requirement because
  7958. // TestWithParam<T> inherits from both Test and WithParamInterface. In more
  7959. // complicated hierarchies, however, it is occasionally useful to inherit
  7960. // separately from Test and WithParamInterface. For example:
  7961. class BaseTest : public ::testing::Test {
  7962. // You can inherit all the usual members for a non-parameterized test
  7963. // fixture here.
  7964. };
  7965. class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
  7966. // The usual test fixture members go here too.
  7967. };
  7968. TEST_F(BaseTest, HasFoo) {
  7969. // This is an ordinary non-parameterized test.
  7970. }
  7971. TEST_P(DerivedTest, DoesBlah) {
  7972. // GetParam works just the same here as if you inherit from TestWithParam.
  7973. EXPECT_TRUE(foo.Blah(GetParam()));
  7974. }
  7975. #endif // 0
  7976. #if !GTEST_OS_SYMBIAN
  7977. # include <utility>
  7978. #endif
  7979. // scripts/fuse_gtest.py depends on gtest's own header being #included
  7980. // *unconditionally*. Therefore these #includes cannot be moved
  7981. // inside #if GTEST_HAS_PARAM_TEST.
  7982. // Copyright 2008 Google Inc.
  7983. // All Rights Reserved.
  7984. //
  7985. // Redistribution and use in source and binary forms, with or without
  7986. // modification, are permitted provided that the following conditions are
  7987. // met:
  7988. //
  7989. // * Redistributions of source code must retain the above copyright
  7990. // notice, this list of conditions and the following disclaimer.
  7991. // * Redistributions in binary form must reproduce the above
  7992. // copyright notice, this list of conditions and the following disclaimer
  7993. // in the documentation and/or other materials provided with the
  7994. // distribution.
  7995. // * Neither the name of Google Inc. nor the names of its
  7996. // contributors may be used to endorse or promote products derived from
  7997. // this software without specific prior written permission.
  7998. //
  7999. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8000. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  8001. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8002. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  8003. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8004. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  8005. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  8006. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  8007. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  8008. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  8009. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8010. //
  8011. // Author: [email protected] (Vlad Losev)
  8012. // Type and function utilities for implementing parameterized tests.
  8013. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
  8014. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
  8015. #include <iterator>
  8016. #include <utility>
  8017. #include <vector>
  8018. // scripts/fuse_gtest.py depends on gtest's own header being #included
  8019. // *unconditionally*. Therefore these #includes cannot be moved
  8020. // inside #if GTEST_HAS_PARAM_TEST.
  8021. // Copyright 2003 Google Inc.
  8022. // All rights reserved.
  8023. //
  8024. // Redistribution and use in source and binary forms, with or without
  8025. // modification, are permitted provided that the following conditions are
  8026. // met:
  8027. //
  8028. // * Redistributions of source code must retain the above copyright
  8029. // notice, this list of conditions and the following disclaimer.
  8030. // * Redistributions in binary form must reproduce the above
  8031. // copyright notice, this list of conditions and the following disclaimer
  8032. // in the documentation and/or other materials provided with the
  8033. // distribution.
  8034. // * Neither the name of Google Inc. nor the names of its
  8035. // contributors may be used to endorse or promote products derived from
  8036. // this software without specific prior written permission.
  8037. //
  8038. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8039. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  8040. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8041. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  8042. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8043. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  8044. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  8045. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  8046. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  8047. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  8048. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8049. //
  8050. // Authors: Dan Egnor ([email protected])
  8051. //
  8052. // A "smart" pointer type with reference tracking. Every pointer to a
  8053. // particular object is kept on a circular linked list. When the last pointer
  8054. // to an object is destroyed or reassigned, the object is deleted.
  8055. //
  8056. // Used properly, this deletes the object when the last reference goes away.
  8057. // There are several caveats:
  8058. // - Like all reference counting schemes, cycles lead to leaks.
  8059. // - Each smart pointer is actually two pointers (8 bytes instead of 4).
  8060. // - Every time a pointer is assigned, the entire list of pointers to that
  8061. // object is traversed. This class is therefore NOT SUITABLE when there
  8062. // will often be more than two or three pointers to a particular object.
  8063. // - References are only tracked as long as linked_ptr<> objects are copied.
  8064. // If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
  8065. // will happen (double deletion).
  8066. //
  8067. // A good use of this class is storing object references in STL containers.
  8068. // You can safely put linked_ptr<> in a vector<>.
  8069. // Other uses may not be as good.
  8070. //
  8071. // Note: If you use an incomplete type with linked_ptr<>, the class
  8072. // *containing* linked_ptr<> must have a constructor and destructor (even
  8073. // if they do nothing!).
  8074. //
  8075. // Bill Gibbons suggested we use something like this.
  8076. //
  8077. // Thread Safety:
  8078. // Unlike other linked_ptr implementations, in this implementation
  8079. // a linked_ptr object is thread-safe in the sense that:
  8080. // - it's safe to copy linked_ptr objects concurrently,
  8081. // - it's safe to copy *from* a linked_ptr and read its underlying
  8082. // raw pointer (e.g. via get()) concurrently, and
  8083. // - it's safe to write to two linked_ptrs that point to the same
  8084. // shared object concurrently.
  8085. // TODO([email protected]): rename this to safe_linked_ptr to avoid
  8086. // confusion with normal linked_ptr.
  8087. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
  8088. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
  8089. #include <stdlib.h>
  8090. #include <assert.h>
  8091. namespace testing {
  8092. namespace internal {
  8093. // Protects copying of all linked_ptr objects.
  8094. GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
  8095. // This is used internally by all instances of linked_ptr<>. It needs to be
  8096. // a non-template class because different types of linked_ptr<> can refer to
  8097. // the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
  8098. // So, it needs to be possible for different types of linked_ptr to participate
  8099. // in the same circular linked list, so we need a single class type here.
  8100. //
  8101. // DO NOT USE THIS CLASS DIRECTLY YOURSELF. Use linked_ptr<T>.
  8102. class linked_ptr_internal {
  8103. public:
  8104. // Create a new circle that includes only this instance.
  8105. void join_new() {
  8106. next_ = this;
  8107. }
  8108. // Many linked_ptr operations may change p.link_ for some linked_ptr
  8109. // variable p in the same circle as this object. Therefore we need
  8110. // to prevent two such operations from occurring concurrently.
  8111. //
  8112. // Note that different types of linked_ptr objects can coexist in a
  8113. // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
  8114. // linked_ptr<Derived2>). Therefore we must use a single mutex to
  8115. // protect all linked_ptr objects. This can create serious
  8116. // contention in production code, but is acceptable in a testing
  8117. // framework.
  8118. // Join an existing circle.
  8119. // L < g_linked_ptr_mutex
  8120. void join(linked_ptr_internal const* ptr) {
  8121. MutexLock lock(&g_linked_ptr_mutex);
  8122. linked_ptr_internal const* p = ptr;
  8123. while (p->next_ != ptr) p = p->next_;
  8124. p->next_ = this;
  8125. next_ = ptr;
  8126. }
  8127. // Leave whatever circle we're part of. Returns true if we were the
  8128. // last member of the circle. Once this is done, you can join() another.
  8129. // L < g_linked_ptr_mutex
  8130. bool depart() {
  8131. MutexLock lock(&g_linked_ptr_mutex);
  8132. if (next_ == this) return true;
  8133. linked_ptr_internal const* p = next_;
  8134. while (p->next_ != this) p = p->next_;
  8135. p->next_ = next_;
  8136. return false;
  8137. }
  8138. private:
  8139. mutable linked_ptr_internal const* next_;
  8140. };
  8141. template <typename T>
  8142. class linked_ptr {
  8143. public:
  8144. typedef T element_type;
  8145. // Take over ownership of a raw pointer. This should happen as soon as
  8146. // possible after the object is created.
  8147. explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
  8148. ~linked_ptr() { depart(); }
  8149. // Copy an existing linked_ptr<>, adding ourselves to the list of references.
  8150. template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
  8151. linked_ptr(linked_ptr const& ptr) { // NOLINT
  8152. assert(&ptr != this);
  8153. copy(&ptr);
  8154. }
  8155. // Assignment releases the old value and acquires the new.
  8156. template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
  8157. depart();
  8158. copy(&ptr);
  8159. return *this;
  8160. }
  8161. linked_ptr& operator=(linked_ptr const& ptr) {
  8162. if (&ptr != this) {
  8163. depart();
  8164. copy(&ptr);
  8165. }
  8166. return *this;
  8167. }
  8168. // Smart pointer members.
  8169. void reset(T* ptr = NULL) {
  8170. depart();
  8171. capture(ptr);
  8172. }
  8173. T* get() const { return value_; }
  8174. T* operator->() const { return value_; }
  8175. T& operator*() const { return *value_; }
  8176. bool operator==(T* p) const { return value_ == p; }
  8177. bool operator!=(T* p) const { return value_ != p; }
  8178. template <typename U>
  8179. bool operator==(linked_ptr<U> const& ptr) const {
  8180. return value_ == ptr.get();
  8181. }
  8182. template <typename U>
  8183. bool operator!=(linked_ptr<U> const& ptr) const {
  8184. return value_ != ptr.get();
  8185. }
  8186. private:
  8187. template <typename U>
  8188. friend class linked_ptr;
  8189. T* value_;
  8190. linked_ptr_internal link_;
  8191. void depart() {
  8192. if (link_.depart()) delete value_;
  8193. }
  8194. void capture(T* ptr) {
  8195. value_ = ptr;
  8196. link_.join_new();
  8197. }
  8198. template <typename U> void copy(linked_ptr<U> const* ptr) {
  8199. value_ = ptr->get();
  8200. if (value_)
  8201. link_.join(&ptr->link_);
  8202. else
  8203. link_.join_new();
  8204. }
  8205. };
  8206. template<typename T> inline
  8207. bool operator==(T* ptr, const linked_ptr<T>& x) {
  8208. return ptr == x.get();
  8209. }
  8210. template<typename T> inline
  8211. bool operator!=(T* ptr, const linked_ptr<T>& x) {
  8212. return ptr != x.get();
  8213. }
  8214. // A function to convert T* into linked_ptr<T>
  8215. // Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
  8216. // for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
  8217. template <typename T>
  8218. linked_ptr<T> make_linked_ptr(T* ptr) {
  8219. return linked_ptr<T>(ptr);
  8220. }
  8221. } // namespace internal
  8222. } // namespace testing
  8223. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
  8224. // Copyright 2007, Google Inc.
  8225. // All rights reserved.
  8226. //
  8227. // Redistribution and use in source and binary forms, with or without
  8228. // modification, are permitted provided that the following conditions are
  8229. // met:
  8230. //
  8231. // * Redistributions of source code must retain the above copyright
  8232. // notice, this list of conditions and the following disclaimer.
  8233. // * Redistributions in binary form must reproduce the above
  8234. // copyright notice, this list of conditions and the following disclaimer
  8235. // in the documentation and/or other materials provided with the
  8236. // distribution.
  8237. // * Neither the name of Google Inc. nor the names of its
  8238. // contributors may be used to endorse or promote products derived from
  8239. // this software without specific prior written permission.
  8240. //
  8241. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8242. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  8243. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8244. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  8245. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8246. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  8247. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  8248. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  8249. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  8250. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  8251. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8252. //
  8253. // Author: [email protected] (Zhanyong Wan)
  8254. // Google Test - The Google C++ Testing Framework
  8255. //
  8256. // This file implements a universal value printer that can print a
  8257. // value of any type T:
  8258. //
  8259. // void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
  8260. //
  8261. // A user can teach this function how to print a class type T by
  8262. // defining either operator<<() or PrintTo() in the namespace that
  8263. // defines T. More specifically, the FIRST defined function in the
  8264. // following list will be used (assuming T is defined in namespace
  8265. // foo):
  8266. //
  8267. // 1. foo::PrintTo(const T&, ostream*)
  8268. // 2. operator<<(ostream&, const T&) defined in either foo or the
  8269. // global namespace.
  8270. //
  8271. // If none of the above is defined, it will print the debug string of
  8272. // the value if it is a protocol buffer, or print the raw bytes in the
  8273. // value otherwise.
  8274. //
  8275. // To aid debugging: when T is a reference type, the address of the
  8276. // value is also printed; when T is a (const) char pointer, both the
  8277. // pointer value and the NUL-terminated string it points to are
  8278. // printed.
  8279. //
  8280. // We also provide some convenient wrappers:
  8281. //
  8282. // // Prints a value to a string. For a (const or not) char
  8283. // // pointer, the NUL-terminated string (but not the pointer) is
  8284. // // printed.
  8285. // std::string ::testing::PrintToString(const T& value);
  8286. //
  8287. // // Prints a value tersely: for a reference type, the referenced
  8288. // // value (but not the address) is printed; for a (const or not) char
  8289. // // pointer, the NUL-terminated string (but not the pointer) is
  8290. // // printed.
  8291. // void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
  8292. //
  8293. // // Prints value using the type inferred by the compiler. The difference
  8294. // // from UniversalTersePrint() is that this function prints both the
  8295. // // pointer and the NUL-terminated string for a (const or not) char pointer.
  8296. // void ::testing::internal::UniversalPrint(const T& value, ostream*);
  8297. //
  8298. // // Prints the fields of a tuple tersely to a string vector, one
  8299. // // element for each field. Tuple support must be enabled in
  8300. // // gtest-port.h.
  8301. // std::vector<string> UniversalTersePrintTupleFieldsToStrings(
  8302. // const Tuple& value);
  8303. //
  8304. // Known limitation:
  8305. //
  8306. // The print primitives print the elements of an STL-style container
  8307. // using the compiler-inferred type of *iter where iter is a
  8308. // const_iterator of the container. When const_iterator is an input
  8309. // iterator but not a forward iterator, this inferred type may not
  8310. // match value_type, and the print output may be incorrect. In
  8311. // practice, this is rarely a problem as for most containers
  8312. // const_iterator is a forward iterator. We'll fix this if there's an
  8313. // actual need for it. Note that this fix cannot rely on value_type
  8314. // being defined as many user-defined container types don't have
  8315. // value_type.
  8316. #ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
  8317. #define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
  8318. #include <ostream> // NOLINT
  8319. #include <sstream>
  8320. #include <string>
  8321. #include <utility>
  8322. #include <vector>
  8323. namespace testing {
  8324. // Definitions in the 'internal' and 'internal2' name spaces are
  8325. // subject to change without notice. DO NOT USE THEM IN USER CODE!
  8326. namespace internal2 {
  8327. // Prints the given number of bytes in the given object to the given
  8328. // ostream.
  8329. GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
  8330. size_t count,
  8331. ::std::ostream* os);
  8332. // For selecting which printer to use when a given type has neither <<
  8333. // nor PrintTo().
  8334. enum TypeKind {
  8335. kProtobuf, // a protobuf type
  8336. kConvertibleToInteger, // a type implicitly convertible to BiggestInt
  8337. // (e.g. a named or unnamed enum type)
  8338. kOtherType // anything else
  8339. };
  8340. // TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
  8341. // by the universal printer to print a value of type T when neither
  8342. // operator<< nor PrintTo() is defined for T, where kTypeKind is the
  8343. // "kind" of T as defined by enum TypeKind.
  8344. template <typename T, TypeKind kTypeKind>
  8345. class TypeWithoutFormatter {
  8346. public:
  8347. // This default version is called when kTypeKind is kOtherType.
  8348. static void PrintValue(const T& value, ::std::ostream* os) {
  8349. PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value),
  8350. sizeof(value), os);
  8351. }
  8352. };
  8353. // We print a protobuf using its ShortDebugString() when the string
  8354. // doesn't exceed this many characters; otherwise we print it using
  8355. // DebugString() for better readability.
  8356. const size_t kProtobufOneLinerMaxLength = 50;
  8357. template <typename T>
  8358. class TypeWithoutFormatter<T, kProtobuf> {
  8359. public:
  8360. static void PrintValue(const T& value, ::std::ostream* os) {
  8361. const ::testing::internal::string short_str = value.ShortDebugString();
  8362. const ::testing::internal::string pretty_str =
  8363. short_str.length() <= kProtobufOneLinerMaxLength ?
  8364. short_str : ("\n" + value.DebugString());
  8365. *os << ("<" + pretty_str + ">");
  8366. }
  8367. };
  8368. template <typename T>
  8369. class TypeWithoutFormatter<T, kConvertibleToInteger> {
  8370. public:
  8371. // Since T has no << operator or PrintTo() but can be implicitly
  8372. // converted to BiggestInt, we print it as a BiggestInt.
  8373. //
  8374. // Most likely T is an enum type (either named or unnamed), in which
  8375. // case printing it as an integer is the desired behavior. In case
  8376. // T is not an enum, printing it as an integer is the best we can do
  8377. // given that it has no user-defined printer.
  8378. static void PrintValue(const T& value, ::std::ostream* os) {
  8379. const internal::BiggestInt kBigInt = value;
  8380. *os << kBigInt;
  8381. }
  8382. };
  8383. // Prints the given value to the given ostream. If the value is a
  8384. // protocol message, its debug string is printed; if it's an enum or
  8385. // of a type implicitly convertible to BiggestInt, it's printed as an
  8386. // integer; otherwise the bytes in the value are printed. This is
  8387. // what UniversalPrinter<T>::Print() does when it knows nothing about
  8388. // type T and T has neither << operator nor PrintTo().
  8389. //
  8390. // A user can override this behavior for a class type Foo by defining
  8391. // a << operator in the namespace where Foo is defined.
  8392. //
  8393. // We put this operator in namespace 'internal2' instead of 'internal'
  8394. // to simplify the implementation, as much code in 'internal' needs to
  8395. // use << in STL, which would conflict with our own << were it defined
  8396. // in 'internal'.
  8397. //
  8398. // Note that this operator<< takes a generic std::basic_ostream<Char,
  8399. // CharTraits> type instead of the more restricted std::ostream. If
  8400. // we define it to take an std::ostream instead, we'll get an
  8401. // "ambiguous overloads" compiler error when trying to print a type
  8402. // Foo that supports streaming to std::basic_ostream<Char,
  8403. // CharTraits>, as the compiler cannot tell whether
  8404. // operator<<(std::ostream&, const T&) or
  8405. // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
  8406. // specific.
  8407. template <typename Char, typename CharTraits, typename T>
  8408. ::std::basic_ostream<Char, CharTraits>& operator<<(
  8409. ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
  8410. TypeWithoutFormatter<T,
  8411. (internal::IsAProtocolMessage<T>::value ? kProtobuf :
  8412. internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ?
  8413. kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
  8414. return os;
  8415. }
  8416. } // namespace internal2
  8417. } // namespace testing
  8418. // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
  8419. // magic needed for implementing UniversalPrinter won't work.
  8420. namespace testing_internal {
  8421. // Used to print a value that is not an STL-style container when the
  8422. // user doesn't define PrintTo() for it.
  8423. template <typename T>
  8424. void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
  8425. // With the following statement, during unqualified name lookup,
  8426. // testing::internal2::operator<< appears as if it was declared in
  8427. // the nearest enclosing namespace that contains both
  8428. // ::testing_internal and ::testing::internal2, i.e. the global
  8429. // namespace. For more details, refer to the C++ Standard section
  8430. // 7.3.4-1 [namespace.udir]. This allows us to fall back onto
  8431. // testing::internal2::operator<< in case T doesn't come with a <<
  8432. // operator.
  8433. //
  8434. // We cannot write 'using ::testing::internal2::operator<<;', which
  8435. // gcc 3.3 fails to compile due to a compiler bug.
  8436. using namespace ::testing::internal2; // NOLINT
  8437. // Assuming T is defined in namespace foo, in the next statement,
  8438. // the compiler will consider all of:
  8439. //
  8440. // 1. foo::operator<< (thanks to Koenig look-up),
  8441. // 2. ::operator<< (as the current namespace is enclosed in ::),
  8442. // 3. testing::internal2::operator<< (thanks to the using statement above).
  8443. //
  8444. // The operator<< whose type matches T best will be picked.
  8445. //
  8446. // We deliberately allow #2 to be a candidate, as sometimes it's
  8447. // impossible to define #1 (e.g. when foo is ::std, defining
  8448. // anything in it is undefined behavior unless you are a compiler
  8449. // vendor.).
  8450. *os << value;
  8451. }
  8452. } // namespace testing_internal
  8453. namespace testing {
  8454. namespace internal {
  8455. // UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
  8456. // value to the given ostream. The caller must ensure that
  8457. // 'ostream_ptr' is not NULL, or the behavior is undefined.
  8458. //
  8459. // We define UniversalPrinter as a class template (as opposed to a
  8460. // function template), as we need to partially specialize it for
  8461. // reference types, which cannot be done with function templates.
  8462. template <typename T>
  8463. class UniversalPrinter;
  8464. template <typename T>
  8465. void UniversalPrint(const T& value, ::std::ostream* os);
  8466. // Used to print an STL-style container when the user doesn't define
  8467. // a PrintTo() for it.
  8468. template <typename C>
  8469. void DefaultPrintTo(IsContainer /* dummy */,
  8470. false_type /* is not a pointer */,
  8471. const C& container, ::std::ostream* os) {
  8472. const size_t kMaxCount = 32; // The maximum number of elements to print.
  8473. *os << '{';
  8474. size_t count = 0;
  8475. for (typename C::const_iterator it = container.begin();
  8476. it != container.end(); ++it, ++count) {
  8477. if (count > 0) {
  8478. *os << ',';
  8479. if (count == kMaxCount) { // Enough has been printed.
  8480. *os << " ...";
  8481. break;
  8482. }
  8483. }
  8484. *os << ' ';
  8485. // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
  8486. // handle *it being a native array.
  8487. internal::UniversalPrint(*it, os);
  8488. }
  8489. if (count > 0) {
  8490. *os << ' ';
  8491. }
  8492. *os << '}';
  8493. }
  8494. // Used to print a pointer that is neither a char pointer nor a member
  8495. // pointer, when the user doesn't define PrintTo() for it. (A member
  8496. // variable pointer or member function pointer doesn't really point to
  8497. // a location in the address space. Their representation is
  8498. // implementation-defined. Therefore they will be printed as raw
  8499. // bytes.)
  8500. template <typename T>
  8501. void DefaultPrintTo(IsNotContainer /* dummy */,
  8502. true_type /* is a pointer */,
  8503. T* p, ::std::ostream* os) {
  8504. if (p == NULL) {
  8505. *os << "NULL";
  8506. } else {
  8507. // C++ doesn't allow casting from a function pointer to any object
  8508. // pointer.
  8509. //
  8510. // IsTrue() silences warnings: "Condition is always true",
  8511. // "unreachable code".
  8512. if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {
  8513. // T is not a function type. We just call << to print p,
  8514. // relying on ADL to pick up user-defined << for their pointer
  8515. // types, if any.
  8516. *os << p;
  8517. } else {
  8518. // T is a function type, so '*os << p' doesn't do what we want
  8519. // (it just prints p as bool). We want to print p as a const
  8520. // void*. However, we cannot cast it to const void* directly,
  8521. // even using reinterpret_cast, as earlier versions of gcc
  8522. // (e.g. 3.4.5) cannot compile the cast when p is a function
  8523. // pointer. Casting to UInt64 first solves the problem.
  8524. *os << reinterpret_cast<const void*>(
  8525. reinterpret_cast<internal::UInt64>(p));
  8526. }
  8527. }
  8528. }
  8529. // Used to print a non-container, non-pointer value when the user
  8530. // doesn't define PrintTo() for it.
  8531. template <typename T>
  8532. void DefaultPrintTo(IsNotContainer /* dummy */,
  8533. false_type /* is not a pointer */,
  8534. const T& value, ::std::ostream* os) {
  8535. ::testing_internal::DefaultPrintNonContainerTo(value, os);
  8536. }
  8537. // Prints the given value using the << operator if it has one;
  8538. // otherwise prints the bytes in it. This is what
  8539. // UniversalPrinter<T>::Print() does when PrintTo() is not specialized
  8540. // or overloaded for type T.
  8541. //
  8542. // A user can override this behavior for a class type Foo by defining
  8543. // an overload of PrintTo() in the namespace where Foo is defined. We
  8544. // give the user this option as sometimes defining a << operator for
  8545. // Foo is not desirable (e.g. the coding style may prevent doing it,
  8546. // or there is already a << operator but it doesn't do what the user
  8547. // wants).
  8548. template <typename T>
  8549. void PrintTo(const T& value, ::std::ostream* os) {
  8550. // DefaultPrintTo() is overloaded. The type of its first two
  8551. // arguments determine which version will be picked. If T is an
  8552. // STL-style container, the version for container will be called; if
  8553. // T is a pointer, the pointer version will be called; otherwise the
  8554. // generic version will be called.
  8555. //
  8556. // Note that we check for container types here, prior to we check
  8557. // for protocol message types in our operator<<. The rationale is:
  8558. //
  8559. // For protocol messages, we want to give people a chance to
  8560. // override Google Mock's format by defining a PrintTo() or
  8561. // operator<<. For STL containers, other formats can be
  8562. // incompatible with Google Mock's format for the container
  8563. // elements; therefore we check for container types here to ensure
  8564. // that our format is used.
  8565. //
  8566. // The second argument of DefaultPrintTo() is needed to bypass a bug
  8567. // in Symbian's C++ compiler that prevents it from picking the right
  8568. // overload between:
  8569. //
  8570. // PrintTo(const T& x, ...);
  8571. // PrintTo(T* x, ...);
  8572. DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);
  8573. }
  8574. // The following list of PrintTo() overloads tells
  8575. // UniversalPrinter<T>::Print() how to print standard types (built-in
  8576. // types, strings, plain arrays, and pointers).
  8577. // Overloads for various char types.
  8578. GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
  8579. GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
  8580. inline void PrintTo(char c, ::std::ostream* os) {
  8581. // When printing a plain char, we always treat it as unsigned. This
  8582. // way, the output won't be affected by whether the compiler thinks
  8583. // char is signed or not.
  8584. PrintTo(static_cast<unsigned char>(c), os);
  8585. }
  8586. // Overloads for other simple built-in types.
  8587. inline void PrintTo(bool x, ::std::ostream* os) {
  8588. *os << (x ? "true" : "false");
  8589. }
  8590. // Overload for wchar_t type.
  8591. // Prints a wchar_t as a symbol if it is printable or as its internal
  8592. // code otherwise and also as its decimal code (except for L'\0').
  8593. // The L'\0' char is printed as "L'\\0'". The decimal code is printed
  8594. // as signed integer when wchar_t is implemented by the compiler
  8595. // as a signed type and is printed as an unsigned integer when wchar_t
  8596. // is implemented as an unsigned type.
  8597. GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
  8598. // Overloads for C strings.
  8599. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
  8600. inline void PrintTo(char* s, ::std::ostream* os) {
  8601. PrintTo(ImplicitCast_<const char*>(s), os);
  8602. }
  8603. // signed/unsigned char is often used for representing binary data, so
  8604. // we print pointers to it as void* to be safe.
  8605. inline void PrintTo(const signed char* s, ::std::ostream* os) {
  8606. PrintTo(ImplicitCast_<const void*>(s), os);
  8607. }
  8608. inline void PrintTo(signed char* s, ::std::ostream* os) {
  8609. PrintTo(ImplicitCast_<const void*>(s), os);
  8610. }
  8611. inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
  8612. PrintTo(ImplicitCast_<const void*>(s), os);
  8613. }
  8614. inline void PrintTo(unsigned char* s, ::std::ostream* os) {
  8615. PrintTo(ImplicitCast_<const void*>(s), os);
  8616. }
  8617. // MSVC can be configured to define wchar_t as a typedef of unsigned
  8618. // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
  8619. // type. When wchar_t is a typedef, defining an overload for const
  8620. // wchar_t* would cause unsigned short* be printed as a wide string,
  8621. // possibly causing invalid memory accesses.
  8622. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
  8623. // Overloads for wide C strings
  8624. GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
  8625. inline void PrintTo(wchar_t* s, ::std::ostream* os) {
  8626. PrintTo(ImplicitCast_<const wchar_t*>(s), os);
  8627. }
  8628. #endif
  8629. // Overload for C arrays. Multi-dimensional arrays are printed
  8630. // properly.
  8631. // Prints the given number of elements in an array, without printing
  8632. // the curly braces.
  8633. template <typename T>
  8634. void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
  8635. UniversalPrint(a[0], os);
  8636. for (size_t i = 1; i != count; i++) {
  8637. *os << ", ";
  8638. UniversalPrint(a[i], os);
  8639. }
  8640. }
  8641. // Overloads for ::string and ::std::string.
  8642. #if GTEST_HAS_GLOBAL_STRING
  8643. GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
  8644. inline void PrintTo(const ::string& s, ::std::ostream* os) {
  8645. PrintStringTo(s, os);
  8646. }
  8647. #endif // GTEST_HAS_GLOBAL_STRING
  8648. GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
  8649. inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
  8650. PrintStringTo(s, os);
  8651. }
  8652. // Overloads for ::wstring and ::std::wstring.
  8653. #if GTEST_HAS_GLOBAL_WSTRING
  8654. GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
  8655. inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
  8656. PrintWideStringTo(s, os);
  8657. }
  8658. #endif // GTEST_HAS_GLOBAL_WSTRING
  8659. #if GTEST_HAS_STD_WSTRING
  8660. GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
  8661. inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
  8662. PrintWideStringTo(s, os);
  8663. }
  8664. #endif // GTEST_HAS_STD_WSTRING
  8665. #if GTEST_HAS_TR1_TUPLE
  8666. // Overload for ::std::tr1::tuple. Needed for printing function arguments,
  8667. // which are packed as tuples.
  8668. // Helper function for printing a tuple. T must be instantiated with
  8669. // a tuple type.
  8670. template <typename T>
  8671. void PrintTupleTo(const T& t, ::std::ostream* os);
  8672. // Overloaded PrintTo() for tuples of various arities. We support
  8673. // tuples of up-to 10 fields. The following implementation works
  8674. // regardless of whether tr1::tuple is implemented using the
  8675. // non-standard variadic template feature or not.
  8676. inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
  8677. PrintTupleTo(t, os);
  8678. }
  8679. template <typename T1>
  8680. void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
  8681. PrintTupleTo(t, os);
  8682. }
  8683. template <typename T1, typename T2>
  8684. void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
  8685. PrintTupleTo(t, os);
  8686. }
  8687. template <typename T1, typename T2, typename T3>
  8688. void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
  8689. PrintTupleTo(t, os);
  8690. }
  8691. template <typename T1, typename T2, typename T3, typename T4>
  8692. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
  8693. PrintTupleTo(t, os);
  8694. }
  8695. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  8696. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
  8697. ::std::ostream* os) {
  8698. PrintTupleTo(t, os);
  8699. }
  8700. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  8701. typename T6>
  8702. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
  8703. ::std::ostream* os) {
  8704. PrintTupleTo(t, os);
  8705. }
  8706. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  8707. typename T6, typename T7>
  8708. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
  8709. ::std::ostream* os) {
  8710. PrintTupleTo(t, os);
  8711. }
  8712. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  8713. typename T6, typename T7, typename T8>
  8714. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
  8715. ::std::ostream* os) {
  8716. PrintTupleTo(t, os);
  8717. }
  8718. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  8719. typename T6, typename T7, typename T8, typename T9>
  8720. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
  8721. ::std::ostream* os) {
  8722. PrintTupleTo(t, os);
  8723. }
  8724. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  8725. typename T6, typename T7, typename T8, typename T9, typename T10>
  8726. void PrintTo(
  8727. const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
  8728. ::std::ostream* os) {
  8729. PrintTupleTo(t, os);
  8730. }
  8731. #endif // GTEST_HAS_TR1_TUPLE
  8732. // Overload for std::pair.
  8733. template <typename T1, typename T2>
  8734. void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
  8735. *os << '(';
  8736. // We cannot use UniversalPrint(value.first, os) here, as T1 may be
  8737. // a reference type. The same for printing value.second.
  8738. UniversalPrinter<T1>::Print(value.first, os);
  8739. *os << ", ";
  8740. UniversalPrinter<T2>::Print(value.second, os);
  8741. *os << ')';
  8742. }
  8743. // Implements printing a non-reference type T by letting the compiler
  8744. // pick the right overload of PrintTo() for T.
  8745. template <typename T>
  8746. class UniversalPrinter {
  8747. public:
  8748. // MSVC warns about adding const to a function type, so we want to
  8749. // disable the warning.
  8750. #ifdef _MSC_VER
  8751. # pragma warning(push) // Saves the current warning state.
  8752. # pragma warning(disable:4180) // Temporarily disables warning 4180.
  8753. #endif // _MSC_VER
  8754. // Note: we deliberately don't call this PrintTo(), as that name
  8755. // conflicts with ::testing::internal::PrintTo in the body of the
  8756. // function.
  8757. static void Print(const T& value, ::std::ostream* os) {
  8758. // By default, ::testing::internal::PrintTo() is used for printing
  8759. // the value.
  8760. //
  8761. // Thanks to Koenig look-up, if T is a class and has its own
  8762. // PrintTo() function defined in its namespace, that function will
  8763. // be visible here. Since it is more specific than the generic ones
  8764. // in ::testing::internal, it will be picked by the compiler in the
  8765. // following statement - exactly what we want.
  8766. PrintTo(value, os);
  8767. }
  8768. #ifdef _MSC_VER
  8769. # pragma warning(pop) // Restores the warning state.
  8770. #endif // _MSC_VER
  8771. };
  8772. // UniversalPrintArray(begin, len, os) prints an array of 'len'
  8773. // elements, starting at address 'begin'.
  8774. template <typename T>
  8775. void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
  8776. if (len == 0) {
  8777. *os << "{}";
  8778. } else {
  8779. *os << "{ ";
  8780. const size_t kThreshold = 18;
  8781. const size_t kChunkSize = 8;
  8782. // If the array has more than kThreshold elements, we'll have to
  8783. // omit some details by printing only the first and the last
  8784. // kChunkSize elements.
  8785. // TODO([email protected]): let the user control the threshold using a flag.
  8786. if (len <= kThreshold) {
  8787. PrintRawArrayTo(begin, len, os);
  8788. } else {
  8789. PrintRawArrayTo(begin, kChunkSize, os);
  8790. *os << ", ..., ";
  8791. PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
  8792. }
  8793. *os << " }";
  8794. }
  8795. }
  8796. // This overload prints a (const) char array compactly.
  8797. GTEST_API_ void UniversalPrintArray(const char* begin,
  8798. size_t len,
  8799. ::std::ostream* os);
  8800. // Implements printing an array type T[N].
  8801. template <typename T, size_t N>
  8802. class UniversalPrinter<T[N]> {
  8803. public:
  8804. // Prints the given array, omitting some elements when there are too
  8805. // many.
  8806. static void Print(const T (&a)[N], ::std::ostream* os) {
  8807. UniversalPrintArray(a, N, os);
  8808. }
  8809. };
  8810. // Implements printing a reference type T&.
  8811. template <typename T>
  8812. class UniversalPrinter<T&> {
  8813. public:
  8814. // MSVC warns about adding const to a function type, so we want to
  8815. // disable the warning.
  8816. #ifdef _MSC_VER
  8817. # pragma warning(push) // Saves the current warning state.
  8818. # pragma warning(disable:4180) // Temporarily disables warning 4180.
  8819. #endif // _MSC_VER
  8820. static void Print(const T& value, ::std::ostream* os) {
  8821. // Prints the address of the value. We use reinterpret_cast here
  8822. // as static_cast doesn't compile when T is a function type.
  8823. *os << "@" << reinterpret_cast<const void*>(&value) << " ";
  8824. // Then prints the value itself.
  8825. UniversalPrint(value, os);
  8826. }
  8827. #ifdef _MSC_VER
  8828. # pragma warning(pop) // Restores the warning state.
  8829. #endif // _MSC_VER
  8830. };
  8831. // Prints a value tersely: for a reference type, the referenced value
  8832. // (but not the address) is printed; for a (const) char pointer, the
  8833. // NUL-terminated string (but not the pointer) is printed.
  8834. template <typename T>
  8835. void UniversalTersePrint(const T& value, ::std::ostream* os) {
  8836. UniversalPrint(value, os);
  8837. }
  8838. inline void UniversalTersePrint(const char* str, ::std::ostream* os) {
  8839. if (str == NULL) {
  8840. *os << "NULL";
  8841. } else {
  8842. UniversalPrint(string(str), os);
  8843. }
  8844. }
  8845. inline void UniversalTersePrint(char* str, ::std::ostream* os) {
  8846. UniversalTersePrint(static_cast<const char*>(str), os);
  8847. }
  8848. // Prints a value using the type inferred by the compiler. The
  8849. // difference between this and UniversalTersePrint() is that for a
  8850. // (const) char pointer, this prints both the pointer and the
  8851. // NUL-terminated string.
  8852. template <typename T>
  8853. void UniversalPrint(const T& value, ::std::ostream* os) {
  8854. UniversalPrinter<T>::Print(value, os);
  8855. }
  8856. #if GTEST_HAS_TR1_TUPLE
  8857. typedef ::std::vector<string> Strings;
  8858. // This helper template allows PrintTo() for tuples and
  8859. // UniversalTersePrintTupleFieldsToStrings() to be defined by
  8860. // induction on the number of tuple fields. The idea is that
  8861. // TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
  8862. // fields in tuple t, and can be defined in terms of
  8863. // TuplePrefixPrinter<N - 1>.
  8864. // The inductive case.
  8865. template <size_t N>
  8866. struct TuplePrefixPrinter {
  8867. // Prints the first N fields of a tuple.
  8868. template <typename Tuple>
  8869. static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
  8870. TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
  8871. *os << ", ";
  8872. UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>
  8873. ::Print(::std::tr1::get<N - 1>(t), os);
  8874. }
  8875. // Tersely prints the first N fields of a tuple to a string vector,
  8876. // one element for each field.
  8877. template <typename Tuple>
  8878. static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
  8879. TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
  8880. ::std::stringstream ss;
  8881. UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);
  8882. strings->push_back(ss.str());
  8883. }
  8884. };
  8885. // Base cases.
  8886. template <>
  8887. struct TuplePrefixPrinter<0> {
  8888. template <typename Tuple>
  8889. static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
  8890. template <typename Tuple>
  8891. static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
  8892. };
  8893. // We have to specialize the entire TuplePrefixPrinter<> class
  8894. // template here, even though the definition of
  8895. // TersePrintPrefixToStrings() is the same as the generic version, as
  8896. // Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't
  8897. // support specializing a method template of a class template.
  8898. template <>
  8899. struct TuplePrefixPrinter<1> {
  8900. template <typename Tuple>
  8901. static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
  8902. UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::
  8903. Print(::std::tr1::get<0>(t), os);
  8904. }
  8905. template <typename Tuple>
  8906. static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
  8907. ::std::stringstream ss;
  8908. UniversalTersePrint(::std::tr1::get<0>(t), &ss);
  8909. strings->push_back(ss.str());
  8910. }
  8911. };
  8912. // Helper function for printing a tuple. T must be instantiated with
  8913. // a tuple type.
  8914. template <typename T>
  8915. void PrintTupleTo(const T& t, ::std::ostream* os) {
  8916. *os << "(";
  8917. TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::
  8918. PrintPrefixTo(t, os);
  8919. *os << ")";
  8920. }
  8921. // Prints the fields of a tuple tersely to a string vector, one
  8922. // element for each field. See the comment before
  8923. // UniversalTersePrint() for how we define "tersely".
  8924. template <typename Tuple>
  8925. Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
  8926. Strings result;
  8927. TuplePrefixPrinter< ::std::tr1::tuple_size<Tuple>::value>::
  8928. TersePrintPrefixToStrings(value, &result);
  8929. return result;
  8930. }
  8931. #endif // GTEST_HAS_TR1_TUPLE
  8932. } // namespace internal
  8933. template <typename T>
  8934. ::std::string PrintToString(const T& value) {
  8935. ::std::stringstream ss;
  8936. internal::UniversalTersePrint(value, &ss);
  8937. return ss.str();
  8938. }
  8939. } // namespace testing
  8940. #endif // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
  8941. #if GTEST_HAS_PARAM_TEST
  8942. namespace testing {
  8943. namespace internal {
  8944. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  8945. //
  8946. // Outputs a message explaining invalid registration of different
  8947. // fixture class for the same test case. This may happen when
  8948. // TEST_P macro is used to define two tests with the same name
  8949. // but in different namespaces.
  8950. GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
  8951. const char* file, int line);
  8952. template <typename> class ParamGeneratorInterface;
  8953. template <typename> class ParamGenerator;
  8954. // Interface for iterating over elements provided by an implementation
  8955. // of ParamGeneratorInterface<T>.
  8956. template <typename T>
  8957. class ParamIteratorInterface {
  8958. public:
  8959. virtual ~ParamIteratorInterface() {}
  8960. // A pointer to the base generator instance.
  8961. // Used only for the purposes of iterator comparison
  8962. // to make sure that two iterators belong to the same generator.
  8963. virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
  8964. // Advances iterator to point to the next element
  8965. // provided by the generator. The caller is responsible
  8966. // for not calling Advance() on an iterator equal to
  8967. // BaseGenerator()->End().
  8968. virtual void Advance() = 0;
  8969. // Clones the iterator object. Used for implementing copy semantics
  8970. // of ParamIterator<T>.
  8971. virtual ParamIteratorInterface* Clone() const = 0;
  8972. // Dereferences the current iterator and provides (read-only) access
  8973. // to the pointed value. It is the caller's responsibility not to call
  8974. // Current() on an iterator equal to BaseGenerator()->End().
  8975. // Used for implementing ParamGenerator<T>::operator*().
  8976. virtual const T* Current() const = 0;
  8977. // Determines whether the given iterator and other point to the same
  8978. // element in the sequence generated by the generator.
  8979. // Used for implementing ParamGenerator<T>::operator==().
  8980. virtual bool Equals(const ParamIteratorInterface& other) const = 0;
  8981. };
  8982. // Class iterating over elements provided by an implementation of
  8983. // ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
  8984. // and implements the const forward iterator concept.
  8985. template <typename T>
  8986. class ParamIterator {
  8987. public:
  8988. typedef T value_type;
  8989. typedef const T& reference;
  8990. typedef ptrdiff_t difference_type;
  8991. // ParamIterator assumes ownership of the impl_ pointer.
  8992. ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
  8993. ParamIterator& operator=(const ParamIterator& other) {
  8994. if (this != &other)
  8995. impl_.reset(other.impl_->Clone());
  8996. return *this;
  8997. }
  8998. const T& operator*() const { return *impl_->Current(); }
  8999. const T* operator->() const { return impl_->Current(); }
  9000. // Prefix version of operator++.
  9001. ParamIterator& operator++() {
  9002. impl_->Advance();
  9003. return *this;
  9004. }
  9005. // Postfix version of operator++.
  9006. ParamIterator operator++(int /*unused*/) {
  9007. ParamIteratorInterface<T>* clone = impl_->Clone();
  9008. impl_->Advance();
  9009. return ParamIterator(clone);
  9010. }
  9011. bool operator==(const ParamIterator& other) const {
  9012. return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
  9013. }
  9014. bool operator!=(const ParamIterator& other) const {
  9015. return !(*this == other);
  9016. }
  9017. private:
  9018. friend class ParamGenerator<T>;
  9019. explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
  9020. scoped_ptr<ParamIteratorInterface<T> > impl_;
  9021. };
  9022. // ParamGeneratorInterface<T> is the binary interface to access generators
  9023. // defined in other translation units.
  9024. template <typename T>
  9025. class ParamGeneratorInterface {
  9026. public:
  9027. typedef T ParamType;
  9028. virtual ~ParamGeneratorInterface() {}
  9029. // Generator interface definition
  9030. virtual ParamIteratorInterface<T>* Begin() const = 0;
  9031. virtual ParamIteratorInterface<T>* End() const = 0;
  9032. };
  9033. // Wraps ParamGeneratorInterface<T> and provides general generator syntax
  9034. // compatible with the STL Container concept.
  9035. // This class implements copy initialization semantics and the contained
  9036. // ParamGeneratorInterface<T> instance is shared among all copies
  9037. // of the original object. This is possible because that instance is immutable.
  9038. template<typename T>
  9039. class ParamGenerator {
  9040. public:
  9041. typedef ParamIterator<T> iterator;
  9042. explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
  9043. ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
  9044. ParamGenerator& operator=(const ParamGenerator& other) {
  9045. impl_ = other.impl_;
  9046. return *this;
  9047. }
  9048. iterator begin() const { return iterator(impl_->Begin()); }
  9049. iterator end() const { return iterator(impl_->End()); }
  9050. private:
  9051. linked_ptr<const ParamGeneratorInterface<T> > impl_;
  9052. };
  9053. // Generates values from a range of two comparable values. Can be used to
  9054. // generate sequences of user-defined types that implement operator+() and
  9055. // operator<().
  9056. // This class is used in the Range() function.
  9057. template <typename T, typename IncrementT>
  9058. class RangeGenerator : public ParamGeneratorInterface<T> {
  9059. public:
  9060. RangeGenerator(T begin, T end, IncrementT step)
  9061. : begin_(begin), end_(end),
  9062. step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
  9063. virtual ~RangeGenerator() {}
  9064. virtual ParamIteratorInterface<T>* Begin() const {
  9065. return new Iterator(this, begin_, 0, step_);
  9066. }
  9067. virtual ParamIteratorInterface<T>* End() const {
  9068. return new Iterator(this, end_, end_index_, step_);
  9069. }
  9070. private:
  9071. class Iterator : public ParamIteratorInterface<T> {
  9072. public:
  9073. Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
  9074. IncrementT step)
  9075. : base_(base), value_(value), index_(index), step_(step) {}
  9076. virtual ~Iterator() {}
  9077. virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
  9078. return base_;
  9079. }
  9080. virtual void Advance() {
  9081. value_ = value_ + step_;
  9082. index_++;
  9083. }
  9084. virtual ParamIteratorInterface<T>* Clone() const {
  9085. return new Iterator(*this);
  9086. }
  9087. virtual const T* Current() const { return &value_; }
  9088. virtual bool Equals(const ParamIteratorInterface<T>& other) const {
  9089. // Having the same base generator guarantees that the other
  9090. // iterator is of the same type and we can downcast.
  9091. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  9092. << "The program attempted to compare iterators "
  9093. << "from different generators." << std::endl;
  9094. const int other_index =
  9095. CheckedDowncastToActualType<const Iterator>(&other)->index_;
  9096. return index_ == other_index;
  9097. }
  9098. private:
  9099. Iterator(const Iterator& other)
  9100. : ParamIteratorInterface<T>(),
  9101. base_(other.base_), value_(other.value_), index_(other.index_),
  9102. step_(other.step_) {}
  9103. // No implementation - assignment is unsupported.
  9104. void operator=(const Iterator& other);
  9105. const ParamGeneratorInterface<T>* const base_;
  9106. T value_;
  9107. int index_;
  9108. const IncrementT step_;
  9109. }; // class RangeGenerator::Iterator
  9110. static int CalculateEndIndex(const T& begin,
  9111. const T& end,
  9112. const IncrementT& step) {
  9113. int end_index = 0;
  9114. for (T i = begin; i < end; i = i + step)
  9115. end_index++;
  9116. return end_index;
  9117. }
  9118. // No implementation - assignment is unsupported.
  9119. void operator=(const RangeGenerator& other);
  9120. const T begin_;
  9121. const T end_;
  9122. const IncrementT step_;
  9123. // The index for the end() iterator. All the elements in the generated
  9124. // sequence are indexed (0-based) to aid iterator comparison.
  9125. const int end_index_;
  9126. }; // class RangeGenerator
  9127. // Generates values from a pair of STL-style iterators. Used in the
  9128. // ValuesIn() function. The elements are copied from the source range
  9129. // since the source can be located on the stack, and the generator
  9130. // is likely to persist beyond that stack frame.
  9131. template <typename T>
  9132. class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
  9133. public:
  9134. template <typename ForwardIterator>
  9135. ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
  9136. : container_(begin, end) {}
  9137. virtual ~ValuesInIteratorRangeGenerator() {}
  9138. virtual ParamIteratorInterface<T>* Begin() const {
  9139. return new Iterator(this, container_.begin());
  9140. }
  9141. virtual ParamIteratorInterface<T>* End() const {
  9142. return new Iterator(this, container_.end());
  9143. }
  9144. private:
  9145. typedef typename ::std::vector<T> ContainerType;
  9146. class Iterator : public ParamIteratorInterface<T> {
  9147. public:
  9148. Iterator(const ParamGeneratorInterface<T>* base,
  9149. typename ContainerType::const_iterator iterator)
  9150. : base_(base), iterator_(iterator) {}
  9151. virtual ~Iterator() {}
  9152. virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
  9153. return base_;
  9154. }
  9155. virtual void Advance() {
  9156. ++iterator_;
  9157. value_.reset();
  9158. }
  9159. virtual ParamIteratorInterface<T>* Clone() const {
  9160. return new Iterator(*this);
  9161. }
  9162. // We need to use cached value referenced by iterator_ because *iterator_
  9163. // can return a temporary object (and of type other then T), so just
  9164. // having "return &*iterator_;" doesn't work.
  9165. // value_ is updated here and not in Advance() because Advance()
  9166. // can advance iterator_ beyond the end of the range, and we cannot
  9167. // detect that fact. The client code, on the other hand, is
  9168. // responsible for not calling Current() on an out-of-range iterator.
  9169. virtual const T* Current() const {
  9170. if (value_.get() == NULL)
  9171. value_.reset(new T(*iterator_));
  9172. return value_.get();
  9173. }
  9174. virtual bool Equals(const ParamIteratorInterface<T>& other) const {
  9175. // Having the same base generator guarantees that the other
  9176. // iterator is of the same type and we can downcast.
  9177. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  9178. << "The program attempted to compare iterators "
  9179. << "from different generators." << std::endl;
  9180. return iterator_ ==
  9181. CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
  9182. }
  9183. private:
  9184. Iterator(const Iterator& other)
  9185. // The explicit constructor call suppresses a false warning
  9186. // emitted by gcc when supplied with the -Wextra option.
  9187. : ParamIteratorInterface<T>(),
  9188. base_(other.base_),
  9189. iterator_(other.iterator_) {}
  9190. const ParamGeneratorInterface<T>* const base_;
  9191. typename ContainerType::const_iterator iterator_;
  9192. // A cached value of *iterator_. We keep it here to allow access by
  9193. // pointer in the wrapping iterator's operator->().
  9194. // value_ needs to be mutable to be accessed in Current().
  9195. // Use of scoped_ptr helps manage cached value's lifetime,
  9196. // which is bound by the lifespan of the iterator itself.
  9197. mutable scoped_ptr<const T> value_;
  9198. }; // class ValuesInIteratorRangeGenerator::Iterator
  9199. // No implementation - assignment is unsupported.
  9200. void operator=(const ValuesInIteratorRangeGenerator& other);
  9201. const ContainerType container_;
  9202. }; // class ValuesInIteratorRangeGenerator
  9203. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9204. //
  9205. // Stores a parameter value and later creates tests parameterized with that
  9206. // value.
  9207. template <class TestClass>
  9208. class ParameterizedTestFactory : public TestFactoryBase {
  9209. public:
  9210. typedef typename TestClass::ParamType ParamType;
  9211. explicit ParameterizedTestFactory(ParamType parameter) :
  9212. parameter_(parameter) {}
  9213. virtual Test* CreateTest() {
  9214. TestClass::SetParam(&parameter_);
  9215. return new TestClass();
  9216. }
  9217. private:
  9218. const ParamType parameter_;
  9219. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
  9220. };
  9221. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9222. //
  9223. // TestMetaFactoryBase is a base class for meta-factories that create
  9224. // test factories for passing into MakeAndRegisterTestInfo function.
  9225. template <class ParamType>
  9226. class TestMetaFactoryBase {
  9227. public:
  9228. virtual ~TestMetaFactoryBase() {}
  9229. virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
  9230. };
  9231. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9232. //
  9233. // TestMetaFactory creates test factories for passing into
  9234. // MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
  9235. // ownership of test factory pointer, same factory object cannot be passed
  9236. // into that method twice. But ParameterizedTestCaseInfo is going to call
  9237. // it for each Test/Parameter value combination. Thus it needs meta factory
  9238. // creator class.
  9239. template <class TestCase>
  9240. class TestMetaFactory
  9241. : public TestMetaFactoryBase<typename TestCase::ParamType> {
  9242. public:
  9243. typedef typename TestCase::ParamType ParamType;
  9244. TestMetaFactory() {}
  9245. virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
  9246. return new ParameterizedTestFactory<TestCase>(parameter);
  9247. }
  9248. private:
  9249. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
  9250. };
  9251. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9252. //
  9253. // ParameterizedTestCaseInfoBase is a generic interface
  9254. // to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
  9255. // accumulates test information provided by TEST_P macro invocations
  9256. // and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
  9257. // and uses that information to register all resulting test instances
  9258. // in RegisterTests method. The ParameterizeTestCaseRegistry class holds
  9259. // a collection of pointers to the ParameterizedTestCaseInfo objects
  9260. // and calls RegisterTests() on each of them when asked.
  9261. class ParameterizedTestCaseInfoBase {
  9262. public:
  9263. virtual ~ParameterizedTestCaseInfoBase() {}
  9264. // Base part of test case name for display purposes.
  9265. virtual const string& GetTestCaseName() const = 0;
  9266. // Test case id to verify identity.
  9267. virtual TypeId GetTestCaseTypeId() const = 0;
  9268. // UnitTest class invokes this method to register tests in this
  9269. // test case right before running them in RUN_ALL_TESTS macro.
  9270. // This method should not be called more then once on any single
  9271. // instance of a ParameterizedTestCaseInfoBase derived class.
  9272. virtual void RegisterTests() = 0;
  9273. protected:
  9274. ParameterizedTestCaseInfoBase() {}
  9275. private:
  9276. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
  9277. };
  9278. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9279. //
  9280. // ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
  9281. // macro invocations for a particular test case and generators
  9282. // obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
  9283. // test case. It registers tests with all values generated by all
  9284. // generators when asked.
  9285. template <class TestCase>
  9286. class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
  9287. public:
  9288. // ParamType and GeneratorCreationFunc are private types but are required
  9289. // for declarations of public methods AddTestPattern() and
  9290. // AddTestCaseInstantiation().
  9291. typedef typename TestCase::ParamType ParamType;
  9292. // A function that returns an instance of appropriate generator type.
  9293. typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
  9294. explicit ParameterizedTestCaseInfo(const char* name)
  9295. : test_case_name_(name) {}
  9296. // Test case base name for display purposes.
  9297. virtual const string& GetTestCaseName() const { return test_case_name_; }
  9298. // Test case id to verify identity.
  9299. virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
  9300. // TEST_P macro uses AddTestPattern() to record information
  9301. // about a single test in a LocalTestInfo structure.
  9302. // test_case_name is the base name of the test case (without invocation
  9303. // prefix). test_base_name is the name of an individual test without
  9304. // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
  9305. // test case base name and DoBar is test base name.
  9306. void AddTestPattern(const char* test_case_name,
  9307. const char* test_base_name,
  9308. TestMetaFactoryBase<ParamType>* meta_factory) {
  9309. tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
  9310. test_base_name,
  9311. meta_factory)));
  9312. }
  9313. // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
  9314. // about a generator.
  9315. int AddTestCaseInstantiation(const string& instantiation_name,
  9316. GeneratorCreationFunc* func,
  9317. const char* /* file */,
  9318. int /* line */) {
  9319. instantiations_.push_back(::std::make_pair(instantiation_name, func));
  9320. return 0; // Return value used only to run this method in namespace scope.
  9321. }
  9322. // UnitTest class invokes this method to register tests in this test case
  9323. // test cases right before running tests in RUN_ALL_TESTS macro.
  9324. // This method should not be called more then once on any single
  9325. // instance of a ParameterizedTestCaseInfoBase derived class.
  9326. // UnitTest has a guard to prevent from calling this method more then once.
  9327. virtual void RegisterTests() {
  9328. for (typename TestInfoContainer::iterator test_it = tests_.begin();
  9329. test_it != tests_.end(); ++test_it) {
  9330. linked_ptr<TestInfo> test_info = *test_it;
  9331. for (typename InstantiationContainer::iterator gen_it =
  9332. instantiations_.begin(); gen_it != instantiations_.end();
  9333. ++gen_it) {
  9334. const string& instantiation_name = gen_it->first;
  9335. ParamGenerator<ParamType> generator((*gen_it->second)());
  9336. Message test_case_name_stream;
  9337. if ( !instantiation_name.empty() )
  9338. test_case_name_stream << instantiation_name << "/";
  9339. test_case_name_stream << test_info->test_case_base_name;
  9340. int i = 0;
  9341. for (typename ParamGenerator<ParamType>::iterator param_it =
  9342. generator.begin();
  9343. param_it != generator.end(); ++param_it, ++i) {
  9344. Message test_name_stream;
  9345. test_name_stream << test_info->test_base_name << "/" << i;
  9346. MakeAndRegisterTestInfo(
  9347. test_case_name_stream.GetString().c_str(),
  9348. test_name_stream.GetString().c_str(),
  9349. NULL, // No type parameter.
  9350. PrintToString(*param_it).c_str(),
  9351. GetTestCaseTypeId(),
  9352. TestCase::SetUpTestCase,
  9353. TestCase::TearDownTestCase,
  9354. test_info->test_meta_factory->CreateTestFactory(*param_it));
  9355. } // for param_it
  9356. } // for gen_it
  9357. } // for test_it
  9358. } // RegisterTests
  9359. private:
  9360. // LocalTestInfo structure keeps information about a single test registered
  9361. // with TEST_P macro.
  9362. struct TestInfo {
  9363. TestInfo(const char* a_test_case_base_name,
  9364. const char* a_test_base_name,
  9365. TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
  9366. test_case_base_name(a_test_case_base_name),
  9367. test_base_name(a_test_base_name),
  9368. test_meta_factory(a_test_meta_factory) {}
  9369. const string test_case_base_name;
  9370. const string test_base_name;
  9371. const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
  9372. };
  9373. typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
  9374. // Keeps pairs of <Instantiation name, Sequence generator creation function>
  9375. // received from INSTANTIATE_TEST_CASE_P macros.
  9376. typedef ::std::vector<std::pair<string, GeneratorCreationFunc*> >
  9377. InstantiationContainer;
  9378. const string test_case_name_;
  9379. TestInfoContainer tests_;
  9380. InstantiationContainer instantiations_;
  9381. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
  9382. }; // class ParameterizedTestCaseInfo
  9383. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9384. //
  9385. // ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
  9386. // classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
  9387. // macros use it to locate their corresponding ParameterizedTestCaseInfo
  9388. // descriptors.
  9389. class ParameterizedTestCaseRegistry {
  9390. public:
  9391. ParameterizedTestCaseRegistry() {}
  9392. ~ParameterizedTestCaseRegistry() {
  9393. for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
  9394. it != test_case_infos_.end(); ++it) {
  9395. delete *it;
  9396. }
  9397. }
  9398. // Looks up or creates and returns a structure containing information about
  9399. // tests and instantiations of a particular test case.
  9400. template <class TestCase>
  9401. ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
  9402. const char* test_case_name,
  9403. const char* file,
  9404. int line) {
  9405. ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
  9406. for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
  9407. it != test_case_infos_.end(); ++it) {
  9408. if ((*it)->GetTestCaseName() == test_case_name) {
  9409. if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
  9410. // Complain about incorrect usage of Google Test facilities
  9411. // and terminate the program since we cannot guaranty correct
  9412. // test case setup and tear-down in this case.
  9413. ReportInvalidTestCaseType(test_case_name, file, line);
  9414. posix::Abort();
  9415. } else {
  9416. // At this point we are sure that the object we found is of the same
  9417. // type we are looking for, so we downcast it to that type
  9418. // without further checks.
  9419. typed_test_info = CheckedDowncastToActualType<
  9420. ParameterizedTestCaseInfo<TestCase> >(*it);
  9421. }
  9422. break;
  9423. }
  9424. }
  9425. if (typed_test_info == NULL) {
  9426. typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name);
  9427. test_case_infos_.push_back(typed_test_info);
  9428. }
  9429. return typed_test_info;
  9430. }
  9431. void RegisterTests() {
  9432. for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
  9433. it != test_case_infos_.end(); ++it) {
  9434. (*it)->RegisterTests();
  9435. }
  9436. }
  9437. private:
  9438. typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
  9439. TestCaseInfoContainer test_case_infos_;
  9440. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
  9441. };
  9442. } // namespace internal
  9443. } // namespace testing
  9444. #endif // GTEST_HAS_PARAM_TEST
  9445. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
  9446. // This file was GENERATED by command:
  9447. // pump.py gtest-param-util-generated.h.pump
  9448. // DO NOT EDIT BY HAND!!!
  9449. // Copyright 2008 Google Inc.
  9450. // All Rights Reserved.
  9451. //
  9452. // Redistribution and use in source and binary forms, with or without
  9453. // modification, are permitted provided that the following conditions are
  9454. // met:
  9455. //
  9456. // * Redistributions of source code must retain the above copyright
  9457. // notice, this list of conditions and the following disclaimer.
  9458. // * Redistributions in binary form must reproduce the above
  9459. // copyright notice, this list of conditions and the following disclaimer
  9460. // in the documentation and/or other materials provided with the
  9461. // distribution.
  9462. // * Neither the name of Google Inc. nor the names of its
  9463. // contributors may be used to endorse or promote products derived from
  9464. // this software without specific prior written permission.
  9465. //
  9466. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  9467. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  9468. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  9469. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  9470. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  9471. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  9472. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  9473. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  9474. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  9475. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  9476. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  9477. //
  9478. // Author: [email protected] (Vlad Losev)
  9479. // Type and function utilities for implementing parameterized tests.
  9480. // This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
  9481. //
  9482. // Currently Google Test supports at most 50 arguments in Values,
  9483. // and at most 10 arguments in Combine. Please contact
  9484. // [email protected] if you need more.
  9485. // Please note that the number of arguments to Combine is limited
  9486. // by the maximum arity of the implementation of tr1::tuple which is
  9487. // currently set at 10.
  9488. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
  9489. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
  9490. // scripts/fuse_gtest.py depends on gtest's own header being #included
  9491. // *unconditionally*. Therefore these #includes cannot be moved
  9492. // inside #if GTEST_HAS_PARAM_TEST.
  9493. #if GTEST_HAS_PARAM_TEST
  9494. namespace testing {
  9495. // Forward declarations of ValuesIn(), which is implemented in
  9496. // include/gtest/gtest-param-test.h.
  9497. template <typename ForwardIterator>
  9498. internal::ParamGenerator<
  9499. typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
  9500. ValuesIn(ForwardIterator begin, ForwardIterator end);
  9501. template <typename T, size_t N>
  9502. internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
  9503. template <class Container>
  9504. internal::ParamGenerator<typename Container::value_type> ValuesIn(
  9505. const Container& container);
  9506. namespace internal {
  9507. // Used in the Values() function to provide polymorphic capabilities.
  9508. template <typename T1>
  9509. class ValueArray1 {
  9510. public:
  9511. explicit ValueArray1(T1 v1) : v1_(v1) {}
  9512. template <typename T>
  9513. operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }
  9514. private:
  9515. // No implementation - assignment is unsupported.
  9516. void operator=(const ValueArray1& other);
  9517. const T1 v1_;
  9518. };
  9519. template <typename T1, typename T2>
  9520. class ValueArray2 {
  9521. public:
  9522. ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
  9523. template <typename T>
  9524. operator ParamGenerator<T>() const {
  9525. const T array[] = {v1_, v2_};
  9526. return ValuesIn(array);
  9527. }
  9528. private:
  9529. // No implementation - assignment is unsupported.
  9530. void operator=(const ValueArray2& other);
  9531. const T1 v1_;
  9532. const T2 v2_;
  9533. };
  9534. template <typename T1, typename T2, typename T3>
  9535. class ValueArray3 {
  9536. public:
  9537. ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
  9538. template <typename T>
  9539. operator ParamGenerator<T>() const {
  9540. const T array[] = {v1_, v2_, v3_};
  9541. return ValuesIn(array);
  9542. }
  9543. private:
  9544. // No implementation - assignment is unsupported.
  9545. void operator=(const ValueArray3& other);
  9546. const T1 v1_;
  9547. const T2 v2_;
  9548. const T3 v3_;
  9549. };
  9550. template <typename T1, typename T2, typename T3, typename T4>
  9551. class ValueArray4 {
  9552. public:
  9553. ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
  9554. v4_(v4) {}
  9555. template <typename T>
  9556. operator ParamGenerator<T>() const {
  9557. const T array[] = {v1_, v2_, v3_, v4_};
  9558. return ValuesIn(array);
  9559. }
  9560. private:
  9561. // No implementation - assignment is unsupported.
  9562. void operator=(const ValueArray4& other);
  9563. const T1 v1_;
  9564. const T2 v2_;
  9565. const T3 v3_;
  9566. const T4 v4_;
  9567. };
  9568. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  9569. class ValueArray5 {
  9570. public:
  9571. ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
  9572. v4_(v4), v5_(v5) {}
  9573. template <typename T>
  9574. operator ParamGenerator<T>() const {
  9575. const T array[] = {v1_, v2_, v3_, v4_, v5_};
  9576. return ValuesIn(array);
  9577. }
  9578. private:
  9579. // No implementation - assignment is unsupported.
  9580. void operator=(const ValueArray5& other);
  9581. const T1 v1_;
  9582. const T2 v2_;
  9583. const T3 v3_;
  9584. const T4 v4_;
  9585. const T5 v5_;
  9586. };
  9587. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9588. typename T6>
  9589. class ValueArray6 {
  9590. public:
  9591. ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
  9592. v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
  9593. template <typename T>
  9594. operator ParamGenerator<T>() const {
  9595. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_};
  9596. return ValuesIn(array);
  9597. }
  9598. private:
  9599. // No implementation - assignment is unsupported.
  9600. void operator=(const ValueArray6& other);
  9601. const T1 v1_;
  9602. const T2 v2_;
  9603. const T3 v3_;
  9604. const T4 v4_;
  9605. const T5 v5_;
  9606. const T6 v6_;
  9607. };
  9608. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9609. typename T6, typename T7>
  9610. class ValueArray7 {
  9611. public:
  9612. ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
  9613. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
  9614. template <typename T>
  9615. operator ParamGenerator<T>() const {
  9616. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_};
  9617. return ValuesIn(array);
  9618. }
  9619. private:
  9620. // No implementation - assignment is unsupported.
  9621. void operator=(const ValueArray7& other);
  9622. const T1 v1_;
  9623. const T2 v2_;
  9624. const T3 v3_;
  9625. const T4 v4_;
  9626. const T5 v5_;
  9627. const T6 v6_;
  9628. const T7 v7_;
  9629. };
  9630. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9631. typename T6, typename T7, typename T8>
  9632. class ValueArray8 {
  9633. public:
  9634. ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  9635. T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  9636. v8_(v8) {}
  9637. template <typename T>
  9638. operator ParamGenerator<T>() const {
  9639. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_};
  9640. return ValuesIn(array);
  9641. }
  9642. private:
  9643. // No implementation - assignment is unsupported.
  9644. void operator=(const ValueArray8& other);
  9645. const T1 v1_;
  9646. const T2 v2_;
  9647. const T3 v3_;
  9648. const T4 v4_;
  9649. const T5 v5_;
  9650. const T6 v6_;
  9651. const T7 v7_;
  9652. const T8 v8_;
  9653. };
  9654. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9655. typename T6, typename T7, typename T8, typename T9>
  9656. class ValueArray9 {
  9657. public:
  9658. ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  9659. T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  9660. v8_(v8), v9_(v9) {}
  9661. template <typename T>
  9662. operator ParamGenerator<T>() const {
  9663. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_};
  9664. return ValuesIn(array);
  9665. }
  9666. private:
  9667. // No implementation - assignment is unsupported.
  9668. void operator=(const ValueArray9& other);
  9669. const T1 v1_;
  9670. const T2 v2_;
  9671. const T3 v3_;
  9672. const T4 v4_;
  9673. const T5 v5_;
  9674. const T6 v6_;
  9675. const T7 v7_;
  9676. const T8 v8_;
  9677. const T9 v9_;
  9678. };
  9679. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9680. typename T6, typename T7, typename T8, typename T9, typename T10>
  9681. class ValueArray10 {
  9682. public:
  9683. ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9684. T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  9685. v8_(v8), v9_(v9), v10_(v10) {}
  9686. template <typename T>
  9687. operator ParamGenerator<T>() const {
  9688. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_};
  9689. return ValuesIn(array);
  9690. }
  9691. private:
  9692. // No implementation - assignment is unsupported.
  9693. void operator=(const ValueArray10& other);
  9694. const T1 v1_;
  9695. const T2 v2_;
  9696. const T3 v3_;
  9697. const T4 v4_;
  9698. const T5 v5_;
  9699. const T6 v6_;
  9700. const T7 v7_;
  9701. const T8 v8_;
  9702. const T9 v9_;
  9703. const T10 v10_;
  9704. };
  9705. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9706. typename T6, typename T7, typename T8, typename T9, typename T10,
  9707. typename T11>
  9708. class ValueArray11 {
  9709. public:
  9710. ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9711. T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  9712. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
  9713. template <typename T>
  9714. operator ParamGenerator<T>() const {
  9715. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_};
  9716. return ValuesIn(array);
  9717. }
  9718. private:
  9719. // No implementation - assignment is unsupported.
  9720. void operator=(const ValueArray11& other);
  9721. const T1 v1_;
  9722. const T2 v2_;
  9723. const T3 v3_;
  9724. const T4 v4_;
  9725. const T5 v5_;
  9726. const T6 v6_;
  9727. const T7 v7_;
  9728. const T8 v8_;
  9729. const T9 v9_;
  9730. const T10 v10_;
  9731. const T11 v11_;
  9732. };
  9733. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9734. typename T6, typename T7, typename T8, typename T9, typename T10,
  9735. typename T11, typename T12>
  9736. class ValueArray12 {
  9737. public:
  9738. ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9739. T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  9740. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
  9741. template <typename T>
  9742. operator ParamGenerator<T>() const {
  9743. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9744. v12_};
  9745. return ValuesIn(array);
  9746. }
  9747. private:
  9748. // No implementation - assignment is unsupported.
  9749. void operator=(const ValueArray12& other);
  9750. const T1 v1_;
  9751. const T2 v2_;
  9752. const T3 v3_;
  9753. const T4 v4_;
  9754. const T5 v5_;
  9755. const T6 v6_;
  9756. const T7 v7_;
  9757. const T8 v8_;
  9758. const T9 v9_;
  9759. const T10 v10_;
  9760. const T11 v11_;
  9761. const T12 v12_;
  9762. };
  9763. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9764. typename T6, typename T7, typename T8, typename T9, typename T10,
  9765. typename T11, typename T12, typename T13>
  9766. class ValueArray13 {
  9767. public:
  9768. ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9769. T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  9770. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  9771. v12_(v12), v13_(v13) {}
  9772. template <typename T>
  9773. operator ParamGenerator<T>() const {
  9774. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9775. v12_, v13_};
  9776. return ValuesIn(array);
  9777. }
  9778. private:
  9779. // No implementation - assignment is unsupported.
  9780. void operator=(const ValueArray13& other);
  9781. const T1 v1_;
  9782. const T2 v2_;
  9783. const T3 v3_;
  9784. const T4 v4_;
  9785. const T5 v5_;
  9786. const T6 v6_;
  9787. const T7 v7_;
  9788. const T8 v8_;
  9789. const T9 v9_;
  9790. const T10 v10_;
  9791. const T11 v11_;
  9792. const T12 v12_;
  9793. const T13 v13_;
  9794. };
  9795. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9796. typename T6, typename T7, typename T8, typename T9, typename T10,
  9797. typename T11, typename T12, typename T13, typename T14>
  9798. class ValueArray14 {
  9799. public:
  9800. ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9801. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
  9802. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  9803. v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
  9804. template <typename T>
  9805. operator ParamGenerator<T>() const {
  9806. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9807. v12_, v13_, v14_};
  9808. return ValuesIn(array);
  9809. }
  9810. private:
  9811. // No implementation - assignment is unsupported.
  9812. void operator=(const ValueArray14& other);
  9813. const T1 v1_;
  9814. const T2 v2_;
  9815. const T3 v3_;
  9816. const T4 v4_;
  9817. const T5 v5_;
  9818. const T6 v6_;
  9819. const T7 v7_;
  9820. const T8 v8_;
  9821. const T9 v9_;
  9822. const T10 v10_;
  9823. const T11 v11_;
  9824. const T12 v12_;
  9825. const T13 v13_;
  9826. const T14 v14_;
  9827. };
  9828. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9829. typename T6, typename T7, typename T8, typename T9, typename T10,
  9830. typename T11, typename T12, typename T13, typename T14, typename T15>
  9831. class ValueArray15 {
  9832. public:
  9833. ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9834. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
  9835. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  9836. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
  9837. template <typename T>
  9838. operator ParamGenerator<T>() const {
  9839. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9840. v12_, v13_, v14_, v15_};
  9841. return ValuesIn(array);
  9842. }
  9843. private:
  9844. // No implementation - assignment is unsupported.
  9845. void operator=(const ValueArray15& other);
  9846. const T1 v1_;
  9847. const T2 v2_;
  9848. const T3 v3_;
  9849. const T4 v4_;
  9850. const T5 v5_;
  9851. const T6 v6_;
  9852. const T7 v7_;
  9853. const T8 v8_;
  9854. const T9 v9_;
  9855. const T10 v10_;
  9856. const T11 v11_;
  9857. const T12 v12_;
  9858. const T13 v13_;
  9859. const T14 v14_;
  9860. const T15 v15_;
  9861. };
  9862. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9863. typename T6, typename T7, typename T8, typename T9, typename T10,
  9864. typename T11, typename T12, typename T13, typename T14, typename T15,
  9865. typename T16>
  9866. class ValueArray16 {
  9867. public:
  9868. ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9869. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
  9870. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  9871. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  9872. v16_(v16) {}
  9873. template <typename T>
  9874. operator ParamGenerator<T>() const {
  9875. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9876. v12_, v13_, v14_, v15_, v16_};
  9877. return ValuesIn(array);
  9878. }
  9879. private:
  9880. // No implementation - assignment is unsupported.
  9881. void operator=(const ValueArray16& other);
  9882. const T1 v1_;
  9883. const T2 v2_;
  9884. const T3 v3_;
  9885. const T4 v4_;
  9886. const T5 v5_;
  9887. const T6 v6_;
  9888. const T7 v7_;
  9889. const T8 v8_;
  9890. const T9 v9_;
  9891. const T10 v10_;
  9892. const T11 v11_;
  9893. const T12 v12_;
  9894. const T13 v13_;
  9895. const T14 v14_;
  9896. const T15 v15_;
  9897. const T16 v16_;
  9898. };
  9899. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9900. typename T6, typename T7, typename T8, typename T9, typename T10,
  9901. typename T11, typename T12, typename T13, typename T14, typename T15,
  9902. typename T16, typename T17>
  9903. class ValueArray17 {
  9904. public:
  9905. ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9906. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
  9907. T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  9908. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  9909. v15_(v15), v16_(v16), v17_(v17) {}
  9910. template <typename T>
  9911. operator ParamGenerator<T>() const {
  9912. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9913. v12_, v13_, v14_, v15_, v16_, v17_};
  9914. return ValuesIn(array);
  9915. }
  9916. private:
  9917. // No implementation - assignment is unsupported.
  9918. void operator=(const ValueArray17& other);
  9919. const T1 v1_;
  9920. const T2 v2_;
  9921. const T3 v3_;
  9922. const T4 v4_;
  9923. const T5 v5_;
  9924. const T6 v6_;
  9925. const T7 v7_;
  9926. const T8 v8_;
  9927. const T9 v9_;
  9928. const T10 v10_;
  9929. const T11 v11_;
  9930. const T12 v12_;
  9931. const T13 v13_;
  9932. const T14 v14_;
  9933. const T15 v15_;
  9934. const T16 v16_;
  9935. const T17 v17_;
  9936. };
  9937. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9938. typename T6, typename T7, typename T8, typename T9, typename T10,
  9939. typename T11, typename T12, typename T13, typename T14, typename T15,
  9940. typename T16, typename T17, typename T18>
  9941. class ValueArray18 {
  9942. public:
  9943. ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9944. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  9945. T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  9946. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  9947. v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
  9948. template <typename T>
  9949. operator ParamGenerator<T>() const {
  9950. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9951. v12_, v13_, v14_, v15_, v16_, v17_, v18_};
  9952. return ValuesIn(array);
  9953. }
  9954. private:
  9955. // No implementation - assignment is unsupported.
  9956. void operator=(const ValueArray18& other);
  9957. const T1 v1_;
  9958. const T2 v2_;
  9959. const T3 v3_;
  9960. const T4 v4_;
  9961. const T5 v5_;
  9962. const T6 v6_;
  9963. const T7 v7_;
  9964. const T8 v8_;
  9965. const T9 v9_;
  9966. const T10 v10_;
  9967. const T11 v11_;
  9968. const T12 v12_;
  9969. const T13 v13_;
  9970. const T14 v14_;
  9971. const T15 v15_;
  9972. const T16 v16_;
  9973. const T17 v17_;
  9974. const T18 v18_;
  9975. };
  9976. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9977. typename T6, typename T7, typename T8, typename T9, typename T10,
  9978. typename T11, typename T12, typename T13, typename T14, typename T15,
  9979. typename T16, typename T17, typename T18, typename T19>
  9980. class ValueArray19 {
  9981. public:
  9982. ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9983. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  9984. T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  9985. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  9986. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
  9987. template <typename T>
  9988. operator ParamGenerator<T>() const {
  9989. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9990. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_};
  9991. return ValuesIn(array);
  9992. }
  9993. private:
  9994. // No implementation - assignment is unsupported.
  9995. void operator=(const ValueArray19& other);
  9996. const T1 v1_;
  9997. const T2 v2_;
  9998. const T3 v3_;
  9999. const T4 v4_;
  10000. const T5 v5_;
  10001. const T6 v6_;
  10002. const T7 v7_;
  10003. const T8 v8_;
  10004. const T9 v9_;
  10005. const T10 v10_;
  10006. const T11 v11_;
  10007. const T12 v12_;
  10008. const T13 v13_;
  10009. const T14 v14_;
  10010. const T15 v15_;
  10011. const T16 v16_;
  10012. const T17 v17_;
  10013. const T18 v18_;
  10014. const T19 v19_;
  10015. };
  10016. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10017. typename T6, typename T7, typename T8, typename T9, typename T10,
  10018. typename T11, typename T12, typename T13, typename T14, typename T15,
  10019. typename T16, typename T17, typename T18, typename T19, typename T20>
  10020. class ValueArray20 {
  10021. public:
  10022. ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10023. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10024. T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  10025. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  10026. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  10027. v19_(v19), v20_(v20) {}
  10028. template <typename T>
  10029. operator ParamGenerator<T>() const {
  10030. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10031. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_};
  10032. return ValuesIn(array);
  10033. }
  10034. private:
  10035. // No implementation - assignment is unsupported.
  10036. void operator=(const ValueArray20& other);
  10037. const T1 v1_;
  10038. const T2 v2_;
  10039. const T3 v3_;
  10040. const T4 v4_;
  10041. const T5 v5_;
  10042. const T6 v6_;
  10043. const T7 v7_;
  10044. const T8 v8_;
  10045. const T9 v9_;
  10046. const T10 v10_;
  10047. const T11 v11_;
  10048. const T12 v12_;
  10049. const T13 v13_;
  10050. const T14 v14_;
  10051. const T15 v15_;
  10052. const T16 v16_;
  10053. const T17 v17_;
  10054. const T18 v18_;
  10055. const T19 v19_;
  10056. const T20 v20_;
  10057. };
  10058. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10059. typename T6, typename T7, typename T8, typename T9, typename T10,
  10060. typename T11, typename T12, typename T13, typename T14, typename T15,
  10061. typename T16, typename T17, typename T18, typename T19, typename T20,
  10062. typename T21>
  10063. class ValueArray21 {
  10064. public:
  10065. ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10066. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10067. T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  10068. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  10069. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  10070. v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
  10071. template <typename T>
  10072. operator ParamGenerator<T>() const {
  10073. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10074. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_};
  10075. return ValuesIn(array);
  10076. }
  10077. private:
  10078. // No implementation - assignment is unsupported.
  10079. void operator=(const ValueArray21& other);
  10080. const T1 v1_;
  10081. const T2 v2_;
  10082. const T3 v3_;
  10083. const T4 v4_;
  10084. const T5 v5_;
  10085. const T6 v6_;
  10086. const T7 v7_;
  10087. const T8 v8_;
  10088. const T9 v9_;
  10089. const T10 v10_;
  10090. const T11 v11_;
  10091. const T12 v12_;
  10092. const T13 v13_;
  10093. const T14 v14_;
  10094. const T15 v15_;
  10095. const T16 v16_;
  10096. const T17 v17_;
  10097. const T18 v18_;
  10098. const T19 v19_;
  10099. const T20 v20_;
  10100. const T21 v21_;
  10101. };
  10102. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10103. typename T6, typename T7, typename T8, typename T9, typename T10,
  10104. typename T11, typename T12, typename T13, typename T14, typename T15,
  10105. typename T16, typename T17, typename T18, typename T19, typename T20,
  10106. typename T21, typename T22>
  10107. class ValueArray22 {
  10108. public:
  10109. ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10110. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10111. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
  10112. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  10113. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  10114. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
  10115. template <typename T>
  10116. operator ParamGenerator<T>() const {
  10117. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10118. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_};
  10119. return ValuesIn(array);
  10120. }
  10121. private:
  10122. // No implementation - assignment is unsupported.
  10123. void operator=(const ValueArray22& other);
  10124. const T1 v1_;
  10125. const T2 v2_;
  10126. const T3 v3_;
  10127. const T4 v4_;
  10128. const T5 v5_;
  10129. const T6 v6_;
  10130. const T7 v7_;
  10131. const T8 v8_;
  10132. const T9 v9_;
  10133. const T10 v10_;
  10134. const T11 v11_;
  10135. const T12 v12_;
  10136. const T13 v13_;
  10137. const T14 v14_;
  10138. const T15 v15_;
  10139. const T16 v16_;
  10140. const T17 v17_;
  10141. const T18 v18_;
  10142. const T19 v19_;
  10143. const T20 v20_;
  10144. const T21 v21_;
  10145. const T22 v22_;
  10146. };
  10147. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10148. typename T6, typename T7, typename T8, typename T9, typename T10,
  10149. typename T11, typename T12, typename T13, typename T14, typename T15,
  10150. typename T16, typename T17, typename T18, typename T19, typename T20,
  10151. typename T21, typename T22, typename T23>
  10152. class ValueArray23 {
  10153. public:
  10154. ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10155. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10156. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
  10157. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  10158. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  10159. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  10160. v23_(v23) {}
  10161. template <typename T>
  10162. operator ParamGenerator<T>() const {
  10163. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10164. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_,
  10165. v23_};
  10166. return ValuesIn(array);
  10167. }
  10168. private:
  10169. // No implementation - assignment is unsupported.
  10170. void operator=(const ValueArray23& other);
  10171. const T1 v1_;
  10172. const T2 v2_;
  10173. const T3 v3_;
  10174. const T4 v4_;
  10175. const T5 v5_;
  10176. const T6 v6_;
  10177. const T7 v7_;
  10178. const T8 v8_;
  10179. const T9 v9_;
  10180. const T10 v10_;
  10181. const T11 v11_;
  10182. const T12 v12_;
  10183. const T13 v13_;
  10184. const T14 v14_;
  10185. const T15 v15_;
  10186. const T16 v16_;
  10187. const T17 v17_;
  10188. const T18 v18_;
  10189. const T19 v19_;
  10190. const T20 v20_;
  10191. const T21 v21_;
  10192. const T22 v22_;
  10193. const T23 v23_;
  10194. };
  10195. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10196. typename T6, typename T7, typename T8, typename T9, typename T10,
  10197. typename T11, typename T12, typename T13, typename T14, typename T15,
  10198. typename T16, typename T17, typename T18, typename T19, typename T20,
  10199. typename T21, typename T22, typename T23, typename T24>
  10200. class ValueArray24 {
  10201. public:
  10202. ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10203. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10204. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
  10205. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  10206. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  10207. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  10208. v22_(v22), v23_(v23), v24_(v24) {}
  10209. template <typename T>
  10210. operator ParamGenerator<T>() const {
  10211. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10212. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10213. v24_};
  10214. return ValuesIn(array);
  10215. }
  10216. private:
  10217. // No implementation - assignment is unsupported.
  10218. void operator=(const ValueArray24& other);
  10219. const T1 v1_;
  10220. const T2 v2_;
  10221. const T3 v3_;
  10222. const T4 v4_;
  10223. const T5 v5_;
  10224. const T6 v6_;
  10225. const T7 v7_;
  10226. const T8 v8_;
  10227. const T9 v9_;
  10228. const T10 v10_;
  10229. const T11 v11_;
  10230. const T12 v12_;
  10231. const T13 v13_;
  10232. const T14 v14_;
  10233. const T15 v15_;
  10234. const T16 v16_;
  10235. const T17 v17_;
  10236. const T18 v18_;
  10237. const T19 v19_;
  10238. const T20 v20_;
  10239. const T21 v21_;
  10240. const T22 v22_;
  10241. const T23 v23_;
  10242. const T24 v24_;
  10243. };
  10244. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10245. typename T6, typename T7, typename T8, typename T9, typename T10,
  10246. typename T11, typename T12, typename T13, typename T14, typename T15,
  10247. typename T16, typename T17, typename T18, typename T19, typename T20,
  10248. typename T21, typename T22, typename T23, typename T24, typename T25>
  10249. class ValueArray25 {
  10250. public:
  10251. ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10252. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10253. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
  10254. T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  10255. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  10256. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  10257. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
  10258. template <typename T>
  10259. operator ParamGenerator<T>() const {
  10260. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10261. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10262. v24_, v25_};
  10263. return ValuesIn(array);
  10264. }
  10265. private:
  10266. // No implementation - assignment is unsupported.
  10267. void operator=(const ValueArray25& other);
  10268. const T1 v1_;
  10269. const T2 v2_;
  10270. const T3 v3_;
  10271. const T4 v4_;
  10272. const T5 v5_;
  10273. const T6 v6_;
  10274. const T7 v7_;
  10275. const T8 v8_;
  10276. const T9 v9_;
  10277. const T10 v10_;
  10278. const T11 v11_;
  10279. const T12 v12_;
  10280. const T13 v13_;
  10281. const T14 v14_;
  10282. const T15 v15_;
  10283. const T16 v16_;
  10284. const T17 v17_;
  10285. const T18 v18_;
  10286. const T19 v19_;
  10287. const T20 v20_;
  10288. const T21 v21_;
  10289. const T22 v22_;
  10290. const T23 v23_;
  10291. const T24 v24_;
  10292. const T25 v25_;
  10293. };
  10294. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10295. typename T6, typename T7, typename T8, typename T9, typename T10,
  10296. typename T11, typename T12, typename T13, typename T14, typename T15,
  10297. typename T16, typename T17, typename T18, typename T19, typename T20,
  10298. typename T21, typename T22, typename T23, typename T24, typename T25,
  10299. typename T26>
  10300. class ValueArray26 {
  10301. public:
  10302. ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10303. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10304. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10305. T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  10306. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  10307. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  10308. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
  10309. template <typename T>
  10310. operator ParamGenerator<T>() const {
  10311. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10312. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10313. v24_, v25_, v26_};
  10314. return ValuesIn(array);
  10315. }
  10316. private:
  10317. // No implementation - assignment is unsupported.
  10318. void operator=(const ValueArray26& other);
  10319. const T1 v1_;
  10320. const T2 v2_;
  10321. const T3 v3_;
  10322. const T4 v4_;
  10323. const T5 v5_;
  10324. const T6 v6_;
  10325. const T7 v7_;
  10326. const T8 v8_;
  10327. const T9 v9_;
  10328. const T10 v10_;
  10329. const T11 v11_;
  10330. const T12 v12_;
  10331. const T13 v13_;
  10332. const T14 v14_;
  10333. const T15 v15_;
  10334. const T16 v16_;
  10335. const T17 v17_;
  10336. const T18 v18_;
  10337. const T19 v19_;
  10338. const T20 v20_;
  10339. const T21 v21_;
  10340. const T22 v22_;
  10341. const T23 v23_;
  10342. const T24 v24_;
  10343. const T25 v25_;
  10344. const T26 v26_;
  10345. };
  10346. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10347. typename T6, typename T7, typename T8, typename T9, typename T10,
  10348. typename T11, typename T12, typename T13, typename T14, typename T15,
  10349. typename T16, typename T17, typename T18, typename T19, typename T20,
  10350. typename T21, typename T22, typename T23, typename T24, typename T25,
  10351. typename T26, typename T27>
  10352. class ValueArray27 {
  10353. public:
  10354. ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10355. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10356. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10357. T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  10358. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  10359. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
  10360. v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
  10361. v26_(v26), v27_(v27) {}
  10362. template <typename T>
  10363. operator ParamGenerator<T>() const {
  10364. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10365. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10366. v24_, v25_, v26_, v27_};
  10367. return ValuesIn(array);
  10368. }
  10369. private:
  10370. // No implementation - assignment is unsupported.
  10371. void operator=(const ValueArray27& other);
  10372. const T1 v1_;
  10373. const T2 v2_;
  10374. const T3 v3_;
  10375. const T4 v4_;
  10376. const T5 v5_;
  10377. const T6 v6_;
  10378. const T7 v7_;
  10379. const T8 v8_;
  10380. const T9 v9_;
  10381. const T10 v10_;
  10382. const T11 v11_;
  10383. const T12 v12_;
  10384. const T13 v13_;
  10385. const T14 v14_;
  10386. const T15 v15_;
  10387. const T16 v16_;
  10388. const T17 v17_;
  10389. const T18 v18_;
  10390. const T19 v19_;
  10391. const T20 v20_;
  10392. const T21 v21_;
  10393. const T22 v22_;
  10394. const T23 v23_;
  10395. const T24 v24_;
  10396. const T25 v25_;
  10397. const T26 v26_;
  10398. const T27 v27_;
  10399. };
  10400. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10401. typename T6, typename T7, typename T8, typename T9, typename T10,
  10402. typename T11, typename T12, typename T13, typename T14, typename T15,
  10403. typename T16, typename T17, typename T18, typename T19, typename T20,
  10404. typename T21, typename T22, typename T23, typename T24, typename T25,
  10405. typename T26, typename T27, typename T28>
  10406. class ValueArray28 {
  10407. public:
  10408. ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10409. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10410. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10411. T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  10412. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  10413. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  10414. v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
  10415. v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
  10416. template <typename T>
  10417. operator ParamGenerator<T>() const {
  10418. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10419. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10420. v24_, v25_, v26_, v27_, v28_};
  10421. return ValuesIn(array);
  10422. }
  10423. private:
  10424. // No implementation - assignment is unsupported.
  10425. void operator=(const ValueArray28& other);
  10426. const T1 v1_;
  10427. const T2 v2_;
  10428. const T3 v3_;
  10429. const T4 v4_;
  10430. const T5 v5_;
  10431. const T6 v6_;
  10432. const T7 v7_;
  10433. const T8 v8_;
  10434. const T9 v9_;
  10435. const T10 v10_;
  10436. const T11 v11_;
  10437. const T12 v12_;
  10438. const T13 v13_;
  10439. const T14 v14_;
  10440. const T15 v15_;
  10441. const T16 v16_;
  10442. const T17 v17_;
  10443. const T18 v18_;
  10444. const T19 v19_;
  10445. const T20 v20_;
  10446. const T21 v21_;
  10447. const T22 v22_;
  10448. const T23 v23_;
  10449. const T24 v24_;
  10450. const T25 v25_;
  10451. const T26 v26_;
  10452. const T27 v27_;
  10453. const T28 v28_;
  10454. };
  10455. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10456. typename T6, typename T7, typename T8, typename T9, typename T10,
  10457. typename T11, typename T12, typename T13, typename T14, typename T15,
  10458. typename T16, typename T17, typename T18, typename T19, typename T20,
  10459. typename T21, typename T22, typename T23, typename T24, typename T25,
  10460. typename T26, typename T27, typename T28, typename T29>
  10461. class ValueArray29 {
  10462. public:
  10463. ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10464. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10465. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10466. T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  10467. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  10468. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  10469. v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
  10470. v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
  10471. template <typename T>
  10472. operator ParamGenerator<T>() const {
  10473. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10474. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10475. v24_, v25_, v26_, v27_, v28_, v29_};
  10476. return ValuesIn(array);
  10477. }
  10478. private:
  10479. // No implementation - assignment is unsupported.
  10480. void operator=(const ValueArray29& other);
  10481. const T1 v1_;
  10482. const T2 v2_;
  10483. const T3 v3_;
  10484. const T4 v4_;
  10485. const T5 v5_;
  10486. const T6 v6_;
  10487. const T7 v7_;
  10488. const T8 v8_;
  10489. const T9 v9_;
  10490. const T10 v10_;
  10491. const T11 v11_;
  10492. const T12 v12_;
  10493. const T13 v13_;
  10494. const T14 v14_;
  10495. const T15 v15_;
  10496. const T16 v16_;
  10497. const T17 v17_;
  10498. const T18 v18_;
  10499. const T19 v19_;
  10500. const T20 v20_;
  10501. const T21 v21_;
  10502. const T22 v22_;
  10503. const T23 v23_;
  10504. const T24 v24_;
  10505. const T25 v25_;
  10506. const T26 v26_;
  10507. const T27 v27_;
  10508. const T28 v28_;
  10509. const T29 v29_;
  10510. };
  10511. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10512. typename T6, typename T7, typename T8, typename T9, typename T10,
  10513. typename T11, typename T12, typename T13, typename T14, typename T15,
  10514. typename T16, typename T17, typename T18, typename T19, typename T20,
  10515. typename T21, typename T22, typename T23, typename T24, typename T25,
  10516. typename T26, typename T27, typename T28, typename T29, typename T30>
  10517. class ValueArray30 {
  10518. public:
  10519. ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10520. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10521. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10522. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
  10523. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  10524. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  10525. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  10526. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  10527. v29_(v29), v30_(v30) {}
  10528. template <typename T>
  10529. operator ParamGenerator<T>() const {
  10530. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10531. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10532. v24_, v25_, v26_, v27_, v28_, v29_, v30_};
  10533. return ValuesIn(array);
  10534. }
  10535. private:
  10536. // No implementation - assignment is unsupported.
  10537. void operator=(const ValueArray30& other);
  10538. const T1 v1_;
  10539. const T2 v2_;
  10540. const T3 v3_;
  10541. const T4 v4_;
  10542. const T5 v5_;
  10543. const T6 v6_;
  10544. const T7 v7_;
  10545. const T8 v8_;
  10546. const T9 v9_;
  10547. const T10 v10_;
  10548. const T11 v11_;
  10549. const T12 v12_;
  10550. const T13 v13_;
  10551. const T14 v14_;
  10552. const T15 v15_;
  10553. const T16 v16_;
  10554. const T17 v17_;
  10555. const T18 v18_;
  10556. const T19 v19_;
  10557. const T20 v20_;
  10558. const T21 v21_;
  10559. const T22 v22_;
  10560. const T23 v23_;
  10561. const T24 v24_;
  10562. const T25 v25_;
  10563. const T26 v26_;
  10564. const T27 v27_;
  10565. const T28 v28_;
  10566. const T29 v29_;
  10567. const T30 v30_;
  10568. };
  10569. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10570. typename T6, typename T7, typename T8, typename T9, typename T10,
  10571. typename T11, typename T12, typename T13, typename T14, typename T15,
  10572. typename T16, typename T17, typename T18, typename T19, typename T20,
  10573. typename T21, typename T22, typename T23, typename T24, typename T25,
  10574. typename T26, typename T27, typename T28, typename T29, typename T30,
  10575. typename T31>
  10576. class ValueArray31 {
  10577. public:
  10578. ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10579. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10580. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10581. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
  10582. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  10583. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  10584. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  10585. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  10586. v29_(v29), v30_(v30), v31_(v31) {}
  10587. template <typename T>
  10588. operator ParamGenerator<T>() const {
  10589. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10590. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10591. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_};
  10592. return ValuesIn(array);
  10593. }
  10594. private:
  10595. // No implementation - assignment is unsupported.
  10596. void operator=(const ValueArray31& other);
  10597. const T1 v1_;
  10598. const T2 v2_;
  10599. const T3 v3_;
  10600. const T4 v4_;
  10601. const T5 v5_;
  10602. const T6 v6_;
  10603. const T7 v7_;
  10604. const T8 v8_;
  10605. const T9 v9_;
  10606. const T10 v10_;
  10607. const T11 v11_;
  10608. const T12 v12_;
  10609. const T13 v13_;
  10610. const T14 v14_;
  10611. const T15 v15_;
  10612. const T16 v16_;
  10613. const T17 v17_;
  10614. const T18 v18_;
  10615. const T19 v19_;
  10616. const T20 v20_;
  10617. const T21 v21_;
  10618. const T22 v22_;
  10619. const T23 v23_;
  10620. const T24 v24_;
  10621. const T25 v25_;
  10622. const T26 v26_;
  10623. const T27 v27_;
  10624. const T28 v28_;
  10625. const T29 v29_;
  10626. const T30 v30_;
  10627. const T31 v31_;
  10628. };
  10629. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10630. typename T6, typename T7, typename T8, typename T9, typename T10,
  10631. typename T11, typename T12, typename T13, typename T14, typename T15,
  10632. typename T16, typename T17, typename T18, typename T19, typename T20,
  10633. typename T21, typename T22, typename T23, typename T24, typename T25,
  10634. typename T26, typename T27, typename T28, typename T29, typename T30,
  10635. typename T31, typename T32>
  10636. class ValueArray32 {
  10637. public:
  10638. ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10639. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10640. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10641. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
  10642. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  10643. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  10644. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  10645. v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
  10646. v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
  10647. template <typename T>
  10648. operator ParamGenerator<T>() const {
  10649. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10650. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10651. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_};
  10652. return ValuesIn(array);
  10653. }
  10654. private:
  10655. // No implementation - assignment is unsupported.
  10656. void operator=(const ValueArray32& other);
  10657. const T1 v1_;
  10658. const T2 v2_;
  10659. const T3 v3_;
  10660. const T4 v4_;
  10661. const T5 v5_;
  10662. const T6 v6_;
  10663. const T7 v7_;
  10664. const T8 v8_;
  10665. const T9 v9_;
  10666. const T10 v10_;
  10667. const T11 v11_;
  10668. const T12 v12_;
  10669. const T13 v13_;
  10670. const T14 v14_;
  10671. const T15 v15_;
  10672. const T16 v16_;
  10673. const T17 v17_;
  10674. const T18 v18_;
  10675. const T19 v19_;
  10676. const T20 v20_;
  10677. const T21 v21_;
  10678. const T22 v22_;
  10679. const T23 v23_;
  10680. const T24 v24_;
  10681. const T25 v25_;
  10682. const T26 v26_;
  10683. const T27 v27_;
  10684. const T28 v28_;
  10685. const T29 v29_;
  10686. const T30 v30_;
  10687. const T31 v31_;
  10688. const T32 v32_;
  10689. };
  10690. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10691. typename T6, typename T7, typename T8, typename T9, typename T10,
  10692. typename T11, typename T12, typename T13, typename T14, typename T15,
  10693. typename T16, typename T17, typename T18, typename T19, typename T20,
  10694. typename T21, typename T22, typename T23, typename T24, typename T25,
  10695. typename T26, typename T27, typename T28, typename T29, typename T30,
  10696. typename T31, typename T32, typename T33>
  10697. class ValueArray33 {
  10698. public:
  10699. ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10700. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10701. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10702. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
  10703. T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  10704. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  10705. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  10706. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  10707. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  10708. v33_(v33) {}
  10709. template <typename T>
  10710. operator ParamGenerator<T>() const {
  10711. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10712. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10713. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_};
  10714. return ValuesIn(array);
  10715. }
  10716. private:
  10717. // No implementation - assignment is unsupported.
  10718. void operator=(const ValueArray33& other);
  10719. const T1 v1_;
  10720. const T2 v2_;
  10721. const T3 v3_;
  10722. const T4 v4_;
  10723. const T5 v5_;
  10724. const T6 v6_;
  10725. const T7 v7_;
  10726. const T8 v8_;
  10727. const T9 v9_;
  10728. const T10 v10_;
  10729. const T11 v11_;
  10730. const T12 v12_;
  10731. const T13 v13_;
  10732. const T14 v14_;
  10733. const T15 v15_;
  10734. const T16 v16_;
  10735. const T17 v17_;
  10736. const T18 v18_;
  10737. const T19 v19_;
  10738. const T20 v20_;
  10739. const T21 v21_;
  10740. const T22 v22_;
  10741. const T23 v23_;
  10742. const T24 v24_;
  10743. const T25 v25_;
  10744. const T26 v26_;
  10745. const T27 v27_;
  10746. const T28 v28_;
  10747. const T29 v29_;
  10748. const T30 v30_;
  10749. const T31 v31_;
  10750. const T32 v32_;
  10751. const T33 v33_;
  10752. };
  10753. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10754. typename T6, typename T7, typename T8, typename T9, typename T10,
  10755. typename T11, typename T12, typename T13, typename T14, typename T15,
  10756. typename T16, typename T17, typename T18, typename T19, typename T20,
  10757. typename T21, typename T22, typename T23, typename T24, typename T25,
  10758. typename T26, typename T27, typename T28, typename T29, typename T30,
  10759. typename T31, typename T32, typename T33, typename T34>
  10760. class ValueArray34 {
  10761. public:
  10762. ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10763. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10764. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10765. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  10766. T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  10767. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  10768. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  10769. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  10770. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  10771. v33_(v33), v34_(v34) {}
  10772. template <typename T>
  10773. operator ParamGenerator<T>() const {
  10774. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10775. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10776. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_};
  10777. return ValuesIn(array);
  10778. }
  10779. private:
  10780. // No implementation - assignment is unsupported.
  10781. void operator=(const ValueArray34& other);
  10782. const T1 v1_;
  10783. const T2 v2_;
  10784. const T3 v3_;
  10785. const T4 v4_;
  10786. const T5 v5_;
  10787. const T6 v6_;
  10788. const T7 v7_;
  10789. const T8 v8_;
  10790. const T9 v9_;
  10791. const T10 v10_;
  10792. const T11 v11_;
  10793. const T12 v12_;
  10794. const T13 v13_;
  10795. const T14 v14_;
  10796. const T15 v15_;
  10797. const T16 v16_;
  10798. const T17 v17_;
  10799. const T18 v18_;
  10800. const T19 v19_;
  10801. const T20 v20_;
  10802. const T21 v21_;
  10803. const T22 v22_;
  10804. const T23 v23_;
  10805. const T24 v24_;
  10806. const T25 v25_;
  10807. const T26 v26_;
  10808. const T27 v27_;
  10809. const T28 v28_;
  10810. const T29 v29_;
  10811. const T30 v30_;
  10812. const T31 v31_;
  10813. const T32 v32_;
  10814. const T33 v33_;
  10815. const T34 v34_;
  10816. };
  10817. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10818. typename T6, typename T7, typename T8, typename T9, typename T10,
  10819. typename T11, typename T12, typename T13, typename T14, typename T15,
  10820. typename T16, typename T17, typename T18, typename T19, typename T20,
  10821. typename T21, typename T22, typename T23, typename T24, typename T25,
  10822. typename T26, typename T27, typename T28, typename T29, typename T30,
  10823. typename T31, typename T32, typename T33, typename T34, typename T35>
  10824. class ValueArray35 {
  10825. public:
  10826. ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10827. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10828. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10829. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  10830. T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  10831. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  10832. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
  10833. v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
  10834. v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
  10835. v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
  10836. template <typename T>
  10837. operator ParamGenerator<T>() const {
  10838. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10839. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10840. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_,
  10841. v35_};
  10842. return ValuesIn(array);
  10843. }
  10844. private:
  10845. // No implementation - assignment is unsupported.
  10846. void operator=(const ValueArray35& other);
  10847. const T1 v1_;
  10848. const T2 v2_;
  10849. const T3 v3_;
  10850. const T4 v4_;
  10851. const T5 v5_;
  10852. const T6 v6_;
  10853. const T7 v7_;
  10854. const T8 v8_;
  10855. const T9 v9_;
  10856. const T10 v10_;
  10857. const T11 v11_;
  10858. const T12 v12_;
  10859. const T13 v13_;
  10860. const T14 v14_;
  10861. const T15 v15_;
  10862. const T16 v16_;
  10863. const T17 v17_;
  10864. const T18 v18_;
  10865. const T19 v19_;
  10866. const T20 v20_;
  10867. const T21 v21_;
  10868. const T22 v22_;
  10869. const T23 v23_;
  10870. const T24 v24_;
  10871. const T25 v25_;
  10872. const T26 v26_;
  10873. const T27 v27_;
  10874. const T28 v28_;
  10875. const T29 v29_;
  10876. const T30 v30_;
  10877. const T31 v31_;
  10878. const T32 v32_;
  10879. const T33 v33_;
  10880. const T34 v34_;
  10881. const T35 v35_;
  10882. };
  10883. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10884. typename T6, typename T7, typename T8, typename T9, typename T10,
  10885. typename T11, typename T12, typename T13, typename T14, typename T15,
  10886. typename T16, typename T17, typename T18, typename T19, typename T20,
  10887. typename T21, typename T22, typename T23, typename T24, typename T25,
  10888. typename T26, typename T27, typename T28, typename T29, typename T30,
  10889. typename T31, typename T32, typename T33, typename T34, typename T35,
  10890. typename T36>
  10891. class ValueArray36 {
  10892. public:
  10893. ValueArray36(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, T15 v15, T16 v16, T17 v17,
  10895. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10896. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  10897. T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  10898. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  10899. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  10900. v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
  10901. v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
  10902. v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
  10903. template <typename T>
  10904. operator ParamGenerator<T>() const {
  10905. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10906. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10907. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  10908. v36_};
  10909. return ValuesIn(array);
  10910. }
  10911. private:
  10912. // No implementation - assignment is unsupported.
  10913. void operator=(const ValueArray36& other);
  10914. const T1 v1_;
  10915. const T2 v2_;
  10916. const T3 v3_;
  10917. const T4 v4_;
  10918. const T5 v5_;
  10919. const T6 v6_;
  10920. const T7 v7_;
  10921. const T8 v8_;
  10922. const T9 v9_;
  10923. const T10 v10_;
  10924. const T11 v11_;
  10925. const T12 v12_;
  10926. const T13 v13_;
  10927. const T14 v14_;
  10928. const T15 v15_;
  10929. const T16 v16_;
  10930. const T17 v17_;
  10931. const T18 v18_;
  10932. const T19 v19_;
  10933. const T20 v20_;
  10934. const T21 v21_;
  10935. const T22 v22_;
  10936. const T23 v23_;
  10937. const T24 v24_;
  10938. const T25 v25_;
  10939. const T26 v26_;
  10940. const T27 v27_;
  10941. const T28 v28_;
  10942. const T29 v29_;
  10943. const T30 v30_;
  10944. const T31 v31_;
  10945. const T32 v32_;
  10946. const T33 v33_;
  10947. const T34 v34_;
  10948. const T35 v35_;
  10949. const T36 v36_;
  10950. };
  10951. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10952. typename T6, typename T7, typename T8, typename T9, typename T10,
  10953. typename T11, typename T12, typename T13, typename T14, typename T15,
  10954. typename T16, typename T17, typename T18, typename T19, typename T20,
  10955. typename T21, typename T22, typename T23, typename T24, typename T25,
  10956. typename T26, typename T27, typename T28, typename T29, typename T30,
  10957. typename T31, typename T32, typename T33, typename T34, typename T35,
  10958. typename T36, typename T37>
  10959. class ValueArray37 {
  10960. public:
  10961. ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10962. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10963. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10964. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  10965. T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  10966. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  10967. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  10968. v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
  10969. v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
  10970. v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
  10971. v36_(v36), v37_(v37) {}
  10972. template <typename T>
  10973. operator ParamGenerator<T>() const {
  10974. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10975. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10976. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  10977. v36_, v37_};
  10978. return ValuesIn(array);
  10979. }
  10980. private:
  10981. // No implementation - assignment is unsupported.
  10982. void operator=(const ValueArray37& other);
  10983. const T1 v1_;
  10984. const T2 v2_;
  10985. const T3 v3_;
  10986. const T4 v4_;
  10987. const T5 v5_;
  10988. const T6 v6_;
  10989. const T7 v7_;
  10990. const T8 v8_;
  10991. const T9 v9_;
  10992. const T10 v10_;
  10993. const T11 v11_;
  10994. const T12 v12_;
  10995. const T13 v13_;
  10996. const T14 v14_;
  10997. const T15 v15_;
  10998. const T16 v16_;
  10999. const T17 v17_;
  11000. const T18 v18_;
  11001. const T19 v19_;
  11002. const T20 v20_;
  11003. const T21 v21_;
  11004. const T22 v22_;
  11005. const T23 v23_;
  11006. const T24 v24_;
  11007. const T25 v25_;
  11008. const T26 v26_;
  11009. const T27 v27_;
  11010. const T28 v28_;
  11011. const T29 v29_;
  11012. const T30 v30_;
  11013. const T31 v31_;
  11014. const T32 v32_;
  11015. const T33 v33_;
  11016. const T34 v34_;
  11017. const T35 v35_;
  11018. const T36 v36_;
  11019. const T37 v37_;
  11020. };
  11021. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11022. typename T6, typename T7, typename T8, typename T9, typename T10,
  11023. typename T11, typename T12, typename T13, typename T14, typename T15,
  11024. typename T16, typename T17, typename T18, typename T19, typename T20,
  11025. typename T21, typename T22, typename T23, typename T24, typename T25,
  11026. typename T26, typename T27, typename T28, typename T29, typename T30,
  11027. typename T31, typename T32, typename T33, typename T34, typename T35,
  11028. typename T36, typename T37, typename T38>
  11029. class ValueArray38 {
  11030. public:
  11031. ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11032. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11033. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11034. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11035. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
  11036. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11037. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  11038. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  11039. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  11040. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  11041. v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
  11042. template <typename T>
  11043. operator ParamGenerator<T>() const {
  11044. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11045. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11046. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11047. v36_, v37_, v38_};
  11048. return ValuesIn(array);
  11049. }
  11050. private:
  11051. // No implementation - assignment is unsupported.
  11052. void operator=(const ValueArray38& other);
  11053. const T1 v1_;
  11054. const T2 v2_;
  11055. const T3 v3_;
  11056. const T4 v4_;
  11057. const T5 v5_;
  11058. const T6 v6_;
  11059. const T7 v7_;
  11060. const T8 v8_;
  11061. const T9 v9_;
  11062. const T10 v10_;
  11063. const T11 v11_;
  11064. const T12 v12_;
  11065. const T13 v13_;
  11066. const T14 v14_;
  11067. const T15 v15_;
  11068. const T16 v16_;
  11069. const T17 v17_;
  11070. const T18 v18_;
  11071. const T19 v19_;
  11072. const T20 v20_;
  11073. const T21 v21_;
  11074. const T22 v22_;
  11075. const T23 v23_;
  11076. const T24 v24_;
  11077. const T25 v25_;
  11078. const T26 v26_;
  11079. const T27 v27_;
  11080. const T28 v28_;
  11081. const T29 v29_;
  11082. const T30 v30_;
  11083. const T31 v31_;
  11084. const T32 v32_;
  11085. const T33 v33_;
  11086. const T34 v34_;
  11087. const T35 v35_;
  11088. const T36 v36_;
  11089. const T37 v37_;
  11090. const T38 v38_;
  11091. };
  11092. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11093. typename T6, typename T7, typename T8, typename T9, typename T10,
  11094. typename T11, typename T12, typename T13, typename T14, typename T15,
  11095. typename T16, typename T17, typename T18, typename T19, typename T20,
  11096. typename T21, typename T22, typename T23, typename T24, typename T25,
  11097. typename T26, typename T27, typename T28, typename T29, typename T30,
  11098. typename T31, typename T32, typename T33, typename T34, typename T35,
  11099. typename T36, typename T37, typename T38, typename T39>
  11100. class ValueArray39 {
  11101. public:
  11102. ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11103. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11104. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11105. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11106. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
  11107. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11108. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  11109. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  11110. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  11111. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  11112. v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
  11113. template <typename T>
  11114. operator ParamGenerator<T>() const {
  11115. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11116. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11117. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11118. v36_, v37_, v38_, v39_};
  11119. return ValuesIn(array);
  11120. }
  11121. private:
  11122. // No implementation - assignment is unsupported.
  11123. void operator=(const ValueArray39& other);
  11124. const T1 v1_;
  11125. const T2 v2_;
  11126. const T3 v3_;
  11127. const T4 v4_;
  11128. const T5 v5_;
  11129. const T6 v6_;
  11130. const T7 v7_;
  11131. const T8 v8_;
  11132. const T9 v9_;
  11133. const T10 v10_;
  11134. const T11 v11_;
  11135. const T12 v12_;
  11136. const T13 v13_;
  11137. const T14 v14_;
  11138. const T15 v15_;
  11139. const T16 v16_;
  11140. const T17 v17_;
  11141. const T18 v18_;
  11142. const T19 v19_;
  11143. const T20 v20_;
  11144. const T21 v21_;
  11145. const T22 v22_;
  11146. const T23 v23_;
  11147. const T24 v24_;
  11148. const T25 v25_;
  11149. const T26 v26_;
  11150. const T27 v27_;
  11151. const T28 v28_;
  11152. const T29 v29_;
  11153. const T30 v30_;
  11154. const T31 v31_;
  11155. const T32 v32_;
  11156. const T33 v33_;
  11157. const T34 v34_;
  11158. const T35 v35_;
  11159. const T36 v36_;
  11160. const T37 v37_;
  11161. const T38 v38_;
  11162. const T39 v39_;
  11163. };
  11164. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11165. typename T6, typename T7, typename T8, typename T9, typename T10,
  11166. typename T11, typename T12, typename T13, typename T14, typename T15,
  11167. typename T16, typename T17, typename T18, typename T19, typename T20,
  11168. typename T21, typename T22, typename T23, typename T24, typename T25,
  11169. typename T26, typename T27, typename T28, typename T29, typename T30,
  11170. typename T31, typename T32, typename T33, typename T34, typename T35,
  11171. typename T36, typename T37, typename T38, typename T39, typename T40>
  11172. class ValueArray40 {
  11173. public:
  11174. ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11175. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11176. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11177. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11178. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
  11179. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  11180. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  11181. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  11182. v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
  11183. v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
  11184. v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
  11185. v40_(v40) {}
  11186. template <typename T>
  11187. operator ParamGenerator<T>() const {
  11188. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11189. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11190. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11191. v36_, v37_, v38_, v39_, v40_};
  11192. return ValuesIn(array);
  11193. }
  11194. private:
  11195. // No implementation - assignment is unsupported.
  11196. void operator=(const ValueArray40& other);
  11197. const T1 v1_;
  11198. const T2 v2_;
  11199. const T3 v3_;
  11200. const T4 v4_;
  11201. const T5 v5_;
  11202. const T6 v6_;
  11203. const T7 v7_;
  11204. const T8 v8_;
  11205. const T9 v9_;
  11206. const T10 v10_;
  11207. const T11 v11_;
  11208. const T12 v12_;
  11209. const T13 v13_;
  11210. const T14 v14_;
  11211. const T15 v15_;
  11212. const T16 v16_;
  11213. const T17 v17_;
  11214. const T18 v18_;
  11215. const T19 v19_;
  11216. const T20 v20_;
  11217. const T21 v21_;
  11218. const T22 v22_;
  11219. const T23 v23_;
  11220. const T24 v24_;
  11221. const T25 v25_;
  11222. const T26 v26_;
  11223. const T27 v27_;
  11224. const T28 v28_;
  11225. const T29 v29_;
  11226. const T30 v30_;
  11227. const T31 v31_;
  11228. const T32 v32_;
  11229. const T33 v33_;
  11230. const T34 v34_;
  11231. const T35 v35_;
  11232. const T36 v36_;
  11233. const T37 v37_;
  11234. const T38 v38_;
  11235. const T39 v39_;
  11236. const T40 v40_;
  11237. };
  11238. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11239. typename T6, typename T7, typename T8, typename T9, typename T10,
  11240. typename T11, typename T12, typename T13, typename T14, typename T15,
  11241. typename T16, typename T17, typename T18, typename T19, typename T20,
  11242. typename T21, typename T22, typename T23, typename T24, typename T25,
  11243. typename T26, typename T27, typename T28, typename T29, typename T30,
  11244. typename T31, typename T32, typename T33, typename T34, typename T35,
  11245. typename T36, typename T37, typename T38, typename T39, typename T40,
  11246. typename T41>
  11247. class ValueArray41 {
  11248. public:
  11249. ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11250. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11251. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11252. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11253. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
  11254. T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11255. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11256. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  11257. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  11258. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  11259. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  11260. v39_(v39), v40_(v40), v41_(v41) {}
  11261. template <typename T>
  11262. operator ParamGenerator<T>() const {
  11263. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11264. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11265. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11266. v36_, v37_, v38_, v39_, v40_, v41_};
  11267. return ValuesIn(array);
  11268. }
  11269. private:
  11270. // No implementation - assignment is unsupported.
  11271. void operator=(const ValueArray41& other);
  11272. const T1 v1_;
  11273. const T2 v2_;
  11274. const T3 v3_;
  11275. const T4 v4_;
  11276. const T5 v5_;
  11277. const T6 v6_;
  11278. const T7 v7_;
  11279. const T8 v8_;
  11280. const T9 v9_;
  11281. const T10 v10_;
  11282. const T11 v11_;
  11283. const T12 v12_;
  11284. const T13 v13_;
  11285. const T14 v14_;
  11286. const T15 v15_;
  11287. const T16 v16_;
  11288. const T17 v17_;
  11289. const T18 v18_;
  11290. const T19 v19_;
  11291. const T20 v20_;
  11292. const T21 v21_;
  11293. const T22 v22_;
  11294. const T23 v23_;
  11295. const T24 v24_;
  11296. const T25 v25_;
  11297. const T26 v26_;
  11298. const T27 v27_;
  11299. const T28 v28_;
  11300. const T29 v29_;
  11301. const T30 v30_;
  11302. const T31 v31_;
  11303. const T32 v32_;
  11304. const T33 v33_;
  11305. const T34 v34_;
  11306. const T35 v35_;
  11307. const T36 v36_;
  11308. const T37 v37_;
  11309. const T38 v38_;
  11310. const T39 v39_;
  11311. const T40 v40_;
  11312. const T41 v41_;
  11313. };
  11314. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11315. typename T6, typename T7, typename T8, typename T9, typename T10,
  11316. typename T11, typename T12, typename T13, typename T14, typename T15,
  11317. typename T16, typename T17, typename T18, typename T19, typename T20,
  11318. typename T21, typename T22, typename T23, typename T24, typename T25,
  11319. typename T26, typename T27, typename T28, typename T29, typename T30,
  11320. typename T31, typename T32, typename T33, typename T34, typename T35,
  11321. typename T36, typename T37, typename T38, typename T39, typename T40,
  11322. typename T41, typename T42>
  11323. class ValueArray42 {
  11324. public:
  11325. ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11326. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11327. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11328. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11329. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11330. T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11331. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11332. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  11333. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  11334. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  11335. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  11336. v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
  11337. template <typename T>
  11338. operator ParamGenerator<T>() const {
  11339. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11340. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11341. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11342. v36_, v37_, v38_, v39_, v40_, v41_, v42_};
  11343. return ValuesIn(array);
  11344. }
  11345. private:
  11346. // No implementation - assignment is unsupported.
  11347. void operator=(const ValueArray42& other);
  11348. const T1 v1_;
  11349. const T2 v2_;
  11350. const T3 v3_;
  11351. const T4 v4_;
  11352. const T5 v5_;
  11353. const T6 v6_;
  11354. const T7 v7_;
  11355. const T8 v8_;
  11356. const T9 v9_;
  11357. const T10 v10_;
  11358. const T11 v11_;
  11359. const T12 v12_;
  11360. const T13 v13_;
  11361. const T14 v14_;
  11362. const T15 v15_;
  11363. const T16 v16_;
  11364. const T17 v17_;
  11365. const T18 v18_;
  11366. const T19 v19_;
  11367. const T20 v20_;
  11368. const T21 v21_;
  11369. const T22 v22_;
  11370. const T23 v23_;
  11371. const T24 v24_;
  11372. const T25 v25_;
  11373. const T26 v26_;
  11374. const T27 v27_;
  11375. const T28 v28_;
  11376. const T29 v29_;
  11377. const T30 v30_;
  11378. const T31 v31_;
  11379. const T32 v32_;
  11380. const T33 v33_;
  11381. const T34 v34_;
  11382. const T35 v35_;
  11383. const T36 v36_;
  11384. const T37 v37_;
  11385. const T38 v38_;
  11386. const T39 v39_;
  11387. const T40 v40_;
  11388. const T41 v41_;
  11389. const T42 v42_;
  11390. };
  11391. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11392. typename T6, typename T7, typename T8, typename T9, typename T10,
  11393. typename T11, typename T12, typename T13, typename T14, typename T15,
  11394. typename T16, typename T17, typename T18, typename T19, typename T20,
  11395. typename T21, typename T22, typename T23, typename T24, typename T25,
  11396. typename T26, typename T27, typename T28, typename T29, typename T30,
  11397. typename T31, typename T32, typename T33, typename T34, typename T35,
  11398. typename T36, typename T37, typename T38, typename T39, typename T40,
  11399. typename T41, typename T42, typename T43>
  11400. class ValueArray43 {
  11401. public:
  11402. ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11403. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11404. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11405. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11406. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11407. T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  11408. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  11409. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
  11410. v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
  11411. v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
  11412. v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
  11413. v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
  11414. template <typename T>
  11415. operator ParamGenerator<T>() const {
  11416. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11417. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11418. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11419. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_};
  11420. return ValuesIn(array);
  11421. }
  11422. private:
  11423. // No implementation - assignment is unsupported.
  11424. void operator=(const ValueArray43& other);
  11425. const T1 v1_;
  11426. const T2 v2_;
  11427. const T3 v3_;
  11428. const T4 v4_;
  11429. const T5 v5_;
  11430. const T6 v6_;
  11431. const T7 v7_;
  11432. const T8 v8_;
  11433. const T9 v9_;
  11434. const T10 v10_;
  11435. const T11 v11_;
  11436. const T12 v12_;
  11437. const T13 v13_;
  11438. const T14 v14_;
  11439. const T15 v15_;
  11440. const T16 v16_;
  11441. const T17 v17_;
  11442. const T18 v18_;
  11443. const T19 v19_;
  11444. const T20 v20_;
  11445. const T21 v21_;
  11446. const T22 v22_;
  11447. const T23 v23_;
  11448. const T24 v24_;
  11449. const T25 v25_;
  11450. const T26 v26_;
  11451. const T27 v27_;
  11452. const T28 v28_;
  11453. const T29 v29_;
  11454. const T30 v30_;
  11455. const T31 v31_;
  11456. const T32 v32_;
  11457. const T33 v33_;
  11458. const T34 v34_;
  11459. const T35 v35_;
  11460. const T36 v36_;
  11461. const T37 v37_;
  11462. const T38 v38_;
  11463. const T39 v39_;
  11464. const T40 v40_;
  11465. const T41 v41_;
  11466. const T42 v42_;
  11467. const T43 v43_;
  11468. };
  11469. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11470. typename T6, typename T7, typename T8, typename T9, typename T10,
  11471. typename T11, typename T12, typename T13, typename T14, typename T15,
  11472. typename T16, typename T17, typename T18, typename T19, typename T20,
  11473. typename T21, typename T22, typename T23, typename T24, typename T25,
  11474. typename T26, typename T27, typename T28, typename T29, typename T30,
  11475. typename T31, typename T32, typename T33, typename T34, typename T35,
  11476. typename T36, typename T37, typename T38, typename T39, typename T40,
  11477. typename T41, typename T42, typename T43, typename T44>
  11478. class ValueArray44 {
  11479. public:
  11480. ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11481. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11482. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11483. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11484. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11485. T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  11486. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  11487. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  11488. v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
  11489. v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
  11490. v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
  11491. v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
  11492. v43_(v43), v44_(v44) {}
  11493. template <typename T>
  11494. operator ParamGenerator<T>() const {
  11495. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11496. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11497. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11498. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_};
  11499. return ValuesIn(array);
  11500. }
  11501. private:
  11502. // No implementation - assignment is unsupported.
  11503. void operator=(const ValueArray44& other);
  11504. const T1 v1_;
  11505. const T2 v2_;
  11506. const T3 v3_;
  11507. const T4 v4_;
  11508. const T5 v5_;
  11509. const T6 v6_;
  11510. const T7 v7_;
  11511. const T8 v8_;
  11512. const T9 v9_;
  11513. const T10 v10_;
  11514. const T11 v11_;
  11515. const T12 v12_;
  11516. const T13 v13_;
  11517. const T14 v14_;
  11518. const T15 v15_;
  11519. const T16 v16_;
  11520. const T17 v17_;
  11521. const T18 v18_;
  11522. const T19 v19_;
  11523. const T20 v20_;
  11524. const T21 v21_;
  11525. const T22 v22_;
  11526. const T23 v23_;
  11527. const T24 v24_;
  11528. const T25 v25_;
  11529. const T26 v26_;
  11530. const T27 v27_;
  11531. const T28 v28_;
  11532. const T29 v29_;
  11533. const T30 v30_;
  11534. const T31 v31_;
  11535. const T32 v32_;
  11536. const T33 v33_;
  11537. const T34 v34_;
  11538. const T35 v35_;
  11539. const T36 v36_;
  11540. const T37 v37_;
  11541. const T38 v38_;
  11542. const T39 v39_;
  11543. const T40 v40_;
  11544. const T41 v41_;
  11545. const T42 v42_;
  11546. const T43 v43_;
  11547. const T44 v44_;
  11548. };
  11549. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11550. typename T6, typename T7, typename T8, typename T9, typename T10,
  11551. typename T11, typename T12, typename T13, typename T14, typename T15,
  11552. typename T16, typename T17, typename T18, typename T19, typename T20,
  11553. typename T21, typename T22, typename T23, typename T24, typename T25,
  11554. typename T26, typename T27, typename T28, typename T29, typename T30,
  11555. typename T31, typename T32, typename T33, typename T34, typename T35,
  11556. typename T36, typename T37, typename T38, typename T39, typename T40,
  11557. typename T41, typename T42, typename T43, typename T44, typename T45>
  11558. class ValueArray45 {
  11559. public:
  11560. ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11561. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11562. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11563. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11564. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11565. T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  11566. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  11567. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  11568. v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
  11569. v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
  11570. v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
  11571. v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
  11572. v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
  11573. template <typename T>
  11574. operator ParamGenerator<T>() const {
  11575. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11576. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11577. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11578. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_};
  11579. return ValuesIn(array);
  11580. }
  11581. private:
  11582. // No implementation - assignment is unsupported.
  11583. void operator=(const ValueArray45& other);
  11584. const T1 v1_;
  11585. const T2 v2_;
  11586. const T3 v3_;
  11587. const T4 v4_;
  11588. const T5 v5_;
  11589. const T6 v6_;
  11590. const T7 v7_;
  11591. const T8 v8_;
  11592. const T9 v9_;
  11593. const T10 v10_;
  11594. const T11 v11_;
  11595. const T12 v12_;
  11596. const T13 v13_;
  11597. const T14 v14_;
  11598. const T15 v15_;
  11599. const T16 v16_;
  11600. const T17 v17_;
  11601. const T18 v18_;
  11602. const T19 v19_;
  11603. const T20 v20_;
  11604. const T21 v21_;
  11605. const T22 v22_;
  11606. const T23 v23_;
  11607. const T24 v24_;
  11608. const T25 v25_;
  11609. const T26 v26_;
  11610. const T27 v27_;
  11611. const T28 v28_;
  11612. const T29 v29_;
  11613. const T30 v30_;
  11614. const T31 v31_;
  11615. const T32 v32_;
  11616. const T33 v33_;
  11617. const T34 v34_;
  11618. const T35 v35_;
  11619. const T36 v36_;
  11620. const T37 v37_;
  11621. const T38 v38_;
  11622. const T39 v39_;
  11623. const T40 v40_;
  11624. const T41 v41_;
  11625. const T42 v42_;
  11626. const T43 v43_;
  11627. const T44 v44_;
  11628. const T45 v45_;
  11629. };
  11630. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11631. typename T6, typename T7, typename T8, typename T9, typename T10,
  11632. typename T11, typename T12, typename T13, typename T14, typename T15,
  11633. typename T16, typename T17, typename T18, typename T19, typename T20,
  11634. typename T21, typename T22, typename T23, typename T24, typename T25,
  11635. typename T26, typename T27, typename T28, typename T29, typename T30,
  11636. typename T31, typename T32, typename T33, typename T34, typename T35,
  11637. typename T36, typename T37, typename T38, typename T39, typename T40,
  11638. typename T41, typename T42, typename T43, typename T44, typename T45,
  11639. typename T46>
  11640. class ValueArray46 {
  11641. public:
  11642. ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11643. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11644. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11645. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11646. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11647. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
  11648. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11649. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  11650. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  11651. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  11652. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  11653. v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
  11654. v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
  11655. template <typename T>
  11656. operator ParamGenerator<T>() const {
  11657. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11658. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11659. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11660. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_};
  11661. return ValuesIn(array);
  11662. }
  11663. private:
  11664. // No implementation - assignment is unsupported.
  11665. void operator=(const ValueArray46& other);
  11666. const T1 v1_;
  11667. const T2 v2_;
  11668. const T3 v3_;
  11669. const T4 v4_;
  11670. const T5 v5_;
  11671. const T6 v6_;
  11672. const T7 v7_;
  11673. const T8 v8_;
  11674. const T9 v9_;
  11675. const T10 v10_;
  11676. const T11 v11_;
  11677. const T12 v12_;
  11678. const T13 v13_;
  11679. const T14 v14_;
  11680. const T15 v15_;
  11681. const T16 v16_;
  11682. const T17 v17_;
  11683. const T18 v18_;
  11684. const T19 v19_;
  11685. const T20 v20_;
  11686. const T21 v21_;
  11687. const T22 v22_;
  11688. const T23 v23_;
  11689. const T24 v24_;
  11690. const T25 v25_;
  11691. const T26 v26_;
  11692. const T27 v27_;
  11693. const T28 v28_;
  11694. const T29 v29_;
  11695. const T30 v30_;
  11696. const T31 v31_;
  11697. const T32 v32_;
  11698. const T33 v33_;
  11699. const T34 v34_;
  11700. const T35 v35_;
  11701. const T36 v36_;
  11702. const T37 v37_;
  11703. const T38 v38_;
  11704. const T39 v39_;
  11705. const T40 v40_;
  11706. const T41 v41_;
  11707. const T42 v42_;
  11708. const T43 v43_;
  11709. const T44 v44_;
  11710. const T45 v45_;
  11711. const T46 v46_;
  11712. };
  11713. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11714. typename T6, typename T7, typename T8, typename T9, typename T10,
  11715. typename T11, typename T12, typename T13, typename T14, typename T15,
  11716. typename T16, typename T17, typename T18, typename T19, typename T20,
  11717. typename T21, typename T22, typename T23, typename T24, typename T25,
  11718. typename T26, typename T27, typename T28, typename T29, typename T30,
  11719. typename T31, typename T32, typename T33, typename T34, typename T35,
  11720. typename T36, typename T37, typename T38, typename T39, typename T40,
  11721. typename T41, typename T42, typename T43, typename T44, typename T45,
  11722. typename T46, typename T47>
  11723. class ValueArray47 {
  11724. public:
  11725. ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11726. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11727. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11728. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11729. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11730. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
  11731. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11732. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  11733. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  11734. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  11735. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  11736. v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
  11737. v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
  11738. v47_(v47) {}
  11739. template <typename T>
  11740. operator ParamGenerator<T>() const {
  11741. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11742. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11743. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11744. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_,
  11745. v47_};
  11746. return ValuesIn(array);
  11747. }
  11748. private:
  11749. // No implementation - assignment is unsupported.
  11750. void operator=(const ValueArray47& other);
  11751. const T1 v1_;
  11752. const T2 v2_;
  11753. const T3 v3_;
  11754. const T4 v4_;
  11755. const T5 v5_;
  11756. const T6 v6_;
  11757. const T7 v7_;
  11758. const T8 v8_;
  11759. const T9 v9_;
  11760. const T10 v10_;
  11761. const T11 v11_;
  11762. const T12 v12_;
  11763. const T13 v13_;
  11764. const T14 v14_;
  11765. const T15 v15_;
  11766. const T16 v16_;
  11767. const T17 v17_;
  11768. const T18 v18_;
  11769. const T19 v19_;
  11770. const T20 v20_;
  11771. const T21 v21_;
  11772. const T22 v22_;
  11773. const T23 v23_;
  11774. const T24 v24_;
  11775. const T25 v25_;
  11776. const T26 v26_;
  11777. const T27 v27_;
  11778. const T28 v28_;
  11779. const T29 v29_;
  11780. const T30 v30_;
  11781. const T31 v31_;
  11782. const T32 v32_;
  11783. const T33 v33_;
  11784. const T34 v34_;
  11785. const T35 v35_;
  11786. const T36 v36_;
  11787. const T37 v37_;
  11788. const T38 v38_;
  11789. const T39 v39_;
  11790. const T40 v40_;
  11791. const T41 v41_;
  11792. const T42 v42_;
  11793. const T43 v43_;
  11794. const T44 v44_;
  11795. const T45 v45_;
  11796. const T46 v46_;
  11797. const T47 v47_;
  11798. };
  11799. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11800. typename T6, typename T7, typename T8, typename T9, typename T10,
  11801. typename T11, typename T12, typename T13, typename T14, typename T15,
  11802. typename T16, typename T17, typename T18, typename T19, typename T20,
  11803. typename T21, typename T22, typename T23, typename T24, typename T25,
  11804. typename T26, typename T27, typename T28, typename T29, typename T30,
  11805. typename T31, typename T32, typename T33, typename T34, typename T35,
  11806. typename T36, typename T37, typename T38, typename T39, typename T40,
  11807. typename T41, typename T42, typename T43, typename T44, typename T45,
  11808. typename T46, typename T47, typename T48>
  11809. class ValueArray48 {
  11810. public:
  11811. ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11812. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11813. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11814. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11815. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11816. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
  11817. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  11818. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  11819. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  11820. v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
  11821. v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
  11822. v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
  11823. v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
  11824. v46_(v46), v47_(v47), v48_(v48) {}
  11825. template <typename T>
  11826. operator ParamGenerator<T>() const {
  11827. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11828. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11829. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11830. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_,
  11831. v48_};
  11832. return ValuesIn(array);
  11833. }
  11834. private:
  11835. // No implementation - assignment is unsupported.
  11836. void operator=(const ValueArray48& other);
  11837. const T1 v1_;
  11838. const T2 v2_;
  11839. const T3 v3_;
  11840. const T4 v4_;
  11841. const T5 v5_;
  11842. const T6 v6_;
  11843. const T7 v7_;
  11844. const T8 v8_;
  11845. const T9 v9_;
  11846. const T10 v10_;
  11847. const T11 v11_;
  11848. const T12 v12_;
  11849. const T13 v13_;
  11850. const T14 v14_;
  11851. const T15 v15_;
  11852. const T16 v16_;
  11853. const T17 v17_;
  11854. const T18 v18_;
  11855. const T19 v19_;
  11856. const T20 v20_;
  11857. const T21 v21_;
  11858. const T22 v22_;
  11859. const T23 v23_;
  11860. const T24 v24_;
  11861. const T25 v25_;
  11862. const T26 v26_;
  11863. const T27 v27_;
  11864. const T28 v28_;
  11865. const T29 v29_;
  11866. const T30 v30_;
  11867. const T31 v31_;
  11868. const T32 v32_;
  11869. const T33 v33_;
  11870. const T34 v34_;
  11871. const T35 v35_;
  11872. const T36 v36_;
  11873. const T37 v37_;
  11874. const T38 v38_;
  11875. const T39 v39_;
  11876. const T40 v40_;
  11877. const T41 v41_;
  11878. const T42 v42_;
  11879. const T43 v43_;
  11880. const T44 v44_;
  11881. const T45 v45_;
  11882. const T46 v46_;
  11883. const T47 v47_;
  11884. const T48 v48_;
  11885. };
  11886. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11887. typename T6, typename T7, typename T8, typename T9, typename T10,
  11888. typename T11, typename T12, typename T13, typename T14, typename T15,
  11889. typename T16, typename T17, typename T18, typename T19, typename T20,
  11890. typename T21, typename T22, typename T23, typename T24, typename T25,
  11891. typename T26, typename T27, typename T28, typename T29, typename T30,
  11892. typename T31, typename T32, typename T33, typename T34, typename T35,
  11893. typename T36, typename T37, typename T38, typename T39, typename T40,
  11894. typename T41, typename T42, typename T43, typename T44, typename T45,
  11895. typename T46, typename T47, typename T48, typename T49>
  11896. class ValueArray49 {
  11897. public:
  11898. ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11899. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11900. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11901. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11902. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11903. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
  11904. T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11905. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11906. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  11907. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  11908. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  11909. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  11910. v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
  11911. v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
  11912. template <typename T>
  11913. operator ParamGenerator<T>() const {
  11914. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11915. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11916. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11917. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_,
  11918. v48_, v49_};
  11919. return ValuesIn(array);
  11920. }
  11921. private:
  11922. // No implementation - assignment is unsupported.
  11923. void operator=(const ValueArray49& other);
  11924. const T1 v1_;
  11925. const T2 v2_;
  11926. const T3 v3_;
  11927. const T4 v4_;
  11928. const T5 v5_;
  11929. const T6 v6_;
  11930. const T7 v7_;
  11931. const T8 v8_;
  11932. const T9 v9_;
  11933. const T10 v10_;
  11934. const T11 v11_;
  11935. const T12 v12_;
  11936. const T13 v13_;
  11937. const T14 v14_;
  11938. const T15 v15_;
  11939. const T16 v16_;
  11940. const T17 v17_;
  11941. const T18 v18_;
  11942. const T19 v19_;
  11943. const T20 v20_;
  11944. const T21 v21_;
  11945. const T22 v22_;
  11946. const T23 v23_;
  11947. const T24 v24_;
  11948. const T25 v25_;
  11949. const T26 v26_;
  11950. const T27 v27_;
  11951. const T28 v28_;
  11952. const T29 v29_;
  11953. const T30 v30_;
  11954. const T31 v31_;
  11955. const T32 v32_;
  11956. const T33 v33_;
  11957. const T34 v34_;
  11958. const T35 v35_;
  11959. const T36 v36_;
  11960. const T37 v37_;
  11961. const T38 v38_;
  11962. const T39 v39_;
  11963. const T40 v40_;
  11964. const T41 v41_;
  11965. const T42 v42_;
  11966. const T43 v43_;
  11967. const T44 v44_;
  11968. const T45 v45_;
  11969. const T46 v46_;
  11970. const T47 v47_;
  11971. const T48 v48_;
  11972. const T49 v49_;
  11973. };
  11974. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11975. typename T6, typename T7, typename T8, typename T9, typename T10,
  11976. typename T11, typename T12, typename T13, typename T14, typename T15,
  11977. typename T16, typename T17, typename T18, typename T19, typename T20,
  11978. typename T21, typename T22, typename T23, typename T24, typename T25,
  11979. typename T26, typename T27, typename T28, typename T29, typename T30,
  11980. typename T31, typename T32, typename T33, typename T34, typename T35,
  11981. typename T36, typename T37, typename T38, typename T39, typename T40,
  11982. typename T41, typename T42, typename T43, typename T44, typename T45,
  11983. typename T46, typename T47, typename T48, typename T49, typename T50>
  11984. class ValueArray50 {
  11985. public:
  11986. ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11987. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11988. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11989. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11990. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11991. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
  11992. T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11993. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11994. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  11995. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  11996. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  11997. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  11998. v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
  11999. v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
  12000. template <typename T>
  12001. operator ParamGenerator<T>() const {
  12002. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  12003. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  12004. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  12005. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_,
  12006. v48_, v49_, v50_};
  12007. return ValuesIn(array);
  12008. }
  12009. private:
  12010. // No implementation - assignment is unsupported.
  12011. void operator=(const ValueArray50& other);
  12012. const T1 v1_;
  12013. const T2 v2_;
  12014. const T3 v3_;
  12015. const T4 v4_;
  12016. const T5 v5_;
  12017. const T6 v6_;
  12018. const T7 v7_;
  12019. const T8 v8_;
  12020. const T9 v9_;
  12021. const T10 v10_;
  12022. const T11 v11_;
  12023. const T12 v12_;
  12024. const T13 v13_;
  12025. const T14 v14_;
  12026. const T15 v15_;
  12027. const T16 v16_;
  12028. const T17 v17_;
  12029. const T18 v18_;
  12030. const T19 v19_;
  12031. const T20 v20_;
  12032. const T21 v21_;
  12033. const T22 v22_;
  12034. const T23 v23_;
  12035. const T24 v24_;
  12036. const T25 v25_;
  12037. const T26 v26_;
  12038. const T27 v27_;
  12039. const T28 v28_;
  12040. const T29 v29_;
  12041. const T30 v30_;
  12042. const T31 v31_;
  12043. const T32 v32_;
  12044. const T33 v33_;
  12045. const T34 v34_;
  12046. const T35 v35_;
  12047. const T36 v36_;
  12048. const T37 v37_;
  12049. const T38 v38_;
  12050. const T39 v39_;
  12051. const T40 v40_;
  12052. const T41 v41_;
  12053. const T42 v42_;
  12054. const T43 v43_;
  12055. const T44 v44_;
  12056. const T45 v45_;
  12057. const T46 v46_;
  12058. const T47 v47_;
  12059. const T48 v48_;
  12060. const T49 v49_;
  12061. const T50 v50_;
  12062. };
  12063. # if GTEST_HAS_COMBINE
  12064. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  12065. //
  12066. // Generates values from the Cartesian product of values produced
  12067. // by the argument generators.
  12068. //
  12069. template <typename T1, typename T2>
  12070. class CartesianProductGenerator2
  12071. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {
  12072. public:
  12073. typedef ::std::tr1::tuple<T1, T2> ParamType;
  12074. CartesianProductGenerator2(const ParamGenerator<T1>& g1,
  12075. const ParamGenerator<T2>& g2)
  12076. : g1_(g1), g2_(g2) {}
  12077. virtual ~CartesianProductGenerator2() {}
  12078. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12079. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
  12080. }
  12081. virtual ParamIteratorInterface<ParamType>* End() const {
  12082. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
  12083. }
  12084. private:
  12085. class Iterator : public ParamIteratorInterface<ParamType> {
  12086. public:
  12087. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12088. const ParamGenerator<T1>& g1,
  12089. const typename ParamGenerator<T1>::iterator& current1,
  12090. const ParamGenerator<T2>& g2,
  12091. const typename ParamGenerator<T2>::iterator& current2)
  12092. : base_(base),
  12093. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12094. begin2_(g2.begin()), end2_(g2.end()), current2_(current2) {
  12095. ComputeCurrentValue();
  12096. }
  12097. virtual ~Iterator() {}
  12098. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12099. return base_;
  12100. }
  12101. // Advance should not be called on beyond-of-range iterators
  12102. // so no component iterators must be beyond end of range, either.
  12103. virtual void Advance() {
  12104. assert(!AtEnd());
  12105. ++current2_;
  12106. if (current2_ == end2_) {
  12107. current2_ = begin2_;
  12108. ++current1_;
  12109. }
  12110. ComputeCurrentValue();
  12111. }
  12112. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12113. return new Iterator(*this);
  12114. }
  12115. virtual const ParamType* Current() const { return &current_value_; }
  12116. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12117. // Having the same base generator guarantees that the other
  12118. // iterator is of the same type and we can downcast.
  12119. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12120. << "The program attempted to compare iterators "
  12121. << "from different generators." << std::endl;
  12122. const Iterator* typed_other =
  12123. CheckedDowncastToActualType<const Iterator>(&other);
  12124. // We must report iterators equal if they both point beyond their
  12125. // respective ranges. That can happen in a variety of fashions,
  12126. // so we have to consult AtEnd().
  12127. return (AtEnd() && typed_other->AtEnd()) ||
  12128. (
  12129. current1_ == typed_other->current1_ &&
  12130. current2_ == typed_other->current2_);
  12131. }
  12132. private:
  12133. Iterator(const Iterator& other)
  12134. : base_(other.base_),
  12135. begin1_(other.begin1_),
  12136. end1_(other.end1_),
  12137. current1_(other.current1_),
  12138. begin2_(other.begin2_),
  12139. end2_(other.end2_),
  12140. current2_(other.current2_) {
  12141. ComputeCurrentValue();
  12142. }
  12143. void ComputeCurrentValue() {
  12144. if (!AtEnd())
  12145. current_value_ = ParamType(*current1_, *current2_);
  12146. }
  12147. bool AtEnd() const {
  12148. // We must report iterator past the end of the range when either of the
  12149. // component iterators has reached the end of its range.
  12150. return
  12151. current1_ == end1_ ||
  12152. current2_ == end2_;
  12153. }
  12154. // No implementation - assignment is unsupported.
  12155. void operator=(const Iterator& other);
  12156. const ParamGeneratorInterface<ParamType>* const base_;
  12157. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12158. // current[i]_ is the actual traversing iterator.
  12159. const typename ParamGenerator<T1>::iterator begin1_;
  12160. const typename ParamGenerator<T1>::iterator end1_;
  12161. typename ParamGenerator<T1>::iterator current1_;
  12162. const typename ParamGenerator<T2>::iterator begin2_;
  12163. const typename ParamGenerator<T2>::iterator end2_;
  12164. typename ParamGenerator<T2>::iterator current2_;
  12165. ParamType current_value_;
  12166. }; // class CartesianProductGenerator2::Iterator
  12167. // No implementation - assignment is unsupported.
  12168. void operator=(const CartesianProductGenerator2& other);
  12169. const ParamGenerator<T1> g1_;
  12170. const ParamGenerator<T2> g2_;
  12171. }; // class CartesianProductGenerator2
  12172. template <typename T1, typename T2, typename T3>
  12173. class CartesianProductGenerator3
  12174. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {
  12175. public:
  12176. typedef ::std::tr1::tuple<T1, T2, T3> ParamType;
  12177. CartesianProductGenerator3(const ParamGenerator<T1>& g1,
  12178. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
  12179. : g1_(g1), g2_(g2), g3_(g3) {}
  12180. virtual ~CartesianProductGenerator3() {}
  12181. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12182. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12183. g3_.begin());
  12184. }
  12185. virtual ParamIteratorInterface<ParamType>* End() const {
  12186. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
  12187. }
  12188. private:
  12189. class Iterator : public ParamIteratorInterface<ParamType> {
  12190. public:
  12191. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12192. const ParamGenerator<T1>& g1,
  12193. const typename ParamGenerator<T1>::iterator& current1,
  12194. const ParamGenerator<T2>& g2,
  12195. const typename ParamGenerator<T2>::iterator& current2,
  12196. const ParamGenerator<T3>& g3,
  12197. const typename ParamGenerator<T3>::iterator& current3)
  12198. : base_(base),
  12199. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12200. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  12201. begin3_(g3.begin()), end3_(g3.end()), current3_(current3) {
  12202. ComputeCurrentValue();
  12203. }
  12204. virtual ~Iterator() {}
  12205. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12206. return base_;
  12207. }
  12208. // Advance should not be called on beyond-of-range iterators
  12209. // so no component iterators must be beyond end of range, either.
  12210. virtual void Advance() {
  12211. assert(!AtEnd());
  12212. ++current3_;
  12213. if (current3_ == end3_) {
  12214. current3_ = begin3_;
  12215. ++current2_;
  12216. }
  12217. if (current2_ == end2_) {
  12218. current2_ = begin2_;
  12219. ++current1_;
  12220. }
  12221. ComputeCurrentValue();
  12222. }
  12223. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12224. return new Iterator(*this);
  12225. }
  12226. virtual const ParamType* Current() const { return &current_value_; }
  12227. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12228. // Having the same base generator guarantees that the other
  12229. // iterator is of the same type and we can downcast.
  12230. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12231. << "The program attempted to compare iterators "
  12232. << "from different generators." << std::endl;
  12233. const Iterator* typed_other =
  12234. CheckedDowncastToActualType<const Iterator>(&other);
  12235. // We must report iterators equal if they both point beyond their
  12236. // respective ranges. That can happen in a variety of fashions,
  12237. // so we have to consult AtEnd().
  12238. return (AtEnd() && typed_other->AtEnd()) ||
  12239. (
  12240. current1_ == typed_other->current1_ &&
  12241. current2_ == typed_other->current2_ &&
  12242. current3_ == typed_other->current3_);
  12243. }
  12244. private:
  12245. Iterator(const Iterator& other)
  12246. : base_(other.base_),
  12247. begin1_(other.begin1_),
  12248. end1_(other.end1_),
  12249. current1_(other.current1_),
  12250. begin2_(other.begin2_),
  12251. end2_(other.end2_),
  12252. current2_(other.current2_),
  12253. begin3_(other.begin3_),
  12254. end3_(other.end3_),
  12255. current3_(other.current3_) {
  12256. ComputeCurrentValue();
  12257. }
  12258. void ComputeCurrentValue() {
  12259. if (!AtEnd())
  12260. current_value_ = ParamType(*current1_, *current2_, *current3_);
  12261. }
  12262. bool AtEnd() const {
  12263. // We must report iterator past the end of the range when either of the
  12264. // component iterators has reached the end of its range.
  12265. return
  12266. current1_ == end1_ ||
  12267. current2_ == end2_ ||
  12268. current3_ == end3_;
  12269. }
  12270. // No implementation - assignment is unsupported.
  12271. void operator=(const Iterator& other);
  12272. const ParamGeneratorInterface<ParamType>* const base_;
  12273. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12274. // current[i]_ is the actual traversing iterator.
  12275. const typename ParamGenerator<T1>::iterator begin1_;
  12276. const typename ParamGenerator<T1>::iterator end1_;
  12277. typename ParamGenerator<T1>::iterator current1_;
  12278. const typename ParamGenerator<T2>::iterator begin2_;
  12279. const typename ParamGenerator<T2>::iterator end2_;
  12280. typename ParamGenerator<T2>::iterator current2_;
  12281. const typename ParamGenerator<T3>::iterator begin3_;
  12282. const typename ParamGenerator<T3>::iterator end3_;
  12283. typename ParamGenerator<T3>::iterator current3_;
  12284. ParamType current_value_;
  12285. }; // class CartesianProductGenerator3::Iterator
  12286. // No implementation - assignment is unsupported.
  12287. void operator=(const CartesianProductGenerator3& other);
  12288. const ParamGenerator<T1> g1_;
  12289. const ParamGenerator<T2> g2_;
  12290. const ParamGenerator<T3> g3_;
  12291. }; // class CartesianProductGenerator3
  12292. template <typename T1, typename T2, typename T3, typename T4>
  12293. class CartesianProductGenerator4
  12294. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {
  12295. public:
  12296. typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;
  12297. CartesianProductGenerator4(const ParamGenerator<T1>& g1,
  12298. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  12299. const ParamGenerator<T4>& g4)
  12300. : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
  12301. virtual ~CartesianProductGenerator4() {}
  12302. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12303. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12304. g3_.begin(), g4_, g4_.begin());
  12305. }
  12306. virtual ParamIteratorInterface<ParamType>* End() const {
  12307. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  12308. g4_, g4_.end());
  12309. }
  12310. private:
  12311. class Iterator : public ParamIteratorInterface<ParamType> {
  12312. public:
  12313. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12314. const ParamGenerator<T1>& g1,
  12315. const typename ParamGenerator<T1>::iterator& current1,
  12316. const ParamGenerator<T2>& g2,
  12317. const typename ParamGenerator<T2>::iterator& current2,
  12318. const ParamGenerator<T3>& g3,
  12319. const typename ParamGenerator<T3>::iterator& current3,
  12320. const ParamGenerator<T4>& g4,
  12321. const typename ParamGenerator<T4>::iterator& current4)
  12322. : base_(base),
  12323. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12324. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  12325. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  12326. begin4_(g4.begin()), end4_(g4.end()), current4_(current4) {
  12327. ComputeCurrentValue();
  12328. }
  12329. virtual ~Iterator() {}
  12330. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12331. return base_;
  12332. }
  12333. // Advance should not be called on beyond-of-range iterators
  12334. // so no component iterators must be beyond end of range, either.
  12335. virtual void Advance() {
  12336. assert(!AtEnd());
  12337. ++current4_;
  12338. if (current4_ == end4_) {
  12339. current4_ = begin4_;
  12340. ++current3_;
  12341. }
  12342. if (current3_ == end3_) {
  12343. current3_ = begin3_;
  12344. ++current2_;
  12345. }
  12346. if (current2_ == end2_) {
  12347. current2_ = begin2_;
  12348. ++current1_;
  12349. }
  12350. ComputeCurrentValue();
  12351. }
  12352. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12353. return new Iterator(*this);
  12354. }
  12355. virtual const ParamType* Current() const { return &current_value_; }
  12356. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12357. // Having the same base generator guarantees that the other
  12358. // iterator is of the same type and we can downcast.
  12359. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12360. << "The program attempted to compare iterators "
  12361. << "from different generators." << std::endl;
  12362. const Iterator* typed_other =
  12363. CheckedDowncastToActualType<const Iterator>(&other);
  12364. // We must report iterators equal if they both point beyond their
  12365. // respective ranges. That can happen in a variety of fashions,
  12366. // so we have to consult AtEnd().
  12367. return (AtEnd() && typed_other->AtEnd()) ||
  12368. (
  12369. current1_ == typed_other->current1_ &&
  12370. current2_ == typed_other->current2_ &&
  12371. current3_ == typed_other->current3_ &&
  12372. current4_ == typed_other->current4_);
  12373. }
  12374. private:
  12375. Iterator(const Iterator& other)
  12376. : base_(other.base_),
  12377. begin1_(other.begin1_),
  12378. end1_(other.end1_),
  12379. current1_(other.current1_),
  12380. begin2_(other.begin2_),
  12381. end2_(other.end2_),
  12382. current2_(other.current2_),
  12383. begin3_(other.begin3_),
  12384. end3_(other.end3_),
  12385. current3_(other.current3_),
  12386. begin4_(other.begin4_),
  12387. end4_(other.end4_),
  12388. current4_(other.current4_) {
  12389. ComputeCurrentValue();
  12390. }
  12391. void ComputeCurrentValue() {
  12392. if (!AtEnd())
  12393. current_value_ = ParamType(*current1_, *current2_, *current3_,
  12394. *current4_);
  12395. }
  12396. bool AtEnd() const {
  12397. // We must report iterator past the end of the range when either of the
  12398. // component iterators has reached the end of its range.
  12399. return
  12400. current1_ == end1_ ||
  12401. current2_ == end2_ ||
  12402. current3_ == end3_ ||
  12403. current4_ == end4_;
  12404. }
  12405. // No implementation - assignment is unsupported.
  12406. void operator=(const Iterator& other);
  12407. const ParamGeneratorInterface<ParamType>* const base_;
  12408. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12409. // current[i]_ is the actual traversing iterator.
  12410. const typename ParamGenerator<T1>::iterator begin1_;
  12411. const typename ParamGenerator<T1>::iterator end1_;
  12412. typename ParamGenerator<T1>::iterator current1_;
  12413. const typename ParamGenerator<T2>::iterator begin2_;
  12414. const typename ParamGenerator<T2>::iterator end2_;
  12415. typename ParamGenerator<T2>::iterator current2_;
  12416. const typename ParamGenerator<T3>::iterator begin3_;
  12417. const typename ParamGenerator<T3>::iterator end3_;
  12418. typename ParamGenerator<T3>::iterator current3_;
  12419. const typename ParamGenerator<T4>::iterator begin4_;
  12420. const typename ParamGenerator<T4>::iterator end4_;
  12421. typename ParamGenerator<T4>::iterator current4_;
  12422. ParamType current_value_;
  12423. }; // class CartesianProductGenerator4::Iterator
  12424. // No implementation - assignment is unsupported.
  12425. void operator=(const CartesianProductGenerator4& other);
  12426. const ParamGenerator<T1> g1_;
  12427. const ParamGenerator<T2> g2_;
  12428. const ParamGenerator<T3> g3_;
  12429. const ParamGenerator<T4> g4_;
  12430. }; // class CartesianProductGenerator4
  12431. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  12432. class CartesianProductGenerator5
  12433. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {
  12434. public:
  12435. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;
  12436. CartesianProductGenerator5(const ParamGenerator<T1>& g1,
  12437. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  12438. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
  12439. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
  12440. virtual ~CartesianProductGenerator5() {}
  12441. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12442. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12443. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
  12444. }
  12445. virtual ParamIteratorInterface<ParamType>* End() const {
  12446. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  12447. g4_, g4_.end(), g5_, g5_.end());
  12448. }
  12449. private:
  12450. class Iterator : public ParamIteratorInterface<ParamType> {
  12451. public:
  12452. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12453. const ParamGenerator<T1>& g1,
  12454. const typename ParamGenerator<T1>::iterator& current1,
  12455. const ParamGenerator<T2>& g2,
  12456. const typename ParamGenerator<T2>::iterator& current2,
  12457. const ParamGenerator<T3>& g3,
  12458. const typename ParamGenerator<T3>::iterator& current3,
  12459. const ParamGenerator<T4>& g4,
  12460. const typename ParamGenerator<T4>::iterator& current4,
  12461. const ParamGenerator<T5>& g5,
  12462. const typename ParamGenerator<T5>::iterator& current5)
  12463. : base_(base),
  12464. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12465. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  12466. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  12467. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  12468. begin5_(g5.begin()), end5_(g5.end()), current5_(current5) {
  12469. ComputeCurrentValue();
  12470. }
  12471. virtual ~Iterator() {}
  12472. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12473. return base_;
  12474. }
  12475. // Advance should not be called on beyond-of-range iterators
  12476. // so no component iterators must be beyond end of range, either.
  12477. virtual void Advance() {
  12478. assert(!AtEnd());
  12479. ++current5_;
  12480. if (current5_ == end5_) {
  12481. current5_ = begin5_;
  12482. ++current4_;
  12483. }
  12484. if (current4_ == end4_) {
  12485. current4_ = begin4_;
  12486. ++current3_;
  12487. }
  12488. if (current3_ == end3_) {
  12489. current3_ = begin3_;
  12490. ++current2_;
  12491. }
  12492. if (current2_ == end2_) {
  12493. current2_ = begin2_;
  12494. ++current1_;
  12495. }
  12496. ComputeCurrentValue();
  12497. }
  12498. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12499. return new Iterator(*this);
  12500. }
  12501. virtual const ParamType* Current() const { return &current_value_; }
  12502. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12503. // Having the same base generator guarantees that the other
  12504. // iterator is of the same type and we can downcast.
  12505. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12506. << "The program attempted to compare iterators "
  12507. << "from different generators." << std::endl;
  12508. const Iterator* typed_other =
  12509. CheckedDowncastToActualType<const Iterator>(&other);
  12510. // We must report iterators equal if they both point beyond their
  12511. // respective ranges. That can happen in a variety of fashions,
  12512. // so we have to consult AtEnd().
  12513. return (AtEnd() && typed_other->AtEnd()) ||
  12514. (
  12515. current1_ == typed_other->current1_ &&
  12516. current2_ == typed_other->current2_ &&
  12517. current3_ == typed_other->current3_ &&
  12518. current4_ == typed_other->current4_ &&
  12519. current5_ == typed_other->current5_);
  12520. }
  12521. private:
  12522. Iterator(const Iterator& other)
  12523. : base_(other.base_),
  12524. begin1_(other.begin1_),
  12525. end1_(other.end1_),
  12526. current1_(other.current1_),
  12527. begin2_(other.begin2_),
  12528. end2_(other.end2_),
  12529. current2_(other.current2_),
  12530. begin3_(other.begin3_),
  12531. end3_(other.end3_),
  12532. current3_(other.current3_),
  12533. begin4_(other.begin4_),
  12534. end4_(other.end4_),
  12535. current4_(other.current4_),
  12536. begin5_(other.begin5_),
  12537. end5_(other.end5_),
  12538. current5_(other.current5_) {
  12539. ComputeCurrentValue();
  12540. }
  12541. void ComputeCurrentValue() {
  12542. if (!AtEnd())
  12543. current_value_ = ParamType(*current1_, *current2_, *current3_,
  12544. *current4_, *current5_);
  12545. }
  12546. bool AtEnd() const {
  12547. // We must report iterator past the end of the range when either of the
  12548. // component iterators has reached the end of its range.
  12549. return
  12550. current1_ == end1_ ||
  12551. current2_ == end2_ ||
  12552. current3_ == end3_ ||
  12553. current4_ == end4_ ||
  12554. current5_ == end5_;
  12555. }
  12556. // No implementation - assignment is unsupported.
  12557. void operator=(const Iterator& other);
  12558. const ParamGeneratorInterface<ParamType>* const base_;
  12559. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12560. // current[i]_ is the actual traversing iterator.
  12561. const typename ParamGenerator<T1>::iterator begin1_;
  12562. const typename ParamGenerator<T1>::iterator end1_;
  12563. typename ParamGenerator<T1>::iterator current1_;
  12564. const typename ParamGenerator<T2>::iterator begin2_;
  12565. const typename ParamGenerator<T2>::iterator end2_;
  12566. typename ParamGenerator<T2>::iterator current2_;
  12567. const typename ParamGenerator<T3>::iterator begin3_;
  12568. const typename ParamGenerator<T3>::iterator end3_;
  12569. typename ParamGenerator<T3>::iterator current3_;
  12570. const typename ParamGenerator<T4>::iterator begin4_;
  12571. const typename ParamGenerator<T4>::iterator end4_;
  12572. typename ParamGenerator<T4>::iterator current4_;
  12573. const typename ParamGenerator<T5>::iterator begin5_;
  12574. const typename ParamGenerator<T5>::iterator end5_;
  12575. typename ParamGenerator<T5>::iterator current5_;
  12576. ParamType current_value_;
  12577. }; // class CartesianProductGenerator5::Iterator
  12578. // No implementation - assignment is unsupported.
  12579. void operator=(const CartesianProductGenerator5& other);
  12580. const ParamGenerator<T1> g1_;
  12581. const ParamGenerator<T2> g2_;
  12582. const ParamGenerator<T3> g3_;
  12583. const ParamGenerator<T4> g4_;
  12584. const ParamGenerator<T5> g5_;
  12585. }; // class CartesianProductGenerator5
  12586. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12587. typename T6>
  12588. class CartesianProductGenerator6
  12589. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,
  12590. T6> > {
  12591. public:
  12592. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;
  12593. CartesianProductGenerator6(const ParamGenerator<T1>& g1,
  12594. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  12595. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  12596. const ParamGenerator<T6>& g6)
  12597. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
  12598. virtual ~CartesianProductGenerator6() {}
  12599. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12600. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12601. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
  12602. }
  12603. virtual ParamIteratorInterface<ParamType>* End() const {
  12604. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  12605. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
  12606. }
  12607. private:
  12608. class Iterator : public ParamIteratorInterface<ParamType> {
  12609. public:
  12610. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12611. const ParamGenerator<T1>& g1,
  12612. const typename ParamGenerator<T1>::iterator& current1,
  12613. const ParamGenerator<T2>& g2,
  12614. const typename ParamGenerator<T2>::iterator& current2,
  12615. const ParamGenerator<T3>& g3,
  12616. const typename ParamGenerator<T3>::iterator& current3,
  12617. const ParamGenerator<T4>& g4,
  12618. const typename ParamGenerator<T4>::iterator& current4,
  12619. const ParamGenerator<T5>& g5,
  12620. const typename ParamGenerator<T5>::iterator& current5,
  12621. const ParamGenerator<T6>& g6,
  12622. const typename ParamGenerator<T6>::iterator& current6)
  12623. : base_(base),
  12624. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12625. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  12626. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  12627. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  12628. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  12629. begin6_(g6.begin()), end6_(g6.end()), current6_(current6) {
  12630. ComputeCurrentValue();
  12631. }
  12632. virtual ~Iterator() {}
  12633. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12634. return base_;
  12635. }
  12636. // Advance should not be called on beyond-of-range iterators
  12637. // so no component iterators must be beyond end of range, either.
  12638. virtual void Advance() {
  12639. assert(!AtEnd());
  12640. ++current6_;
  12641. if (current6_ == end6_) {
  12642. current6_ = begin6_;
  12643. ++current5_;
  12644. }
  12645. if (current5_ == end5_) {
  12646. current5_ = begin5_;
  12647. ++current4_;
  12648. }
  12649. if (current4_ == end4_) {
  12650. current4_ = begin4_;
  12651. ++current3_;
  12652. }
  12653. if (current3_ == end3_) {
  12654. current3_ = begin3_;
  12655. ++current2_;
  12656. }
  12657. if (current2_ == end2_) {
  12658. current2_ = begin2_;
  12659. ++current1_;
  12660. }
  12661. ComputeCurrentValue();
  12662. }
  12663. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12664. return new Iterator(*this);
  12665. }
  12666. virtual const ParamType* Current() const { return &current_value_; }
  12667. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12668. // Having the same base generator guarantees that the other
  12669. // iterator is of the same type and we can downcast.
  12670. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12671. << "The program attempted to compare iterators "
  12672. << "from different generators." << std::endl;
  12673. const Iterator* typed_other =
  12674. CheckedDowncastToActualType<const Iterator>(&other);
  12675. // We must report iterators equal if they both point beyond their
  12676. // respective ranges. That can happen in a variety of fashions,
  12677. // so we have to consult AtEnd().
  12678. return (AtEnd() && typed_other->AtEnd()) ||
  12679. (
  12680. current1_ == typed_other->current1_ &&
  12681. current2_ == typed_other->current2_ &&
  12682. current3_ == typed_other->current3_ &&
  12683. current4_ == typed_other->current4_ &&
  12684. current5_ == typed_other->current5_ &&
  12685. current6_ == typed_other->current6_);
  12686. }
  12687. private:
  12688. Iterator(const Iterator& other)
  12689. : base_(other.base_),
  12690. begin1_(other.begin1_),
  12691. end1_(other.end1_),
  12692. current1_(other.current1_),
  12693. begin2_(other.begin2_),
  12694. end2_(other.end2_),
  12695. current2_(other.current2_),
  12696. begin3_(other.begin3_),
  12697. end3_(other.end3_),
  12698. current3_(other.current3_),
  12699. begin4_(other.begin4_),
  12700. end4_(other.end4_),
  12701. current4_(other.current4_),
  12702. begin5_(other.begin5_),
  12703. end5_(other.end5_),
  12704. current5_(other.current5_),
  12705. begin6_(other.begin6_),
  12706. end6_(other.end6_),
  12707. current6_(other.current6_) {
  12708. ComputeCurrentValue();
  12709. }
  12710. void ComputeCurrentValue() {
  12711. if (!AtEnd())
  12712. current_value_ = ParamType(*current1_, *current2_, *current3_,
  12713. *current4_, *current5_, *current6_);
  12714. }
  12715. bool AtEnd() const {
  12716. // We must report iterator past the end of the range when either of the
  12717. // component iterators has reached the end of its range.
  12718. return
  12719. current1_ == end1_ ||
  12720. current2_ == end2_ ||
  12721. current3_ == end3_ ||
  12722. current4_ == end4_ ||
  12723. current5_ == end5_ ||
  12724. current6_ == end6_;
  12725. }
  12726. // No implementation - assignment is unsupported.
  12727. void operator=(const Iterator& other);
  12728. const ParamGeneratorInterface<ParamType>* const base_;
  12729. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12730. // current[i]_ is the actual traversing iterator.
  12731. const typename ParamGenerator<T1>::iterator begin1_;
  12732. const typename ParamGenerator<T1>::iterator end1_;
  12733. typename ParamGenerator<T1>::iterator current1_;
  12734. const typename ParamGenerator<T2>::iterator begin2_;
  12735. const typename ParamGenerator<T2>::iterator end2_;
  12736. typename ParamGenerator<T2>::iterator current2_;
  12737. const typename ParamGenerator<T3>::iterator begin3_;
  12738. const typename ParamGenerator<T3>::iterator end3_;
  12739. typename ParamGenerator<T3>::iterator current3_;
  12740. const typename ParamGenerator<T4>::iterator begin4_;
  12741. const typename ParamGenerator<T4>::iterator end4_;
  12742. typename ParamGenerator<T4>::iterator current4_;
  12743. const typename ParamGenerator<T5>::iterator begin5_;
  12744. const typename ParamGenerator<T5>::iterator end5_;
  12745. typename ParamGenerator<T5>::iterator current5_;
  12746. const typename ParamGenerator<T6>::iterator begin6_;
  12747. const typename ParamGenerator<T6>::iterator end6_;
  12748. typename ParamGenerator<T6>::iterator current6_;
  12749. ParamType current_value_;
  12750. }; // class CartesianProductGenerator6::Iterator
  12751. // No implementation - assignment is unsupported.
  12752. void operator=(const CartesianProductGenerator6& other);
  12753. const ParamGenerator<T1> g1_;
  12754. const ParamGenerator<T2> g2_;
  12755. const ParamGenerator<T3> g3_;
  12756. const ParamGenerator<T4> g4_;
  12757. const ParamGenerator<T5> g5_;
  12758. const ParamGenerator<T6> g6_;
  12759. }; // class CartesianProductGenerator6
  12760. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12761. typename T6, typename T7>
  12762. class CartesianProductGenerator7
  12763. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
  12764. T7> > {
  12765. public:
  12766. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
  12767. CartesianProductGenerator7(const ParamGenerator<T1>& g1,
  12768. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  12769. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  12770. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
  12771. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
  12772. virtual ~CartesianProductGenerator7() {}
  12773. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12774. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12775. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  12776. g7_.begin());
  12777. }
  12778. virtual ParamIteratorInterface<ParamType>* End() const {
  12779. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  12780. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
  12781. }
  12782. private:
  12783. class Iterator : public ParamIteratorInterface<ParamType> {
  12784. public:
  12785. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12786. const ParamGenerator<T1>& g1,
  12787. const typename ParamGenerator<T1>::iterator& current1,
  12788. const ParamGenerator<T2>& g2,
  12789. const typename ParamGenerator<T2>::iterator& current2,
  12790. const ParamGenerator<T3>& g3,
  12791. const typename ParamGenerator<T3>::iterator& current3,
  12792. const ParamGenerator<T4>& g4,
  12793. const typename ParamGenerator<T4>::iterator& current4,
  12794. const ParamGenerator<T5>& g5,
  12795. const typename ParamGenerator<T5>::iterator& current5,
  12796. const ParamGenerator<T6>& g6,
  12797. const typename ParamGenerator<T6>::iterator& current6,
  12798. const ParamGenerator<T7>& g7,
  12799. const typename ParamGenerator<T7>::iterator& current7)
  12800. : base_(base),
  12801. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12802. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  12803. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  12804. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  12805. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  12806. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  12807. begin7_(g7.begin()), end7_(g7.end()), current7_(current7) {
  12808. ComputeCurrentValue();
  12809. }
  12810. virtual ~Iterator() {}
  12811. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12812. return base_;
  12813. }
  12814. // Advance should not be called on beyond-of-range iterators
  12815. // so no component iterators must be beyond end of range, either.
  12816. virtual void Advance() {
  12817. assert(!AtEnd());
  12818. ++current7_;
  12819. if (current7_ == end7_) {
  12820. current7_ = begin7_;
  12821. ++current6_;
  12822. }
  12823. if (current6_ == end6_) {
  12824. current6_ = begin6_;
  12825. ++current5_;
  12826. }
  12827. if (current5_ == end5_) {
  12828. current5_ = begin5_;
  12829. ++current4_;
  12830. }
  12831. if (current4_ == end4_) {
  12832. current4_ = begin4_;
  12833. ++current3_;
  12834. }
  12835. if (current3_ == end3_) {
  12836. current3_ = begin3_;
  12837. ++current2_;
  12838. }
  12839. if (current2_ == end2_) {
  12840. current2_ = begin2_;
  12841. ++current1_;
  12842. }
  12843. ComputeCurrentValue();
  12844. }
  12845. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12846. return new Iterator(*this);
  12847. }
  12848. virtual const ParamType* Current() const { return &current_value_; }
  12849. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12850. // Having the same base generator guarantees that the other
  12851. // iterator is of the same type and we can downcast.
  12852. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12853. << "The program attempted to compare iterators "
  12854. << "from different generators." << std::endl;
  12855. const Iterator* typed_other =
  12856. CheckedDowncastToActualType<const Iterator>(&other);
  12857. // We must report iterators equal if they both point beyond their
  12858. // respective ranges. That can happen in a variety of fashions,
  12859. // so we have to consult AtEnd().
  12860. return (AtEnd() && typed_other->AtEnd()) ||
  12861. (
  12862. current1_ == typed_other->current1_ &&
  12863. current2_ == typed_other->current2_ &&
  12864. current3_ == typed_other->current3_ &&
  12865. current4_ == typed_other->current4_ &&
  12866. current5_ == typed_other->current5_ &&
  12867. current6_ == typed_other->current6_ &&
  12868. current7_ == typed_other->current7_);
  12869. }
  12870. private:
  12871. Iterator(const Iterator& other)
  12872. : base_(other.base_),
  12873. begin1_(other.begin1_),
  12874. end1_(other.end1_),
  12875. current1_(other.current1_),
  12876. begin2_(other.begin2_),
  12877. end2_(other.end2_),
  12878. current2_(other.current2_),
  12879. begin3_(other.begin3_),
  12880. end3_(other.end3_),
  12881. current3_(other.current3_),
  12882. begin4_(other.begin4_),
  12883. end4_(other.end4_),
  12884. current4_(other.current4_),
  12885. begin5_(other.begin5_),
  12886. end5_(other.end5_),
  12887. current5_(other.current5_),
  12888. begin6_(other.begin6_),
  12889. end6_(other.end6_),
  12890. current6_(other.current6_),
  12891. begin7_(other.begin7_),
  12892. end7_(other.end7_),
  12893. current7_(other.current7_) {
  12894. ComputeCurrentValue();
  12895. }
  12896. void ComputeCurrentValue() {
  12897. if (!AtEnd())
  12898. current_value_ = ParamType(*current1_, *current2_, *current3_,
  12899. *current4_, *current5_, *current6_, *current7_);
  12900. }
  12901. bool AtEnd() const {
  12902. // We must report iterator past the end of the range when either of the
  12903. // component iterators has reached the end of its range.
  12904. return
  12905. current1_ == end1_ ||
  12906. current2_ == end2_ ||
  12907. current3_ == end3_ ||
  12908. current4_ == end4_ ||
  12909. current5_ == end5_ ||
  12910. current6_ == end6_ ||
  12911. current7_ == end7_;
  12912. }
  12913. // No implementation - assignment is unsupported.
  12914. void operator=(const Iterator& other);
  12915. const ParamGeneratorInterface<ParamType>* const base_;
  12916. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12917. // current[i]_ is the actual traversing iterator.
  12918. const typename ParamGenerator<T1>::iterator begin1_;
  12919. const typename ParamGenerator<T1>::iterator end1_;
  12920. typename ParamGenerator<T1>::iterator current1_;
  12921. const typename ParamGenerator<T2>::iterator begin2_;
  12922. const typename ParamGenerator<T2>::iterator end2_;
  12923. typename ParamGenerator<T2>::iterator current2_;
  12924. const typename ParamGenerator<T3>::iterator begin3_;
  12925. const typename ParamGenerator<T3>::iterator end3_;
  12926. typename ParamGenerator<T3>::iterator current3_;
  12927. const typename ParamGenerator<T4>::iterator begin4_;
  12928. const typename ParamGenerator<T4>::iterator end4_;
  12929. typename ParamGenerator<T4>::iterator current4_;
  12930. const typename ParamGenerator<T5>::iterator begin5_;
  12931. const typename ParamGenerator<T5>::iterator end5_;
  12932. typename ParamGenerator<T5>::iterator current5_;
  12933. const typename ParamGenerator<T6>::iterator begin6_;
  12934. const typename ParamGenerator<T6>::iterator end6_;
  12935. typename ParamGenerator<T6>::iterator current6_;
  12936. const typename ParamGenerator<T7>::iterator begin7_;
  12937. const typename ParamGenerator<T7>::iterator end7_;
  12938. typename ParamGenerator<T7>::iterator current7_;
  12939. ParamType current_value_;
  12940. }; // class CartesianProductGenerator7::Iterator
  12941. // No implementation - assignment is unsupported.
  12942. void operator=(const CartesianProductGenerator7& other);
  12943. const ParamGenerator<T1> g1_;
  12944. const ParamGenerator<T2> g2_;
  12945. const ParamGenerator<T3> g3_;
  12946. const ParamGenerator<T4> g4_;
  12947. const ParamGenerator<T5> g5_;
  12948. const ParamGenerator<T6> g6_;
  12949. const ParamGenerator<T7> g7_;
  12950. }; // class CartesianProductGenerator7
  12951. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12952. typename T6, typename T7, typename T8>
  12953. class CartesianProductGenerator8
  12954. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
  12955. T7, T8> > {
  12956. public:
  12957. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
  12958. CartesianProductGenerator8(const ParamGenerator<T1>& g1,
  12959. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  12960. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  12961. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
  12962. const ParamGenerator<T8>& g8)
  12963. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
  12964. g8_(g8) {}
  12965. virtual ~CartesianProductGenerator8() {}
  12966. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12967. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12968. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  12969. g7_.begin(), g8_, g8_.begin());
  12970. }
  12971. virtual ParamIteratorInterface<ParamType>* End() const {
  12972. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  12973. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
  12974. g8_.end());
  12975. }
  12976. private:
  12977. class Iterator : public ParamIteratorInterface<ParamType> {
  12978. public:
  12979. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12980. const ParamGenerator<T1>& g1,
  12981. const typename ParamGenerator<T1>::iterator& current1,
  12982. const ParamGenerator<T2>& g2,
  12983. const typename ParamGenerator<T2>::iterator& current2,
  12984. const ParamGenerator<T3>& g3,
  12985. const typename ParamGenerator<T3>::iterator& current3,
  12986. const ParamGenerator<T4>& g4,
  12987. const typename ParamGenerator<T4>::iterator& current4,
  12988. const ParamGenerator<T5>& g5,
  12989. const typename ParamGenerator<T5>::iterator& current5,
  12990. const ParamGenerator<T6>& g6,
  12991. const typename ParamGenerator<T6>::iterator& current6,
  12992. const ParamGenerator<T7>& g7,
  12993. const typename ParamGenerator<T7>::iterator& current7,
  12994. const ParamGenerator<T8>& g8,
  12995. const typename ParamGenerator<T8>::iterator& current8)
  12996. : base_(base),
  12997. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12998. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  12999. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  13000. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  13001. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  13002. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  13003. begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
  13004. begin8_(g8.begin()), end8_(g8.end()), current8_(current8) {
  13005. ComputeCurrentValue();
  13006. }
  13007. virtual ~Iterator() {}
  13008. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  13009. return base_;
  13010. }
  13011. // Advance should not be called on beyond-of-range iterators
  13012. // so no component iterators must be beyond end of range, either.
  13013. virtual void Advance() {
  13014. assert(!AtEnd());
  13015. ++current8_;
  13016. if (current8_ == end8_) {
  13017. current8_ = begin8_;
  13018. ++current7_;
  13019. }
  13020. if (current7_ == end7_) {
  13021. current7_ = begin7_;
  13022. ++current6_;
  13023. }
  13024. if (current6_ == end6_) {
  13025. current6_ = begin6_;
  13026. ++current5_;
  13027. }
  13028. if (current5_ == end5_) {
  13029. current5_ = begin5_;
  13030. ++current4_;
  13031. }
  13032. if (current4_ == end4_) {
  13033. current4_ = begin4_;
  13034. ++current3_;
  13035. }
  13036. if (current3_ == end3_) {
  13037. current3_ = begin3_;
  13038. ++current2_;
  13039. }
  13040. if (current2_ == end2_) {
  13041. current2_ = begin2_;
  13042. ++current1_;
  13043. }
  13044. ComputeCurrentValue();
  13045. }
  13046. virtual ParamIteratorInterface<ParamType>* Clone() const {
  13047. return new Iterator(*this);
  13048. }
  13049. virtual const ParamType* Current() const { return &current_value_; }
  13050. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  13051. // Having the same base generator guarantees that the other
  13052. // iterator is of the same type and we can downcast.
  13053. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  13054. << "The program attempted to compare iterators "
  13055. << "from different generators." << std::endl;
  13056. const Iterator* typed_other =
  13057. CheckedDowncastToActualType<const Iterator>(&other);
  13058. // We must report iterators equal if they both point beyond their
  13059. // respective ranges. That can happen in a variety of fashions,
  13060. // so we have to consult AtEnd().
  13061. return (AtEnd() && typed_other->AtEnd()) ||
  13062. (
  13063. current1_ == typed_other->current1_ &&
  13064. current2_ == typed_other->current2_ &&
  13065. current3_ == typed_other->current3_ &&
  13066. current4_ == typed_other->current4_ &&
  13067. current5_ == typed_other->current5_ &&
  13068. current6_ == typed_other->current6_ &&
  13069. current7_ == typed_other->current7_ &&
  13070. current8_ == typed_other->current8_);
  13071. }
  13072. private:
  13073. Iterator(const Iterator& other)
  13074. : base_(other.base_),
  13075. begin1_(other.begin1_),
  13076. end1_(other.end1_),
  13077. current1_(other.current1_),
  13078. begin2_(other.begin2_),
  13079. end2_(other.end2_),
  13080. current2_(other.current2_),
  13081. begin3_(other.begin3_),
  13082. end3_(other.end3_),
  13083. current3_(other.current3_),
  13084. begin4_(other.begin4_),
  13085. end4_(other.end4_),
  13086. current4_(other.current4_),
  13087. begin5_(other.begin5_),
  13088. end5_(other.end5_),
  13089. current5_(other.current5_),
  13090. begin6_(other.begin6_),
  13091. end6_(other.end6_),
  13092. current6_(other.current6_),
  13093. begin7_(other.begin7_),
  13094. end7_(other.end7_),
  13095. current7_(other.current7_),
  13096. begin8_(other.begin8_),
  13097. end8_(other.end8_),
  13098. current8_(other.current8_) {
  13099. ComputeCurrentValue();
  13100. }
  13101. void ComputeCurrentValue() {
  13102. if (!AtEnd())
  13103. current_value_ = ParamType(*current1_, *current2_, *current3_,
  13104. *current4_, *current5_, *current6_, *current7_, *current8_);
  13105. }
  13106. bool AtEnd() const {
  13107. // We must report iterator past the end of the range when either of the
  13108. // component iterators has reached the end of its range.
  13109. return
  13110. current1_ == end1_ ||
  13111. current2_ == end2_ ||
  13112. current3_ == end3_ ||
  13113. current4_ == end4_ ||
  13114. current5_ == end5_ ||
  13115. current6_ == end6_ ||
  13116. current7_ == end7_ ||
  13117. current8_ == end8_;
  13118. }
  13119. // No implementation - assignment is unsupported.
  13120. void operator=(const Iterator& other);
  13121. const ParamGeneratorInterface<ParamType>* const base_;
  13122. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  13123. // current[i]_ is the actual traversing iterator.
  13124. const typename ParamGenerator<T1>::iterator begin1_;
  13125. const typename ParamGenerator<T1>::iterator end1_;
  13126. typename ParamGenerator<T1>::iterator current1_;
  13127. const typename ParamGenerator<T2>::iterator begin2_;
  13128. const typename ParamGenerator<T2>::iterator end2_;
  13129. typename ParamGenerator<T2>::iterator current2_;
  13130. const typename ParamGenerator<T3>::iterator begin3_;
  13131. const typename ParamGenerator<T3>::iterator end3_;
  13132. typename ParamGenerator<T3>::iterator current3_;
  13133. const typename ParamGenerator<T4>::iterator begin4_;
  13134. const typename ParamGenerator<T4>::iterator end4_;
  13135. typename ParamGenerator<T4>::iterator current4_;
  13136. const typename ParamGenerator<T5>::iterator begin5_;
  13137. const typename ParamGenerator<T5>::iterator end5_;
  13138. typename ParamGenerator<T5>::iterator current5_;
  13139. const typename ParamGenerator<T6>::iterator begin6_;
  13140. const typename ParamGenerator<T6>::iterator end6_;
  13141. typename ParamGenerator<T6>::iterator current6_;
  13142. const typename ParamGenerator<T7>::iterator begin7_;
  13143. const typename ParamGenerator<T7>::iterator end7_;
  13144. typename ParamGenerator<T7>::iterator current7_;
  13145. const typename ParamGenerator<T8>::iterator begin8_;
  13146. const typename ParamGenerator<T8>::iterator end8_;
  13147. typename ParamGenerator<T8>::iterator current8_;
  13148. ParamType current_value_;
  13149. }; // class CartesianProductGenerator8::Iterator
  13150. // No implementation - assignment is unsupported.
  13151. void operator=(const CartesianProductGenerator8& other);
  13152. const ParamGenerator<T1> g1_;
  13153. const ParamGenerator<T2> g2_;
  13154. const ParamGenerator<T3> g3_;
  13155. const ParamGenerator<T4> g4_;
  13156. const ParamGenerator<T5> g5_;
  13157. const ParamGenerator<T6> g6_;
  13158. const ParamGenerator<T7> g7_;
  13159. const ParamGenerator<T8> g8_;
  13160. }; // class CartesianProductGenerator8
  13161. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13162. typename T6, typename T7, typename T8, typename T9>
  13163. class CartesianProductGenerator9
  13164. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
  13165. T7, T8, T9> > {
  13166. public:
  13167. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
  13168. CartesianProductGenerator9(const ParamGenerator<T1>& g1,
  13169. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  13170. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  13171. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
  13172. const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
  13173. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  13174. g9_(g9) {}
  13175. virtual ~CartesianProductGenerator9() {}
  13176. virtual ParamIteratorInterface<ParamType>* Begin() const {
  13177. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  13178. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  13179. g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
  13180. }
  13181. virtual ParamIteratorInterface<ParamType>* End() const {
  13182. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  13183. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
  13184. g8_.end(), g9_, g9_.end());
  13185. }
  13186. private:
  13187. class Iterator : public ParamIteratorInterface<ParamType> {
  13188. public:
  13189. Iterator(const ParamGeneratorInterface<ParamType>* base,
  13190. const ParamGenerator<T1>& g1,
  13191. const typename ParamGenerator<T1>::iterator& current1,
  13192. const ParamGenerator<T2>& g2,
  13193. const typename ParamGenerator<T2>::iterator& current2,
  13194. const ParamGenerator<T3>& g3,
  13195. const typename ParamGenerator<T3>::iterator& current3,
  13196. const ParamGenerator<T4>& g4,
  13197. const typename ParamGenerator<T4>::iterator& current4,
  13198. const ParamGenerator<T5>& g5,
  13199. const typename ParamGenerator<T5>::iterator& current5,
  13200. const ParamGenerator<T6>& g6,
  13201. const typename ParamGenerator<T6>::iterator& current6,
  13202. const ParamGenerator<T7>& g7,
  13203. const typename ParamGenerator<T7>::iterator& current7,
  13204. const ParamGenerator<T8>& g8,
  13205. const typename ParamGenerator<T8>::iterator& current8,
  13206. const ParamGenerator<T9>& g9,
  13207. const typename ParamGenerator<T9>::iterator& current9)
  13208. : base_(base),
  13209. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  13210. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  13211. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  13212. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  13213. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  13214. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  13215. begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
  13216. begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
  13217. begin9_(g9.begin()), end9_(g9.end()), current9_(current9) {
  13218. ComputeCurrentValue();
  13219. }
  13220. virtual ~Iterator() {}
  13221. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  13222. return base_;
  13223. }
  13224. // Advance should not be called on beyond-of-range iterators
  13225. // so no component iterators must be beyond end of range, either.
  13226. virtual void Advance() {
  13227. assert(!AtEnd());
  13228. ++current9_;
  13229. if (current9_ == end9_) {
  13230. current9_ = begin9_;
  13231. ++current8_;
  13232. }
  13233. if (current8_ == end8_) {
  13234. current8_ = begin8_;
  13235. ++current7_;
  13236. }
  13237. if (current7_ == end7_) {
  13238. current7_ = begin7_;
  13239. ++current6_;
  13240. }
  13241. if (current6_ == end6_) {
  13242. current6_ = begin6_;
  13243. ++current5_;
  13244. }
  13245. if (current5_ == end5_) {
  13246. current5_ = begin5_;
  13247. ++current4_;
  13248. }
  13249. if (current4_ == end4_) {
  13250. current4_ = begin4_;
  13251. ++current3_;
  13252. }
  13253. if (current3_ == end3_) {
  13254. current3_ = begin3_;
  13255. ++current2_;
  13256. }
  13257. if (current2_ == end2_) {
  13258. current2_ = begin2_;
  13259. ++current1_;
  13260. }
  13261. ComputeCurrentValue();
  13262. }
  13263. virtual ParamIteratorInterface<ParamType>* Clone() const {
  13264. return new Iterator(*this);
  13265. }
  13266. virtual const ParamType* Current() const { return &current_value_; }
  13267. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  13268. // Having the same base generator guarantees that the other
  13269. // iterator is of the same type and we can downcast.
  13270. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  13271. << "The program attempted to compare iterators "
  13272. << "from different generators." << std::endl;
  13273. const Iterator* typed_other =
  13274. CheckedDowncastToActualType<const Iterator>(&other);
  13275. // We must report iterators equal if they both point beyond their
  13276. // respective ranges. That can happen in a variety of fashions,
  13277. // so we have to consult AtEnd().
  13278. return (AtEnd() && typed_other->AtEnd()) ||
  13279. (
  13280. current1_ == typed_other->current1_ &&
  13281. current2_ == typed_other->current2_ &&
  13282. current3_ == typed_other->current3_ &&
  13283. current4_ == typed_other->current4_ &&
  13284. current5_ == typed_other->current5_ &&
  13285. current6_ == typed_other->current6_ &&
  13286. current7_ == typed_other->current7_ &&
  13287. current8_ == typed_other->current8_ &&
  13288. current9_ == typed_other->current9_);
  13289. }
  13290. private:
  13291. Iterator(const Iterator& other)
  13292. : base_(other.base_),
  13293. begin1_(other.begin1_),
  13294. end1_(other.end1_),
  13295. current1_(other.current1_),
  13296. begin2_(other.begin2_),
  13297. end2_(other.end2_),
  13298. current2_(other.current2_),
  13299. begin3_(other.begin3_),
  13300. end3_(other.end3_),
  13301. current3_(other.current3_),
  13302. begin4_(other.begin4_),
  13303. end4_(other.end4_),
  13304. current4_(other.current4_),
  13305. begin5_(other.begin5_),
  13306. end5_(other.end5_),
  13307. current5_(other.current5_),
  13308. begin6_(other.begin6_),
  13309. end6_(other.end6_),
  13310. current6_(other.current6_),
  13311. begin7_(other.begin7_),
  13312. end7_(other.end7_),
  13313. current7_(other.current7_),
  13314. begin8_(other.begin8_),
  13315. end8_(other.end8_),
  13316. current8_(other.current8_),
  13317. begin9_(other.begin9_),
  13318. end9_(other.end9_),
  13319. current9_(other.current9_) {
  13320. ComputeCurrentValue();
  13321. }
  13322. void ComputeCurrentValue() {
  13323. if (!AtEnd())
  13324. current_value_ = ParamType(*current1_, *current2_, *current3_,
  13325. *current4_, *current5_, *current6_, *current7_, *current8_,
  13326. *current9_);
  13327. }
  13328. bool AtEnd() const {
  13329. // We must report iterator past the end of the range when either of the
  13330. // component iterators has reached the end of its range.
  13331. return
  13332. current1_ == end1_ ||
  13333. current2_ == end2_ ||
  13334. current3_ == end3_ ||
  13335. current4_ == end4_ ||
  13336. current5_ == end5_ ||
  13337. current6_ == end6_ ||
  13338. current7_ == end7_ ||
  13339. current8_ == end8_ ||
  13340. current9_ == end9_;
  13341. }
  13342. // No implementation - assignment is unsupported.
  13343. void operator=(const Iterator& other);
  13344. const ParamGeneratorInterface<ParamType>* const base_;
  13345. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  13346. // current[i]_ is the actual traversing iterator.
  13347. const typename ParamGenerator<T1>::iterator begin1_;
  13348. const typename ParamGenerator<T1>::iterator end1_;
  13349. typename ParamGenerator<T1>::iterator current1_;
  13350. const typename ParamGenerator<T2>::iterator begin2_;
  13351. const typename ParamGenerator<T2>::iterator end2_;
  13352. typename ParamGenerator<T2>::iterator current2_;
  13353. const typename ParamGenerator<T3>::iterator begin3_;
  13354. const typename ParamGenerator<T3>::iterator end3_;
  13355. typename ParamGenerator<T3>::iterator current3_;
  13356. const typename ParamGenerator<T4>::iterator begin4_;
  13357. const typename ParamGenerator<T4>::iterator end4_;
  13358. typename ParamGenerator<T4>::iterator current4_;
  13359. const typename ParamGenerator<T5>::iterator begin5_;
  13360. const typename ParamGenerator<T5>::iterator end5_;
  13361. typename ParamGenerator<T5>::iterator current5_;
  13362. const typename ParamGenerator<T6>::iterator begin6_;
  13363. const typename ParamGenerator<T6>::iterator end6_;
  13364. typename ParamGenerator<T6>::iterator current6_;
  13365. const typename ParamGenerator<T7>::iterator begin7_;
  13366. const typename ParamGenerator<T7>::iterator end7_;
  13367. typename ParamGenerator<T7>::iterator current7_;
  13368. const typename ParamGenerator<T8>::iterator begin8_;
  13369. const typename ParamGenerator<T8>::iterator end8_;
  13370. typename ParamGenerator<T8>::iterator current8_;
  13371. const typename ParamGenerator<T9>::iterator begin9_;
  13372. const typename ParamGenerator<T9>::iterator end9_;
  13373. typename ParamGenerator<T9>::iterator current9_;
  13374. ParamType current_value_;
  13375. }; // class CartesianProductGenerator9::Iterator
  13376. // No implementation - assignment is unsupported.
  13377. void operator=(const CartesianProductGenerator9& other);
  13378. const ParamGenerator<T1> g1_;
  13379. const ParamGenerator<T2> g2_;
  13380. const ParamGenerator<T3> g3_;
  13381. const ParamGenerator<T4> g4_;
  13382. const ParamGenerator<T5> g5_;
  13383. const ParamGenerator<T6> g6_;
  13384. const ParamGenerator<T7> g7_;
  13385. const ParamGenerator<T8> g8_;
  13386. const ParamGenerator<T9> g9_;
  13387. }; // class CartesianProductGenerator9
  13388. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13389. typename T6, typename T7, typename T8, typename T9, typename T10>
  13390. class CartesianProductGenerator10
  13391. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
  13392. T7, T8, T9, T10> > {
  13393. public:
  13394. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
  13395. CartesianProductGenerator10(const ParamGenerator<T1>& g1,
  13396. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  13397. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  13398. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
  13399. const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
  13400. const ParamGenerator<T10>& g10)
  13401. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  13402. g9_(g9), g10_(g10) {}
  13403. virtual ~CartesianProductGenerator10() {}
  13404. virtual ParamIteratorInterface<ParamType>* Begin() const {
  13405. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  13406. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  13407. g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
  13408. }
  13409. virtual ParamIteratorInterface<ParamType>* End() const {
  13410. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  13411. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
  13412. g8_.end(), g9_, g9_.end(), g10_, g10_.end());
  13413. }
  13414. private:
  13415. class Iterator : public ParamIteratorInterface<ParamType> {
  13416. public:
  13417. Iterator(const ParamGeneratorInterface<ParamType>* base,
  13418. const ParamGenerator<T1>& g1,
  13419. const typename ParamGenerator<T1>::iterator& current1,
  13420. const ParamGenerator<T2>& g2,
  13421. const typename ParamGenerator<T2>::iterator& current2,
  13422. const ParamGenerator<T3>& g3,
  13423. const typename ParamGenerator<T3>::iterator& current3,
  13424. const ParamGenerator<T4>& g4,
  13425. const typename ParamGenerator<T4>::iterator& current4,
  13426. const ParamGenerator<T5>& g5,
  13427. const typename ParamGenerator<T5>::iterator& current5,
  13428. const ParamGenerator<T6>& g6,
  13429. const typename ParamGenerator<T6>::iterator& current6,
  13430. const ParamGenerator<T7>& g7,
  13431. const typename ParamGenerator<T7>::iterator& current7,
  13432. const ParamGenerator<T8>& g8,
  13433. const typename ParamGenerator<T8>::iterator& current8,
  13434. const ParamGenerator<T9>& g9,
  13435. const typename ParamGenerator<T9>::iterator& current9,
  13436. const ParamGenerator<T10>& g10,
  13437. const typename ParamGenerator<T10>::iterator& current10)
  13438. : base_(base),
  13439. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  13440. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  13441. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  13442. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  13443. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  13444. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  13445. begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
  13446. begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
  13447. begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
  13448. begin10_(g10.begin()), end10_(g10.end()), current10_(current10) {
  13449. ComputeCurrentValue();
  13450. }
  13451. virtual ~Iterator() {}
  13452. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  13453. return base_;
  13454. }
  13455. // Advance should not be called on beyond-of-range iterators
  13456. // so no component iterators must be beyond end of range, either.
  13457. virtual void Advance() {
  13458. assert(!AtEnd());
  13459. ++current10_;
  13460. if (current10_ == end10_) {
  13461. current10_ = begin10_;
  13462. ++current9_;
  13463. }
  13464. if (current9_ == end9_) {
  13465. current9_ = begin9_;
  13466. ++current8_;
  13467. }
  13468. if (current8_ == end8_) {
  13469. current8_ = begin8_;
  13470. ++current7_;
  13471. }
  13472. if (current7_ == end7_) {
  13473. current7_ = begin7_;
  13474. ++current6_;
  13475. }
  13476. if (current6_ == end6_) {
  13477. current6_ = begin6_;
  13478. ++current5_;
  13479. }
  13480. if (current5_ == end5_) {
  13481. current5_ = begin5_;
  13482. ++current4_;
  13483. }
  13484. if (current4_ == end4_) {
  13485. current4_ = begin4_;
  13486. ++current3_;
  13487. }
  13488. if (current3_ == end3_) {
  13489. current3_ = begin3_;
  13490. ++current2_;
  13491. }
  13492. if (current2_ == end2_) {
  13493. current2_ = begin2_;
  13494. ++current1_;
  13495. }
  13496. ComputeCurrentValue();
  13497. }
  13498. virtual ParamIteratorInterface<ParamType>* Clone() const {
  13499. return new Iterator(*this);
  13500. }
  13501. virtual const ParamType* Current() const { return &current_value_; }
  13502. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  13503. // Having the same base generator guarantees that the other
  13504. // iterator is of the same type and we can downcast.
  13505. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  13506. << "The program attempted to compare iterators "
  13507. << "from different generators." << std::endl;
  13508. const Iterator* typed_other =
  13509. CheckedDowncastToActualType<const Iterator>(&other);
  13510. // We must report iterators equal if they both point beyond their
  13511. // respective ranges. That can happen in a variety of fashions,
  13512. // so we have to consult AtEnd().
  13513. return (AtEnd() && typed_other->AtEnd()) ||
  13514. (
  13515. current1_ == typed_other->current1_ &&
  13516. current2_ == typed_other->current2_ &&
  13517. current3_ == typed_other->current3_ &&
  13518. current4_ == typed_other->current4_ &&
  13519. current5_ == typed_other->current5_ &&
  13520. current6_ == typed_other->current6_ &&
  13521. current7_ == typed_other->current7_ &&
  13522. current8_ == typed_other->current8_ &&
  13523. current9_ == typed_other->current9_ &&
  13524. current10_ == typed_other->current10_);
  13525. }
  13526. private:
  13527. Iterator(const Iterator& other)
  13528. : base_(other.base_),
  13529. begin1_(other.begin1_),
  13530. end1_(other.end1_),
  13531. current1_(other.current1_),
  13532. begin2_(other.begin2_),
  13533. end2_(other.end2_),
  13534. current2_(other.current2_),
  13535. begin3_(other.begin3_),
  13536. end3_(other.end3_),
  13537. current3_(other.current3_),
  13538. begin4_(other.begin4_),
  13539. end4_(other.end4_),
  13540. current4_(other.current4_),
  13541. begin5_(other.begin5_),
  13542. end5_(other.end5_),
  13543. current5_(other.current5_),
  13544. begin6_(other.begin6_),
  13545. end6_(other.end6_),
  13546. current6_(other.current6_),
  13547. begin7_(other.begin7_),
  13548. end7_(other.end7_),
  13549. current7_(other.current7_),
  13550. begin8_(other.begin8_),
  13551. end8_(other.end8_),
  13552. current8_(other.current8_),
  13553. begin9_(other.begin9_),
  13554. end9_(other.end9_),
  13555. current9_(other.current9_),
  13556. begin10_(other.begin10_),
  13557. end10_(other.end10_),
  13558. current10_(other.current10_) {
  13559. ComputeCurrentValue();
  13560. }
  13561. void ComputeCurrentValue() {
  13562. if (!AtEnd())
  13563. current_value_ = ParamType(*current1_, *current2_, *current3_,
  13564. *current4_, *current5_, *current6_, *current7_, *current8_,
  13565. *current9_, *current10_);
  13566. }
  13567. bool AtEnd() const {
  13568. // We must report iterator past the end of the range when either of the
  13569. // component iterators has reached the end of its range.
  13570. return
  13571. current1_ == end1_ ||
  13572. current2_ == end2_ ||
  13573. current3_ == end3_ ||
  13574. current4_ == end4_ ||
  13575. current5_ == end5_ ||
  13576. current6_ == end6_ ||
  13577. current7_ == end7_ ||
  13578. current8_ == end8_ ||
  13579. current9_ == end9_ ||
  13580. current10_ == end10_;
  13581. }
  13582. // No implementation - assignment is unsupported.
  13583. void operator=(const Iterator& other);
  13584. const ParamGeneratorInterface<ParamType>* const base_;
  13585. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  13586. // current[i]_ is the actual traversing iterator.
  13587. const typename ParamGenerator<T1>::iterator begin1_;
  13588. const typename ParamGenerator<T1>::iterator end1_;
  13589. typename ParamGenerator<T1>::iterator current1_;
  13590. const typename ParamGenerator<T2>::iterator begin2_;
  13591. const typename ParamGenerator<T2>::iterator end2_;
  13592. typename ParamGenerator<T2>::iterator current2_;
  13593. const typename ParamGenerator<T3>::iterator begin3_;
  13594. const typename ParamGenerator<T3>::iterator end3_;
  13595. typename ParamGenerator<T3>::iterator current3_;
  13596. const typename ParamGenerator<T4>::iterator begin4_;
  13597. const typename ParamGenerator<T4>::iterator end4_;
  13598. typename ParamGenerator<T4>::iterator current4_;
  13599. const typename ParamGenerator<T5>::iterator begin5_;
  13600. const typename ParamGenerator<T5>::iterator end5_;
  13601. typename ParamGenerator<T5>::iterator current5_;
  13602. const typename ParamGenerator<T6>::iterator begin6_;
  13603. const typename ParamGenerator<T6>::iterator end6_;
  13604. typename ParamGenerator<T6>::iterator current6_;
  13605. const typename ParamGenerator<T7>::iterator begin7_;
  13606. const typename ParamGenerator<T7>::iterator end7_;
  13607. typename ParamGenerator<T7>::iterator current7_;
  13608. const typename ParamGenerator<T8>::iterator begin8_;
  13609. const typename ParamGenerator<T8>::iterator end8_;
  13610. typename ParamGenerator<T8>::iterator current8_;
  13611. const typename ParamGenerator<T9>::iterator begin9_;
  13612. const typename ParamGenerator<T9>::iterator end9_;
  13613. typename ParamGenerator<T9>::iterator current9_;
  13614. const typename ParamGenerator<T10>::iterator begin10_;
  13615. const typename ParamGenerator<T10>::iterator end10_;
  13616. typename ParamGenerator<T10>::iterator current10_;
  13617. ParamType current_value_;
  13618. }; // class CartesianProductGenerator10::Iterator
  13619. // No implementation - assignment is unsupported.
  13620. void operator=(const CartesianProductGenerator10& other);
  13621. const ParamGenerator<T1> g1_;
  13622. const ParamGenerator<T2> g2_;
  13623. const ParamGenerator<T3> g3_;
  13624. const ParamGenerator<T4> g4_;
  13625. const ParamGenerator<T5> g5_;
  13626. const ParamGenerator<T6> g6_;
  13627. const ParamGenerator<T7> g7_;
  13628. const ParamGenerator<T8> g8_;
  13629. const ParamGenerator<T9> g9_;
  13630. const ParamGenerator<T10> g10_;
  13631. }; // class CartesianProductGenerator10
  13632. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  13633. //
  13634. // Helper classes providing Combine() with polymorphic features. They allow
  13635. // casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
  13636. // convertible to U.
  13637. //
  13638. template <class Generator1, class Generator2>
  13639. class CartesianProductHolder2 {
  13640. public:
  13641. CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
  13642. : g1_(g1), g2_(g2) {}
  13643. template <typename T1, typename T2>
  13644. operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {
  13645. return ParamGenerator< ::std::tr1::tuple<T1, T2> >(
  13646. new CartesianProductGenerator2<T1, T2>(
  13647. static_cast<ParamGenerator<T1> >(g1_),
  13648. static_cast<ParamGenerator<T2> >(g2_)));
  13649. }
  13650. private:
  13651. // No implementation - assignment is unsupported.
  13652. void operator=(const CartesianProductHolder2& other);
  13653. const Generator1 g1_;
  13654. const Generator2 g2_;
  13655. }; // class CartesianProductHolder2
  13656. template <class Generator1, class Generator2, class Generator3>
  13657. class CartesianProductHolder3 {
  13658. public:
  13659. CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
  13660. const Generator3& g3)
  13661. : g1_(g1), g2_(g2), g3_(g3) {}
  13662. template <typename T1, typename T2, typename T3>
  13663. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {
  13664. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(
  13665. new CartesianProductGenerator3<T1, T2, T3>(
  13666. static_cast<ParamGenerator<T1> >(g1_),
  13667. static_cast<ParamGenerator<T2> >(g2_),
  13668. static_cast<ParamGenerator<T3> >(g3_)));
  13669. }
  13670. private:
  13671. // No implementation - assignment is unsupported.
  13672. void operator=(const CartesianProductHolder3& other);
  13673. const Generator1 g1_;
  13674. const Generator2 g2_;
  13675. const Generator3 g3_;
  13676. }; // class CartesianProductHolder3
  13677. template <class Generator1, class Generator2, class Generator3,
  13678. class Generator4>
  13679. class CartesianProductHolder4 {
  13680. public:
  13681. CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
  13682. const Generator3& g3, const Generator4& g4)
  13683. : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
  13684. template <typename T1, typename T2, typename T3, typename T4>
  13685. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {
  13686. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(
  13687. new CartesianProductGenerator4<T1, T2, T3, T4>(
  13688. static_cast<ParamGenerator<T1> >(g1_),
  13689. static_cast<ParamGenerator<T2> >(g2_),
  13690. static_cast<ParamGenerator<T3> >(g3_),
  13691. static_cast<ParamGenerator<T4> >(g4_)));
  13692. }
  13693. private:
  13694. // No implementation - assignment is unsupported.
  13695. void operator=(const CartesianProductHolder4& other);
  13696. const Generator1 g1_;
  13697. const Generator2 g2_;
  13698. const Generator3 g3_;
  13699. const Generator4 g4_;
  13700. }; // class CartesianProductHolder4
  13701. template <class Generator1, class Generator2, class Generator3,
  13702. class Generator4, class Generator5>
  13703. class CartesianProductHolder5 {
  13704. public:
  13705. CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
  13706. const Generator3& g3, const Generator4& g4, const Generator5& g5)
  13707. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
  13708. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  13709. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {
  13710. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(
  13711. new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
  13712. static_cast<ParamGenerator<T1> >(g1_),
  13713. static_cast<ParamGenerator<T2> >(g2_),
  13714. static_cast<ParamGenerator<T3> >(g3_),
  13715. static_cast<ParamGenerator<T4> >(g4_),
  13716. static_cast<ParamGenerator<T5> >(g5_)));
  13717. }
  13718. private:
  13719. // No implementation - assignment is unsupported.
  13720. void operator=(const CartesianProductHolder5& other);
  13721. const Generator1 g1_;
  13722. const Generator2 g2_;
  13723. const Generator3 g3_;
  13724. const Generator4 g4_;
  13725. const Generator5 g5_;
  13726. }; // class CartesianProductHolder5
  13727. template <class Generator1, class Generator2, class Generator3,
  13728. class Generator4, class Generator5, class Generator6>
  13729. class CartesianProductHolder6 {
  13730. public:
  13731. CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
  13732. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  13733. const Generator6& g6)
  13734. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
  13735. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13736. typename T6>
  13737. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {
  13738. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(
  13739. new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
  13740. static_cast<ParamGenerator<T1> >(g1_),
  13741. static_cast<ParamGenerator<T2> >(g2_),
  13742. static_cast<ParamGenerator<T3> >(g3_),
  13743. static_cast<ParamGenerator<T4> >(g4_),
  13744. static_cast<ParamGenerator<T5> >(g5_),
  13745. static_cast<ParamGenerator<T6> >(g6_)));
  13746. }
  13747. private:
  13748. // No implementation - assignment is unsupported.
  13749. void operator=(const CartesianProductHolder6& other);
  13750. const Generator1 g1_;
  13751. const Generator2 g2_;
  13752. const Generator3 g3_;
  13753. const Generator4 g4_;
  13754. const Generator5 g5_;
  13755. const Generator6 g6_;
  13756. }; // class CartesianProductHolder6
  13757. template <class Generator1, class Generator2, class Generator3,
  13758. class Generator4, class Generator5, class Generator6, class Generator7>
  13759. class CartesianProductHolder7 {
  13760. public:
  13761. CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
  13762. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  13763. const Generator6& g6, const Generator7& g7)
  13764. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
  13765. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13766. typename T6, typename T7>
  13767. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
  13768. T7> >() const {
  13769. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(
  13770. new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
  13771. static_cast<ParamGenerator<T1> >(g1_),
  13772. static_cast<ParamGenerator<T2> >(g2_),
  13773. static_cast<ParamGenerator<T3> >(g3_),
  13774. static_cast<ParamGenerator<T4> >(g4_),
  13775. static_cast<ParamGenerator<T5> >(g5_),
  13776. static_cast<ParamGenerator<T6> >(g6_),
  13777. static_cast<ParamGenerator<T7> >(g7_)));
  13778. }
  13779. private:
  13780. // No implementation - assignment is unsupported.
  13781. void operator=(const CartesianProductHolder7& other);
  13782. const Generator1 g1_;
  13783. const Generator2 g2_;
  13784. const Generator3 g3_;
  13785. const Generator4 g4_;
  13786. const Generator5 g5_;
  13787. const Generator6 g6_;
  13788. const Generator7 g7_;
  13789. }; // class CartesianProductHolder7
  13790. template <class Generator1, class Generator2, class Generator3,
  13791. class Generator4, class Generator5, class Generator6, class Generator7,
  13792. class Generator8>
  13793. class CartesianProductHolder8 {
  13794. public:
  13795. CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
  13796. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  13797. const Generator6& g6, const Generator7& g7, const Generator8& g8)
  13798. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
  13799. g8_(g8) {}
  13800. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13801. typename T6, typename T7, typename T8>
  13802. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,
  13803. T8> >() const {
  13804. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
  13805. new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
  13806. static_cast<ParamGenerator<T1> >(g1_),
  13807. static_cast<ParamGenerator<T2> >(g2_),
  13808. static_cast<ParamGenerator<T3> >(g3_),
  13809. static_cast<ParamGenerator<T4> >(g4_),
  13810. static_cast<ParamGenerator<T5> >(g5_),
  13811. static_cast<ParamGenerator<T6> >(g6_),
  13812. static_cast<ParamGenerator<T7> >(g7_),
  13813. static_cast<ParamGenerator<T8> >(g8_)));
  13814. }
  13815. private:
  13816. // No implementation - assignment is unsupported.
  13817. void operator=(const CartesianProductHolder8& other);
  13818. const Generator1 g1_;
  13819. const Generator2 g2_;
  13820. const Generator3 g3_;
  13821. const Generator4 g4_;
  13822. const Generator5 g5_;
  13823. const Generator6 g6_;
  13824. const Generator7 g7_;
  13825. const Generator8 g8_;
  13826. }; // class CartesianProductHolder8
  13827. template <class Generator1, class Generator2, class Generator3,
  13828. class Generator4, class Generator5, class Generator6, class Generator7,
  13829. class Generator8, class Generator9>
  13830. class CartesianProductHolder9 {
  13831. public:
  13832. CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
  13833. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  13834. const Generator6& g6, const Generator7& g7, const Generator8& g8,
  13835. const Generator9& g9)
  13836. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  13837. g9_(g9) {}
  13838. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13839. typename T6, typename T7, typename T8, typename T9>
  13840. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
  13841. T9> >() const {
  13842. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
  13843. T9> >(
  13844. new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
  13845. static_cast<ParamGenerator<T1> >(g1_),
  13846. static_cast<ParamGenerator<T2> >(g2_),
  13847. static_cast<ParamGenerator<T3> >(g3_),
  13848. static_cast<ParamGenerator<T4> >(g4_),
  13849. static_cast<ParamGenerator<T5> >(g5_),
  13850. static_cast<ParamGenerator<T6> >(g6_),
  13851. static_cast<ParamGenerator<T7> >(g7_),
  13852. static_cast<ParamGenerator<T8> >(g8_),
  13853. static_cast<ParamGenerator<T9> >(g9_)));
  13854. }
  13855. private:
  13856. // No implementation - assignment is unsupported.
  13857. void operator=(const CartesianProductHolder9& other);
  13858. const Generator1 g1_;
  13859. const Generator2 g2_;
  13860. const Generator3 g3_;
  13861. const Generator4 g4_;
  13862. const Generator5 g5_;
  13863. const Generator6 g6_;
  13864. const Generator7 g7_;
  13865. const Generator8 g8_;
  13866. const Generator9 g9_;
  13867. }; // class CartesianProductHolder9
  13868. template <class Generator1, class Generator2, class Generator3,
  13869. class Generator4, class Generator5, class Generator6, class Generator7,
  13870. class Generator8, class Generator9, class Generator10>
  13871. class CartesianProductHolder10 {
  13872. public:
  13873. CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
  13874. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  13875. const Generator6& g6, const Generator7& g7, const Generator8& g8,
  13876. const Generator9& g9, const Generator10& g10)
  13877. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  13878. g9_(g9), g10_(g10) {}
  13879. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13880. typename T6, typename T7, typename T8, typename T9, typename T10>
  13881. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
  13882. T9, T10> >() const {
  13883. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
  13884. T9, T10> >(
  13885. new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
  13886. T10>(
  13887. static_cast<ParamGenerator<T1> >(g1_),
  13888. static_cast<ParamGenerator<T2> >(g2_),
  13889. static_cast<ParamGenerator<T3> >(g3_),
  13890. static_cast<ParamGenerator<T4> >(g4_),
  13891. static_cast<ParamGenerator<T5> >(g5_),
  13892. static_cast<ParamGenerator<T6> >(g6_),
  13893. static_cast<ParamGenerator<T7> >(g7_),
  13894. static_cast<ParamGenerator<T8> >(g8_),
  13895. static_cast<ParamGenerator<T9> >(g9_),
  13896. static_cast<ParamGenerator<T10> >(g10_)));
  13897. }
  13898. private:
  13899. // No implementation - assignment is unsupported.
  13900. void operator=(const CartesianProductHolder10& other);
  13901. const Generator1 g1_;
  13902. const Generator2 g2_;
  13903. const Generator3 g3_;
  13904. const Generator4 g4_;
  13905. const Generator5 g5_;
  13906. const Generator6 g6_;
  13907. const Generator7 g7_;
  13908. const Generator8 g8_;
  13909. const Generator9 g9_;
  13910. const Generator10 g10_;
  13911. }; // class CartesianProductHolder10
  13912. # endif // GTEST_HAS_COMBINE
  13913. } // namespace internal
  13914. } // namespace testing
  13915. #endif // GTEST_HAS_PARAM_TEST
  13916. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
  13917. #if GTEST_HAS_PARAM_TEST
  13918. namespace testing {
  13919. // Functions producing parameter generators.
  13920. //
  13921. // Google Test uses these generators to produce parameters for value-
  13922. // parameterized tests. When a parameterized test case is instantiated
  13923. // with a particular generator, Google Test creates and runs tests
  13924. // for each element in the sequence produced by the generator.
  13925. //
  13926. // In the following sample, tests from test case FooTest are instantiated
  13927. // each three times with parameter values 3, 5, and 8:
  13928. //
  13929. // class FooTest : public TestWithParam<int> { ... };
  13930. //
  13931. // TEST_P(FooTest, TestThis) {
  13932. // }
  13933. // TEST_P(FooTest, TestThat) {
  13934. // }
  13935. // INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
  13936. //
  13937. // Range() returns generators providing sequences of values in a range.
  13938. //
  13939. // Synopsis:
  13940. // Range(start, end)
  13941. // - returns a generator producing a sequence of values {start, start+1,
  13942. // start+2, ..., }.
  13943. // Range(start, end, step)
  13944. // - returns a generator producing a sequence of values {start, start+step,
  13945. // start+step+step, ..., }.
  13946. // Notes:
  13947. // * The generated sequences never include end. For example, Range(1, 5)
  13948. // returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
  13949. // returns a generator producing {1, 3, 5, 7}.
  13950. // * start and end must have the same type. That type may be any integral or
  13951. // floating-point type or a user defined type satisfying these conditions:
  13952. // * It must be assignable (have operator=() defined).
  13953. // * It must have operator+() (operator+(int-compatible type) for
  13954. // two-operand version).
  13955. // * It must have operator<() defined.
  13956. // Elements in the resulting sequences will also have that type.
  13957. // * Condition start < end must be satisfied in order for resulting sequences
  13958. // to contain any elements.
  13959. //
  13960. template <typename T, typename IncrementT>
  13961. internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
  13962. return internal::ParamGenerator<T>(
  13963. new internal::RangeGenerator<T, IncrementT>(start, end, step));
  13964. }
  13965. template <typename T>
  13966. internal::ParamGenerator<T> Range(T start, T end) {
  13967. return Range(start, end, 1);
  13968. }
  13969. // ValuesIn() function allows generation of tests with parameters coming from
  13970. // a container.
  13971. //
  13972. // Synopsis:
  13973. // ValuesIn(const T (&array)[N])
  13974. // - returns a generator producing sequences with elements from
  13975. // a C-style array.
  13976. // ValuesIn(const Container& container)
  13977. // - returns a generator producing sequences with elements from
  13978. // an STL-style container.
  13979. // ValuesIn(Iterator begin, Iterator end)
  13980. // - returns a generator producing sequences with elements from
  13981. // a range [begin, end) defined by a pair of STL-style iterators. These
  13982. // iterators can also be plain C pointers.
  13983. //
  13984. // Please note that ValuesIn copies the values from the containers
  13985. // passed in and keeps them to generate tests in RUN_ALL_TESTS().
  13986. //
  13987. // Examples:
  13988. //
  13989. // This instantiates tests from test case StringTest
  13990. // each with C-string values of "foo", "bar", and "baz":
  13991. //
  13992. // const char* strings[] = {"foo", "bar", "baz"};
  13993. // INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
  13994. //
  13995. // This instantiates tests from test case StlStringTest
  13996. // each with STL strings with values "a" and "b":
  13997. //
  13998. // ::std::vector< ::std::string> GetParameterStrings() {
  13999. // ::std::vector< ::std::string> v;
  14000. // v.push_back("a");
  14001. // v.push_back("b");
  14002. // return v;
  14003. // }
  14004. //
  14005. // INSTANTIATE_TEST_CASE_P(CharSequence,
  14006. // StlStringTest,
  14007. // ValuesIn(GetParameterStrings()));
  14008. //
  14009. //
  14010. // This will also instantiate tests from CharTest
  14011. // each with parameter values 'a' and 'b':
  14012. //
  14013. // ::std::list<char> GetParameterChars() {
  14014. // ::std::list<char> list;
  14015. // list.push_back('a');
  14016. // list.push_back('b');
  14017. // return list;
  14018. // }
  14019. // ::std::list<char> l = GetParameterChars();
  14020. // INSTANTIATE_TEST_CASE_P(CharSequence2,
  14021. // CharTest,
  14022. // ValuesIn(l.begin(), l.end()));
  14023. //
  14024. template <typename ForwardIterator>
  14025. internal::ParamGenerator<
  14026. typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
  14027. ValuesIn(ForwardIterator begin, ForwardIterator end) {
  14028. typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
  14029. ::value_type ParamType;
  14030. return internal::ParamGenerator<ParamType>(
  14031. new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
  14032. }
  14033. template <typename T, size_t N>
  14034. internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
  14035. return ValuesIn(array, array + N);
  14036. }
  14037. template <class Container>
  14038. internal::ParamGenerator<typename Container::value_type> ValuesIn(
  14039. const Container& container) {
  14040. return ValuesIn(container.begin(), container.end());
  14041. }
  14042. // Values() allows generating tests from explicitly specified list of
  14043. // parameters.
  14044. //
  14045. // Synopsis:
  14046. // Values(T v1, T v2, ..., T vN)
  14047. // - returns a generator producing sequences with elements v1, v2, ..., vN.
  14048. //
  14049. // For example, this instantiates tests from test case BarTest each
  14050. // with values "one", "two", and "three":
  14051. //
  14052. // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
  14053. //
  14054. // This instantiates tests from test case BazTest each with values 1, 2, 3.5.
  14055. // The exact type of values will depend on the type of parameter in BazTest.
  14056. //
  14057. // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
  14058. //
  14059. // Currently, Values() supports from 1 to 50 parameters.
  14060. //
  14061. template <typename T1>
  14062. internal::ValueArray1<T1> Values(T1 v1) {
  14063. return internal::ValueArray1<T1>(v1);
  14064. }
  14065. template <typename T1, typename T2>
  14066. internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
  14067. return internal::ValueArray2<T1, T2>(v1, v2);
  14068. }
  14069. template <typename T1, typename T2, typename T3>
  14070. internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
  14071. return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
  14072. }
  14073. template <typename T1, typename T2, typename T3, typename T4>
  14074. internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
  14075. return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
  14076. }
  14077. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  14078. internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14079. T5 v5) {
  14080. return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
  14081. }
  14082. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14083. typename T6>
  14084. internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
  14085. T4 v4, T5 v5, T6 v6) {
  14086. return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
  14087. }
  14088. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14089. typename T6, typename T7>
  14090. internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
  14091. T4 v4, T5 v5, T6 v6, T7 v7) {
  14092. return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
  14093. v6, v7);
  14094. }
  14095. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14096. typename T6, typename T7, typename T8>
  14097. internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
  14098. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
  14099. return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
  14100. v5, v6, v7, v8);
  14101. }
  14102. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14103. typename T6, typename T7, typename T8, typename T9>
  14104. internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
  14105. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
  14106. return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
  14107. v4, v5, v6, v7, v8, v9);
  14108. }
  14109. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14110. typename T6, typename T7, typename T8, typename T9, typename T10>
  14111. internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
  14112. T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
  14113. return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
  14114. v2, v3, v4, v5, v6, v7, v8, v9, v10);
  14115. }
  14116. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14117. typename T6, typename T7, typename T8, typename T9, typename T10,
  14118. typename T11>
  14119. internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
  14120. T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14121. T10 v10, T11 v11) {
  14122. return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
  14123. T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
  14124. }
  14125. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14126. typename T6, typename T7, typename T8, typename T9, typename T10,
  14127. typename T11, typename T12>
  14128. internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14129. T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14130. T10 v10, T11 v11, T12 v12) {
  14131. return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14132. T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
  14133. }
  14134. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14135. typename T6, typename T7, typename T8, typename T9, typename T10,
  14136. typename T11, typename T12, typename T13>
  14137. internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  14138. T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14139. T10 v10, T11 v11, T12 v12, T13 v13) {
  14140. return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14141. T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
  14142. }
  14143. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14144. typename T6, typename T7, typename T8, typename T9, typename T10,
  14145. typename T11, typename T12, typename T13, typename T14>
  14146. internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14147. T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14148. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
  14149. return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14150. T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
  14151. v14);
  14152. }
  14153. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14154. typename T6, typename T7, typename T8, typename T9, typename T10,
  14155. typename T11, typename T12, typename T13, typename T14, typename T15>
  14156. internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14157. T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  14158. T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
  14159. return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14160. T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
  14161. v13, v14, v15);
  14162. }
  14163. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14164. typename T6, typename T7, typename T8, typename T9, typename T10,
  14165. typename T11, typename T12, typename T13, typename T14, typename T15,
  14166. typename T16>
  14167. internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14168. T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14169. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14170. T16 v16) {
  14171. return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14172. T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
  14173. v12, v13, v14, v15, v16);
  14174. }
  14175. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14176. typename T6, typename T7, typename T8, typename T9, typename T10,
  14177. typename T11, typename T12, typename T13, typename T14, typename T15,
  14178. typename T16, typename T17>
  14179. internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14180. T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14181. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14182. T16 v16, T17 v17) {
  14183. return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14184. T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
  14185. v11, v12, v13, v14, v15, v16, v17);
  14186. }
  14187. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14188. typename T6, typename T7, typename T8, typename T9, typename T10,
  14189. typename T11, typename T12, typename T13, typename T14, typename T15,
  14190. typename T16, typename T17, typename T18>
  14191. internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14192. T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
  14193. T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14194. T16 v16, T17 v17, T18 v18) {
  14195. return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14196. T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
  14197. v10, v11, v12, v13, v14, v15, v16, v17, v18);
  14198. }
  14199. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14200. typename T6, typename T7, typename T8, typename T9, typename T10,
  14201. typename T11, typename T12, typename T13, typename T14, typename T15,
  14202. typename T16, typename T17, typename T18, typename T19>
  14203. internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14204. T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
  14205. T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
  14206. T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
  14207. return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14208. T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
  14209. v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
  14210. }
  14211. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14212. typename T6, typename T7, typename T8, typename T9, typename T10,
  14213. typename T11, typename T12, typename T13, typename T14, typename T15,
  14214. typename T16, typename T17, typename T18, typename T19, typename T20>
  14215. internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14216. T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14217. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  14218. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
  14219. return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14220. T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
  14221. v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
  14222. }
  14223. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14224. typename T6, typename T7, typename T8, typename T9, typename T10,
  14225. typename T11, typename T12, typename T13, typename T14, typename T15,
  14226. typename T16, typename T17, typename T18, typename T19, typename T20,
  14227. typename T21>
  14228. internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14229. T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14230. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  14231. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
  14232. return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14233. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
  14234. v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
  14235. }
  14236. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14237. typename T6, typename T7, typename T8, typename T9, typename T10,
  14238. typename T11, typename T12, typename T13, typename T14, typename T15,
  14239. typename T16, typename T17, typename T18, typename T19, typename T20,
  14240. typename T21, typename T22>
  14241. internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14242. T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
  14243. T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14244. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14245. T21 v21, T22 v22) {
  14246. return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14247. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
  14248. v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  14249. v20, v21, v22);
  14250. }
  14251. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14252. typename T6, typename T7, typename T8, typename T9, typename T10,
  14253. typename T11, typename T12, typename T13, typename T14, typename T15,
  14254. typename T16, typename T17, typename T18, typename T19, typename T20,
  14255. typename T21, typename T22, typename T23>
  14256. internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14257. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
  14258. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14259. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14260. T21 v21, T22 v22, T23 v23) {
  14261. return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14262. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
  14263. v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  14264. v20, v21, v22, v23);
  14265. }
  14266. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14267. typename T6, typename T7, typename T8, typename T9, typename T10,
  14268. typename T11, typename T12, typename T13, typename T14, typename T15,
  14269. typename T16, typename T17, typename T18, typename T19, typename T20,
  14270. typename T21, typename T22, typename T23, typename T24>
  14271. internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14272. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
  14273. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14274. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14275. T21 v21, T22 v22, T23 v23, T24 v24) {
  14276. return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14277. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
  14278. v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
  14279. v19, v20, v21, v22, v23, v24);
  14280. }
  14281. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14282. typename T6, typename T7, typename T8, typename T9, typename T10,
  14283. typename T11, typename T12, typename T13, typename T14, typename T15,
  14284. typename T16, typename T17, typename T18, typename T19, typename T20,
  14285. typename T21, typename T22, typename T23, typename T24, typename T25>
  14286. internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14287. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
  14288. T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
  14289. T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
  14290. T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
  14291. return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14292. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
  14293. v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
  14294. v18, v19, v20, v21, v22, v23, v24, v25);
  14295. }
  14296. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14297. typename T6, typename T7, typename T8, typename T9, typename T10,
  14298. typename T11, typename T12, typename T13, typename T14, typename T15,
  14299. typename T16, typename T17, typename T18, typename T19, typename T20,
  14300. typename T21, typename T22, typename T23, typename T24, typename T25,
  14301. typename T26>
  14302. internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14303. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14304. T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14305. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14306. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14307. T26 v26) {
  14308. return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14309. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14310. T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
  14311. v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
  14312. }
  14313. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14314. typename T6, typename T7, typename T8, typename T9, typename T10,
  14315. typename T11, typename T12, typename T13, typename T14, typename T15,
  14316. typename T16, typename T17, typename T18, typename T19, typename T20,
  14317. typename T21, typename T22, typename T23, typename T24, typename T25,
  14318. typename T26, typename T27>
  14319. internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14320. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  14321. T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14322. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14323. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14324. T26 v26, T27 v27) {
  14325. return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14326. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14327. T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
  14328. v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
  14329. }
  14330. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14331. typename T6, typename T7, typename T8, typename T9, typename T10,
  14332. typename T11, typename T12, typename T13, typename T14, typename T15,
  14333. typename T16, typename T17, typename T18, typename T19, typename T20,
  14334. typename T21, typename T22, typename T23, typename T24, typename T25,
  14335. typename T26, typename T27, typename T28>
  14336. internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14337. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  14338. T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14339. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14340. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14341. T26 v26, T27 v27, T28 v28) {
  14342. return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14343. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14344. T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
  14345. v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
  14346. v28);
  14347. }
  14348. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14349. typename T6, typename T7, typename T8, typename T9, typename T10,
  14350. typename T11, typename T12, typename T13, typename T14, typename T15,
  14351. typename T16, typename T17, typename T18, typename T19, typename T20,
  14352. typename T21, typename T22, typename T23, typename T24, typename T25,
  14353. typename T26, typename T27, typename T28, typename T29>
  14354. internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14355. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14356. T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14357. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14358. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14359. T26 v26, T27 v27, T28 v28, T29 v29) {
  14360. return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14361. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14362. T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
  14363. v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
  14364. v27, v28, v29);
  14365. }
  14366. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14367. typename T6, typename T7, typename T8, typename T9, typename T10,
  14368. typename T11, typename T12, typename T13, typename T14, typename T15,
  14369. typename T16, typename T17, typename T18, typename T19, typename T20,
  14370. typename T21, typename T22, typename T23, typename T24, typename T25,
  14371. typename T26, typename T27, typename T28, typename T29, typename T30>
  14372. internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14373. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14374. T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  14375. T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
  14376. T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
  14377. T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
  14378. return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14379. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14380. T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
  14381. v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
  14382. v26, v27, v28, v29, v30);
  14383. }
  14384. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14385. typename T6, typename T7, typename T8, typename T9, typename T10,
  14386. typename T11, typename T12, typename T13, typename T14, typename T15,
  14387. typename T16, typename T17, typename T18, typename T19, typename T20,
  14388. typename T21, typename T22, typename T23, typename T24, typename T25,
  14389. typename T26, typename T27, typename T28, typename T29, typename T30,
  14390. typename T31>
  14391. internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14392. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14393. T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14394. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14395. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  14396. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
  14397. return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14398. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14399. T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
  14400. v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
  14401. v25, v26, v27, v28, v29, v30, v31);
  14402. }
  14403. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14404. typename T6, typename T7, typename T8, typename T9, typename T10,
  14405. typename T11, typename T12, typename T13, typename T14, typename T15,
  14406. typename T16, typename T17, typename T18, typename T19, typename T20,
  14407. typename T21, typename T22, typename T23, typename T24, typename T25,
  14408. typename T26, typename T27, typename T28, typename T29, typename T30,
  14409. typename T31, typename T32>
  14410. internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14411. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14412. T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14413. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14414. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  14415. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  14416. T32 v32) {
  14417. return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14418. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14419. T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
  14420. v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  14421. v24, v25, v26, v27, v28, v29, v30, v31, v32);
  14422. }
  14423. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14424. typename T6, typename T7, typename T8, typename T9, typename T10,
  14425. typename T11, typename T12, typename T13, typename T14, typename T15,
  14426. typename T16, typename T17, typename T18, typename T19, typename T20,
  14427. typename T21, typename T22, typename T23, typename T24, typename T25,
  14428. typename T26, typename T27, typename T28, typename T29, typename T30,
  14429. typename T31, typename T32, typename T33>
  14430. internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14431. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14432. T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
  14433. T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14434. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  14435. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  14436. T32 v32, T33 v33) {
  14437. return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14438. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14439. T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
  14440. v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  14441. v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
  14442. }
  14443. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14444. typename T6, typename T7, typename T8, typename T9, typename T10,
  14445. typename T11, typename T12, typename T13, typename T14, typename T15,
  14446. typename T16, typename T17, typename T18, typename T19, typename T20,
  14447. typename T21, typename T22, typename T23, typename T24, typename T25,
  14448. typename T26, typename T27, typename T28, typename T29, typename T30,
  14449. typename T31, typename T32, typename T33, typename T34>
  14450. internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14451. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14452. T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
  14453. T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
  14454. T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
  14455. T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
  14456. T31 v31, T32 v32, T33 v33, T34 v34) {
  14457. return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14458. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14459. T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
  14460. v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
  14461. v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
  14462. }
  14463. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14464. typename T6, typename T7, typename T8, typename T9, typename T10,
  14465. typename T11, typename T12, typename T13, typename T14, typename T15,
  14466. typename T16, typename T17, typename T18, typename T19, typename T20,
  14467. typename T21, typename T22, typename T23, typename T24, typename T25,
  14468. typename T26, typename T27, typename T28, typename T29, typename T30,
  14469. typename T31, typename T32, typename T33, typename T34, typename T35>
  14470. internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14471. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14472. T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14473. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  14474. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
  14475. T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
  14476. T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
  14477. return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14478. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14479. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
  14480. v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
  14481. v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
  14482. }
  14483. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14484. typename T6, typename T7, typename T8, typename T9, typename T10,
  14485. typename T11, typename T12, typename T13, typename T14, typename T15,
  14486. typename T16, typename T17, typename T18, typename T19, typename T20,
  14487. typename T21, typename T22, typename T23, typename T24, typename T25,
  14488. typename T26, typename T27, typename T28, typename T29, typename T30,
  14489. typename T31, typename T32, typename T33, typename T34, typename T35,
  14490. typename T36>
  14491. internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14492. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14493. T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14494. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  14495. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
  14496. T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
  14497. T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
  14498. return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14499. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14500. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
  14501. v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  14502. v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
  14503. v34, v35, v36);
  14504. }
  14505. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14506. typename T6, typename T7, typename T8, typename T9, typename T10,
  14507. typename T11, typename T12, typename T13, typename T14, typename T15,
  14508. typename T16, typename T17, typename T18, typename T19, typename T20,
  14509. typename T21, typename T22, typename T23, typename T24, typename T25,
  14510. typename T26, typename T27, typename T28, typename T29, typename T30,
  14511. typename T31, typename T32, typename T33, typename T34, typename T35,
  14512. typename T36, typename T37>
  14513. internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14514. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14515. T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
  14516. T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14517. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14518. T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
  14519. T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
  14520. T37 v37) {
  14521. return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14522. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14523. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
  14524. v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  14525. v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
  14526. v34, v35, v36, v37);
  14527. }
  14528. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14529. typename T6, typename T7, typename T8, typename T9, typename T10,
  14530. typename T11, typename T12, typename T13, typename T14, typename T15,
  14531. typename T16, typename T17, typename T18, typename T19, typename T20,
  14532. typename T21, typename T22, typename T23, typename T24, typename T25,
  14533. typename T26, typename T27, typename T28, typename T29, typename T30,
  14534. typename T31, typename T32, typename T33, typename T34, typename T35,
  14535. typename T36, typename T37, typename T38>
  14536. internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14537. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14538. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
  14539. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14540. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14541. T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
  14542. T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
  14543. T37 v37, T38 v38) {
  14544. return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14545. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14546. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
  14547. v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
  14548. v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
  14549. v33, v34, v35, v36, v37, v38);
  14550. }
  14551. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14552. typename T6, typename T7, typename T8, typename T9, typename T10,
  14553. typename T11, typename T12, typename T13, typename T14, typename T15,
  14554. typename T16, typename T17, typename T18, typename T19, typename T20,
  14555. typename T21, typename T22, typename T23, typename T24, typename T25,
  14556. typename T26, typename T27, typename T28, typename T29, typename T30,
  14557. typename T31, typename T32, typename T33, typename T34, typename T35,
  14558. typename T36, typename T37, typename T38, typename T39>
  14559. internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14560. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14561. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
  14562. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14563. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14564. T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
  14565. T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
  14566. T37 v37, T38 v38, T39 v39) {
  14567. return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14568. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14569. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
  14570. v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
  14571. v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
  14572. v32, v33, v34, v35, v36, v37, v38, v39);
  14573. }
  14574. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14575. typename T6, typename T7, typename T8, typename T9, typename T10,
  14576. typename T11, typename T12, typename T13, typename T14, typename T15,
  14577. typename T16, typename T17, typename T18, typename T19, typename T20,
  14578. typename T21, typename T22, typename T23, typename T24, typename T25,
  14579. typename T26, typename T27, typename T28, typename T29, typename T30,
  14580. typename T31, typename T32, typename T33, typename T34, typename T35,
  14581. typename T36, typename T37, typename T38, typename T39, typename T40>
  14582. internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14583. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14584. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
  14585. T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
  14586. T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
  14587. T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
  14588. T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
  14589. T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
  14590. return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14591. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14592. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14593. T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
  14594. v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
  14595. v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
  14596. }
  14597. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14598. typename T6, typename T7, typename T8, typename T9, typename T10,
  14599. typename T11, typename T12, typename T13, typename T14, typename T15,
  14600. typename T16, typename T17, typename T18, typename T19, typename T20,
  14601. typename T21, typename T22, typename T23, typename T24, typename T25,
  14602. typename T26, typename T27, typename T28, typename T29, typename T30,
  14603. typename T31, typename T32, typename T33, typename T34, typename T35,
  14604. typename T36, typename T37, typename T38, typename T39, typename T40,
  14605. typename T41>
  14606. internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14607. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14608. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  14609. T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14610. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14611. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14612. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  14613. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
  14614. return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14615. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14616. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14617. T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
  14618. v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
  14619. v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
  14620. }
  14621. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14622. typename T6, typename T7, typename T8, typename T9, typename T10,
  14623. typename T11, typename T12, typename T13, typename T14, typename T15,
  14624. typename T16, typename T17, typename T18, typename T19, typename T20,
  14625. typename T21, typename T22, typename T23, typename T24, typename T25,
  14626. typename T26, typename T27, typename T28, typename T29, typename T30,
  14627. typename T31, typename T32, typename T33, typename T34, typename T35,
  14628. typename T36, typename T37, typename T38, typename T39, typename T40,
  14629. typename T41, typename T42>
  14630. internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14631. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14632. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  14633. T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14634. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14635. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14636. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  14637. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  14638. T42 v42) {
  14639. return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14640. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14641. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14642. T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
  14643. v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
  14644. v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
  14645. v42);
  14646. }
  14647. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14648. typename T6, typename T7, typename T8, typename T9, typename T10,
  14649. typename T11, typename T12, typename T13, typename T14, typename T15,
  14650. typename T16, typename T17, typename T18, typename T19, typename T20,
  14651. typename T21, typename T22, typename T23, typename T24, typename T25,
  14652. typename T26, typename T27, typename T28, typename T29, typename T30,
  14653. typename T31, typename T32, typename T33, typename T34, typename T35,
  14654. typename T36, typename T37, typename T38, typename T39, typename T40,
  14655. typename T41, typename T42, typename T43>
  14656. internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14657. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14658. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  14659. T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14660. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14661. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14662. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  14663. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  14664. T42 v42, T43 v43) {
  14665. return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14666. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14667. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14668. T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
  14669. v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
  14670. v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
  14671. v41, v42, v43);
  14672. }
  14673. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14674. typename T6, typename T7, typename T8, typename T9, typename T10,
  14675. typename T11, typename T12, typename T13, typename T14, typename T15,
  14676. typename T16, typename T17, typename T18, typename T19, typename T20,
  14677. typename T21, typename T22, typename T23, typename T24, typename T25,
  14678. typename T26, typename T27, typename T28, typename T29, typename T30,
  14679. typename T31, typename T32, typename T33, typename T34, typename T35,
  14680. typename T36, typename T37, typename T38, typename T39, typename T40,
  14681. typename T41, typename T42, typename T43, typename T44>
  14682. internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14683. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14684. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  14685. T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14686. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14687. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14688. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  14689. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  14690. T42 v42, T43 v43, T44 v44) {
  14691. return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14692. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14693. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14694. T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
  14695. v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
  14696. v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
  14697. v40, v41, v42, v43, v44);
  14698. }
  14699. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14700. typename T6, typename T7, typename T8, typename T9, typename T10,
  14701. typename T11, typename T12, typename T13, typename T14, typename T15,
  14702. typename T16, typename T17, typename T18, typename T19, typename T20,
  14703. typename T21, typename T22, typename T23, typename T24, typename T25,
  14704. typename T26, typename T27, typename T28, typename T29, typename T30,
  14705. typename T31, typename T32, typename T33, typename T34, typename T35,
  14706. typename T36, typename T37, typename T38, typename T39, typename T40,
  14707. typename T41, typename T42, typename T43, typename T44, typename T45>
  14708. internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14709. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14710. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  14711. T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  14712. T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
  14713. T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
  14714. T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
  14715. T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
  14716. T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
  14717. return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14718. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14719. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14720. T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
  14721. v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
  14722. v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
  14723. v39, v40, v41, v42, v43, v44, v45);
  14724. }
  14725. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14726. typename T6, typename T7, typename T8, typename T9, typename T10,
  14727. typename T11, typename T12, typename T13, typename T14, typename T15,
  14728. typename T16, typename T17, typename T18, typename T19, typename T20,
  14729. typename T21, typename T22, typename T23, typename T24, typename T25,
  14730. typename T26, typename T27, typename T28, typename T29, typename T30,
  14731. typename T31, typename T32, typename T33, typename T34, typename T35,
  14732. typename T36, typename T37, typename T38, typename T39, typename T40,
  14733. typename T41, typename T42, typename T43, typename T44, typename T45,
  14734. typename T46>
  14735. internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14736. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14737. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  14738. T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14739. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14740. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  14741. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  14742. T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
  14743. T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
  14744. return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14745. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14746. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14747. T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
  14748. v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  14749. v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
  14750. v38, v39, v40, v41, v42, v43, v44, v45, v46);
  14751. }
  14752. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14753. typename T6, typename T7, typename T8, typename T9, typename T10,
  14754. typename T11, typename T12, typename T13, typename T14, typename T15,
  14755. typename T16, typename T17, typename T18, typename T19, typename T20,
  14756. typename T21, typename T22, typename T23, typename T24, typename T25,
  14757. typename T26, typename T27, typename T28, typename T29, typename T30,
  14758. typename T31, typename T32, typename T33, typename T34, typename T35,
  14759. typename T36, typename T37, typename T38, typename T39, typename T40,
  14760. typename T41, typename T42, typename T43, typename T44, typename T45,
  14761. typename T46, typename T47>
  14762. internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14763. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14764. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  14765. T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14766. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14767. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  14768. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  14769. T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
  14770. T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
  14771. return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14772. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14773. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14774. T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
  14775. v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  14776. v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
  14777. v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
  14778. }
  14779. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14780. typename T6, typename T7, typename T8, typename T9, typename T10,
  14781. typename T11, typename T12, typename T13, typename T14, typename T15,
  14782. typename T16, typename T17, typename T18, typename T19, typename T20,
  14783. typename T21, typename T22, typename T23, typename T24, typename T25,
  14784. typename T26, typename T27, typename T28, typename T29, typename T30,
  14785. typename T31, typename T32, typename T33, typename T34, typename T35,
  14786. typename T36, typename T37, typename T38, typename T39, typename T40,
  14787. typename T41, typename T42, typename T43, typename T44, typename T45,
  14788. typename T46, typename T47, typename T48>
  14789. internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14790. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14791. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  14792. T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
  14793. T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14794. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  14795. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  14796. T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
  14797. T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
  14798. T48 v48) {
  14799. return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14800. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14801. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14802. T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
  14803. v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
  14804. v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
  14805. v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
  14806. }
  14807. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14808. typename T6, typename T7, typename T8, typename T9, typename T10,
  14809. typename T11, typename T12, typename T13, typename T14, typename T15,
  14810. typename T16, typename T17, typename T18, typename T19, typename T20,
  14811. typename T21, typename T22, typename T23, typename T24, typename T25,
  14812. typename T26, typename T27, typename T28, typename T29, typename T30,
  14813. typename T31, typename T32, typename T33, typename T34, typename T35,
  14814. typename T36, typename T37, typename T38, typename T39, typename T40,
  14815. typename T41, typename T42, typename T43, typename T44, typename T45,
  14816. typename T46, typename T47, typename T48, typename T49>
  14817. internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14818. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14819. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  14820. T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
  14821. T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
  14822. T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
  14823. T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
  14824. T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
  14825. T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
  14826. T47 v47, T48 v48, T49 v49) {
  14827. return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14828. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14829. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14830. T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
  14831. v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
  14832. v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
  14833. v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
  14834. }
  14835. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14836. typename T6, typename T7, typename T8, typename T9, typename T10,
  14837. typename T11, typename T12, typename T13, typename T14, typename T15,
  14838. typename T16, typename T17, typename T18, typename T19, typename T20,
  14839. typename T21, typename T22, typename T23, typename T24, typename T25,
  14840. typename T26, typename T27, typename T28, typename T29, typename T30,
  14841. typename T31, typename T32, typename T33, typename T34, typename T35,
  14842. typename T36, typename T37, typename T38, typename T39, typename T40,
  14843. typename T41, typename T42, typename T43, typename T44, typename T45,
  14844. typename T46, typename T47, typename T48, typename T49, typename T50>
  14845. internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14846. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14847. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  14848. T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14849. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  14850. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
  14851. T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
  14852. T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
  14853. T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
  14854. T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
  14855. return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14856. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14857. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14858. T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
  14859. v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  14860. v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
  14861. v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
  14862. v48, v49, v50);
  14863. }
  14864. // Bool() allows generating tests with parameters in a set of (false, true).
  14865. //
  14866. // Synopsis:
  14867. // Bool()
  14868. // - returns a generator producing sequences with elements {false, true}.
  14869. //
  14870. // It is useful when testing code that depends on Boolean flags. Combinations
  14871. // of multiple flags can be tested when several Bool()'s are combined using
  14872. // Combine() function.
  14873. //
  14874. // In the following example all tests in the test case FlagDependentTest
  14875. // will be instantiated twice with parameters false and true.
  14876. //
  14877. // class FlagDependentTest : public testing::TestWithParam<bool> {
  14878. // virtual void SetUp() {
  14879. // external_flag = GetParam();
  14880. // }
  14881. // }
  14882. // INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
  14883. //
  14884. inline internal::ParamGenerator<bool> Bool() {
  14885. return Values(false, true);
  14886. }
  14887. # if GTEST_HAS_COMBINE
  14888. // Combine() allows the user to combine two or more sequences to produce
  14889. // values of a Cartesian product of those sequences' elements.
  14890. //
  14891. // Synopsis:
  14892. // Combine(gen1, gen2, ..., genN)
  14893. // - returns a generator producing sequences with elements coming from
  14894. // the Cartesian product of elements from the sequences generated by
  14895. // gen1, gen2, ..., genN. The sequence elements will have a type of
  14896. // tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
  14897. // of elements from sequences produces by gen1, gen2, ..., genN.
  14898. //
  14899. // Combine can have up to 10 arguments. This number is currently limited
  14900. // by the maximum number of elements in the tuple implementation used by Google
  14901. // Test.
  14902. //
  14903. // Example:
  14904. //
  14905. // This will instantiate tests in test case AnimalTest each one with
  14906. // the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
  14907. // tuple("dog", BLACK), and tuple("dog", WHITE):
  14908. //
  14909. // enum Color { BLACK, GRAY, WHITE };
  14910. // class AnimalTest
  14911. // : public testing::TestWithParam<tuple<const char*, Color> > {...};
  14912. //
  14913. // TEST_P(AnimalTest, AnimalLooksNice) {...}
  14914. //
  14915. // INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
  14916. // Combine(Values("cat", "dog"),
  14917. // Values(BLACK, WHITE)));
  14918. //
  14919. // This will instantiate tests in FlagDependentTest with all variations of two
  14920. // Boolean flags:
  14921. //
  14922. // class FlagDependentTest
  14923. // : public testing::TestWithParam<tuple(bool, bool)> > {
  14924. // virtual void SetUp() {
  14925. // // Assigns external_flag_1 and external_flag_2 values from the tuple.
  14926. // tie(external_flag_1, external_flag_2) = GetParam();
  14927. // }
  14928. // };
  14929. //
  14930. // TEST_P(FlagDependentTest, TestFeature1) {
  14931. // // Test your code using external_flag_1 and external_flag_2 here.
  14932. // }
  14933. // INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
  14934. // Combine(Bool(), Bool()));
  14935. //
  14936. template <typename Generator1, typename Generator2>
  14937. internal::CartesianProductHolder2<Generator1, Generator2> Combine(
  14938. const Generator1& g1, const Generator2& g2) {
  14939. return internal::CartesianProductHolder2<Generator1, Generator2>(
  14940. g1, g2);
  14941. }
  14942. template <typename Generator1, typename Generator2, typename Generator3>
  14943. internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
  14944. const Generator1& g1, const Generator2& g2, const Generator3& g3) {
  14945. return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
  14946. g1, g2, g3);
  14947. }
  14948. template <typename Generator1, typename Generator2, typename Generator3,
  14949. typename Generator4>
  14950. internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
  14951. Generator4> Combine(
  14952. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  14953. const Generator4& g4) {
  14954. return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
  14955. Generator4>(
  14956. g1, g2, g3, g4);
  14957. }
  14958. template <typename Generator1, typename Generator2, typename Generator3,
  14959. typename Generator4, typename Generator5>
  14960. internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
  14961. Generator4, Generator5> Combine(
  14962. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  14963. const Generator4& g4, const Generator5& g5) {
  14964. return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
  14965. Generator4, Generator5>(
  14966. g1, g2, g3, g4, g5);
  14967. }
  14968. template <typename Generator1, typename Generator2, typename Generator3,
  14969. typename Generator4, typename Generator5, typename Generator6>
  14970. internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
  14971. Generator4, Generator5, Generator6> Combine(
  14972. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  14973. const Generator4& g4, const Generator5& g5, const Generator6& g6) {
  14974. return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
  14975. Generator4, Generator5, Generator6>(
  14976. g1, g2, g3, g4, g5, g6);
  14977. }
  14978. template <typename Generator1, typename Generator2, typename Generator3,
  14979. typename Generator4, typename Generator5, typename Generator6,
  14980. typename Generator7>
  14981. internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
  14982. Generator4, Generator5, Generator6, Generator7> Combine(
  14983. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  14984. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  14985. const Generator7& g7) {
  14986. return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
  14987. Generator4, Generator5, Generator6, Generator7>(
  14988. g1, g2, g3, g4, g5, g6, g7);
  14989. }
  14990. template <typename Generator1, typename Generator2, typename Generator3,
  14991. typename Generator4, typename Generator5, typename Generator6,
  14992. typename Generator7, typename Generator8>
  14993. internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
  14994. Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
  14995. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  14996. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  14997. const Generator7& g7, const Generator8& g8) {
  14998. return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
  14999. Generator4, Generator5, Generator6, Generator7, Generator8>(
  15000. g1, g2, g3, g4, g5, g6, g7, g8);
  15001. }
  15002. template <typename Generator1, typename Generator2, typename Generator3,
  15003. typename Generator4, typename Generator5, typename Generator6,
  15004. typename Generator7, typename Generator8, typename Generator9>
  15005. internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
  15006. Generator4, Generator5, Generator6, Generator7, Generator8,
  15007. Generator9> Combine(
  15008. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  15009. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  15010. const Generator7& g7, const Generator8& g8, const Generator9& g9) {
  15011. return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
  15012. Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
  15013. g1, g2, g3, g4, g5, g6, g7, g8, g9);
  15014. }
  15015. template <typename Generator1, typename Generator2, typename Generator3,
  15016. typename Generator4, typename Generator5, typename Generator6,
  15017. typename Generator7, typename Generator8, typename Generator9,
  15018. typename Generator10>
  15019. internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
  15020. Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
  15021. Generator10> Combine(
  15022. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  15023. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  15024. const Generator7& g7, const Generator8& g8, const Generator9& g9,
  15025. const Generator10& g10) {
  15026. return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
  15027. Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
  15028. Generator10>(
  15029. g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
  15030. }
  15031. # endif // GTEST_HAS_COMBINE
  15032. # define TEST_P(test_case_name, test_name) \
  15033. class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
  15034. : public test_case_name { \
  15035. public: \
  15036. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
  15037. virtual void TestBody(); \
  15038. private: \
  15039. static int AddToRegistry() { \
  15040. ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
  15041. GetTestCasePatternHolder<test_case_name>(\
  15042. #test_case_name, __FILE__, __LINE__)->AddTestPattern(\
  15043. #test_case_name, \
  15044. #test_name, \
  15045. new ::testing::internal::TestMetaFactory< \
  15046. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \
  15047. return 0; \
  15048. } \
  15049. static int gtest_registering_dummy_; \
  15050. GTEST_DISALLOW_COPY_AND_ASSIGN_(\
  15051. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
  15052. }; \
  15053. int GTEST_TEST_CLASS_NAME_(test_case_name, \
  15054. test_name)::gtest_registering_dummy_ = \
  15055. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
  15056. void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
  15057. # define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
  15058. ::testing::internal::ParamGenerator<test_case_name::ParamType> \
  15059. gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
  15060. int gtest_##prefix##test_case_name##_dummy_ = \
  15061. ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
  15062. GetTestCasePatternHolder<test_case_name>(\
  15063. #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\
  15064. #prefix, \
  15065. &gtest_##prefix##test_case_name##_EvalGenerator_, \
  15066. __FILE__, __LINE__)
  15067. } // namespace testing
  15068. #endif // GTEST_HAS_PARAM_TEST
  15069. #endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
  15070. // Copyright 2006, Google Inc.
  15071. // All rights reserved.
  15072. //
  15073. // Redistribution and use in source and binary forms, with or without
  15074. // modification, are permitted provided that the following conditions are
  15075. // met:
  15076. //
  15077. // * Redistributions of source code must retain the above copyright
  15078. // notice, this list of conditions and the following disclaimer.
  15079. // * Redistributions in binary form must reproduce the above
  15080. // copyright notice, this list of conditions and the following disclaimer
  15081. // in the documentation and/or other materials provided with the
  15082. // distribution.
  15083. // * Neither the name of Google Inc. nor the names of its
  15084. // contributors may be used to endorse or promote products derived from
  15085. // this software without specific prior written permission.
  15086. //
  15087. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  15088. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  15089. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  15090. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  15091. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15092. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  15093. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  15094. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  15095. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  15096. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  15097. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  15098. //
  15099. // Author: [email protected] (Zhanyong Wan)
  15100. //
  15101. // Google C++ Testing Framework definitions useful in production code.
  15102. #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
  15103. #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
  15104. // When you need to test the private or protected members of a class,
  15105. // use the FRIEND_TEST macro to declare your tests as friends of the
  15106. // class. For example:
  15107. //
  15108. // class MyClass {
  15109. // private:
  15110. // void MyMethod();
  15111. // FRIEND_TEST(MyClassTest, MyMethod);
  15112. // };
  15113. //
  15114. // class MyClassTest : public testing::Test {
  15115. // // ...
  15116. // };
  15117. //
  15118. // TEST_F(MyClassTest, MyMethod) {
  15119. // // Can call MyClass::MyMethod() here.
  15120. // }
  15121. #define FRIEND_TEST(test_case_name, test_name)\
  15122. friend class test_case_name##_##test_name##_Test
  15123. #endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
  15124. // Copyright 2008, Google Inc.
  15125. // All rights reserved.
  15126. //
  15127. // Redistribution and use in source and binary forms, with or without
  15128. // modification, are permitted provided that the following conditions are
  15129. // met:
  15130. //
  15131. // * Redistributions of source code must retain the above copyright
  15132. // notice, this list of conditions and the following disclaimer.
  15133. // * Redistributions in binary form must reproduce the above
  15134. // copyright notice, this list of conditions and the following disclaimer
  15135. // in the documentation and/or other materials provided with the
  15136. // distribution.
  15137. // * Neither the name of Google Inc. nor the names of its
  15138. // contributors may be used to endorse or promote products derived from
  15139. // this software without specific prior written permission.
  15140. //
  15141. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  15142. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  15143. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  15144. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  15145. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15146. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  15147. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  15148. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  15149. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  15150. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  15151. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  15152. //
  15153. // Author: [email protected] (Markus Heule)
  15154. //
  15155. #ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
  15156. #define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
  15157. #include <iosfwd>
  15158. #include <vector>
  15159. namespace testing {
  15160. // A copyable object representing the result of a test part (i.e. an
  15161. // assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
  15162. //
  15163. // Don't inherit from TestPartResult as its destructor is not virtual.
  15164. class GTEST_API_ TestPartResult {
  15165. public:
  15166. // The possible outcomes of a test part (i.e. an assertion or an
  15167. // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
  15168. enum Type {
  15169. kSuccess, // Succeeded.
  15170. kNonFatalFailure, // Failed but the test can continue.
  15171. kFatalFailure // Failed and the test should be terminated.
  15172. };
  15173. // C'tor. TestPartResult does NOT have a default constructor.
  15174. // Always use this constructor (with parameters) to create a
  15175. // TestPartResult object.
  15176. TestPartResult(Type a_type,
  15177. const char* a_file_name,
  15178. int a_line_number,
  15179. const char* a_message)
  15180. : type_(a_type),
  15181. file_name_(a_file_name),
  15182. line_number_(a_line_number),
  15183. summary_(ExtractSummary(a_message)),
  15184. message_(a_message) {
  15185. }
  15186. // Gets the outcome of the test part.
  15187. Type type() const { return type_; }
  15188. // Gets the name of the source file where the test part took place, or
  15189. // NULL if it's unknown.
  15190. const char* file_name() const { return file_name_.c_str(); }
  15191. // Gets the line in the source file where the test part took place,
  15192. // or -1 if it's unknown.
  15193. int line_number() const { return line_number_; }
  15194. // Gets the summary of the failure message.
  15195. const char* summary() const { return summary_.c_str(); }
  15196. // Gets the message associated with the test part.
  15197. const char* message() const { return message_.c_str(); }
  15198. // Returns true iff the test part passed.
  15199. bool passed() const { return type_ == kSuccess; }
  15200. // Returns true iff the test part failed.
  15201. bool failed() const { return type_ != kSuccess; }
  15202. // Returns true iff the test part non-fatally failed.
  15203. bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
  15204. // Returns true iff the test part fatally failed.
  15205. bool fatally_failed() const { return type_ == kFatalFailure; }
  15206. private:
  15207. Type type_;
  15208. // Gets the summary of the failure message by omitting the stack
  15209. // trace in it.
  15210. static internal::String ExtractSummary(const char* message);
  15211. // The name of the source file where the test part took place, or
  15212. // NULL if the source file is unknown.
  15213. internal::String file_name_;
  15214. // The line in the source file where the test part took place, or -1
  15215. // if the line number is unknown.
  15216. int line_number_;
  15217. internal::String summary_; // The test failure summary.
  15218. internal::String message_; // The test failure message.
  15219. };
  15220. // Prints a TestPartResult object.
  15221. std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
  15222. // An array of TestPartResult objects.
  15223. //
  15224. // Don't inherit from TestPartResultArray as its destructor is not
  15225. // virtual.
  15226. class GTEST_API_ TestPartResultArray {
  15227. public:
  15228. TestPartResultArray() {}
  15229. // Appends the given TestPartResult to the array.
  15230. void Append(const TestPartResult& result);
  15231. // Returns the TestPartResult at the given index (0-based).
  15232. const TestPartResult& GetTestPartResult(int index) const;
  15233. // Returns the number of TestPartResult objects in the array.
  15234. int size() const;
  15235. private:
  15236. std::vector<TestPartResult> array_;
  15237. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
  15238. };
  15239. // This interface knows how to report a test part result.
  15240. class TestPartResultReporterInterface {
  15241. public:
  15242. virtual ~TestPartResultReporterInterface() {}
  15243. virtual void ReportTestPartResult(const TestPartResult& result) = 0;
  15244. };
  15245. namespace internal {
  15246. // This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
  15247. // statement generates new fatal failures. To do so it registers itself as the
  15248. // current test part result reporter. Besides checking if fatal failures were
  15249. // reported, it only delegates the reporting to the former result reporter.
  15250. // The original result reporter is restored in the destructor.
  15251. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  15252. class GTEST_API_ HasNewFatalFailureHelper
  15253. : public TestPartResultReporterInterface {
  15254. public:
  15255. HasNewFatalFailureHelper();
  15256. virtual ~HasNewFatalFailureHelper();
  15257. virtual void ReportTestPartResult(const TestPartResult& result);
  15258. bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
  15259. private:
  15260. bool has_new_fatal_failure_;
  15261. TestPartResultReporterInterface* original_reporter_;
  15262. GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
  15263. };
  15264. } // namespace internal
  15265. } // namespace testing
  15266. #endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
  15267. // Copyright 2008 Google Inc.
  15268. // All Rights Reserved.
  15269. //
  15270. // Redistribution and use in source and binary forms, with or without
  15271. // modification, are permitted provided that the following conditions are
  15272. // met:
  15273. //
  15274. // * Redistributions of source code must retain the above copyright
  15275. // notice, this list of conditions and the following disclaimer.
  15276. // * Redistributions in binary form must reproduce the above
  15277. // copyright notice, this list of conditions and the following disclaimer
  15278. // in the documentation and/or other materials provided with the
  15279. // distribution.
  15280. // * Neither the name of Google Inc. nor the names of its
  15281. // contributors may be used to endorse or promote products derived from
  15282. // this software without specific prior written permission.
  15283. //
  15284. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  15285. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  15286. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  15287. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  15288. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15289. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  15290. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  15291. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  15292. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  15293. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  15294. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  15295. //
  15296. // Author: [email protected] (Zhanyong Wan)
  15297. #ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
  15298. #define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
  15299. // This header implements typed tests and type-parameterized tests.
  15300. // Typed (aka type-driven) tests repeat the same test for types in a
  15301. // list. You must know which types you want to test with when writing
  15302. // typed tests. Here's how you do it:
  15303. #if 0
  15304. // First, define a fixture class template. It should be parameterized
  15305. // by a type. Remember to derive it from testing::Test.
  15306. template <typename T>
  15307. class FooTest : public testing::Test {
  15308. public:
  15309. ...
  15310. typedef std::list<T> List;
  15311. static T shared_;
  15312. T value_;
  15313. };
  15314. // Next, associate a list of types with the test case, which will be
  15315. // repeated for each type in the list. The typedef is necessary for
  15316. // the macro to parse correctly.
  15317. typedef testing::Types<char, int, unsigned int> MyTypes;
  15318. TYPED_TEST_CASE(FooTest, MyTypes);
  15319. // If the type list contains only one type, you can write that type
  15320. // directly without Types<...>:
  15321. // TYPED_TEST_CASE(FooTest, int);
  15322. // Then, use TYPED_TEST() instead of TEST_F() to define as many typed
  15323. // tests for this test case as you want.
  15324. TYPED_TEST(FooTest, DoesBlah) {
  15325. // Inside a test, refer to TypeParam to get the type parameter.
  15326. // Since we are inside a derived class template, C++ requires use to
  15327. // visit the members of FooTest via 'this'.
  15328. TypeParam n = this->value_;
  15329. // To visit static members of the fixture, add the TestFixture::
  15330. // prefix.
  15331. n += TestFixture::shared_;
  15332. // To refer to typedefs in the fixture, add the "typename
  15333. // TestFixture::" prefix.
  15334. typename TestFixture::List values;
  15335. values.push_back(n);
  15336. ...
  15337. }
  15338. TYPED_TEST(FooTest, HasPropertyA) { ... }
  15339. #endif // 0
  15340. // Type-parameterized tests are abstract test patterns parameterized
  15341. // by a type. Compared with typed tests, type-parameterized tests
  15342. // allow you to define the test pattern without knowing what the type
  15343. // parameters are. The defined pattern can be instantiated with
  15344. // different types any number of times, in any number of translation
  15345. // units.
  15346. //
  15347. // If you are designing an interface or concept, you can define a
  15348. // suite of type-parameterized tests to verify properties that any
  15349. // valid implementation of the interface/concept should have. Then,
  15350. // each implementation can easily instantiate the test suite to verify
  15351. // that it conforms to the requirements, without having to write
  15352. // similar tests repeatedly. Here's an example:
  15353. #if 0
  15354. // First, define a fixture class template. It should be parameterized
  15355. // by a type. Remember to derive it from testing::Test.
  15356. template <typename T>
  15357. class FooTest : public testing::Test {
  15358. ...
  15359. };
  15360. // Next, declare that you will define a type-parameterized test case
  15361. // (the _P suffix is for "parameterized" or "pattern", whichever you
  15362. // prefer):
  15363. TYPED_TEST_CASE_P(FooTest);
  15364. // Then, use TYPED_TEST_P() to define as many type-parameterized tests
  15365. // for this type-parameterized test case as you want.
  15366. TYPED_TEST_P(FooTest, DoesBlah) {
  15367. // Inside a test, refer to TypeParam to get the type parameter.
  15368. TypeParam n = 0;
  15369. ...
  15370. }
  15371. TYPED_TEST_P(FooTest, HasPropertyA) { ... }
  15372. // Now the tricky part: you need to register all test patterns before
  15373. // you can instantiate them. The first argument of the macro is the
  15374. // test case name; the rest are the names of the tests in this test
  15375. // case.
  15376. REGISTER_TYPED_TEST_CASE_P(FooTest,
  15377. DoesBlah, HasPropertyA);
  15378. // Finally, you are free to instantiate the pattern with the types you
  15379. // want. If you put the above code in a header file, you can #include
  15380. // it in multiple C++ source files and instantiate it multiple times.
  15381. //
  15382. // To distinguish different instances of the pattern, the first
  15383. // argument to the INSTANTIATE_* macro is a prefix that will be added
  15384. // to the actual test case name. Remember to pick unique prefixes for
  15385. // different instances.
  15386. typedef testing::Types<char, int, unsigned int> MyTypes;
  15387. INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
  15388. // If the type list contains only one type, you can write that type
  15389. // directly without Types<...>:
  15390. // INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
  15391. #endif // 0
  15392. // Implements typed tests.
  15393. #if GTEST_HAS_TYPED_TEST
  15394. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  15395. //
  15396. // Expands to the name of the typedef for the type parameters of the
  15397. // given test case.
  15398. # define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
  15399. // The 'Types' template argument below must have spaces around it
  15400. // since some compilers may choke on '>>' when passing a template
  15401. // instance (e.g. Types<int>)
  15402. # define TYPED_TEST_CASE(CaseName, Types) \
  15403. typedef ::testing::internal::TypeList< Types >::type \
  15404. GTEST_TYPE_PARAMS_(CaseName)
  15405. # define TYPED_TEST(CaseName, TestName) \
  15406. template <typename gtest_TypeParam_> \
  15407. class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
  15408. : public CaseName<gtest_TypeParam_> { \
  15409. private: \
  15410. typedef CaseName<gtest_TypeParam_> TestFixture; \
  15411. typedef gtest_TypeParam_ TypeParam; \
  15412. virtual void TestBody(); \
  15413. }; \
  15414. bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \
  15415. ::testing::internal::TypeParameterizedTest< \
  15416. CaseName, \
  15417. ::testing::internal::TemplateSel< \
  15418. GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
  15419. GTEST_TYPE_PARAMS_(CaseName)>::Register(\
  15420. "", #CaseName, #TestName, 0); \
  15421. template <typename gtest_TypeParam_> \
  15422. void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
  15423. #endif // GTEST_HAS_TYPED_TEST
  15424. // Implements type-parameterized tests.
  15425. #if GTEST_HAS_TYPED_TEST_P
  15426. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  15427. //
  15428. // Expands to the namespace name that the type-parameterized tests for
  15429. // the given type-parameterized test case are defined in. The exact
  15430. // name of the namespace is subject to change without notice.
  15431. # define GTEST_CASE_NAMESPACE_(TestCaseName) \
  15432. gtest_case_##TestCaseName##_
  15433. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  15434. //
  15435. // Expands to the name of the variable used to remember the names of
  15436. // the defined tests in the given test case.
  15437. # define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
  15438. gtest_typed_test_case_p_state_##TestCaseName##_
  15439. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
  15440. //
  15441. // Expands to the name of the variable used to remember the names of
  15442. // the registered tests in the given test case.
  15443. # define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
  15444. gtest_registered_test_names_##TestCaseName##_
  15445. // The variables defined in the type-parameterized test macros are
  15446. // static as typically these macros are used in a .h file that can be
  15447. // #included in multiple translation units linked together.
  15448. # define TYPED_TEST_CASE_P(CaseName) \
  15449. static ::testing::internal::TypedTestCasePState \
  15450. GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
  15451. # define TYPED_TEST_P(CaseName, TestName) \
  15452. namespace GTEST_CASE_NAMESPACE_(CaseName) { \
  15453. template <typename gtest_TypeParam_> \
  15454. class TestName : public CaseName<gtest_TypeParam_> { \
  15455. private: \
  15456. typedef CaseName<gtest_TypeParam_> TestFixture; \
  15457. typedef gtest_TypeParam_ TypeParam; \
  15458. virtual void TestBody(); \
  15459. }; \
  15460. static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
  15461. GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
  15462. __FILE__, __LINE__, #CaseName, #TestName); \
  15463. } \
  15464. template <typename gtest_TypeParam_> \
  15465. void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
  15466. # define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
  15467. namespace GTEST_CASE_NAMESPACE_(CaseName) { \
  15468. typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
  15469. } \
  15470. static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
  15471. GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
  15472. __FILE__, __LINE__, #__VA_ARGS__)
  15473. // The 'Types' template argument below must have spaces around it
  15474. // since some compilers may choke on '>>' when passing a template
  15475. // instance (e.g. Types<int>)
  15476. # define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \
  15477. bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
  15478. ::testing::internal::TypeParameterizedTestCase<CaseName, \
  15479. GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
  15480. ::testing::internal::TypeList< Types >::type>::Register(\
  15481. #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
  15482. #endif // GTEST_HAS_TYPED_TEST_P
  15483. #endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
  15484. // Depending on the platform, different string classes are available.
  15485. // On Linux, in addition to ::std::string, Google also makes use of
  15486. // class ::string, which has the same interface as ::std::string, but
  15487. // has a different implementation.
  15488. //
  15489. // The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
  15490. // ::string is available AND is a distinct type to ::std::string, or
  15491. // define it to 0 to indicate otherwise.
  15492. //
  15493. // If the user's ::std::string and ::string are the same class due to
  15494. // aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0.
  15495. //
  15496. // If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined
  15497. // heuristically.
  15498. namespace testing {
  15499. // Declares the flags.
  15500. // This flag temporary enables the disabled tests.
  15501. GTEST_DECLARE_bool_(also_run_disabled_tests);
  15502. // This flag brings the debugger on an assertion failure.
  15503. GTEST_DECLARE_bool_(break_on_failure);
  15504. // This flag controls whether Google Test catches all test-thrown exceptions
  15505. // and logs them as failures.
  15506. GTEST_DECLARE_bool_(catch_exceptions);
  15507. // This flag enables using colors in terminal output. Available values are
  15508. // "yes" to enable colors, "no" (disable colors), or "auto" (the default)
  15509. // to let Google Test decide.
  15510. GTEST_DECLARE_string_(color);
  15511. // This flag sets up the filter to select by name using a glob pattern
  15512. // the tests to run. If the filter is not given all tests are executed.
  15513. GTEST_DECLARE_string_(filter);
  15514. // This flag causes the Google Test to list tests. None of the tests listed
  15515. // are actually run if the flag is provided.
  15516. GTEST_DECLARE_bool_(list_tests);
  15517. // This flag controls whether Google Test emits a detailed XML report to a file
  15518. // in addition to its normal textual output.
  15519. GTEST_DECLARE_string_(output);
  15520. // This flags control whether Google Test prints the elapsed time for each
  15521. // test.
  15522. GTEST_DECLARE_bool_(print_time);
  15523. // This flag specifies the random number seed.
  15524. GTEST_DECLARE_int32_(random_seed);
  15525. // This flag sets how many times the tests are repeated. The default value
  15526. // is 1. If the value is -1 the tests are repeating forever.
  15527. GTEST_DECLARE_int32_(repeat);
  15528. // This flag controls whether Google Test includes Google Test internal
  15529. // stack frames in failure stack traces.
  15530. GTEST_DECLARE_bool_(show_internal_stack_frames);
  15531. // When this flag is specified, tests' order is randomized on every iteration.
  15532. GTEST_DECLARE_bool_(shuffle);
  15533. // This flag specifies the maximum number of stack frames to be
  15534. // printed in a failure message.
  15535. GTEST_DECLARE_int32_(stack_trace_depth);
  15536. // When this flag is specified, a failed assertion will throw an
  15537. // exception if exceptions are enabled, or exit the program with a
  15538. // non-zero code otherwise.
  15539. GTEST_DECLARE_bool_(throw_on_failure);
  15540. // When this flag is set with a "host:port" string, on supported
  15541. // platforms test results are streamed to the specified port on
  15542. // the specified host machine.
  15543. GTEST_DECLARE_string_(stream_result_to);
  15544. // The upper limit for valid stack trace depths.
  15545. const int kMaxStackTraceDepth = 100;
  15546. namespace internal {
  15547. class AssertHelper;
  15548. class DefaultGlobalTestPartResultReporter;
  15549. class ExecDeathTest;
  15550. class NoExecDeathTest;
  15551. class FinalSuccessChecker;
  15552. class GTestFlagSaver;
  15553. class TestResultAccessor;
  15554. class TestEventListenersAccessor;
  15555. class TestEventRepeater;
  15556. class WindowsDeathTest;
  15557. class UnitTestImpl* GetUnitTestImpl();
  15558. void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
  15559. const String& message);
  15560. // Converts a streamable value to a String. A NULL pointer is
  15561. // converted to "(null)". When the input value is a ::string,
  15562. // ::std::string, ::wstring, or ::std::wstring object, each NUL
  15563. // character in it is replaced with "\\0".
  15564. // Declared in gtest-internal.h but defined here, so that it has access
  15565. // to the definition of the Message class, required by the ARM
  15566. // compiler.
  15567. template <typename T>
  15568. String StreamableToString(const T& streamable) {
  15569. return (Message() << streamable).GetString();
  15570. }
  15571. } // namespace internal
  15572. // The friend relationship of some of these classes is cyclic.
  15573. // If we don't forward declare them the compiler might confuse the classes
  15574. // in friendship clauses with same named classes on the scope.
  15575. class Test;
  15576. class TestCase;
  15577. class TestInfo;
  15578. class UnitTest;
  15579. // A class for indicating whether an assertion was successful. When
  15580. // the assertion wasn't successful, the AssertionResult object
  15581. // remembers a non-empty message that describes how it failed.
  15582. //
  15583. // To create an instance of this class, use one of the factory functions
  15584. // (AssertionSuccess() and AssertionFailure()).
  15585. //
  15586. // This class is useful for two purposes:
  15587. // 1. Defining predicate functions to be used with Boolean test assertions
  15588. // EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
  15589. // 2. Defining predicate-format functions to be
  15590. // used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
  15591. //
  15592. // For example, if you define IsEven predicate:
  15593. //
  15594. // testing::AssertionResult IsEven(int n) {
  15595. // if ((n % 2) == 0)
  15596. // return testing::AssertionSuccess();
  15597. // else
  15598. // return testing::AssertionFailure() << n << " is odd";
  15599. // }
  15600. //
  15601. // Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
  15602. // will print the message
  15603. //
  15604. // Value of: IsEven(Fib(5))
  15605. // Actual: false (5 is odd)
  15606. // Expected: true
  15607. //
  15608. // instead of a more opaque
  15609. //
  15610. // Value of: IsEven(Fib(5))
  15611. // Actual: false
  15612. // Expected: true
  15613. //
  15614. // in case IsEven is a simple Boolean predicate.
  15615. //
  15616. // If you expect your predicate to be reused and want to support informative
  15617. // messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
  15618. // about half as often as positive ones in our tests), supply messages for
  15619. // both success and failure cases:
  15620. //
  15621. // testing::AssertionResult IsEven(int n) {
  15622. // if ((n % 2) == 0)
  15623. // return testing::AssertionSuccess() << n << " is even";
  15624. // else
  15625. // return testing::AssertionFailure() << n << " is odd";
  15626. // }
  15627. //
  15628. // Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
  15629. //
  15630. // Value of: IsEven(Fib(6))
  15631. // Actual: true (8 is even)
  15632. // Expected: false
  15633. //
  15634. // NB: Predicates that support negative Boolean assertions have reduced
  15635. // performance in positive ones so be careful not to use them in tests
  15636. // that have lots (tens of thousands) of positive Boolean assertions.
  15637. //
  15638. // To use this class with EXPECT_PRED_FORMAT assertions such as:
  15639. //
  15640. // // Verifies that Foo() returns an even number.
  15641. // EXPECT_PRED_FORMAT1(IsEven, Foo());
  15642. //
  15643. // you need to define:
  15644. //
  15645. // testing::AssertionResult IsEven(const char* expr, int n) {
  15646. // if ((n % 2) == 0)
  15647. // return testing::AssertionSuccess();
  15648. // else
  15649. // return testing::AssertionFailure()
  15650. // << "Expected: " << expr << " is even\n Actual: it's " << n;
  15651. // }
  15652. //
  15653. // If Foo() returns 5, you will see the following message:
  15654. //
  15655. // Expected: Foo() is even
  15656. // Actual: it's 5
  15657. //
  15658. class GTEST_API_ AssertionResult {
  15659. public:
  15660. // Copy constructor.
  15661. // Used in EXPECT_TRUE/FALSE(assertion_result).
  15662. AssertionResult(const AssertionResult& other);
  15663. // Used in the EXPECT_TRUE/FALSE(bool_expression).
  15664. explicit AssertionResult(bool success) : success_(success) {}
  15665. // Returns true iff the assertion succeeded.
  15666. operator bool() const { return success_; } // NOLINT
  15667. // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
  15668. AssertionResult operator!() const;
  15669. // Returns the text streamed into this AssertionResult. Test assertions
  15670. // use it when they fail (i.e., the predicate's outcome doesn't match the
  15671. // assertion's expectation). When nothing has been streamed into the
  15672. // object, returns an empty string.
  15673. const char* message() const {
  15674. return message_.get() != NULL ? message_->c_str() : "";
  15675. }
  15676. // TODO([email protected]): Remove this after making sure no clients use it.
  15677. // Deprecated; please use message() instead.
  15678. const char* failure_message() const { return message(); }
  15679. // Streams a custom failure message into this object.
  15680. template <typename T> AssertionResult& operator<<(const T& value) {
  15681. AppendMessage(Message() << value);
  15682. return *this;
  15683. }
  15684. // Allows streaming basic output manipulators such as endl or flush into
  15685. // this object.
  15686. AssertionResult& operator<<(
  15687. ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
  15688. AppendMessage(Message() << basic_manipulator);
  15689. return *this;
  15690. }
  15691. private:
  15692. // Appends the contents of message to message_.
  15693. void AppendMessage(const Message& a_message) {
  15694. if (message_.get() == NULL)
  15695. message_.reset(new ::std::string);
  15696. message_->append(a_message.GetString().c_str());
  15697. }
  15698. // Stores result of the assertion predicate.
  15699. bool success_;
  15700. // Stores the message describing the condition in case the expectation
  15701. // construct is not satisfied with the predicate's outcome.
  15702. // Referenced via a pointer to avoid taking too much stack frame space
  15703. // with test assertions.
  15704. internal::scoped_ptr< ::std::string> message_;
  15705. GTEST_DISALLOW_ASSIGN_(AssertionResult);
  15706. };
  15707. // Makes a successful assertion result.
  15708. GTEST_API_ AssertionResult AssertionSuccess();
  15709. // Makes a failed assertion result.
  15710. GTEST_API_ AssertionResult AssertionFailure();
  15711. // Makes a failed assertion result with the given failure message.
  15712. // Deprecated; use AssertionFailure() << msg.
  15713. GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
  15714. // The abstract class that all tests inherit from.
  15715. //
  15716. // In Google Test, a unit test program contains one or many TestCases, and
  15717. // each TestCase contains one or many Tests.
  15718. //
  15719. // When you define a test using the TEST macro, you don't need to
  15720. // explicitly derive from Test - the TEST macro automatically does
  15721. // this for you.
  15722. //
  15723. // The only time you derive from Test is when defining a test fixture
  15724. // to be used a TEST_F. For example:
  15725. //
  15726. // class FooTest : public testing::Test {
  15727. // protected:
  15728. // virtual void SetUp() { ... }
  15729. // virtual void TearDown() { ... }
  15730. // ...
  15731. // };
  15732. //
  15733. // TEST_F(FooTest, Bar) { ... }
  15734. // TEST_F(FooTest, Baz) { ... }
  15735. //
  15736. // Test is not copyable.
  15737. class GTEST_API_ Test {
  15738. public:
  15739. friend class TestInfo;
  15740. // Defines types for pointers to functions that set up and tear down
  15741. // a test case.
  15742. typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
  15743. typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
  15744. // The d'tor is virtual as we intend to inherit from Test.
  15745. virtual ~Test();
  15746. // Sets up the stuff shared by all tests in this test case.
  15747. //
  15748. // Google Test will call Foo::SetUpTestCase() before running the first
  15749. // test in test case Foo. Hence a sub-class can define its own
  15750. // SetUpTestCase() method to shadow the one defined in the super
  15751. // class.
  15752. static void SetUpTestCase() {}
  15753. // Tears down the stuff shared by all tests in this test case.
  15754. //
  15755. // Google Test will call Foo::TearDownTestCase() after running the last
  15756. // test in test case Foo. Hence a sub-class can define its own
  15757. // TearDownTestCase() method to shadow the one defined in the super
  15758. // class.
  15759. static void TearDownTestCase() {}
  15760. // Returns true iff the current test has a fatal failure.
  15761. static bool HasFatalFailure();
  15762. // Returns true iff the current test has a non-fatal failure.
  15763. static bool HasNonfatalFailure();
  15764. // Returns true iff the current test has a (either fatal or
  15765. // non-fatal) failure.
  15766. static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
  15767. // Logs a property for the current test. Only the last value for a given
  15768. // key is remembered.
  15769. // These are public static so they can be called from utility functions
  15770. // that are not members of the test fixture.
  15771. // The arguments are const char* instead strings, as Google Test is used
  15772. // on platforms where string doesn't compile.
  15773. //
  15774. // Note that a driving consideration for these RecordProperty methods
  15775. // was to produce xml output suited to the Greenspan charting utility,
  15776. // which at present will only chart values that fit in a 32-bit int. It
  15777. // is the user's responsibility to restrict their values to 32-bit ints
  15778. // if they intend them to be used with Greenspan.
  15779. static void RecordProperty(const char* key, const char* value);
  15780. static void RecordProperty(const char* key, int value);
  15781. protected:
  15782. // Creates a Test object.
  15783. Test();
  15784. // Sets up the test fixture.
  15785. virtual void SetUp();
  15786. // Tears down the test fixture.
  15787. virtual void TearDown();
  15788. private:
  15789. // Returns true iff the current test has the same fixture class as
  15790. // the first test in the current test case.
  15791. static bool HasSameFixtureClass();
  15792. // Runs the test after the test fixture has been set up.
  15793. //
  15794. // A sub-class must implement this to define the test logic.
  15795. //
  15796. // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
  15797. // Instead, use the TEST or TEST_F macro.
  15798. virtual void TestBody() = 0;
  15799. // Sets up, executes, and tears down the test.
  15800. void Run();
  15801. // Deletes self. We deliberately pick an unusual name for this
  15802. // internal method to avoid clashing with names used in user TESTs.
  15803. void DeleteSelf_() { delete this; }
  15804. // Uses a GTestFlagSaver to save and restore all Google Test flags.
  15805. const internal::GTestFlagSaver* const gtest_flag_saver_;
  15806. // Often a user mis-spells SetUp() as Setup() and spends a long time
  15807. // wondering why it is never called by Google Test. The declaration of
  15808. // the following method is solely for catching such an error at
  15809. // compile time:
  15810. //
  15811. // - The return type is deliberately chosen to be not void, so it
  15812. // will be a conflict if a user declares void Setup() in his test
  15813. // fixture.
  15814. //
  15815. // - This method is private, so it will be another compiler error
  15816. // if a user calls it from his test fixture.
  15817. //
  15818. // DO NOT OVERRIDE THIS FUNCTION.
  15819. //
  15820. // If you see an error about overriding the following function or
  15821. // about it being private, you have mis-spelled SetUp() as Setup().
  15822. struct Setup_should_be_spelled_SetUp {};
  15823. virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
  15824. // We disallow copying Tests.
  15825. GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
  15826. };
  15827. typedef internal::TimeInMillis TimeInMillis;
  15828. // A copyable object representing a user specified test property which can be
  15829. // output as a key/value string pair.
  15830. //
  15831. // Don't inherit from TestProperty as its destructor is not virtual.
  15832. class TestProperty {
  15833. public:
  15834. // C'tor. TestProperty does NOT have a default constructor.
  15835. // Always use this constructor (with parameters) to create a
  15836. // TestProperty object.
  15837. TestProperty(const char* a_key, const char* a_value) :
  15838. key_(a_key), value_(a_value) {
  15839. }
  15840. // Gets the user supplied key.
  15841. const char* key() const {
  15842. return key_.c_str();
  15843. }
  15844. // Gets the user supplied value.
  15845. const char* value() const {
  15846. return value_.c_str();
  15847. }
  15848. // Sets a new value, overriding the one supplied in the constructor.
  15849. void SetValue(const char* new_value) {
  15850. value_ = new_value;
  15851. }
  15852. private:
  15853. // The key supplied by the user.
  15854. internal::String key_;
  15855. // The value supplied by the user.
  15856. internal::String value_;
  15857. };
  15858. // The result of a single Test. This includes a list of
  15859. // TestPartResults, a list of TestProperties, a count of how many
  15860. // death tests there are in the Test, and how much time it took to run
  15861. // the Test.
  15862. //
  15863. // TestResult is not copyable.
  15864. class GTEST_API_ TestResult {
  15865. public:
  15866. // Creates an empty TestResult.
  15867. TestResult();
  15868. // D'tor. Do not inherit from TestResult.
  15869. ~TestResult();
  15870. // Gets the number of all test parts. This is the sum of the number
  15871. // of successful test parts and the number of failed test parts.
  15872. int total_part_count() const;
  15873. // Returns the number of the test properties.
  15874. int test_property_count() const;
  15875. // Returns true iff the test passed (i.e. no test part failed).
  15876. bool Passed() const { return !Failed(); }
  15877. // Returns true iff the test failed.
  15878. bool Failed() const;
  15879. // Returns true iff the test fatally failed.
  15880. bool HasFatalFailure() const;
  15881. // Returns true iff the test has a non-fatal failure.
  15882. bool HasNonfatalFailure() const;
  15883. // Returns the elapsed time, in milliseconds.
  15884. TimeInMillis elapsed_time() const { return elapsed_time_; }
  15885. // Returns the i-th test part result among all the results. i can range
  15886. // from 0 to test_property_count() - 1. If i is not in that range, aborts
  15887. // the program.
  15888. const TestPartResult& GetTestPartResult(int i) const;
  15889. // Returns the i-th test property. i can range from 0 to
  15890. // test_property_count() - 1. If i is not in that range, aborts the
  15891. // program.
  15892. const TestProperty& GetTestProperty(int i) const;
  15893. private:
  15894. friend class TestInfo;
  15895. friend class UnitTest;
  15896. friend class internal::DefaultGlobalTestPartResultReporter;
  15897. friend class internal::ExecDeathTest;
  15898. friend class internal::TestResultAccessor;
  15899. friend class internal::UnitTestImpl;
  15900. friend class internal::WindowsDeathTest;
  15901. // Gets the vector of TestPartResults.
  15902. const std::vector<TestPartResult>& test_part_results() const {
  15903. return test_part_results_;
  15904. }
  15905. // Gets the vector of TestProperties.
  15906. const std::vector<TestProperty>& test_properties() const {
  15907. return test_properties_;
  15908. }
  15909. // Sets the elapsed time.
  15910. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
  15911. // Adds a test property to the list. The property is validated and may add
  15912. // a non-fatal failure if invalid (e.g., if it conflicts with reserved
  15913. // key names). If a property is already recorded for the same key, the
  15914. // value will be updated, rather than storing multiple values for the same
  15915. // key.
  15916. void RecordProperty(const TestProperty& test_property);
  15917. // Adds a failure if the key is a reserved attribute of Google Test
  15918. // testcase tags. Returns true if the property is valid.
  15919. // TODO(russr): Validate attribute names are legal and human readable.
  15920. static bool ValidateTestProperty(const TestProperty& test_property);
  15921. // Adds a test part result to the list.
  15922. void AddTestPartResult(const TestPartResult& test_part_result);
  15923. // Returns the death test count.
  15924. int death_test_count() const { return death_test_count_; }
  15925. // Increments the death test count, returning the new count.
  15926. int increment_death_test_count() { return ++death_test_count_; }
  15927. // Clears the test part results.
  15928. void ClearTestPartResults();
  15929. // Clears the object.
  15930. void Clear();
  15931. // Protects mutable state of the property vector and of owned
  15932. // properties, whose values may be updated.
  15933. internal::Mutex test_properites_mutex_;
  15934. // The vector of TestPartResults
  15935. std::vector<TestPartResult> test_part_results_;
  15936. // The vector of TestProperties
  15937. std::vector<TestProperty> test_properties_;
  15938. // Running count of death tests.
  15939. int death_test_count_;
  15940. // The elapsed time, in milliseconds.
  15941. TimeInMillis elapsed_time_;
  15942. // We disallow copying TestResult.
  15943. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
  15944. }; // class TestResult
  15945. // A TestInfo object stores the following information about a test:
  15946. //
  15947. // Test case name
  15948. // Test name
  15949. // Whether the test should be run
  15950. // A function pointer that creates the test object when invoked
  15951. // Test result
  15952. //
  15953. // The constructor of TestInfo registers itself with the UnitTest
  15954. // singleton such that the RUN_ALL_TESTS() macro knows which tests to
  15955. // run.
  15956. class GTEST_API_ TestInfo {
  15957. public:
  15958. // Destructs a TestInfo object. This function is not virtual, so
  15959. // don't inherit from TestInfo.
  15960. ~TestInfo();
  15961. // Returns the test case name.
  15962. const char* test_case_name() const { return test_case_name_.c_str(); }
  15963. // Returns the test name.
  15964. const char* name() const { return name_.c_str(); }
  15965. // Returns the name of the parameter type, or NULL if this is not a typed
  15966. // or a type-parameterized test.
  15967. const char* type_param() const {
  15968. if (type_param_.get() != NULL)
  15969. return type_param_->c_str();
  15970. return NULL;
  15971. }
  15972. // Returns the text representation of the value parameter, or NULL if this
  15973. // is not a value-parameterized test.
  15974. const char* value_param() const {
  15975. if (value_param_.get() != NULL)
  15976. return value_param_->c_str();
  15977. return NULL;
  15978. }
  15979. // Returns true if this test should run, that is if the test is not disabled
  15980. // (or it is disabled but the also_run_disabled_tests flag has been specified)
  15981. // and its full name matches the user-specified filter.
  15982. //
  15983. // Google Test allows the user to filter the tests by their full names.
  15984. // The full name of a test Bar in test case Foo is defined as
  15985. // "Foo.Bar". Only the tests that match the filter will run.
  15986. //
  15987. // A filter is a colon-separated list of glob (not regex) patterns,
  15988. // optionally followed by a '-' and a colon-separated list of
  15989. // negative patterns (tests to exclude). A test is run if it
  15990. // matches one of the positive patterns and does not match any of
  15991. // the negative patterns.
  15992. //
  15993. // For example, *A*:Foo.* is a filter that matches any string that
  15994. // contains the character 'A' or starts with "Foo.".
  15995. bool should_run() const { return should_run_; }
  15996. // Returns the result of the test.
  15997. const TestResult* result() const { return &result_; }
  15998. private:
  15999. #if GTEST_HAS_DEATH_TEST
  16000. friend class internal::DefaultDeathTestFactory;
  16001. #endif // GTEST_HAS_DEATH_TEST
  16002. friend class Test;
  16003. friend class TestCase;
  16004. friend class internal::UnitTestImpl;
  16005. friend TestInfo* internal::MakeAndRegisterTestInfo(
  16006. const char* test_case_name, const char* name,
  16007. const char* type_param,
  16008. const char* value_param,
  16009. internal::TypeId fixture_class_id,
  16010. Test::SetUpTestCaseFunc set_up_tc,
  16011. Test::TearDownTestCaseFunc tear_down_tc,
  16012. internal::TestFactoryBase* factory);
  16013. // Constructs a TestInfo object. The newly constructed instance assumes
  16014. // ownership of the factory object.
  16015. TestInfo(const char* test_case_name, const char* name,
  16016. const char* a_type_param,
  16017. const char* a_value_param,
  16018. internal::TypeId fixture_class_id,
  16019. internal::TestFactoryBase* factory);
  16020. // Increments the number of death tests encountered in this test so
  16021. // far.
  16022. int increment_death_test_count() {
  16023. return result_.increment_death_test_count();
  16024. }
  16025. // Creates the test object, runs it, records its result, and then
  16026. // deletes it.
  16027. void Run();
  16028. static void ClearTestResult(TestInfo* test_info) {
  16029. test_info->result_.Clear();
  16030. }
  16031. // These fields are immutable properties of the test.
  16032. const std::string test_case_name_; // Test case name
  16033. const std::string name_; // Test name
  16034. // Name of the parameter type, or NULL if this is not a typed or a
  16035. // type-parameterized test.
  16036. const internal::scoped_ptr<const ::std::string> type_param_;
  16037. // Text representation of the value parameter, or NULL if this is not a
  16038. // value-parameterized test.
  16039. const internal::scoped_ptr<const ::std::string> value_param_;
  16040. const internal::TypeId fixture_class_id_; // ID of the test fixture class
  16041. bool should_run_; // True iff this test should run
  16042. bool is_disabled_; // True iff this test is disabled
  16043. bool matches_filter_; // True if this test matches the
  16044. // user-specified filter.
  16045. internal::TestFactoryBase* const factory_; // The factory that creates
  16046. // the test object
  16047. // This field is mutable and needs to be reset before running the
  16048. // test for the second time.
  16049. TestResult result_;
  16050. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
  16051. };
  16052. // A test case, which consists of a vector of TestInfos.
  16053. //
  16054. // TestCase is not copyable.
  16055. class GTEST_API_ TestCase {
  16056. public:
  16057. // Creates a TestCase with the given name.
  16058. //
  16059. // TestCase does NOT have a default constructor. Always use this
  16060. // constructor to create a TestCase object.
  16061. //
  16062. // Arguments:
  16063. //
  16064. // name: name of the test case
  16065. // a_type_param: the name of the test's type parameter, or NULL if
  16066. // this is not a type-parameterized test.
  16067. // set_up_tc: pointer to the function that sets up the test case
  16068. // tear_down_tc: pointer to the function that tears down the test case
  16069. TestCase(const char* name, const char* a_type_param,
  16070. Test::SetUpTestCaseFunc set_up_tc,
  16071. Test::TearDownTestCaseFunc tear_down_tc);
  16072. // Destructor of TestCase.
  16073. virtual ~TestCase();
  16074. // Gets the name of the TestCase.
  16075. const char* name() const { return name_.c_str(); }
  16076. // Returns the name of the parameter type, or NULL if this is not a
  16077. // type-parameterized test case.
  16078. const char* type_param() const {
  16079. if (type_param_.get() != NULL)
  16080. return type_param_->c_str();
  16081. return NULL;
  16082. }
  16083. // Returns true if any test in this test case should run.
  16084. bool should_run() const { return should_run_; }
  16085. // Gets the number of successful tests in this test case.
  16086. int successful_test_count() const;
  16087. // Gets the number of failed tests in this test case.
  16088. int failed_test_count() const;
  16089. // Gets the number of disabled tests in this test case.
  16090. int disabled_test_count() const;
  16091. // Get the number of tests in this test case that should run.
  16092. int test_to_run_count() const;
  16093. // Gets the number of all tests in this test case.
  16094. int total_test_count() const;
  16095. // Returns true iff the test case passed.
  16096. bool Passed() const { return !Failed(); }
  16097. // Returns true iff the test case failed.
  16098. bool Failed() const { return failed_test_count() > 0; }
  16099. // Returns the elapsed time, in milliseconds.
  16100. TimeInMillis elapsed_time() const { return elapsed_time_; }
  16101. // Returns the i-th test among all the tests. i can range from 0 to
  16102. // total_test_count() - 1. If i is not in that range, returns NULL.
  16103. const TestInfo* GetTestInfo(int i) const;
  16104. private:
  16105. friend class Test;
  16106. friend class internal::UnitTestImpl;
  16107. // Gets the (mutable) vector of TestInfos in this TestCase.
  16108. std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
  16109. // Gets the (immutable) vector of TestInfos in this TestCase.
  16110. const std::vector<TestInfo*>& test_info_list() const {
  16111. return test_info_list_;
  16112. }
  16113. // Returns the i-th test among all the tests. i can range from 0 to
  16114. // total_test_count() - 1. If i is not in that range, returns NULL.
  16115. TestInfo* GetMutableTestInfo(int i);
  16116. // Sets the should_run member.
  16117. void set_should_run(bool should) { should_run_ = should; }
  16118. // Adds a TestInfo to this test case. Will delete the TestInfo upon
  16119. // destruction of the TestCase object.
  16120. void AddTestInfo(TestInfo * test_info);
  16121. // Clears the results of all tests in this test case.
  16122. void ClearResult();
  16123. // Clears the results of all tests in the given test case.
  16124. static void ClearTestCaseResult(TestCase* test_case) {
  16125. test_case->ClearResult();
  16126. }
  16127. // Runs every test in this TestCase.
  16128. void Run();
  16129. // Runs SetUpTestCase() for this TestCase. This wrapper is needed
  16130. // for catching exceptions thrown from SetUpTestCase().
  16131. void RunSetUpTestCase() { (*set_up_tc_)(); }
  16132. // Runs TearDownTestCase() for this TestCase. This wrapper is
  16133. // needed for catching exceptions thrown from TearDownTestCase().
  16134. void RunTearDownTestCase() { (*tear_down_tc_)(); }
  16135. // Returns true iff test passed.
  16136. static bool TestPassed(const TestInfo* test_info) {
  16137. return test_info->should_run() && test_info->result()->Passed();
  16138. }
  16139. // Returns true iff test failed.
  16140. static bool TestFailed(const TestInfo* test_info) {
  16141. return test_info->should_run() && test_info->result()->Failed();
  16142. }
  16143. // Returns true iff test is disabled.
  16144. static bool TestDisabled(const TestInfo* test_info) {
  16145. return test_info->is_disabled_;
  16146. }
  16147. // Returns true if the given test should run.
  16148. static bool ShouldRunTest(const TestInfo* test_info) {
  16149. return test_info->should_run();
  16150. }
  16151. // Shuffles the tests in this test case.
  16152. void ShuffleTests(internal::Random* random);
  16153. // Restores the test order to before the first shuffle.
  16154. void UnshuffleTests();
  16155. // Name of the test case.
  16156. internal::String name_;
  16157. // Name of the parameter type, or NULL if this is not a typed or a
  16158. // type-parameterized test.
  16159. const internal::scoped_ptr<const ::std::string> type_param_;
  16160. // The vector of TestInfos in their original order. It owns the
  16161. // elements in the vector.
  16162. std::vector<TestInfo*> test_info_list_;
  16163. // Provides a level of indirection for the test list to allow easy
  16164. // shuffling and restoring the test order. The i-th element in this
  16165. // vector is the index of the i-th test in the shuffled test list.
  16166. std::vector<int> test_indices_;
  16167. // Pointer to the function that sets up the test case.
  16168. Test::SetUpTestCaseFunc set_up_tc_;
  16169. // Pointer to the function that tears down the test case.
  16170. Test::TearDownTestCaseFunc tear_down_tc_;
  16171. // True iff any test in this test case should run.
  16172. bool should_run_;
  16173. // Elapsed time, in milliseconds.
  16174. TimeInMillis elapsed_time_;
  16175. // We disallow copying TestCases.
  16176. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
  16177. };
  16178. // An Environment object is capable of setting up and tearing down an
  16179. // environment. The user should subclass this to define his own
  16180. // environment(s).
  16181. //
  16182. // An Environment object does the set-up and tear-down in virtual
  16183. // methods SetUp() and TearDown() instead of the constructor and the
  16184. // destructor, as:
  16185. //
  16186. // 1. You cannot safely throw from a destructor. This is a problem
  16187. // as in some cases Google Test is used where exceptions are enabled, and
  16188. // we may want to implement ASSERT_* using exceptions where they are
  16189. // available.
  16190. // 2. You cannot use ASSERT_* directly in a constructor or
  16191. // destructor.
  16192. class Environment {
  16193. public:
  16194. // The d'tor is virtual as we need to subclass Environment.
  16195. virtual ~Environment() {}
  16196. // Override this to define how to set up the environment.
  16197. virtual void SetUp() {}
  16198. // Override this to define how to tear down the environment.
  16199. virtual void TearDown() {}
  16200. private:
  16201. // If you see an error about overriding the following function or
  16202. // about it being private, you have mis-spelled SetUp() as Setup().
  16203. struct Setup_should_be_spelled_SetUp {};
  16204. virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
  16205. };
  16206. // The interface for tracing execution of tests. The methods are organized in
  16207. // the order the corresponding events are fired.
  16208. class TestEventListener {
  16209. public:
  16210. virtual ~TestEventListener() {}
  16211. // Fired before any test activity starts.
  16212. virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
  16213. // Fired before each iteration of tests starts. There may be more than
  16214. // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
  16215. // index, starting from 0.
  16216. virtual void OnTestIterationStart(const UnitTest& unit_test,
  16217. int iteration) = 0;
  16218. // Fired before environment set-up for each iteration of tests starts.
  16219. virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
  16220. // Fired after environment set-up for each iteration of tests ends.
  16221. virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
  16222. // Fired before the test case starts.
  16223. virtual void OnTestCaseStart(const TestCase& test_case) = 0;
  16224. // Fired before the test starts.
  16225. virtual void OnTestStart(const TestInfo& test_info) = 0;
  16226. // Fired after a failed assertion or a SUCCEED() invocation.
  16227. virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
  16228. // Fired after the test ends.
  16229. virtual void OnTestEnd(const TestInfo& test_info) = 0;
  16230. // Fired after the test case ends.
  16231. virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
  16232. // Fired before environment tear-down for each iteration of tests starts.
  16233. virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
  16234. // Fired after environment tear-down for each iteration of tests ends.
  16235. virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
  16236. // Fired after each iteration of tests finishes.
  16237. virtual void OnTestIterationEnd(const UnitTest& unit_test,
  16238. int iteration) = 0;
  16239. // Fired after all test activities have ended.
  16240. virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
  16241. };
  16242. // The convenience class for users who need to override just one or two
  16243. // methods and are not concerned that a possible change to a signature of
  16244. // the methods they override will not be caught during the build. For
  16245. // comments about each method please see the definition of TestEventListener
  16246. // above.
  16247. class EmptyTestEventListener : public TestEventListener {
  16248. public:
  16249. virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
  16250. virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
  16251. int /*iteration*/) {}
  16252. virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
  16253. virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
  16254. virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
  16255. virtual void OnTestStart(const TestInfo& /*test_info*/) {}
  16256. virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
  16257. virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
  16258. virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
  16259. virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
  16260. virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
  16261. virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
  16262. int /*iteration*/) {}
  16263. virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
  16264. };
  16265. // TestEventListeners lets users add listeners to track events in Google Test.
  16266. class GTEST_API_ TestEventListeners {
  16267. public:
  16268. TestEventListeners();
  16269. ~TestEventListeners();
  16270. // Appends an event listener to the end of the list. Google Test assumes
  16271. // the ownership of the listener (i.e. it will delete the listener when
  16272. // the test program finishes).
  16273. void Append(TestEventListener* listener);
  16274. // Removes the given event listener from the list and returns it. It then
  16275. // becomes the caller's responsibility to delete the listener. Returns
  16276. // NULL if the listener is not found in the list.
  16277. TestEventListener* Release(TestEventListener* listener);
  16278. // Returns the standard listener responsible for the default console
  16279. // output. Can be removed from the listeners list to shut down default
  16280. // console output. Note that removing this object from the listener list
  16281. // with Release transfers its ownership to the caller and makes this
  16282. // function return NULL the next time.
  16283. TestEventListener* default_result_printer() const {
  16284. return default_result_printer_;
  16285. }
  16286. // Returns the standard listener responsible for the default XML output
  16287. // controlled by the --gtest_output=xml flag. Can be removed from the
  16288. // listeners list by users who want to shut down the default XML output
  16289. // controlled by this flag and substitute it with custom one. Note that
  16290. // removing this object from the listener list with Release transfers its
  16291. // ownership to the caller and makes this function return NULL the next
  16292. // time.
  16293. TestEventListener* default_xml_generator() const {
  16294. return default_xml_generator_;
  16295. }
  16296. private:
  16297. friend class TestCase;
  16298. friend class TestInfo;
  16299. friend class internal::DefaultGlobalTestPartResultReporter;
  16300. friend class internal::NoExecDeathTest;
  16301. friend class internal::TestEventListenersAccessor;
  16302. friend class internal::UnitTestImpl;
  16303. // Returns repeater that broadcasts the TestEventListener events to all
  16304. // subscribers.
  16305. TestEventListener* repeater();
  16306. // Sets the default_result_printer attribute to the provided listener.
  16307. // The listener is also added to the listener list and previous
  16308. // default_result_printer is removed from it and deleted. The listener can
  16309. // also be NULL in which case it will not be added to the list. Does
  16310. // nothing if the previous and the current listener objects are the same.
  16311. void SetDefaultResultPrinter(TestEventListener* listener);
  16312. // Sets the default_xml_generator attribute to the provided listener. The
  16313. // listener is also added to the listener list and previous
  16314. // default_xml_generator is removed from it and deleted. The listener can
  16315. // also be NULL in which case it will not be added to the list. Does
  16316. // nothing if the previous and the current listener objects are the same.
  16317. void SetDefaultXmlGenerator(TestEventListener* listener);
  16318. // Controls whether events will be forwarded by the repeater to the
  16319. // listeners in the list.
  16320. bool EventForwardingEnabled() const;
  16321. void SuppressEventForwarding();
  16322. // The actual list of listeners.
  16323. internal::TestEventRepeater* repeater_;
  16324. // Listener responsible for the standard result output.
  16325. TestEventListener* default_result_printer_;
  16326. // Listener responsible for the creation of the XML output file.
  16327. TestEventListener* default_xml_generator_;
  16328. // We disallow copying TestEventListeners.
  16329. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
  16330. };
  16331. // A UnitTest consists of a vector of TestCases.
  16332. //
  16333. // This is a singleton class. The only instance of UnitTest is
  16334. // created when UnitTest::GetInstance() is first called. This
  16335. // instance is never deleted.
  16336. //
  16337. // UnitTest is not copyable.
  16338. //
  16339. // This class is thread-safe as long as the methods are called
  16340. // according to their specification.
  16341. class GTEST_API_ UnitTest {
  16342. public:
  16343. // Gets the singleton UnitTest object. The first time this method
  16344. // is called, a UnitTest object is constructed and returned.
  16345. // Consecutive calls will return the same object.
  16346. static UnitTest* GetInstance();
  16347. // Runs all tests in this UnitTest object and prints the result.
  16348. // Returns 0 if successful, or 1 otherwise.
  16349. //
  16350. // This method can only be called from the main thread.
  16351. //
  16352. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16353. int Run() GTEST_MUST_USE_RESULT_;
  16354. // Returns the working directory when the first TEST() or TEST_F()
  16355. // was executed. The UnitTest object owns the string.
  16356. const char* original_working_dir() const;
  16357. // Returns the TestCase object for the test that's currently running,
  16358. // or NULL if no test is running.
  16359. const TestCase* current_test_case() const;
  16360. // Returns the TestInfo object for the test that's currently running,
  16361. // or NULL if no test is running.
  16362. const TestInfo* current_test_info() const;
  16363. // Returns the random seed used at the start of the current test run.
  16364. int random_seed() const;
  16365. #if GTEST_HAS_PARAM_TEST
  16366. // Returns the ParameterizedTestCaseRegistry object used to keep track of
  16367. // value-parameterized tests and instantiate and register them.
  16368. //
  16369. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16370. internal::ParameterizedTestCaseRegistry& parameterized_test_registry();
  16371. #endif // GTEST_HAS_PARAM_TEST
  16372. // Gets the number of successful test cases.
  16373. int successful_test_case_count() const;
  16374. // Gets the number of failed test cases.
  16375. int failed_test_case_count() const;
  16376. // Gets the number of all test cases.
  16377. int total_test_case_count() const;
  16378. // Gets the number of all test cases that contain at least one test
  16379. // that should run.
  16380. int test_case_to_run_count() const;
  16381. // Gets the number of successful tests.
  16382. int successful_test_count() const;
  16383. // Gets the number of failed tests.
  16384. int failed_test_count() const;
  16385. // Gets the number of disabled tests.
  16386. int disabled_test_count() const;
  16387. // Gets the number of all tests.
  16388. int total_test_count() const;
  16389. // Gets the number of tests that should run.
  16390. int test_to_run_count() const;
  16391. // Gets the elapsed time, in milliseconds.
  16392. TimeInMillis elapsed_time() const;
  16393. // Returns true iff the unit test passed (i.e. all test cases passed).
  16394. bool Passed() const;
  16395. // Returns true iff the unit test failed (i.e. some test case failed
  16396. // or something outside of all tests failed).
  16397. bool Failed() const;
  16398. // Gets the i-th test case among all the test cases. i can range from 0 to
  16399. // total_test_case_count() - 1. If i is not in that range, returns NULL.
  16400. const TestCase* GetTestCase(int i) const;
  16401. // Returns the list of event listeners that can be used to track events
  16402. // inside Google Test.
  16403. TestEventListeners& listeners();
  16404. private:
  16405. // Registers and returns a global test environment. When a test
  16406. // program is run, all global test environments will be set-up in
  16407. // the order they were registered. After all tests in the program
  16408. // have finished, all global test environments will be torn-down in
  16409. // the *reverse* order they were registered.
  16410. //
  16411. // The UnitTest object takes ownership of the given environment.
  16412. //
  16413. // This method can only be called from the main thread.
  16414. Environment* AddEnvironment(Environment* env);
  16415. // Adds a TestPartResult to the current TestResult object. All
  16416. // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
  16417. // eventually call this to report their results. The user code
  16418. // should use the assertion macros instead of calling this directly.
  16419. void AddTestPartResult(TestPartResult::Type result_type,
  16420. const char* file_name,
  16421. int line_number,
  16422. const internal::String& message,
  16423. const internal::String& os_stack_trace);
  16424. // Adds a TestProperty to the current TestResult object. If the result already
  16425. // contains a property with the same key, the value will be updated.
  16426. void RecordPropertyForCurrentTest(const char* key, const char* value);
  16427. // Gets the i-th test case among all the test cases. i can range from 0 to
  16428. // total_test_case_count() - 1. If i is not in that range, returns NULL.
  16429. TestCase* GetMutableTestCase(int i);
  16430. // Accessors for the implementation object.
  16431. internal::UnitTestImpl* impl() { return impl_; }
  16432. const internal::UnitTestImpl* impl() const { return impl_; }
  16433. // These classes and funcions are friends as they need to access private
  16434. // members of UnitTest.
  16435. friend class Test;
  16436. friend class internal::AssertHelper;
  16437. friend class internal::ScopedTrace;
  16438. friend Environment* AddGlobalTestEnvironment(Environment* env);
  16439. friend internal::UnitTestImpl* internal::GetUnitTestImpl();
  16440. friend void internal::ReportFailureInUnknownLocation(
  16441. TestPartResult::Type result_type,
  16442. const internal::String& message);
  16443. // Creates an empty UnitTest.
  16444. UnitTest();
  16445. // D'tor
  16446. virtual ~UnitTest();
  16447. // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
  16448. // Google Test trace stack.
  16449. void PushGTestTrace(const internal::TraceInfo& trace);
  16450. // Pops a trace from the per-thread Google Test trace stack.
  16451. void PopGTestTrace();
  16452. // Protects mutable state in *impl_. This is mutable as some const
  16453. // methods need to lock it too.
  16454. mutable internal::Mutex mutex_;
  16455. // Opaque implementation object. This field is never changed once
  16456. // the object is constructed. We don't mark it as const here, as
  16457. // doing so will cause a warning in the constructor of UnitTest.
  16458. // Mutable state in *impl_ is protected by mutex_.
  16459. internal::UnitTestImpl* impl_;
  16460. // We disallow copying UnitTest.
  16461. GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
  16462. };
  16463. // A convenient wrapper for adding an environment for the test
  16464. // program.
  16465. //
  16466. // You should call this before RUN_ALL_TESTS() is called, probably in
  16467. // main(). If you use gtest_main, you need to call this before main()
  16468. // starts for it to take effect. For example, you can define a global
  16469. // variable like this:
  16470. //
  16471. // testing::Environment* const foo_env =
  16472. // testing::AddGlobalTestEnvironment(new FooEnvironment);
  16473. //
  16474. // However, we strongly recommend you to write your own main() and
  16475. // call AddGlobalTestEnvironment() there, as relying on initialization
  16476. // of global variables makes the code harder to read and may cause
  16477. // problems when you register multiple environments from different
  16478. // translation units and the environments have dependencies among them
  16479. // (remember that the compiler doesn't guarantee the order in which
  16480. // global variables from different translation units are initialized).
  16481. inline Environment* AddGlobalTestEnvironment(Environment* env) {
  16482. return UnitTest::GetInstance()->AddEnvironment(env);
  16483. }
  16484. // Initializes Google Test. This must be called before calling
  16485. // RUN_ALL_TESTS(). In particular, it parses a command line for the
  16486. // flags that Google Test recognizes. Whenever a Google Test flag is
  16487. // seen, it is removed from argv, and *argc is decremented.
  16488. //
  16489. // No value is returned. Instead, the Google Test flag variables are
  16490. // updated.
  16491. //
  16492. // Calling the function for the second time has no user-visible effect.
  16493. GTEST_API_ void InitGoogleTest(int* argc, char** argv);
  16494. // This overloaded version can be used in Windows programs compiled in
  16495. // UNICODE mode.
  16496. GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
  16497. namespace internal {
  16498. // Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
  16499. // operand to be used in a failure message. The type (but not value)
  16500. // of the other operand may affect the format. This allows us to
  16501. // print a char* as a raw pointer when it is compared against another
  16502. // char*, and print it as a C string when it is compared against an
  16503. // std::string object, for example.
  16504. //
  16505. // The default implementation ignores the type of the other operand.
  16506. // Some specialized versions are used to handle formatting wide or
  16507. // narrow C strings.
  16508. //
  16509. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16510. template <typename T1, typename T2>
  16511. String FormatForComparisonFailureMessage(const T1& value,
  16512. const T2& /* other_operand */) {
  16513. // C++Builder compiles this incorrectly if the namespace isn't explicitly
  16514. // given.
  16515. return ::testing::PrintToString(value);
  16516. }
  16517. // The helper function for {ASSERT|EXPECT}_EQ.
  16518. template <typename T1, typename T2>
  16519. AssertionResult CmpHelperEQ(const char* expected_expression,
  16520. const char* actual_expression,
  16521. const T1& expected,
  16522. const T2& actual) {
  16523. #ifdef _MSC_VER
  16524. # pragma warning(push) // Saves the current warning state.
  16525. # pragma warning(disable:4389) // Temporarily disables warning on
  16526. // signed/unsigned mismatch.
  16527. #elif __clang__
  16528. #pragma clang diagnostic push
  16529. #pragma clang diagnostic ignored "-Wsign-compare"
  16530. #elif __GNUC__
  16531. #pragma gcc diagnostic push
  16532. #pragma gcc diagnostic ignored "-Wsign-compare"
  16533. #endif
  16534. if (expected == actual) {
  16535. return AssertionSuccess();
  16536. }
  16537. #ifdef _MSC_VER
  16538. # pragma warning(pop) // Restores the warning state.
  16539. #elif __clang__
  16540. #pragma clang diagnostic pop
  16541. #elif __GNUC__
  16542. #pragma gcc diagnostic pop
  16543. #endif
  16544. return EqFailure(expected_expression,
  16545. actual_expression,
  16546. FormatForComparisonFailureMessage(expected, actual),
  16547. FormatForComparisonFailureMessage(actual, expected),
  16548. false);
  16549. }
  16550. // With this overloaded version, we allow anonymous enums to be used
  16551. // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
  16552. // can be implicitly cast to BiggestInt.
  16553. GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression,
  16554. const char* actual_expression,
  16555. BiggestInt expected,
  16556. BiggestInt actual);
  16557. // The helper class for {ASSERT|EXPECT}_EQ. The template argument
  16558. // lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
  16559. // is a null pointer literal. The following default implementation is
  16560. // for lhs_is_null_literal being false.
  16561. template <bool lhs_is_null_literal>
  16562. class EqHelper {
  16563. public:
  16564. // This templatized version is for the general case.
  16565. template <typename T1, typename T2>
  16566. static AssertionResult Compare(const char* expected_expression,
  16567. const char* actual_expression,
  16568. const T1& expected,
  16569. const T2& actual) {
  16570. return CmpHelperEQ(expected_expression, actual_expression, expected,
  16571. actual);
  16572. }
  16573. // With this overloaded version, we allow anonymous enums to be used
  16574. // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
  16575. // enums can be implicitly cast to BiggestInt.
  16576. //
  16577. // Even though its body looks the same as the above version, we
  16578. // cannot merge the two, as it will make anonymous enums unhappy.
  16579. static AssertionResult Compare(const char* expected_expression,
  16580. const char* actual_expression,
  16581. BiggestInt expected,
  16582. BiggestInt actual) {
  16583. return CmpHelperEQ(expected_expression, actual_expression, expected,
  16584. actual);
  16585. }
  16586. };
  16587. // This specialization is used when the first argument to ASSERT_EQ()
  16588. // is a null pointer literal, like NULL, false, or 0.
  16589. template <>
  16590. class EqHelper<true> {
  16591. public:
  16592. // We define two overloaded versions of Compare(). The first
  16593. // version will be picked when the second argument to ASSERT_EQ() is
  16594. // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
  16595. // EXPECT_EQ(false, a_bool).
  16596. template <typename T1, typename T2>
  16597. static AssertionResult Compare(
  16598. const char* expected_expression,
  16599. const char* actual_expression,
  16600. const T1& expected,
  16601. const T2& actual,
  16602. // The following line prevents this overload from being considered if T2
  16603. // is not a pointer type. We need this because ASSERT_EQ(NULL, my_ptr)
  16604. // expands to Compare("", "", NULL, my_ptr), which requires a conversion
  16605. // to match the Secret* in the other overload, which would otherwise make
  16606. // this template match better.
  16607. typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
  16608. return CmpHelperEQ(expected_expression, actual_expression, expected,
  16609. actual);
  16610. }
  16611. // This version will be picked when the second argument to ASSERT_EQ() is a
  16612. // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
  16613. template <typename T>
  16614. static AssertionResult Compare(
  16615. const char* expected_expression,
  16616. const char* actual_expression,
  16617. // We used to have a second template parameter instead of Secret*. That
  16618. // template parameter would deduce to 'long', making this a better match
  16619. // than the first overload even without the first overload's EnableIf.
  16620. // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
  16621. // non-pointer argument" (even a deduced integral argument), so the old
  16622. // implementation caused warnings in user code.
  16623. Secret* /* expected (NULL) */,
  16624. T* actual) {
  16625. // We already know that 'expected' is a null pointer.
  16626. return CmpHelperEQ(expected_expression, actual_expression,
  16627. static_cast<T*>(NULL), actual);
  16628. }
  16629. };
  16630. // A macro for implementing the helper functions needed to implement
  16631. // ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste
  16632. // of similar code.
  16633. //
  16634. // For each templatized helper function, we also define an overloaded
  16635. // version for BiggestInt in order to reduce code bloat and allow
  16636. // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
  16637. // with gcc 4.
  16638. //
  16639. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16640. #define GTEST_IMPL_CMP_HELPER_(op_name, op)\
  16641. template <typename T1, typename T2>\
  16642. AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
  16643. const T1& val1, const T2& val2) {\
  16644. if (val1 op val2) {\
  16645. return AssertionSuccess();\
  16646. } else {\
  16647. return AssertionFailure() \
  16648. << "Expected: (" << expr1 << ") " #op " (" << expr2\
  16649. << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
  16650. << " vs " << FormatForComparisonFailureMessage(val2, val1);\
  16651. }\
  16652. }\
  16653. GTEST_API_ AssertionResult CmpHelper##op_name(\
  16654. const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
  16655. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16656. // Implements the helper function for {ASSERT|EXPECT}_NE
  16657. GTEST_IMPL_CMP_HELPER_(NE, !=);
  16658. // Implements the helper function for {ASSERT|EXPECT}_LE
  16659. GTEST_IMPL_CMP_HELPER_(LE, <=);
  16660. // Implements the helper function for {ASSERT|EXPECT}_LT
  16661. GTEST_IMPL_CMP_HELPER_(LT, < );
  16662. // Implements the helper function for {ASSERT|EXPECT}_GE
  16663. GTEST_IMPL_CMP_HELPER_(GE, >=);
  16664. // Implements the helper function for {ASSERT|EXPECT}_GT
  16665. GTEST_IMPL_CMP_HELPER_(GT, > );
  16666. #undef GTEST_IMPL_CMP_HELPER_
  16667. // The helper function for {ASSERT|EXPECT}_STREQ.
  16668. //
  16669. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16670. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
  16671. const char* actual_expression,
  16672. const char* expected,
  16673. const char* actual);
  16674. // The helper function for {ASSERT|EXPECT}_STRCASEEQ.
  16675. //
  16676. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16677. GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,
  16678. const char* actual_expression,
  16679. const char* expected,
  16680. const char* actual);
  16681. // The helper function for {ASSERT|EXPECT}_STRNE.
  16682. //
  16683. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16684. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
  16685. const char* s2_expression,
  16686. const char* s1,
  16687. const char* s2);
  16688. // The helper function for {ASSERT|EXPECT}_STRCASENE.
  16689. //
  16690. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16691. GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
  16692. const char* s2_expression,
  16693. const char* s1,
  16694. const char* s2);
  16695. // Helper function for *_STREQ on wide strings.
  16696. //
  16697. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16698. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
  16699. const char* actual_expression,
  16700. const wchar_t* expected,
  16701. const wchar_t* actual);
  16702. // Helper function for *_STRNE on wide strings.
  16703. //
  16704. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16705. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
  16706. const char* s2_expression,
  16707. const wchar_t* s1,
  16708. const wchar_t* s2);
  16709. } // namespace internal
  16710. // IsSubstring() and IsNotSubstring() are intended to be used as the
  16711. // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
  16712. // themselves. They check whether needle is a substring of haystack
  16713. // (NULL is considered a substring of itself only), and return an
  16714. // appropriate error message when they fail.
  16715. //
  16716. // The {needle,haystack}_expr arguments are the stringified
  16717. // expressions that generated the two real arguments.
  16718. GTEST_API_ AssertionResult IsSubstring(
  16719. const char* needle_expr, const char* haystack_expr,
  16720. const char* needle, const char* haystack);
  16721. GTEST_API_ AssertionResult IsSubstring(
  16722. const char* needle_expr, const char* haystack_expr,
  16723. const wchar_t* needle, const wchar_t* haystack);
  16724. GTEST_API_ AssertionResult IsNotSubstring(
  16725. const char* needle_expr, const char* haystack_expr,
  16726. const char* needle, const char* haystack);
  16727. GTEST_API_ AssertionResult IsNotSubstring(
  16728. const char* needle_expr, const char* haystack_expr,
  16729. const wchar_t* needle, const wchar_t* haystack);
  16730. GTEST_API_ AssertionResult IsSubstring(
  16731. const char* needle_expr, const char* haystack_expr,
  16732. const ::std::string& needle, const ::std::string& haystack);
  16733. GTEST_API_ AssertionResult IsNotSubstring(
  16734. const char* needle_expr, const char* haystack_expr,
  16735. const ::std::string& needle, const ::std::string& haystack);
  16736. #if GTEST_HAS_STD_WSTRING
  16737. GTEST_API_ AssertionResult IsSubstring(
  16738. const char* needle_expr, const char* haystack_expr,
  16739. const ::std::wstring& needle, const ::std::wstring& haystack);
  16740. GTEST_API_ AssertionResult IsNotSubstring(
  16741. const char* needle_expr, const char* haystack_expr,
  16742. const ::std::wstring& needle, const ::std::wstring& haystack);
  16743. #endif // GTEST_HAS_STD_WSTRING
  16744. namespace internal {
  16745. // Helper template function for comparing floating-points.
  16746. //
  16747. // Template parameter:
  16748. //
  16749. // RawType: the raw floating-point type (either float or double)
  16750. //
  16751. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16752. template <typename RawType>
  16753. AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression,
  16754. const char* actual_expression,
  16755. RawType expected,
  16756. RawType actual) {
  16757. const FloatingPoint<RawType> lhs(expected), rhs(actual);
  16758. if (lhs.AlmostEquals(rhs)) {
  16759. return AssertionSuccess();
  16760. }
  16761. ::std::stringstream expected_ss;
  16762. expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
  16763. << expected;
  16764. ::std::stringstream actual_ss;
  16765. actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
  16766. << actual;
  16767. return EqFailure(expected_expression,
  16768. actual_expression,
  16769. StringStreamToString(&expected_ss),
  16770. StringStreamToString(&actual_ss),
  16771. false);
  16772. }
  16773. // Helper function for implementing ASSERT_NEAR.
  16774. //
  16775. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16776. GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
  16777. const char* expr2,
  16778. const char* abs_error_expr,
  16779. double val1,
  16780. double val2,
  16781. double abs_error);
  16782. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  16783. // A class that enables one to stream messages to assertion macros
  16784. class GTEST_API_ AssertHelper {
  16785. public:
  16786. // Constructor.
  16787. AssertHelper(TestPartResult::Type type,
  16788. const char* file,
  16789. int line,
  16790. const char* message);
  16791. ~AssertHelper();
  16792. // Message assignment is a semantic trick to enable assertion
  16793. // streaming; see the GTEST_MESSAGE_ macro below.
  16794. void operator=(const Message& message) const;
  16795. private:
  16796. // We put our data in a struct so that the size of the AssertHelper class can
  16797. // be as small as possible. This is important because gcc is incapable of
  16798. // re-using stack space even for temporary variables, so every EXPECT_EQ
  16799. // reserves stack space for another AssertHelper.
  16800. struct AssertHelperData {
  16801. AssertHelperData(TestPartResult::Type t,
  16802. const char* srcfile,
  16803. int line_num,
  16804. const char* msg)
  16805. : type(t), file(srcfile), line(line_num), message(msg) { }
  16806. TestPartResult::Type const type;
  16807. const char* const file;
  16808. int const line;
  16809. String const message;
  16810. private:
  16811. GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
  16812. };
  16813. AssertHelperData* const data_;
  16814. GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
  16815. };
  16816. } // namespace internal
  16817. #if GTEST_HAS_PARAM_TEST
  16818. // The pure interface class that all value-parameterized tests inherit from.
  16819. // A value-parameterized class must inherit from both ::testing::Test and
  16820. // ::testing::WithParamInterface. In most cases that just means inheriting
  16821. // from ::testing::TestWithParam, but more complicated test hierarchies
  16822. // may need to inherit from Test and WithParamInterface at different levels.
  16823. //
  16824. // This interface has support for accessing the test parameter value via
  16825. // the GetParam() method.
  16826. //
  16827. // Use it with one of the parameter generator defining functions, like Range(),
  16828. // Values(), ValuesIn(), Bool(), and Combine().
  16829. //
  16830. // class FooTest : public ::testing::TestWithParam<int> {
  16831. // protected:
  16832. // FooTest() {
  16833. // // Can use GetParam() here.
  16834. // }
  16835. // virtual ~FooTest() {
  16836. // // Can use GetParam() here.
  16837. // }
  16838. // virtual void SetUp() {
  16839. // // Can use GetParam() here.
  16840. // }
  16841. // virtual void TearDown {
  16842. // // Can use GetParam() here.
  16843. // }
  16844. // };
  16845. // TEST_P(FooTest, DoesBar) {
  16846. // // Can use GetParam() method here.
  16847. // Foo foo;
  16848. // ASSERT_TRUE(foo.DoesBar(GetParam()));
  16849. // }
  16850. // INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
  16851. template <typename T>
  16852. class WithParamInterface {
  16853. public:
  16854. typedef T ParamType;
  16855. virtual ~WithParamInterface() {}
  16856. // The current parameter value. Is also available in the test fixture's
  16857. // constructor. This member function is non-static, even though it only
  16858. // references static data, to reduce the opportunity for incorrect uses
  16859. // like writing 'WithParamInterface<bool>::GetParam()' for a test that
  16860. // uses a fixture whose parameter type is int.
  16861. const ParamType& GetParam() const { return *parameter_; }
  16862. private:
  16863. // Sets parameter value. The caller is responsible for making sure the value
  16864. // remains alive and unchanged throughout the current test.
  16865. static void SetParam(const ParamType* parameter) {
  16866. parameter_ = parameter;
  16867. }
  16868. // Static value used for accessing parameter during a test lifetime.
  16869. static const ParamType* parameter_;
  16870. // TestClass must be a subclass of WithParamInterface<T> and Test.
  16871. template <class TestClass> friend class internal::ParameterizedTestFactory;
  16872. };
  16873. template <typename T>
  16874. const T* WithParamInterface<T>::parameter_ = NULL;
  16875. // Most value-parameterized classes can ignore the existence of
  16876. // WithParamInterface, and can just inherit from ::testing::TestWithParam.
  16877. template <typename T>
  16878. class TestWithParam : public Test, public WithParamInterface<T> {
  16879. };
  16880. #endif // GTEST_HAS_PARAM_TEST
  16881. // Macros for indicating success/failure in test code.
  16882. // ADD_FAILURE unconditionally adds a failure to the current test.
  16883. // SUCCEED generates a success - it doesn't automatically make the
  16884. // current test successful, as a test is only successful when it has
  16885. // no failure.
  16886. //
  16887. // EXPECT_* verifies that a certain condition is satisfied. If not,
  16888. // it behaves like ADD_FAILURE. In particular:
  16889. //
  16890. // EXPECT_TRUE verifies that a Boolean condition is true.
  16891. // EXPECT_FALSE verifies that a Boolean condition is false.
  16892. //
  16893. // FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
  16894. // that they will also abort the current function on failure. People
  16895. // usually want the fail-fast behavior of FAIL and ASSERT_*, but those
  16896. // writing data-driven tests often find themselves using ADD_FAILURE
  16897. // and EXPECT_* more.
  16898. //
  16899. // Examples:
  16900. //
  16901. // EXPECT_TRUE(server.StatusIsOK());
  16902. // ASSERT_FALSE(server.HasPendingRequest(port))
  16903. // << "There are still pending requests " << "on port " << port;
  16904. // Generates a nonfatal failure with a generic message.
  16905. #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
  16906. // Generates a nonfatal failure at the given source file location with
  16907. // a generic message.
  16908. #define ADD_FAILURE_AT(file, line) \
  16909. GTEST_MESSAGE_AT_(file, line, "Failed", \
  16910. ::testing::TestPartResult::kNonFatalFailure)
  16911. // Generates a fatal failure with a generic message.
  16912. #define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
  16913. // Define this macro to 1 to omit the definition of FAIL(), which is a
  16914. // generic name and clashes with some other libraries.
  16915. #if !GTEST_DONT_DEFINE_FAIL
  16916. # define FAIL() GTEST_FAIL()
  16917. #endif
  16918. // Generates a success with a generic message.
  16919. #define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
  16920. // Define this macro to 1 to omit the definition of SUCCEED(), which
  16921. // is a generic name and clashes with some other libraries.
  16922. #if !GTEST_DONT_DEFINE_SUCCEED
  16923. # define SUCCEED() GTEST_SUCCEED()
  16924. #endif
  16925. // Macros for testing exceptions.
  16926. //
  16927. // * {ASSERT|EXPECT}_THROW(statement, expected_exception):
  16928. // Tests that the statement throws the expected exception.
  16929. // * {ASSERT|EXPECT}_NO_THROW(statement):
  16930. // Tests that the statement doesn't throw any exception.
  16931. // * {ASSERT|EXPECT}_ANY_THROW(statement):
  16932. // Tests that the statement throws an exception.
  16933. #define EXPECT_THROW(statement, expected_exception) \
  16934. GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
  16935. #define EXPECT_NO_THROW(statement) \
  16936. GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
  16937. #define EXPECT_ANY_THROW(statement) \
  16938. GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
  16939. #define ASSERT_THROW(statement, expected_exception) \
  16940. GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
  16941. #define ASSERT_NO_THROW(statement) \
  16942. GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
  16943. #define ASSERT_ANY_THROW(statement) \
  16944. GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
  16945. // Boolean assertions. Condition can be either a Boolean expression or an
  16946. // AssertionResult. For more information on how to use AssertionResult with
  16947. // these macros see comments on that class.
  16948. #define EXPECT_TRUE(condition) \
  16949. GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
  16950. GTEST_NONFATAL_FAILURE_)
  16951. #define EXPECT_FALSE(condition) \
  16952. GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
  16953. GTEST_NONFATAL_FAILURE_)
  16954. #define ASSERT_TRUE(condition) \
  16955. GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
  16956. GTEST_FATAL_FAILURE_)
  16957. #define ASSERT_FALSE(condition) \
  16958. GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
  16959. GTEST_FATAL_FAILURE_)
  16960. // Includes the auto-generated header that implements a family of
  16961. // generic predicate assertion macros.
  16962. // Copyright 2006, Google Inc.
  16963. // All rights reserved.
  16964. //
  16965. // Redistribution and use in source and binary forms, with or without
  16966. // modification, are permitted provided that the following conditions are
  16967. // met:
  16968. //
  16969. // * Redistributions of source code must retain the above copyright
  16970. // notice, this list of conditions and the following disclaimer.
  16971. // * Redistributions in binary form must reproduce the above
  16972. // copyright notice, this list of conditions and the following disclaimer
  16973. // in the documentation and/or other materials provided with the
  16974. // distribution.
  16975. // * Neither the name of Google Inc. nor the names of its
  16976. // contributors may be used to endorse or promote products derived from
  16977. // this software without specific prior written permission.
  16978. //
  16979. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  16980. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  16981. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  16982. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  16983. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16984. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16985. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  16986. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  16987. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  16988. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  16989. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  16990. // This file is AUTOMATICALLY GENERATED on 09/24/2010 by command
  16991. // 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
  16992. //
  16993. // Implements a family of generic predicate assertion macros.
  16994. #ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
  16995. #define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
  16996. // Makes sure this header is not included before gtest.h.
  16997. #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
  16998. # error Do not include gtest_pred_impl.h directly. Include gtest.h instead.
  16999. #endif // GTEST_INCLUDE_GTEST_GTEST_H_
  17000. // This header implements a family of generic predicate assertion
  17001. // macros:
  17002. //
  17003. // ASSERT_PRED_FORMAT1(pred_format, v1)
  17004. // ASSERT_PRED_FORMAT2(pred_format, v1, v2)
  17005. // ...
  17006. //
  17007. // where pred_format is a function or functor that takes n (in the
  17008. // case of ASSERT_PRED_FORMATn) values and their source expression
  17009. // text, and returns a testing::AssertionResult. See the definition
  17010. // of ASSERT_EQ in gtest.h for an example.
  17011. //
  17012. // If you don't care about formatting, you can use the more
  17013. // restrictive version:
  17014. //
  17015. // ASSERT_PRED1(pred, v1)
  17016. // ASSERT_PRED2(pred, v1, v2)
  17017. // ...
  17018. //
  17019. // where pred is an n-ary function or functor that returns bool,
  17020. // and the values v1, v2, ..., must support the << operator for
  17021. // streaming to std::ostream.
  17022. //
  17023. // We also define the EXPECT_* variations.
  17024. //
  17025. // For now we only support predicates whose arity is at most 5.
  17026. // Please email [email protected] if you need
  17027. // support for higher arities.
  17028. // GTEST_ASSERT_ is the basic statement to which all of the assertions
  17029. // in this file reduce. Don't use this in your code.
  17030. #define GTEST_ASSERT_(expression, on_failure) \
  17031. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  17032. if (const ::testing::AssertionResult gtest_ar = (expression)) \
  17033. ; \
  17034. else \
  17035. on_failure(gtest_ar.failure_message())
  17036. // Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use
  17037. // this in your code.
  17038. template <typename Pred,
  17039. typename T1>
  17040. AssertionResult AssertPred1Helper(const char* pred_text,
  17041. const char* e1,
  17042. Pred pred,
  17043. const T1& v1) {
  17044. if (pred(v1)) return AssertionSuccess();
  17045. return AssertionFailure() << pred_text << "("
  17046. << e1 << ") evaluates to false, where"
  17047. << "\n" << e1 << " evaluates to " << v1;
  17048. }
  17049. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
  17050. // Don't use this in your code.
  17051. #define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
  17052. GTEST_ASSERT_(pred_format(#v1, v1),\
  17053. on_failure)
  17054. // Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use
  17055. // this in your code.
  17056. #define GTEST_PRED1_(pred, v1, on_failure)\
  17057. GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
  17058. #v1, \
  17059. pred, \
  17060. v1), on_failure)
  17061. // Unary predicate assertion macros.
  17062. #define EXPECT_PRED_FORMAT1(pred_format, v1) \
  17063. GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
  17064. #define EXPECT_PRED1(pred, v1) \
  17065. GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
  17066. #define ASSERT_PRED_FORMAT1(pred_format, v1) \
  17067. GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
  17068. #define ASSERT_PRED1(pred, v1) \
  17069. GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
  17070. // Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use
  17071. // this in your code.
  17072. template <typename Pred,
  17073. typename T1,
  17074. typename T2>
  17075. AssertionResult AssertPred2Helper(const char* pred_text,
  17076. const char* e1,
  17077. const char* e2,
  17078. Pred pred,
  17079. const T1& v1,
  17080. const T2& v2) {
  17081. if (pred(v1, v2)) return AssertionSuccess();
  17082. return AssertionFailure() << pred_text << "("
  17083. << e1 << ", "
  17084. << e2 << ") evaluates to false, where"
  17085. << "\n" << e1 << " evaluates to " << v1
  17086. << "\n" << e2 << " evaluates to " << v2;
  17087. }
  17088. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
  17089. // Don't use this in your code.
  17090. #define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
  17091. GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2),\
  17092. on_failure)
  17093. // Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use
  17094. // this in your code.
  17095. #define GTEST_PRED2_(pred, v1, v2, on_failure)\
  17096. GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
  17097. #v1, \
  17098. #v2, \
  17099. pred, \
  17100. v1, \
  17101. v2), on_failure)
  17102. // Binary predicate assertion macros.
  17103. #define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
  17104. GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
  17105. #define EXPECT_PRED2(pred, v1, v2) \
  17106. GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
  17107. #define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
  17108. GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
  17109. #define ASSERT_PRED2(pred, v1, v2) \
  17110. GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
  17111. // Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use
  17112. // this in your code.
  17113. template <typename Pred,
  17114. typename T1,
  17115. typename T2,
  17116. typename T3>
  17117. AssertionResult AssertPred3Helper(const char* pred_text,
  17118. const char* e1,
  17119. const char* e2,
  17120. const char* e3,
  17121. Pred pred,
  17122. const T1& v1,
  17123. const T2& v2,
  17124. const T3& v3) {
  17125. if (pred(v1, v2, v3)) return AssertionSuccess();
  17126. return AssertionFailure() << pred_text << "("
  17127. << e1 << ", "
  17128. << e2 << ", "
  17129. << e3 << ") evaluates to false, where"
  17130. << "\n" << e1 << " evaluates to " << v1
  17131. << "\n" << e2 << " evaluates to " << v2
  17132. << "\n" << e3 << " evaluates to " << v3;
  17133. }
  17134. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
  17135. // Don't use this in your code.
  17136. #define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
  17137. GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3),\
  17138. on_failure)
  17139. // Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use
  17140. // this in your code.
  17141. #define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
  17142. GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
  17143. #v1, \
  17144. #v2, \
  17145. #v3, \
  17146. pred, \
  17147. v1, \
  17148. v2, \
  17149. v3), on_failure)
  17150. // Ternary predicate assertion macros.
  17151. #define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
  17152. GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
  17153. #define EXPECT_PRED3(pred, v1, v2, v3) \
  17154. GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
  17155. #define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
  17156. GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
  17157. #define ASSERT_PRED3(pred, v1, v2, v3) \
  17158. GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
  17159. // Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use
  17160. // this in your code.
  17161. template <typename Pred,
  17162. typename T1,
  17163. typename T2,
  17164. typename T3,
  17165. typename T4>
  17166. AssertionResult AssertPred4Helper(const char* pred_text,
  17167. const char* e1,
  17168. const char* e2,
  17169. const char* e3,
  17170. const char* e4,
  17171. Pred pred,
  17172. const T1& v1,
  17173. const T2& v2,
  17174. const T3& v3,
  17175. const T4& v4) {
  17176. if (pred(v1, v2, v3, v4)) return AssertionSuccess();
  17177. return AssertionFailure() << pred_text << "("
  17178. << e1 << ", "
  17179. << e2 << ", "
  17180. << e3 << ", "
  17181. << e4 << ") evaluates to false, where"
  17182. << "\n" << e1 << " evaluates to " << v1
  17183. << "\n" << e2 << " evaluates to " << v2
  17184. << "\n" << e3 << " evaluates to " << v3
  17185. << "\n" << e4 << " evaluates to " << v4;
  17186. }
  17187. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
  17188. // Don't use this in your code.
  17189. #define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
  17190. GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4),\
  17191. on_failure)
  17192. // Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use
  17193. // this in your code.
  17194. #define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
  17195. GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
  17196. #v1, \
  17197. #v2, \
  17198. #v3, \
  17199. #v4, \
  17200. pred, \
  17201. v1, \
  17202. v2, \
  17203. v3, \
  17204. v4), on_failure)
  17205. // 4-ary predicate assertion macros.
  17206. #define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
  17207. GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
  17208. #define EXPECT_PRED4(pred, v1, v2, v3, v4) \
  17209. GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
  17210. #define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
  17211. GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
  17212. #define ASSERT_PRED4(pred, v1, v2, v3, v4) \
  17213. GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
  17214. // Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use
  17215. // this in your code.
  17216. template <typename Pred,
  17217. typename T1,
  17218. typename T2,
  17219. typename T3,
  17220. typename T4,
  17221. typename T5>
  17222. AssertionResult AssertPred5Helper(const char* pred_text,
  17223. const char* e1,
  17224. const char* e2,
  17225. const char* e3,
  17226. const char* e4,
  17227. const char* e5,
  17228. Pred pred,
  17229. const T1& v1,
  17230. const T2& v2,
  17231. const T3& v3,
  17232. const T4& v4,
  17233. const T5& v5) {
  17234. if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
  17235. return AssertionFailure() << pred_text << "("
  17236. << e1 << ", "
  17237. << e2 << ", "
  17238. << e3 << ", "
  17239. << e4 << ", "
  17240. << e5 << ") evaluates to false, where"
  17241. << "\n" << e1 << " evaluates to " << v1
  17242. << "\n" << e2 << " evaluates to " << v2
  17243. << "\n" << e3 << " evaluates to " << v3
  17244. << "\n" << e4 << " evaluates to " << v4
  17245. << "\n" << e5 << " evaluates to " << v5;
  17246. }
  17247. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
  17248. // Don't use this in your code.
  17249. #define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
  17250. GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5),\
  17251. on_failure)
  17252. // Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use
  17253. // this in your code.
  17254. #define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
  17255. GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
  17256. #v1, \
  17257. #v2, \
  17258. #v3, \
  17259. #v4, \
  17260. #v5, \
  17261. pred, \
  17262. v1, \
  17263. v2, \
  17264. v3, \
  17265. v4, \
  17266. v5), on_failure)
  17267. // 5-ary predicate assertion macros.
  17268. #define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
  17269. GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
  17270. #define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
  17271. GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
  17272. #define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
  17273. GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
  17274. #define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
  17275. GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
  17276. #endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
  17277. // Macros for testing equalities and inequalities.
  17278. //
  17279. // * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual
  17280. // * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
  17281. // * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2
  17282. // * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2
  17283. // * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2
  17284. // * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2
  17285. //
  17286. // When they are not, Google Test prints both the tested expressions and
  17287. // their actual values. The values must be compatible built-in types,
  17288. // or you will get a compiler error. By "compatible" we mean that the
  17289. // values can be compared by the respective operator.
  17290. //
  17291. // Note:
  17292. //
  17293. // 1. It is possible to make a user-defined type work with
  17294. // {ASSERT|EXPECT}_??(), but that requires overloading the
  17295. // comparison operators and is thus discouraged by the Google C++
  17296. // Usage Guide. Therefore, you are advised to use the
  17297. // {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
  17298. // equal.
  17299. //
  17300. // 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
  17301. // pointers (in particular, C strings). Therefore, if you use it
  17302. // with two C strings, you are testing how their locations in memory
  17303. // are related, not how their content is related. To compare two C
  17304. // strings by content, use {ASSERT|EXPECT}_STR*().
  17305. //
  17306. // 3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to
  17307. // {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you
  17308. // what the actual value is when it fails, and similarly for the
  17309. // other comparisons.
  17310. //
  17311. // 4. Do not depend on the order in which {ASSERT|EXPECT}_??()
  17312. // evaluate their arguments, which is undefined.
  17313. //
  17314. // 5. These macros evaluate their arguments exactly once.
  17315. //
  17316. // Examples:
  17317. //
  17318. // EXPECT_NE(5, Foo());
  17319. // EXPECT_EQ(NULL, a_pointer);
  17320. // ASSERT_LT(i, array_size);
  17321. // ASSERT_GT(records.size(), 0) << "There is no record left.";
  17322. #define EXPECT_EQ(expected, actual) \
  17323. EXPECT_PRED_FORMAT2(::testing::internal:: \
  17324. EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
  17325. expected, actual)
  17326. #define EXPECT_NE(expected, actual) \
  17327. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual)
  17328. #define EXPECT_LE(val1, val2) \
  17329. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
  17330. #define EXPECT_LT(val1, val2) \
  17331. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
  17332. #define EXPECT_GE(val1, val2) \
  17333. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
  17334. #define EXPECT_GT(val1, val2) \
  17335. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
  17336. #define GTEST_ASSERT_EQ(expected, actual) \
  17337. ASSERT_PRED_FORMAT2(::testing::internal:: \
  17338. EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
  17339. expected, actual)
  17340. #define GTEST_ASSERT_NE(val1, val2) \
  17341. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
  17342. #define GTEST_ASSERT_LE(val1, val2) \
  17343. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
  17344. #define GTEST_ASSERT_LT(val1, val2) \
  17345. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
  17346. #define GTEST_ASSERT_GE(val1, val2) \
  17347. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
  17348. #define GTEST_ASSERT_GT(val1, val2) \
  17349. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
  17350. // Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
  17351. // ASSERT_XY(), which clashes with some users' own code.
  17352. #if !GTEST_DONT_DEFINE_ASSERT_EQ
  17353. # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
  17354. #endif
  17355. #if !GTEST_DONT_DEFINE_ASSERT_NE
  17356. # define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
  17357. #endif
  17358. #if !GTEST_DONT_DEFINE_ASSERT_LE
  17359. # define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
  17360. #endif
  17361. #if !GTEST_DONT_DEFINE_ASSERT_LT
  17362. # define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
  17363. #endif
  17364. #if !GTEST_DONT_DEFINE_ASSERT_GE
  17365. # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
  17366. #endif
  17367. #if !GTEST_DONT_DEFINE_ASSERT_GT
  17368. # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
  17369. #endif
  17370. // C String Comparisons. All tests treat NULL and any non-NULL string
  17371. // as different. Two NULLs are equal.
  17372. //
  17373. // * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2
  17374. // * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2
  17375. // * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
  17376. // * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
  17377. //
  17378. // For wide or narrow string objects, you can use the
  17379. // {ASSERT|EXPECT}_??() macros.
  17380. //
  17381. // Don't depend on the order in which the arguments are evaluated,
  17382. // which is undefined.
  17383. //
  17384. // These macros evaluate their arguments exactly once.
  17385. #define EXPECT_STREQ(expected, actual) \
  17386. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
  17387. #define EXPECT_STRNE(s1, s2) \
  17388. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
  17389. #define EXPECT_STRCASEEQ(expected, actual) \
  17390. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
  17391. #define EXPECT_STRCASENE(s1, s2)\
  17392. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
  17393. #define ASSERT_STREQ(expected, actual) \
  17394. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
  17395. #define ASSERT_STRNE(s1, s2) \
  17396. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
  17397. #define ASSERT_STRCASEEQ(expected, actual) \
  17398. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
  17399. #define ASSERT_STRCASENE(s1, s2)\
  17400. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
  17401. // Macros for comparing floating-point numbers.
  17402. //
  17403. // * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual):
  17404. // Tests that two float values are almost equal.
  17405. // * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual):
  17406. // Tests that two double values are almost equal.
  17407. // * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
  17408. // Tests that v1 and v2 are within the given distance to each other.
  17409. //
  17410. // Google Test uses ULP-based comparison to automatically pick a default
  17411. // error bound that is appropriate for the operands. See the
  17412. // FloatingPoint template class in gtest-internal.h if you are
  17413. // interested in the implementation details.
  17414. #define EXPECT_FLOAT_EQ(expected, actual)\
  17415. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
  17416. expected, actual)
  17417. #define EXPECT_DOUBLE_EQ(expected, actual)\
  17418. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
  17419. expected, actual)
  17420. #define ASSERT_FLOAT_EQ(expected, actual)\
  17421. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
  17422. expected, actual)
  17423. #define ASSERT_DOUBLE_EQ(expected, actual)\
  17424. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
  17425. expected, actual)
  17426. #define EXPECT_NEAR(val1, val2, abs_error)\
  17427. EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
  17428. val1, val2, abs_error)
  17429. #define ASSERT_NEAR(val1, val2, abs_error)\
  17430. ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
  17431. val1, val2, abs_error)
  17432. // These predicate format functions work on floating-point values, and
  17433. // can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
  17434. //
  17435. // EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
  17436. // Asserts that val1 is less than, or almost equal to, val2. Fails
  17437. // otherwise. In particular, it fails if either val1 or val2 is NaN.
  17438. GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
  17439. float val1, float val2);
  17440. GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
  17441. double val1, double val2);
  17442. #if GTEST_OS_WINDOWS
  17443. // Macros that test for HRESULT failure and success, these are only useful
  17444. // on Windows, and rely on Windows SDK macros and APIs to compile.
  17445. //
  17446. // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
  17447. //
  17448. // When expr unexpectedly fails or succeeds, Google Test prints the
  17449. // expected result and the actual result with both a human-readable
  17450. // string representation of the error, if available, as well as the
  17451. // hex result code.
  17452. # define EXPECT_HRESULT_SUCCEEDED(expr) \
  17453. EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
  17454. # define ASSERT_HRESULT_SUCCEEDED(expr) \
  17455. ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
  17456. # define EXPECT_HRESULT_FAILED(expr) \
  17457. EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
  17458. # define ASSERT_HRESULT_FAILED(expr) \
  17459. ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
  17460. #endif // GTEST_OS_WINDOWS
  17461. // Macros that execute statement and check that it doesn't generate new fatal
  17462. // failures in the current thread.
  17463. //
  17464. // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
  17465. //
  17466. // Examples:
  17467. //
  17468. // EXPECT_NO_FATAL_FAILURE(Process());
  17469. // ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
  17470. //
  17471. #define ASSERT_NO_FATAL_FAILURE(statement) \
  17472. GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
  17473. #define EXPECT_NO_FATAL_FAILURE(statement) \
  17474. GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
  17475. // Causes a trace (including the source file path, the current line
  17476. // number, and the given message) to be included in every test failure
  17477. // message generated by code in the current scope. The effect is
  17478. // undone when the control leaves the current scope.
  17479. //
  17480. // The message argument can be anything streamable to std::ostream.
  17481. //
  17482. // In the implementation, we include the current line number as part
  17483. // of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
  17484. // to appear in the same block - as long as they are on different
  17485. // lines.
  17486. #define SCOPED_TRACE(message) \
  17487. ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
  17488. __FILE__, __LINE__, ::testing::Message() << (message))
  17489. // Compile-time assertion for type equality.
  17490. // StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
  17491. // the same type. The value it returns is not interesting.
  17492. //
  17493. // Instead of making StaticAssertTypeEq a class template, we make it a
  17494. // function template that invokes a helper class template. This
  17495. // prevents a user from misusing StaticAssertTypeEq<T1, T2> by
  17496. // defining objects of that type.
  17497. //
  17498. // CAVEAT:
  17499. //
  17500. // When used inside a method of a class template,
  17501. // StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
  17502. // instantiated. For example, given:
  17503. //
  17504. // template <typename T> class Foo {
  17505. // public:
  17506. // void Bar() { testing::StaticAssertTypeEq<int, T>(); }
  17507. // };
  17508. //
  17509. // the code:
  17510. //
  17511. // void Test1() { Foo<bool> foo; }
  17512. //
  17513. // will NOT generate a compiler error, as Foo<bool>::Bar() is never
  17514. // actually instantiated. Instead, you need:
  17515. //
  17516. // void Test2() { Foo<bool> foo; foo.Bar(); }
  17517. //
  17518. // to cause a compiler error.
  17519. template <typename T1, typename T2>
  17520. bool StaticAssertTypeEq() {
  17521. (void)internal::StaticAssertTypeEqHelper<T1, T2>();
  17522. return true;
  17523. }
  17524. // Defines a test.
  17525. //
  17526. // The first parameter is the name of the test case, and the second
  17527. // parameter is the name of the test within the test case.
  17528. //
  17529. // The convention is to end the test case name with "Test". For
  17530. // example, a test case for the Foo class can be named FooTest.
  17531. //
  17532. // The user should put his test code between braces after using this
  17533. // macro. Example:
  17534. //
  17535. // TEST(FooTest, InitializesCorrectly) {
  17536. // Foo foo;
  17537. // EXPECT_TRUE(foo.StatusIsOK());
  17538. // }
  17539. // Note that we call GetTestTypeId() instead of GetTypeId<
  17540. // ::testing::Test>() here to get the type ID of testing::Test. This
  17541. // is to work around a suspected linker bug when using Google Test as
  17542. // a framework on Mac OS X. The bug causes GetTypeId<
  17543. // ::testing::Test>() to return different values depending on whether
  17544. // the call is from the Google Test framework itself or from user test
  17545. // code. GetTestTypeId() is guaranteed to always return the same
  17546. // value, as it always calls GetTypeId<>() from the Google Test
  17547. // framework.
  17548. #define GTEST_TEST(test_case_name, test_name)\
  17549. GTEST_TEST_(test_case_name, test_name, \
  17550. ::testing::Test, ::testing::internal::GetTestTypeId())
  17551. // Define this macro to 1 to omit the definition of TEST(), which
  17552. // is a generic name and clashes with some other libraries.
  17553. #if !GTEST_DONT_DEFINE_TEST
  17554. # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
  17555. #endif
  17556. // Defines a test that uses a test fixture.
  17557. //
  17558. // The first parameter is the name of the test fixture class, which
  17559. // also doubles as the test case name. The second parameter is the
  17560. // name of the test within the test case.
  17561. //
  17562. // A test fixture class must be declared earlier. The user should put
  17563. // his test code between braces after using this macro. Example:
  17564. //
  17565. // class FooTest : public testing::Test {
  17566. // protected:
  17567. // virtual void SetUp() { b_.AddElement(3); }
  17568. //
  17569. // Foo a_;
  17570. // Foo b_;
  17571. // };
  17572. //
  17573. // TEST_F(FooTest, InitializesCorrectly) {
  17574. // EXPECT_TRUE(a_.StatusIsOK());
  17575. // }
  17576. //
  17577. // TEST_F(FooTest, ReturnsElementCountCorrectly) {
  17578. // EXPECT_EQ(0, a_.size());
  17579. // EXPECT_EQ(1, b_.size());
  17580. // }
  17581. #define TEST_F(test_fixture, test_name)\
  17582. GTEST_TEST_(test_fixture, test_name, test_fixture, \
  17583. ::testing::internal::GetTypeId<test_fixture>())
  17584. // Use this macro in main() to run all tests. It returns 0 if all
  17585. // tests are successful, or 1 otherwise.
  17586. //
  17587. // RUN_ALL_TESTS() should be invoked after the command line has been
  17588. // parsed by InitGoogleTest().
  17589. #define RUN_ALL_TESTS()\
  17590. (::testing::UnitTest::GetInstance()->Run())
  17591. } // namespace testing
  17592. #pragma warning( pop )
  17593. #endif // GTEST_INCLUDE_GTEST_GTEST_H_