gtest.h 783 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556
  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. #if defined(_MSC_VER)
  55. #pragma warning(push)
  56. #pragma warning(disable : 4996)
  57. #endif
  58. // Copyright 2005, Google Inc.
  59. // All rights reserved.
  60. //
  61. // Redistribution and use in source and binary forms, with or without
  62. // modification, are permitted provided that the following conditions are
  63. // met:
  64. //
  65. // * Redistributions of source code must retain the above copyright
  66. // notice, this list of conditions and the following disclaimer.
  67. // * Redistributions in binary form must reproduce the above
  68. // copyright notice, this list of conditions and the following disclaimer
  69. // in the documentation and/or other materials provided with the
  70. // distribution.
  71. // * Neither the name of Google Inc. nor the names of its
  72. // contributors may be used to endorse or promote products derived from
  73. // this software without specific prior written permission.
  74. //
  75. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  76. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  77. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  78. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  79. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  80. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  81. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  82. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  83. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  84. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  85. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  86. //
  87. // Authors: [email protected] (Zhanyong Wan), [email protected] (Sean Mcafee)
  88. //
  89. // The Google C++ Testing Framework (Google Test)
  90. //
  91. // This header file declares functions and macros used internally by
  92. // Google Test. They are subject to change without notice.
  93. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
  94. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
  95. // Copyright 2005, Google Inc.
  96. // All rights reserved.
  97. //
  98. // Redistribution and use in source and binary forms, with or without
  99. // modification, are permitted provided that the following conditions are
  100. // met:
  101. //
  102. // * Redistributions of source code must retain the above copyright
  103. // notice, this list of conditions and the following disclaimer.
  104. // * Redistributions in binary form must reproduce the above
  105. // copyright notice, this list of conditions and the following disclaimer
  106. // in the documentation and/or other materials provided with the
  107. // distribution.
  108. // * Neither the name of Google Inc. nor the names of its
  109. // contributors may be used to endorse or promote products derived from
  110. // this software without specific prior written permission.
  111. //
  112. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  113. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  114. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  115. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  116. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  117. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  118. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  119. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  120. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  121. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  122. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  123. //
  124. // Authors: [email protected] (Zhanyong Wan)
  125. //
  126. // Low-level types and utilities for porting Google Test to various
  127. // platforms. They are subject to change without notice. DO NOT USE
  128. // THEM IN USER CODE.
  129. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
  130. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
  131. // The user can define the following macros in the build script to
  132. // control Google Test's behavior. If the user doesn't define a macro
  133. // in this list, Google Test will define it.
  134. //
  135. // GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2)
  136. // is/isn't available.
  137. // GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions
  138. // are enabled.
  139. // GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string
  140. // is/isn't available (some systems define
  141. // ::string, which is different to std::string).
  142. // GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
  143. // is/isn't available (some systems define
  144. // ::wstring, which is different to std::wstring).
  145. // GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular
  146. // expressions are/aren't available.
  147. // GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that <pthread.h>
  148. // is/isn't available.
  149. // GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't
  150. // enabled.
  151. // GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that
  152. // std::wstring does/doesn't work (Google Test can
  153. // be used where std::wstring is unavailable).
  154. // GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple
  155. // is/isn't available.
  156. // GTEST_HAS_SEH - Define it to 1/0 to indicate whether the
  157. // compiler supports Microsoft's "Structured
  158. // Exception Handling".
  159. // GTEST_HAS_STREAM_REDIRECTION
  160. // - Define it to 1/0 to indicate whether the
  161. // platform supports I/O stream redirection using
  162. // dup() and dup2().
  163. // GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google
  164. // Test's own tr1 tuple implementation should be
  165. // used. Unused when the user sets
  166. // GTEST_HAS_TR1_TUPLE to 0.
  167. // GTEST_LINKED_AS_SHARED_LIBRARY
  168. // - Define to 1 when compiling tests that use
  169. // Google Test as a shared library (known as
  170. // DLL on Windows).
  171. // GTEST_CREATE_SHARED_LIBRARY
  172. // - Define to 1 when compiling Google Test itself
  173. // as a shared library.
  174. // This header defines the following utilities:
  175. //
  176. // Macros indicating the current platform (defined to 1 if compiled on
  177. // the given platform; otherwise undefined):
  178. // GTEST_OS_AIX - IBM AIX
  179. // GTEST_OS_CYGWIN - Cygwin
  180. // GTEST_OS_HPUX - HP-UX
  181. // GTEST_OS_LINUX - Linux
  182. // GTEST_OS_LINUX_ANDROID - Google Android
  183. // GTEST_OS_MAC - Mac OS X
  184. // GTEST_OS_NACL - Google Native Client (NaCl)
  185. // GTEST_OS_SOLARIS - Sun Solaris
  186. // GTEST_OS_SYMBIAN - Symbian
  187. // GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile)
  188. // GTEST_OS_WINDOWS_DESKTOP - Windows Desktop
  189. // GTEST_OS_WINDOWS_MINGW - MinGW
  190. // GTEST_OS_WINDOWS_MOBILE - Windows Mobile
  191. // GTEST_OS_ZOS - z/OS
  192. //
  193. // Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
  194. // most stable support. Since core members of the Google Test project
  195. // don't have access to other platforms, support for them may be less
  196. // stable. If you notice any problems on your platform, please notify
  197. // [email protected] (patches for fixing them are
  198. // even more welcome!).
  199. //
  200. // Note that it is possible that none of the GTEST_OS_* macros are defined.
  201. //
  202. // Macros indicating available Google Test features (defined to 1 if
  203. // the corresponding feature is supported; otherwise undefined):
  204. // GTEST_HAS_COMBINE - the Combine() function (for value-parameterized
  205. // tests)
  206. // GTEST_HAS_DEATH_TEST - death tests
  207. // GTEST_HAS_PARAM_TEST - value-parameterized tests
  208. // GTEST_HAS_TYPED_TEST - typed tests
  209. // GTEST_HAS_TYPED_TEST_P - type-parameterized tests
  210. // GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with
  211. // GTEST_HAS_POSIX_RE (see above) which users can
  212. // define themselves.
  213. // GTEST_USES_SIMPLE_RE - our own simple regex is used;
  214. // the above two are mutually exclusive.
  215. // GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
  216. //
  217. // Macros for basic C++ coding:
  218. // GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
  219. // GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a
  220. // variable don't have to be used.
  221. // GTEST_DISALLOW_ASSIGN_ - disables operator=.
  222. // GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
  223. // GTEST_MUST_USE_RESULT_ - declares that a function's result must be used.
  224. //
  225. // Synchronization:
  226. // Mutex, MutexLock, ThreadLocal, GetThreadCount()
  227. // - synchronization primitives.
  228. // GTEST_IS_THREADSAFE - defined to 1 to indicate that the above
  229. // synchronization primitives have real implementations
  230. // and Google Test is thread-safe; or 0 otherwise.
  231. //
  232. // Template meta programming:
  233. // is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only.
  234. // IteratorTraits - partial implementation of std::iterator_traits, which
  235. // is not available in libCstd when compiled with Sun C++.
  236. //
  237. // Smart pointers:
  238. // scoped_ptr - as in TR2.
  239. //
  240. // Regular expressions:
  241. // RE - a simple regular expression class using the POSIX
  242. // Extended Regular Expression syntax on UNIX-like
  243. // platforms, or a reduced regular exception syntax on
  244. // other platforms, including Windows.
  245. //
  246. // Logging:
  247. // GTEST_LOG_() - logs messages at the specified severity level.
  248. // LogToStderr() - directs all log messages to stderr.
  249. // FlushInfoLog() - flushes informational log messages.
  250. //
  251. // Stdout and stderr capturing:
  252. // CaptureStdout() - starts capturing stdout.
  253. // GetCapturedStdout() - stops capturing stdout and returns the captured
  254. // string.
  255. // CaptureStderr() - starts capturing stderr.
  256. // GetCapturedStderr() - stops capturing stderr and returns the captured
  257. // string.
  258. //
  259. // Integer types:
  260. // TypeWithSize - maps an integer to a int type.
  261. // Int32, UInt32, Int64, UInt64, TimeInMillis
  262. // - integers of known sizes.
  263. // BiggestInt - the biggest signed integer type.
  264. //
  265. // Command-line utilities:
  266. // GTEST_FLAG() - references a flag.
  267. // GTEST_DECLARE_*() - declares a flag.
  268. // GTEST_DEFINE_*() - defines a flag.
  269. // GetArgvs() - returns the command line as a vector of strings.
  270. //
  271. // Environment variable utilities:
  272. // GetEnv() - gets the value of an environment variable.
  273. // BoolFromGTestEnv() - parses a bool environment variable.
  274. // Int32FromGTestEnv() - parses an Int32 environment variable.
  275. // StringFromGTestEnv() - parses a string environment variable.
  276. #include <ctype.h> // for isspace, etc
  277. #include <stddef.h> // for ptrdiff_t
  278. #include <stdlib.h>
  279. #include <stdio.h>
  280. #include <string.h>
  281. #ifndef _WIN32_WCE
  282. # include <sys/types.h>
  283. # include <sys/stat.h>
  284. #endif // !_WIN32_WCE
  285. #include <iostream> // NOLINT
  286. #include <sstream> // NOLINT
  287. #include <string> // NOLINT
  288. #define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
  289. #define GTEST_FLAG_PREFIX_ "gtest_"
  290. #define GTEST_FLAG_PREFIX_DASH_ "gtest-"
  291. #define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
  292. #define GTEST_NAME_ "Google Test"
  293. #define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/"
  294. // Determines the version of gcc that is used to compile this.
  295. #ifdef __GNUC__
  296. // 40302 means version 4.3.2.
  297. # define GTEST_GCC_VER_ \
  298. (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
  299. #endif // __GNUC__
  300. // Determines the platform on which Google Test is compiled.
  301. #ifdef __CYGWIN__
  302. # define GTEST_OS_CYGWIN 1
  303. #elif defined __SYMBIAN32__
  304. # define GTEST_OS_SYMBIAN 1
  305. #elif defined _WIN32
  306. # define GTEST_OS_WINDOWS 1
  307. # ifdef _WIN32_WCE
  308. # define GTEST_OS_WINDOWS_MOBILE 1
  309. # elif defined(__MINGW__) || defined(__MINGW32__)
  310. # define GTEST_OS_WINDOWS_MINGW 1
  311. # else
  312. # define GTEST_OS_WINDOWS_DESKTOP 1
  313. # endif // _WIN32_WCE
  314. #elif defined __APPLE__
  315. # define GTEST_OS_MAC 1
  316. #elif defined __linux__
  317. # define GTEST_OS_LINUX 1
  318. # ifdef ANDROID
  319. # define GTEST_OS_LINUX_ANDROID 1
  320. # endif // ANDROID
  321. #elif defined __MVS__
  322. # define GTEST_OS_ZOS 1
  323. #elif defined(__sun) && defined(__SVR4)
  324. # define GTEST_OS_SOLARIS 1
  325. #elif defined(_AIX)
  326. # define GTEST_OS_AIX 1
  327. #elif defined(__hpux)
  328. # define GTEST_OS_HPUX 1
  329. #elif defined __native_client__
  330. # define GTEST_OS_NACL 1
  331. #endif // __CYGWIN__
  332. // Brings in definitions for functions used in the testing::internal::posix
  333. // namespace (read, write, close, chdir, isatty, stat). We do not currently
  334. // use them on Windows Mobile.
  335. #if !GTEST_OS_WINDOWS
  336. // This assumes that non-Windows OSes provide unistd.h. For OSes where this
  337. // is not the case, we need to include headers that provide the functions
  338. // mentioned above.
  339. # include <unistd.h>
  340. # if !GTEST_OS_NACL
  341. // TODO([email protected]): Remove this condition when Native Client SDK adds
  342. // strings.h (tracked in
  343. // http://code.google.com/p/nativeclient/issues/detail?id=1175).
  344. # include <strings.h> // Native Client doesn't provide strings.h.
  345. # endif
  346. #elif !GTEST_OS_WINDOWS_MOBILE
  347. # include <direct.h>
  348. # include <io.h>
  349. #endif
  350. // Defines this to true iff Google Test can use POSIX regular expressions.
  351. #ifndef GTEST_HAS_POSIX_RE
  352. # define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)
  353. #endif
  354. #if GTEST_HAS_POSIX_RE
  355. // On some platforms, <regex.h> needs someone to define size_t, and
  356. // won't compile otherwise. We can #include it here as we already
  357. // included <stdlib.h>, which is guaranteed to define size_t through
  358. // <stddef.h>.
  359. # include <regex.h> // NOLINT
  360. # define GTEST_USES_POSIX_RE 1
  361. #elif GTEST_OS_WINDOWS
  362. // <regex.h> is not available on Windows. Use our own simple regex
  363. // implementation instead.
  364. # define GTEST_USES_SIMPLE_RE 1
  365. #else
  366. // <regex.h> may not be available on this platform. Use our own
  367. // simple regex implementation instead.
  368. # define GTEST_USES_SIMPLE_RE 1
  369. #endif // GTEST_HAS_POSIX_RE
  370. #ifndef GTEST_HAS_EXCEPTIONS
  371. // The user didn't tell us whether exceptions are enabled, so we need
  372. // to figure it out.
  373. # if defined(_MSC_VER) || defined(__BORLANDC__)
  374. // MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS
  375. // macro to enable exceptions, so we'll do the same.
  376. // Assumes that exceptions are enabled by default.
  377. # ifndef _HAS_EXCEPTIONS
  378. # define _HAS_EXCEPTIONS 1
  379. # endif // _HAS_EXCEPTIONS
  380. # define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
  381. # elif defined(__GNUC__) && __EXCEPTIONS
  382. // gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
  383. # define GTEST_HAS_EXCEPTIONS 1
  384. # elif defined(__SUNPRO_CC)
  385. // Sun Pro CC supports exceptions. However, there is no compile-time way of
  386. // detecting whether they are enabled or not. Therefore, we assume that
  387. // they are enabled unless the user tells us otherwise.
  388. # define GTEST_HAS_EXCEPTIONS 1
  389. # elif defined(__IBMCPP__) && __EXCEPTIONS
  390. // xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
  391. # define GTEST_HAS_EXCEPTIONS 1
  392. # elif defined(__HP_aCC)
  393. // Exception handling is in effect by default in HP aCC compiler. It has to
  394. // be turned of by +noeh compiler option if desired.
  395. # define GTEST_HAS_EXCEPTIONS 1
  396. # else
  397. // For other compilers, we assume exceptions are disabled to be
  398. // conservative.
  399. # define GTEST_HAS_EXCEPTIONS 0
  400. # endif // defined(_MSC_VER) || defined(__BORLANDC__)
  401. #endif // GTEST_HAS_EXCEPTIONS
  402. #if !defined(GTEST_HAS_STD_STRING)
  403. // Even though we don't use this macro any longer, we keep it in case
  404. // some clients still depend on it.
  405. # define GTEST_HAS_STD_STRING 1
  406. #elif !GTEST_HAS_STD_STRING
  407. // The user told us that ::std::string isn't available.
  408. # error "Google Test cannot be used where ::std::string isn't available."
  409. #endif // !defined(GTEST_HAS_STD_STRING)
  410. #ifndef GTEST_HAS_GLOBAL_STRING
  411. // The user didn't tell us whether ::string is available, so we need
  412. // to figure it out.
  413. # define GTEST_HAS_GLOBAL_STRING 0
  414. #endif // GTEST_HAS_GLOBAL_STRING
  415. #ifndef GTEST_HAS_STD_WSTRING
  416. // The user didn't tell us whether ::std::wstring is available, so we need
  417. // to figure it out.
  418. // TODO([email protected]): uses autoconf to detect whether ::std::wstring
  419. // is available.
  420. // Cygwin 1.7 and below doesn't support ::std::wstring.
  421. // Solaris' libc++ doesn't support it either. Android has
  422. // no support for it at least as recent as Froyo (2.2).
  423. # define GTEST_HAS_STD_WSTRING \
  424. (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
  425. #endif // GTEST_HAS_STD_WSTRING
  426. #ifndef GTEST_HAS_GLOBAL_WSTRING
  427. // The user didn't tell us whether ::wstring is available, so we need
  428. // to figure it out.
  429. # define GTEST_HAS_GLOBAL_WSTRING \
  430. (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
  431. #endif // GTEST_HAS_GLOBAL_WSTRING
  432. // Determines whether RTTI is available.
  433. #ifndef GTEST_HAS_RTTI
  434. // The user didn't tell us whether RTTI is enabled, so we need to
  435. // figure it out.
  436. # ifdef _MSC_VER
  437. # ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled.
  438. # define GTEST_HAS_RTTI 1
  439. # else
  440. # define GTEST_HAS_RTTI 0
  441. # endif
  442. // Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
  443. # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
  444. # ifdef __GXX_RTTI
  445. # define GTEST_HAS_RTTI 1
  446. # else
  447. # define GTEST_HAS_RTTI 0
  448. # endif // __GXX_RTTI
  449. // Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
  450. // both the typeid and dynamic_cast features are present.
  451. # elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
  452. # ifdef __RTTI_ALL__
  453. # define GTEST_HAS_RTTI 1
  454. # else
  455. # define GTEST_HAS_RTTI 0
  456. # endif
  457. # else
  458. // For all other compilers, we assume RTTI is enabled.
  459. # define GTEST_HAS_RTTI 1
  460. # endif // _MSC_VER
  461. #endif // GTEST_HAS_RTTI
  462. // It's this header's responsibility to #include <typeinfo> when RTTI
  463. // is enabled.
  464. #if GTEST_HAS_RTTI
  465. # include <typeinfo>
  466. #endif
  467. // Determines whether Google Test can use the pthreads library.
  468. #ifndef GTEST_HAS_PTHREAD
  469. // The user didn't tell us explicitly, so we assume pthreads support is
  470. // available on Linux and Mac.
  471. //
  472. // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
  473. // to your compiler flags.
  474. # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX)
  475. #endif // GTEST_HAS_PTHREAD
  476. #if GTEST_HAS_PTHREAD
  477. // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
  478. // true.
  479. # include <pthread.h> // NOLINT
  480. // For timespec and nanosleep, used below.
  481. # include <time.h> // NOLINT
  482. #endif
  483. // Determines whether Google Test can use tr1/tuple. You can define
  484. // this macro to 0 to prevent Google Test from using tuple (any
  485. // feature depending on tuple with be disabled in this mode).
  486. #ifndef GTEST_HAS_TR1_TUPLE
  487. // The user didn't tell us not to do it, so we assume it's OK.
  488. # define GTEST_HAS_TR1_TUPLE 1
  489. #endif // GTEST_HAS_TR1_TUPLE
  490. // Determines whether Google Test's own tr1 tuple implementation
  491. // should be used.
  492. #ifndef GTEST_USE_OWN_TR1_TUPLE
  493. // The user didn't tell us, so we need to figure it out.
  494. // We use our own TR1 tuple if we aren't sure the user has an
  495. // implementation of it already. At this time, GCC 4.0.0+ and MSVC
  496. // 2010 are the only mainstream compilers that come with a TR1 tuple
  497. // implementation. NVIDIA's CUDA NVCC compiler pretends to be GCC by
  498. // defining __GNUC__ and friends, but cannot compile GCC's tuple
  499. // implementation. MSVC 2008 (9.0) provides TR1 tuple in a 323 MB
  500. // Feature Pack download, which we cannot assume the user has.
  501. # if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000)) \
  502. || _MSC_VER >= 1600
  503. # define GTEST_USE_OWN_TR1_TUPLE 0
  504. # else
  505. # define GTEST_USE_OWN_TR1_TUPLE 1
  506. # endif
  507. #endif // GTEST_USE_OWN_TR1_TUPLE
  508. // To avoid conditional compilation everywhere, we make it
  509. // gtest-port.h's responsibility to #include the header implementing
  510. // tr1/tuple.
  511. #if GTEST_HAS_TR1_TUPLE
  512. # if GTEST_USE_OWN_TR1_TUPLE
  513. // This file was GENERATED by a script. DO NOT EDIT BY HAND!!!
  514. // Copyright 2009 Google Inc.
  515. // All Rights Reserved.
  516. //
  517. // Redistribution and use in source and binary forms, with or without
  518. // modification, are permitted provided that the following conditions are
  519. // met:
  520. //
  521. // * Redistributions of source code must retain the above copyright
  522. // notice, this list of conditions and the following disclaimer.
  523. // * Redistributions in binary form must reproduce the above
  524. // copyright notice, this list of conditions and the following disclaimer
  525. // in the documentation and/or other materials provided with the
  526. // distribution.
  527. // * Neither the name of Google Inc. nor the names of its
  528. // contributors may be used to endorse or promote products derived from
  529. // this software without specific prior written permission.
  530. //
  531. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  532. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  533. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  534. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  535. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  536. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  537. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  538. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  539. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  540. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  541. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  542. //
  543. // Author: [email protected] (Zhanyong Wan)
  544. // Implements a subset of TR1 tuple needed by Google Test and Google Mock.
  545. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
  546. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
  547. #include <utility> // For ::std::pair.
  548. // The compiler used in Symbian has a bug that prevents us from declaring the
  549. // tuple template as a friend (it complains that tuple is redefined). This
  550. // hack bypasses the bug by declaring the members that should otherwise be
  551. // private as public.
  552. // Sun Studio versions < 12 also have the above bug.
  553. #if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
  554. # define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
  555. #else
  556. # define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
  557. template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
  558. private:
  559. #endif
  560. // GTEST_n_TUPLE_(T) is the type of an n-tuple.
  561. #define GTEST_0_TUPLE_(T) tuple<>
  562. #define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
  563. void, void, void>
  564. #define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
  565. void, void, void>
  566. #define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
  567. void, void, void>
  568. #define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
  569. void, void, void>
  570. #define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
  571. void, void, void>
  572. #define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
  573. void, void, void>
  574. #define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  575. void, void, void>
  576. #define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  577. T##7, void, void>
  578. #define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  579. T##7, T##8, void>
  580. #define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  581. T##7, T##8, T##9>
  582. // GTEST_n_TYPENAMES_(T) declares a list of n typenames.
  583. #define GTEST_0_TYPENAMES_(T)
  584. #define GTEST_1_TYPENAMES_(T) typename T##0
  585. #define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
  586. #define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
  587. #define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  588. typename T##3
  589. #define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  590. typename T##3, typename T##4
  591. #define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  592. typename T##3, typename T##4, typename T##5
  593. #define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  594. typename T##3, typename T##4, typename T##5, typename T##6
  595. #define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  596. typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
  597. #define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  598. typename T##3, typename T##4, typename T##5, typename T##6, \
  599. typename T##7, typename T##8
  600. #define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  601. typename T##3, typename T##4, typename T##5, typename T##6, \
  602. typename T##7, typename T##8, typename T##9
  603. // In theory, defining stuff in the ::std namespace is undefined
  604. // behavior. We can do this as we are playing the role of a standard
  605. // library vendor.
  606. namespace std {
  607. namespace tr1 {
  608. template <typename T0 = void, typename T1 = void, typename T2 = void,
  609. typename T3 = void, typename T4 = void, typename T5 = void,
  610. typename T6 = void, typename T7 = void, typename T8 = void,
  611. typename T9 = void>
  612. class tuple;
  613. // Anything in namespace gtest_internal is Google Test's INTERNAL
  614. // IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
  615. namespace gtest_internal {
  616. // ByRef<T>::type is T if T is a reference; otherwise it's const T&.
  617. template <typename T>
  618. struct ByRef { typedef const T& type; }; // NOLINT
  619. template <typename T>
  620. struct ByRef<T&> { typedef T& type; }; // NOLINT
  621. // A handy wrapper for ByRef.
  622. #define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
  623. // AddRef<T>::type is T if T is a reference; otherwise it's T&. This
  624. // is the same as tr1::add_reference<T>::type.
  625. template <typename T>
  626. struct AddRef { typedef T& type; }; // NOLINT
  627. template <typename T>
  628. struct AddRef<T&> { typedef T& type; }; // NOLINT
  629. // A handy wrapper for AddRef.
  630. #define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
  631. // A helper for implementing get<k>().
  632. template <int k> class Get;
  633. // A helper for implementing tuple_element<k, T>. kIndexValid is true
  634. // iff k < the number of fields in tuple type T.
  635. template <bool kIndexValid, int kIndex, class Tuple>
  636. struct TupleElement;
  637. template <GTEST_10_TYPENAMES_(T)>
  638. struct TupleElement<true, 0, GTEST_10_TUPLE_(T)> { typedef T0 type; };
  639. template <GTEST_10_TYPENAMES_(T)>
  640. struct TupleElement<true, 1, GTEST_10_TUPLE_(T)> { typedef T1 type; };
  641. template <GTEST_10_TYPENAMES_(T)>
  642. struct TupleElement<true, 2, GTEST_10_TUPLE_(T)> { typedef T2 type; };
  643. template <GTEST_10_TYPENAMES_(T)>
  644. struct TupleElement<true, 3, GTEST_10_TUPLE_(T)> { typedef T3 type; };
  645. template <GTEST_10_TYPENAMES_(T)>
  646. struct TupleElement<true, 4, GTEST_10_TUPLE_(T)> { typedef T4 type; };
  647. template <GTEST_10_TYPENAMES_(T)>
  648. struct TupleElement<true, 5, GTEST_10_TUPLE_(T)> { typedef T5 type; };
  649. template <GTEST_10_TYPENAMES_(T)>
  650. struct TupleElement<true, 6, GTEST_10_TUPLE_(T)> { typedef T6 type; };
  651. template <GTEST_10_TYPENAMES_(T)>
  652. struct TupleElement<true, 7, GTEST_10_TUPLE_(T)> { typedef T7 type; };
  653. template <GTEST_10_TYPENAMES_(T)>
  654. struct TupleElement<true, 8, GTEST_10_TUPLE_(T)> { typedef T8 type; };
  655. template <GTEST_10_TYPENAMES_(T)>
  656. struct TupleElement<true, 9, GTEST_10_TUPLE_(T)> { typedef T9 type; };
  657. } // namespace gtest_internal
  658. template <>
  659. class tuple<> {
  660. public:
  661. tuple() {}
  662. tuple(const tuple& /* t */) {}
  663. tuple& operator=(const tuple& /* t */) { return *this; }
  664. };
  665. template <GTEST_1_TYPENAMES_(T)>
  666. class GTEST_1_TUPLE_(T) {
  667. public:
  668. template <int k> friend class gtest_internal::Get;
  669. tuple() : f0_() {}
  670. explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
  671. tuple(const tuple& t) : f0_(t.f0_) {}
  672. template <GTEST_1_TYPENAMES_(U)>
  673. tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
  674. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  675. template <GTEST_1_TYPENAMES_(U)>
  676. tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
  677. return CopyFrom(t);
  678. }
  679. GTEST_DECLARE_TUPLE_AS_FRIEND_
  680. template <GTEST_1_TYPENAMES_(U)>
  681. tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
  682. f0_ = t.f0_;
  683. return *this;
  684. }
  685. T0 f0_;
  686. };
  687. template <GTEST_2_TYPENAMES_(T)>
  688. class GTEST_2_TUPLE_(T) {
  689. public:
  690. template <int k> friend class gtest_internal::Get;
  691. tuple() : f0_(), f1_() {}
  692. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
  693. f1_(f1) {}
  694. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
  695. template <GTEST_2_TYPENAMES_(U)>
  696. tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
  697. template <typename U0, typename U1>
  698. tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
  699. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  700. template <GTEST_2_TYPENAMES_(U)>
  701. tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
  702. return CopyFrom(t);
  703. }
  704. template <typename U0, typename U1>
  705. tuple& operator=(const ::std::pair<U0, U1>& p) {
  706. f0_ = p.first;
  707. f1_ = p.second;
  708. return *this;
  709. }
  710. GTEST_DECLARE_TUPLE_AS_FRIEND_
  711. template <GTEST_2_TYPENAMES_(U)>
  712. tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
  713. f0_ = t.f0_;
  714. f1_ = t.f1_;
  715. return *this;
  716. }
  717. T0 f0_;
  718. T1 f1_;
  719. };
  720. template <GTEST_3_TYPENAMES_(T)>
  721. class GTEST_3_TUPLE_(T) {
  722. public:
  723. template <int k> friend class gtest_internal::Get;
  724. tuple() : f0_(), f1_(), f2_() {}
  725. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  726. GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
  727. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
  728. template <GTEST_3_TYPENAMES_(U)>
  729. tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
  730. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  731. template <GTEST_3_TYPENAMES_(U)>
  732. tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
  733. return CopyFrom(t);
  734. }
  735. GTEST_DECLARE_TUPLE_AS_FRIEND_
  736. template <GTEST_3_TYPENAMES_(U)>
  737. tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
  738. f0_ = t.f0_;
  739. f1_ = t.f1_;
  740. f2_ = t.f2_;
  741. return *this;
  742. }
  743. T0 f0_;
  744. T1 f1_;
  745. T2 f2_;
  746. };
  747. template <GTEST_4_TYPENAMES_(T)>
  748. class GTEST_4_TUPLE_(T) {
  749. public:
  750. template <int k> friend class gtest_internal::Get;
  751. tuple() : f0_(), f1_(), f2_(), f3_() {}
  752. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  753. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
  754. f3_(f3) {}
  755. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
  756. template <GTEST_4_TYPENAMES_(U)>
  757. tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  758. f3_(t.f3_) {}
  759. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  760. template <GTEST_4_TYPENAMES_(U)>
  761. tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
  762. return CopyFrom(t);
  763. }
  764. GTEST_DECLARE_TUPLE_AS_FRIEND_
  765. template <GTEST_4_TYPENAMES_(U)>
  766. tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
  767. f0_ = t.f0_;
  768. f1_ = t.f1_;
  769. f2_ = t.f2_;
  770. f3_ = t.f3_;
  771. return *this;
  772. }
  773. T0 f0_;
  774. T1 f1_;
  775. T2 f2_;
  776. T3 f3_;
  777. };
  778. template <GTEST_5_TYPENAMES_(T)>
  779. class GTEST_5_TUPLE_(T) {
  780. public:
  781. template <int k> friend class gtest_internal::Get;
  782. tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
  783. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  784. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
  785. GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
  786. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  787. f4_(t.f4_) {}
  788. template <GTEST_5_TYPENAMES_(U)>
  789. tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  790. f3_(t.f3_), f4_(t.f4_) {}
  791. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  792. template <GTEST_5_TYPENAMES_(U)>
  793. tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
  794. return CopyFrom(t);
  795. }
  796. GTEST_DECLARE_TUPLE_AS_FRIEND_
  797. template <GTEST_5_TYPENAMES_(U)>
  798. tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
  799. f0_ = t.f0_;
  800. f1_ = t.f1_;
  801. f2_ = t.f2_;
  802. f3_ = t.f3_;
  803. f4_ = t.f4_;
  804. return *this;
  805. }
  806. T0 f0_;
  807. T1 f1_;
  808. T2 f2_;
  809. T3 f3_;
  810. T4 f4_;
  811. };
  812. template <GTEST_6_TYPENAMES_(T)>
  813. class GTEST_6_TUPLE_(T) {
  814. public:
  815. template <int k> friend class gtest_internal::Get;
  816. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
  817. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  818. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  819. GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
  820. f5_(f5) {}
  821. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  822. f4_(t.f4_), f5_(t.f5_) {}
  823. template <GTEST_6_TYPENAMES_(U)>
  824. tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  825. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
  826. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  827. template <GTEST_6_TYPENAMES_(U)>
  828. tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
  829. return CopyFrom(t);
  830. }
  831. GTEST_DECLARE_TUPLE_AS_FRIEND_
  832. template <GTEST_6_TYPENAMES_(U)>
  833. tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
  834. f0_ = t.f0_;
  835. f1_ = t.f1_;
  836. f2_ = t.f2_;
  837. f3_ = t.f3_;
  838. f4_ = t.f4_;
  839. f5_ = t.f5_;
  840. return *this;
  841. }
  842. T0 f0_;
  843. T1 f1_;
  844. T2 f2_;
  845. T3 f3_;
  846. T4 f4_;
  847. T5 f5_;
  848. };
  849. template <GTEST_7_TYPENAMES_(T)>
  850. class GTEST_7_TUPLE_(T) {
  851. public:
  852. template <int k> friend class gtest_internal::Get;
  853. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
  854. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  855. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  856. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
  857. f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
  858. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  859. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
  860. template <GTEST_7_TYPENAMES_(U)>
  861. tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  862. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
  863. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  864. template <GTEST_7_TYPENAMES_(U)>
  865. tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
  866. return CopyFrom(t);
  867. }
  868. GTEST_DECLARE_TUPLE_AS_FRIEND_
  869. template <GTEST_7_TYPENAMES_(U)>
  870. tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
  871. f0_ = t.f0_;
  872. f1_ = t.f1_;
  873. f2_ = t.f2_;
  874. f3_ = t.f3_;
  875. f4_ = t.f4_;
  876. f5_ = t.f5_;
  877. f6_ = t.f6_;
  878. return *this;
  879. }
  880. T0 f0_;
  881. T1 f1_;
  882. T2 f2_;
  883. T3 f3_;
  884. T4 f4_;
  885. T5 f5_;
  886. T6 f6_;
  887. };
  888. template <GTEST_8_TYPENAMES_(T)>
  889. class GTEST_8_TUPLE_(T) {
  890. public:
  891. template <int k> friend class gtest_internal::Get;
  892. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
  893. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  894. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  895. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
  896. GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
  897. f5_(f5), f6_(f6), f7_(f7) {}
  898. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  899. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
  900. template <GTEST_8_TYPENAMES_(U)>
  901. tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  902. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
  903. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  904. template <GTEST_8_TYPENAMES_(U)>
  905. tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
  906. return CopyFrom(t);
  907. }
  908. GTEST_DECLARE_TUPLE_AS_FRIEND_
  909. template <GTEST_8_TYPENAMES_(U)>
  910. tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
  911. f0_ = t.f0_;
  912. f1_ = t.f1_;
  913. f2_ = t.f2_;
  914. f3_ = t.f3_;
  915. f4_ = t.f4_;
  916. f5_ = t.f5_;
  917. f6_ = t.f6_;
  918. f7_ = t.f7_;
  919. return *this;
  920. }
  921. T0 f0_;
  922. T1 f1_;
  923. T2 f2_;
  924. T3 f3_;
  925. T4 f4_;
  926. T5 f5_;
  927. T6 f6_;
  928. T7 f7_;
  929. };
  930. template <GTEST_9_TYPENAMES_(T)>
  931. class GTEST_9_TUPLE_(T) {
  932. public:
  933. template <int k> friend class gtest_internal::Get;
  934. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
  935. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  936. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  937. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
  938. GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
  939. f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
  940. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  941. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
  942. template <GTEST_9_TYPENAMES_(U)>
  943. tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  944. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
  945. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  946. template <GTEST_9_TYPENAMES_(U)>
  947. tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
  948. return CopyFrom(t);
  949. }
  950. GTEST_DECLARE_TUPLE_AS_FRIEND_
  951. template <GTEST_9_TYPENAMES_(U)>
  952. tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
  953. f0_ = t.f0_;
  954. f1_ = t.f1_;
  955. f2_ = t.f2_;
  956. f3_ = t.f3_;
  957. f4_ = t.f4_;
  958. f5_ = t.f5_;
  959. f6_ = t.f6_;
  960. f7_ = t.f7_;
  961. f8_ = t.f8_;
  962. return *this;
  963. }
  964. T0 f0_;
  965. T1 f1_;
  966. T2 f2_;
  967. T3 f3_;
  968. T4 f4_;
  969. T5 f5_;
  970. T6 f6_;
  971. T7 f7_;
  972. T8 f8_;
  973. };
  974. template <GTEST_10_TYPENAMES_(T)>
  975. class tuple {
  976. public:
  977. template <int k> friend class gtest_internal::Get;
  978. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
  979. f9_() {}
  980. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  981. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  982. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
  983. GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
  984. f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
  985. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  986. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
  987. template <GTEST_10_TYPENAMES_(U)>
  988. tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  989. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
  990. f9_(t.f9_) {}
  991. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  992. template <GTEST_10_TYPENAMES_(U)>
  993. tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
  994. return CopyFrom(t);
  995. }
  996. GTEST_DECLARE_TUPLE_AS_FRIEND_
  997. template <GTEST_10_TYPENAMES_(U)>
  998. tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
  999. f0_ = t.f0_;
  1000. f1_ = t.f1_;
  1001. f2_ = t.f2_;
  1002. f3_ = t.f3_;
  1003. f4_ = t.f4_;
  1004. f5_ = t.f5_;
  1005. f6_ = t.f6_;
  1006. f7_ = t.f7_;
  1007. f8_ = t.f8_;
  1008. f9_ = t.f9_;
  1009. return *this;
  1010. }
  1011. T0 f0_;
  1012. T1 f1_;
  1013. T2 f2_;
  1014. T3 f3_;
  1015. T4 f4_;
  1016. T5 f5_;
  1017. T6 f6_;
  1018. T7 f7_;
  1019. T8 f8_;
  1020. T9 f9_;
  1021. };
  1022. // 6.1.3.2 Tuple creation functions.
  1023. // Known limitations: we don't support passing an
  1024. // std::tr1::reference_wrapper<T> to make_tuple(). And we don't
  1025. // implement tie().
  1026. inline tuple<> make_tuple() { return tuple<>(); }
  1027. template <GTEST_1_TYPENAMES_(T)>
  1028. inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
  1029. return GTEST_1_TUPLE_(T)(f0);
  1030. }
  1031. template <GTEST_2_TYPENAMES_(T)>
  1032. inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
  1033. return GTEST_2_TUPLE_(T)(f0, f1);
  1034. }
  1035. template <GTEST_3_TYPENAMES_(T)>
  1036. inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
  1037. return GTEST_3_TUPLE_(T)(f0, f1, f2);
  1038. }
  1039. template <GTEST_4_TYPENAMES_(T)>
  1040. inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1041. const T3& f3) {
  1042. return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
  1043. }
  1044. template <GTEST_5_TYPENAMES_(T)>
  1045. inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1046. const T3& f3, const T4& f4) {
  1047. return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
  1048. }
  1049. template <GTEST_6_TYPENAMES_(T)>
  1050. inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1051. const T3& f3, const T4& f4, const T5& f5) {
  1052. return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
  1053. }
  1054. template <GTEST_7_TYPENAMES_(T)>
  1055. inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1056. const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
  1057. return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
  1058. }
  1059. template <GTEST_8_TYPENAMES_(T)>
  1060. inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1061. const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
  1062. return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
  1063. }
  1064. template <GTEST_9_TYPENAMES_(T)>
  1065. inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1066. const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
  1067. const T8& f8) {
  1068. return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
  1069. }
  1070. template <GTEST_10_TYPENAMES_(T)>
  1071. inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1072. const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
  1073. const T8& f8, const T9& f9) {
  1074. return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
  1075. }
  1076. // 6.1.3.3 Tuple helper classes.
  1077. template <typename Tuple> struct tuple_size;
  1078. template <GTEST_0_TYPENAMES_(T)>
  1079. struct tuple_size<GTEST_0_TUPLE_(T)> { static const int value = 0; };
  1080. template <GTEST_1_TYPENAMES_(T)>
  1081. struct tuple_size<GTEST_1_TUPLE_(T)> { static const int value = 1; };
  1082. template <GTEST_2_TYPENAMES_(T)>
  1083. struct tuple_size<GTEST_2_TUPLE_(T)> { static const int value = 2; };
  1084. template <GTEST_3_TYPENAMES_(T)>
  1085. struct tuple_size<GTEST_3_TUPLE_(T)> { static const int value = 3; };
  1086. template <GTEST_4_TYPENAMES_(T)>
  1087. struct tuple_size<GTEST_4_TUPLE_(T)> { static const int value = 4; };
  1088. template <GTEST_5_TYPENAMES_(T)>
  1089. struct tuple_size<GTEST_5_TUPLE_(T)> { static const int value = 5; };
  1090. template <GTEST_6_TYPENAMES_(T)>
  1091. struct tuple_size<GTEST_6_TUPLE_(T)> { static const int value = 6; };
  1092. template <GTEST_7_TYPENAMES_(T)>
  1093. struct tuple_size<GTEST_7_TUPLE_(T)> { static const int value = 7; };
  1094. template <GTEST_8_TYPENAMES_(T)>
  1095. struct tuple_size<GTEST_8_TUPLE_(T)> { static const int value = 8; };
  1096. template <GTEST_9_TYPENAMES_(T)>
  1097. struct tuple_size<GTEST_9_TUPLE_(T)> { static const int value = 9; };
  1098. template <GTEST_10_TYPENAMES_(T)>
  1099. struct tuple_size<GTEST_10_TUPLE_(T)> { static const int value = 10; };
  1100. template <int k, class Tuple>
  1101. struct tuple_element {
  1102. typedef typename gtest_internal::TupleElement<
  1103. k < (tuple_size<Tuple>::value), k, Tuple>::type type;
  1104. };
  1105. #define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
  1106. // 6.1.3.4 Element access.
  1107. namespace gtest_internal {
  1108. template <>
  1109. class Get<0> {
  1110. public:
  1111. template <class Tuple>
  1112. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
  1113. Field(Tuple& t) { return t.f0_; } // NOLINT
  1114. template <class Tuple>
  1115. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
  1116. ConstField(const Tuple& t) { return t.f0_; }
  1117. };
  1118. template <>
  1119. class Get<1> {
  1120. public:
  1121. template <class Tuple>
  1122. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
  1123. Field(Tuple& t) { return t.f1_; } // NOLINT
  1124. template <class Tuple>
  1125. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
  1126. ConstField(const Tuple& t) { return t.f1_; }
  1127. };
  1128. template <>
  1129. class Get<2> {
  1130. public:
  1131. template <class Tuple>
  1132. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
  1133. Field(Tuple& t) { return t.f2_; } // NOLINT
  1134. template <class Tuple>
  1135. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
  1136. ConstField(const Tuple& t) { return t.f2_; }
  1137. };
  1138. template <>
  1139. class Get<3> {
  1140. public:
  1141. template <class Tuple>
  1142. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
  1143. Field(Tuple& t) { return t.f3_; } // NOLINT
  1144. template <class Tuple>
  1145. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
  1146. ConstField(const Tuple& t) { return t.f3_; }
  1147. };
  1148. template <>
  1149. class Get<4> {
  1150. public:
  1151. template <class Tuple>
  1152. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
  1153. Field(Tuple& t) { return t.f4_; } // NOLINT
  1154. template <class Tuple>
  1155. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
  1156. ConstField(const Tuple& t) { return t.f4_; }
  1157. };
  1158. template <>
  1159. class Get<5> {
  1160. public:
  1161. template <class Tuple>
  1162. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
  1163. Field(Tuple& t) { return t.f5_; } // NOLINT
  1164. template <class Tuple>
  1165. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
  1166. ConstField(const Tuple& t) { return t.f5_; }
  1167. };
  1168. template <>
  1169. class Get<6> {
  1170. public:
  1171. template <class Tuple>
  1172. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
  1173. Field(Tuple& t) { return t.f6_; } // NOLINT
  1174. template <class Tuple>
  1175. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
  1176. ConstField(const Tuple& t) { return t.f6_; }
  1177. };
  1178. template <>
  1179. class Get<7> {
  1180. public:
  1181. template <class Tuple>
  1182. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
  1183. Field(Tuple& t) { return t.f7_; } // NOLINT
  1184. template <class Tuple>
  1185. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
  1186. ConstField(const Tuple& t) { return t.f7_; }
  1187. };
  1188. template <>
  1189. class Get<8> {
  1190. public:
  1191. template <class Tuple>
  1192. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
  1193. Field(Tuple& t) { return t.f8_; } // NOLINT
  1194. template <class Tuple>
  1195. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
  1196. ConstField(const Tuple& t) { return t.f8_; }
  1197. };
  1198. template <>
  1199. class Get<9> {
  1200. public:
  1201. template <class Tuple>
  1202. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
  1203. Field(Tuple& t) { return t.f9_; } // NOLINT
  1204. template <class Tuple>
  1205. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
  1206. ConstField(const Tuple& t) { return t.f9_; }
  1207. };
  1208. } // namespace gtest_internal
  1209. template <int k, GTEST_10_TYPENAMES_(T)>
  1210. GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
  1211. get(GTEST_10_TUPLE_(T)& t) {
  1212. return gtest_internal::Get<k>::Field(t);
  1213. }
  1214. template <int k, GTEST_10_TYPENAMES_(T)>
  1215. GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
  1216. get(const GTEST_10_TUPLE_(T)& t) {
  1217. return gtest_internal::Get<k>::ConstField(t);
  1218. }
  1219. // 6.1.3.5 Relational operators
  1220. // We only implement == and !=, as we don't have a need for the rest yet.
  1221. namespace gtest_internal {
  1222. // SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
  1223. // first k fields of t1 equals the first k fields of t2.
  1224. // SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
  1225. // k1 != k2.
  1226. template <int kSize1, int kSize2>
  1227. struct SameSizeTuplePrefixComparator;
  1228. template <>
  1229. struct SameSizeTuplePrefixComparator<0, 0> {
  1230. template <class Tuple1, class Tuple2>
  1231. static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
  1232. return true;
  1233. }
  1234. };
  1235. template <int k>
  1236. struct SameSizeTuplePrefixComparator<k, k> {
  1237. template <class Tuple1, class Tuple2>
  1238. static bool Eq(const Tuple1& t1, const Tuple2& t2) {
  1239. return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
  1240. ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
  1241. }
  1242. };
  1243. } // namespace gtest_internal
  1244. template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
  1245. inline bool operator==(const GTEST_10_TUPLE_(T)& t,
  1246. const GTEST_10_TUPLE_(U)& u) {
  1247. return gtest_internal::SameSizeTuplePrefixComparator<
  1248. tuple_size<GTEST_10_TUPLE_(T)>::value,
  1249. tuple_size<GTEST_10_TUPLE_(U)>::value>::Eq(t, u);
  1250. }
  1251. template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
  1252. inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
  1253. const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
  1254. // 6.1.4 Pairs.
  1255. // Unimplemented.
  1256. } // namespace tr1
  1257. } // namespace std
  1258. #undef GTEST_0_TUPLE_
  1259. #undef GTEST_1_TUPLE_
  1260. #undef GTEST_2_TUPLE_
  1261. #undef GTEST_3_TUPLE_
  1262. #undef GTEST_4_TUPLE_
  1263. #undef GTEST_5_TUPLE_
  1264. #undef GTEST_6_TUPLE_
  1265. #undef GTEST_7_TUPLE_
  1266. #undef GTEST_8_TUPLE_
  1267. #undef GTEST_9_TUPLE_
  1268. #undef GTEST_10_TUPLE_
  1269. #undef GTEST_0_TYPENAMES_
  1270. #undef GTEST_1_TYPENAMES_
  1271. #undef GTEST_2_TYPENAMES_
  1272. #undef GTEST_3_TYPENAMES_
  1273. #undef GTEST_4_TYPENAMES_
  1274. #undef GTEST_5_TYPENAMES_
  1275. #undef GTEST_6_TYPENAMES_
  1276. #undef GTEST_7_TYPENAMES_
  1277. #undef GTEST_8_TYPENAMES_
  1278. #undef GTEST_9_TYPENAMES_
  1279. #undef GTEST_10_TYPENAMES_
  1280. #undef GTEST_DECLARE_TUPLE_AS_FRIEND_
  1281. #undef GTEST_BY_REF_
  1282. #undef GTEST_ADD_REF_
  1283. #undef GTEST_TUPLE_ELEMENT_
  1284. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
  1285. # elif GTEST_OS_SYMBIAN
  1286. // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
  1287. // use STLport's tuple implementation, which unfortunately doesn't
  1288. // work as the copy of STLport distributed with Symbian is incomplete.
  1289. // By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
  1290. // use its own tuple implementation.
  1291. # ifdef BOOST_HAS_TR1_TUPLE
  1292. # undef BOOST_HAS_TR1_TUPLE
  1293. # endif // BOOST_HAS_TR1_TUPLE
  1294. // This prevents <boost/tr1/detail/config.hpp>, which defines
  1295. // BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
  1296. # define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
  1297. # include <tuple>
  1298. # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
  1299. // GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header. This does
  1300. // not conform to the TR1 spec, which requires the header to be <tuple>.
  1301. # if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
  1302. // Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
  1303. // which is #included by <tr1/tuple>, to not compile when RTTI is
  1304. // disabled. _TR1_FUNCTIONAL is the header guard for
  1305. // <tr1/functional>. Hence the following #define is a hack to prevent
  1306. // <tr1/functional> from being included.
  1307. # define _TR1_FUNCTIONAL 1
  1308. # include <tr1/tuple>
  1309. # undef _TR1_FUNCTIONAL // Allows the user to #include
  1310. // <tr1/functional> if he chooses to.
  1311. # else
  1312. # include <tr1/tuple> // NOLINT
  1313. # endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
  1314. # else
  1315. // If the compiler is not GCC 4.0+, we assume the user is using a
  1316. // spec-conforming TR1 implementation.
  1317. # include <tuple> // NOLINT
  1318. # endif // GTEST_USE_OWN_TR1_TUPLE
  1319. #endif // GTEST_HAS_TR1_TUPLE
  1320. // Determines whether clone(2) is supported.
  1321. // Usually it will only be available on Linux, excluding
  1322. // Linux on the Itanium architecture.
  1323. // Also see http://linux.die.net/man/2/clone.
  1324. #ifndef GTEST_HAS_CLONE
  1325. // The user didn't tell us, so we need to figure it out.
  1326. # if GTEST_OS_LINUX && !defined(__ia64__)
  1327. # define GTEST_HAS_CLONE 1
  1328. # else
  1329. # define GTEST_HAS_CLONE 0
  1330. # endif // GTEST_OS_LINUX && !defined(__ia64__)
  1331. #endif // GTEST_HAS_CLONE
  1332. // Determines whether to support stream redirection. This is used to test
  1333. // output correctness and to implement death tests.
  1334. #ifndef GTEST_HAS_STREAM_REDIRECTION
  1335. // By default, we assume that stream redirection is supported on all
  1336. // platforms except known mobile ones.
  1337. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN
  1338. # define GTEST_HAS_STREAM_REDIRECTION 0
  1339. # else
  1340. # define GTEST_HAS_STREAM_REDIRECTION 1
  1341. # endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
  1342. #endif // GTEST_HAS_STREAM_REDIRECTION
  1343. // Determines whether to support death tests.
  1344. // Google Test does not support death tests for VC 7.1 and earlier as
  1345. // abort() in a VC 7.1 application compiled as GUI in debug config
  1346. // pops up a dialog window that cannot be suppressed programmatically.
  1347. #if (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
  1348. (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
  1349. GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX)
  1350. # define GTEST_HAS_DEATH_TEST 1
  1351. # include <vector> // NOLINT
  1352. #endif
  1353. // We don't support MSVC 7.1 with exceptions disabled now. Therefore
  1354. // all the compilers we care about are adequate for supporting
  1355. // value-parameterized tests.
  1356. #define GTEST_HAS_PARAM_TEST 1
  1357. // Determines whether to support type-driven tests.
  1358. // Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
  1359. // Sun Pro CC, IBM Visual Age, and HP aCC support.
  1360. #if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
  1361. defined(__IBMCPP__) || defined(__HP_aCC)
  1362. # define GTEST_HAS_TYPED_TEST 1
  1363. # define GTEST_HAS_TYPED_TEST_P 1
  1364. #endif
  1365. // Determines whether to support Combine(). This only makes sense when
  1366. // value-parameterized tests are enabled. The implementation doesn't
  1367. // work on Sun Studio since it doesn't understand templated conversion
  1368. // operators.
  1369. #if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)
  1370. # define GTEST_HAS_COMBINE 1
  1371. #endif
  1372. // Determines whether the system compiler uses UTF-16 for encoding wide strings.
  1373. #define GTEST_WIDE_STRING_USES_UTF16_ \
  1374. (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
  1375. // Determines whether test results can be streamed to a socket.
  1376. #if GTEST_OS_LINUX
  1377. # define GTEST_CAN_STREAM_RESULTS_ 1
  1378. #endif
  1379. // Defines some utility macros.
  1380. // The GNU compiler emits a warning if nested "if" statements are followed by
  1381. // an "else" statement and braces are not used to explicitly disambiguate the
  1382. // "else" binding. This leads to problems with code like:
  1383. //
  1384. // if (gate)
  1385. // ASSERT_*(condition) << "Some message";
  1386. //
  1387. // The "switch (0) case 0:" idiom is used to suppress this.
  1388. #ifdef __INTEL_COMPILER
  1389. # define GTEST_AMBIGUOUS_ELSE_BLOCKER_
  1390. #else
  1391. # define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default: // NOLINT
  1392. #endif
  1393. // Use this annotation at the end of a struct/class definition to
  1394. // prevent the compiler from optimizing away instances that are never
  1395. // used. This is useful when all interesting logic happens inside the
  1396. // c'tor and / or d'tor. Example:
  1397. //
  1398. // struct Foo {
  1399. // Foo() { ... }
  1400. // } GTEST_ATTRIBUTE_UNUSED_;
  1401. //
  1402. // Also use it after a variable or parameter declaration to tell the
  1403. // compiler the variable/parameter does not have to be used.
  1404. #if defined(__GNUC__) && !defined(COMPILER_ICC)
  1405. # define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
  1406. #else
  1407. # define GTEST_ATTRIBUTE_UNUSED_
  1408. #endif
  1409. // A macro to disallow operator=
  1410. // This should be used in the private: declarations for a class.
  1411. #define GTEST_DISALLOW_ASSIGN_(type)\
  1412. void operator=(type const &)
  1413. // A macro to disallow copy constructor and operator=
  1414. // This should be used in the private: declarations for a class.
  1415. #define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
  1416. type(type const &);\
  1417. GTEST_DISALLOW_ASSIGN_(type)
  1418. // Tell the compiler to warn about unused return values for functions declared
  1419. // with this macro. The macro should be used on function declarations
  1420. // following the argument list:
  1421. //
  1422. // Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
  1423. #if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
  1424. # define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
  1425. #else
  1426. # define GTEST_MUST_USE_RESULT_
  1427. #endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
  1428. // Determine whether the compiler supports Microsoft's Structured Exception
  1429. // Handling. This is supported by several Windows compilers but generally
  1430. // does not exist on any other system.
  1431. #ifndef GTEST_HAS_SEH
  1432. // The user didn't tell us, so we need to figure it out.
  1433. # if defined(_MSC_VER) || defined(__BORLANDC__)
  1434. // These two compilers are known to support SEH.
  1435. # define GTEST_HAS_SEH 1
  1436. # else
  1437. // Assume no SEH.
  1438. # define GTEST_HAS_SEH 0
  1439. # endif
  1440. #endif // GTEST_HAS_SEH
  1441. #ifdef _MSC_VER
  1442. # if GTEST_LINKED_AS_SHARED_LIBRARY
  1443. # define GTEST_API_ __declspec(dllimport)
  1444. # elif GTEST_CREATE_SHARED_LIBRARY
  1445. # define GTEST_API_ __declspec(dllexport)
  1446. # endif
  1447. #endif // _MSC_VER
  1448. #ifndef GTEST_API_
  1449. # define GTEST_API_
  1450. #endif
  1451. #ifdef __GNUC__
  1452. // Ask the compiler to never inline a given function.
  1453. # define GTEST_NO_INLINE_ __attribute__((noinline))
  1454. #else
  1455. # define GTEST_NO_INLINE_
  1456. #endif
  1457. namespace testing {
  1458. class Message;
  1459. namespace internal {
  1460. class String;
  1461. // The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
  1462. // expression is true. For example, you could use it to verify the
  1463. // size of a static array:
  1464. //
  1465. // GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,
  1466. // content_type_names_incorrect_size);
  1467. //
  1468. // or to make sure a struct is smaller than a certain size:
  1469. //
  1470. // GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
  1471. //
  1472. // The second argument to the macro is the name of the variable. If
  1473. // the expression is false, most compilers will issue a warning/error
  1474. // containing the name of the variable.
  1475. template <bool>
  1476. struct CompileAssert {
  1477. };
  1478. #define GTEST_COMPILE_ASSERT_(expr, msg) \
  1479. typedef ::testing::internal::CompileAssert<(bool(expr))> \
  1480. msg[bool(expr) ? 1 : -1]
  1481. // Implementation details of GTEST_COMPILE_ASSERT_:
  1482. //
  1483. // - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
  1484. // elements (and thus is invalid) when the expression is false.
  1485. //
  1486. // - The simpler definition
  1487. //
  1488. // #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
  1489. //
  1490. // does not work, as gcc supports variable-length arrays whose sizes
  1491. // are determined at run-time (this is gcc's extension and not part
  1492. // of the C++ standard). As a result, gcc fails to reject the
  1493. // following code with the simple definition:
  1494. //
  1495. // int foo;
  1496. // GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
  1497. // // not a compile-time constant.
  1498. //
  1499. // - By using the type CompileAssert<(bool(expr))>, we ensures that
  1500. // expr is a compile-time constant. (Template arguments must be
  1501. // determined at compile-time.)
  1502. //
  1503. // - The outter parentheses in CompileAssert<(bool(expr))> are necessary
  1504. // to work around a bug in gcc 3.4.4 and 4.0.1. If we had written
  1505. //
  1506. // CompileAssert<bool(expr)>
  1507. //
  1508. // instead, these compilers will refuse to compile
  1509. //
  1510. // GTEST_COMPILE_ASSERT_(5 > 0, some_message);
  1511. //
  1512. // (They seem to think the ">" in "5 > 0" marks the end of the
  1513. // template argument list.)
  1514. //
  1515. // - The array size is (bool(expr) ? 1 : -1), instead of simply
  1516. //
  1517. // ((expr) ? 1 : -1).
  1518. //
  1519. // This is to avoid running into a bug in MS VC 7.1, which
  1520. // causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
  1521. // StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
  1522. //
  1523. // This template is declared, but intentionally undefined.
  1524. template <typename T1, typename T2>
  1525. struct StaticAssertTypeEqHelper;
  1526. template <typename T>
  1527. struct StaticAssertTypeEqHelper<T, T> {};
  1528. #if GTEST_HAS_GLOBAL_STRING
  1529. typedef ::string string;
  1530. #else
  1531. typedef ::std::string string;
  1532. #endif // GTEST_HAS_GLOBAL_STRING
  1533. #if GTEST_HAS_GLOBAL_WSTRING
  1534. typedef ::wstring wstring;
  1535. #elif GTEST_HAS_STD_WSTRING
  1536. typedef ::std::wstring wstring;
  1537. #endif // GTEST_HAS_GLOBAL_WSTRING
  1538. // A helper for suppressing warnings on constant condition. It just
  1539. // returns 'condition'.
  1540. GTEST_API_ bool IsTrue(bool condition);
  1541. // Defines scoped_ptr.
  1542. // This implementation of scoped_ptr is PARTIAL - it only contains
  1543. // enough stuff to satisfy Google Test's need.
  1544. template <typename T>
  1545. class scoped_ptr {
  1546. public:
  1547. typedef T element_type;
  1548. explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
  1549. ~scoped_ptr() { reset(); }
  1550. T& operator*() const { return *ptr_; }
  1551. T* operator->() const { return ptr_; }
  1552. T* get() const { return ptr_; }
  1553. T* release() {
  1554. T* const ptr = ptr_;
  1555. ptr_ = NULL;
  1556. return ptr;
  1557. }
  1558. void reset(T* p = NULL) {
  1559. if (p != ptr_) {
  1560. if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type.
  1561. delete ptr_;
  1562. }
  1563. ptr_ = p;
  1564. }
  1565. }
  1566. private:
  1567. T* ptr_;
  1568. GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
  1569. };
  1570. // Defines RE.
  1571. // A simple C++ wrapper for <regex.h>. It uses the POSIX Extended
  1572. // Regular Expression syntax.
  1573. class GTEST_API_ RE {
  1574. public:
  1575. // A copy constructor is required by the Standard to initialize object
  1576. // references from r-values.
  1577. RE(const RE& other) { Init(other.pattern()); }
  1578. // Constructs an RE from a string.
  1579. RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT
  1580. #if GTEST_HAS_GLOBAL_STRING
  1581. RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT
  1582. #endif // GTEST_HAS_GLOBAL_STRING
  1583. RE(const char* regex) { Init(regex); } // NOLINT
  1584. ~RE();
  1585. // Returns the string representation of the regex.
  1586. const char* pattern() const { return pattern_; }
  1587. // FullMatch(str, re) returns true iff regular expression re matches
  1588. // the entire str.
  1589. // PartialMatch(str, re) returns true iff regular expression re
  1590. // matches a substring of str (including str itself).
  1591. //
  1592. // TODO([email protected]): make FullMatch() and PartialMatch() work
  1593. // when str contains NUL characters.
  1594. static bool FullMatch(const ::std::string& str, const RE& re) {
  1595. return FullMatch(str.c_str(), re);
  1596. }
  1597. static bool PartialMatch(const ::std::string& str, const RE& re) {
  1598. return PartialMatch(str.c_str(), re);
  1599. }
  1600. #if GTEST_HAS_GLOBAL_STRING
  1601. static bool FullMatch(const ::string& str, const RE& re) {
  1602. return FullMatch(str.c_str(), re);
  1603. }
  1604. static bool PartialMatch(const ::string& str, const RE& re) {
  1605. return PartialMatch(str.c_str(), re);
  1606. }
  1607. #endif // GTEST_HAS_GLOBAL_STRING
  1608. static bool FullMatch(const char* str, const RE& re);
  1609. static bool PartialMatch(const char* str, const RE& re);
  1610. private:
  1611. void Init(const char* regex);
  1612. // We use a const char* instead of a string, as Google Test may be used
  1613. // where string is not available. We also do not use Google Test's own
  1614. // String type here, in order to simplify dependencies between the
  1615. // files.
  1616. const char* pattern_;
  1617. bool is_valid_;
  1618. #if GTEST_USES_POSIX_RE
  1619. regex_t full_regex_; // For FullMatch().
  1620. regex_t partial_regex_; // For PartialMatch().
  1621. #else // GTEST_USES_SIMPLE_RE
  1622. const char* full_pattern_; // For FullMatch();
  1623. #endif
  1624. GTEST_DISALLOW_ASSIGN_(RE);
  1625. };
  1626. // Formats a source file path and a line number as they would appear
  1627. // in an error message from the compiler used to compile this code.
  1628. GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
  1629. // Formats a file location for compiler-independent XML output.
  1630. // Although this function is not platform dependent, we put it next to
  1631. // FormatFileLocation in order to contrast the two functions.
  1632. GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
  1633. int line);
  1634. // Defines logging utilities:
  1635. // GTEST_LOG_(severity) - logs messages at the specified severity level. The
  1636. // message itself is streamed into the macro.
  1637. // LogToStderr() - directs all log messages to stderr.
  1638. // FlushInfoLog() - flushes informational log messages.
  1639. enum GTestLogSeverity {
  1640. GTEST_INFO,
  1641. GTEST_WARNING,
  1642. GTEST_ERROR,
  1643. GTEST_FATAL
  1644. };
  1645. // Formats log entry severity, provides a stream object for streaming the
  1646. // log message, and terminates the message with a newline when going out of
  1647. // scope.
  1648. class GTEST_API_ GTestLog {
  1649. public:
  1650. GTestLog(GTestLogSeverity severity, const char* file, int line);
  1651. // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
  1652. ~GTestLog();
  1653. ::std::ostream& GetStream() { return ::std::cerr; }
  1654. private:
  1655. const GTestLogSeverity severity_;
  1656. GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
  1657. };
  1658. #define GTEST_LOG_(severity) \
  1659. ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
  1660. __FILE__, __LINE__).GetStream()
  1661. inline void LogToStderr() {}
  1662. inline void FlushInfoLog() { fflush(NULL); }
  1663. // INTERNAL IMPLEMENTATION - DO NOT USE.
  1664. //
  1665. // GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
  1666. // is not satisfied.
  1667. // Synopsys:
  1668. // GTEST_CHECK_(boolean_condition);
  1669. // or
  1670. // GTEST_CHECK_(boolean_condition) << "Additional message";
  1671. //
  1672. // This checks the condition and if the condition is not satisfied
  1673. // it prints message about the condition violation, including the
  1674. // condition itself, plus additional message streamed into it, if any,
  1675. // and then it aborts the program. It aborts the program irrespective of
  1676. // whether it is built in the debug mode or not.
  1677. #define GTEST_CHECK_(condition) \
  1678. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  1679. if (::testing::internal::IsTrue(condition)) \
  1680. ; \
  1681. else \
  1682. GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
  1683. // An all-mode assert to verify that the given POSIX-style function
  1684. // call returns 0 (indicating success). Known limitation: this
  1685. // doesn't expand to a balanced 'if' statement, so enclose the macro
  1686. // in {} if you need to use it as the only statement in an 'if'
  1687. // branch.
  1688. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
  1689. if (const int gtest_error = (posix_call)) \
  1690. GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
  1691. << gtest_error
  1692. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  1693. //
  1694. // Use ImplicitCast_ as a safe version of static_cast for upcasting in
  1695. // the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
  1696. // const Foo*). When you use ImplicitCast_, the compiler checks that
  1697. // the cast is safe. Such explicit ImplicitCast_s are necessary in
  1698. // surprisingly many situations where C++ demands an exact type match
  1699. // instead of an argument type convertable to a target type.
  1700. //
  1701. // The syntax for using ImplicitCast_ is the same as for static_cast:
  1702. //
  1703. // ImplicitCast_<ToType>(expr)
  1704. //
  1705. // ImplicitCast_ would have been part of the C++ standard library,
  1706. // but the proposal was submitted too late. It will probably make
  1707. // its way into the language in the future.
  1708. //
  1709. // This relatively ugly name is intentional. It prevents clashes with
  1710. // similar functions users may have (e.g., implicit_cast). The internal
  1711. // namespace alone is not enough because the function can be found by ADL.
  1712. template<typename To>
  1713. inline To ImplicitCast_(To x) { return x; }
  1714. // When you upcast (that is, cast a pointer from type Foo to type
  1715. // SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
  1716. // always succeed. When you downcast (that is, cast a pointer from
  1717. // type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
  1718. // how do you know the pointer is really of type SubclassOfFoo? It
  1719. // could be a bare Foo, or of type DifferentSubclassOfFoo. Thus,
  1720. // when you downcast, you should use this macro. In debug mode, we
  1721. // use dynamic_cast<> to double-check the downcast is legal (we die
  1722. // if it's not). In normal mode, we do the efficient static_cast<>
  1723. // instead. Thus, it's important to test in debug mode to make sure
  1724. // the cast is legal!
  1725. // This is the only place in the code we should use dynamic_cast<>.
  1726. // In particular, you SHOULDN'T be using dynamic_cast<> in order to
  1727. // do RTTI (eg code like this:
  1728. // if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
  1729. // if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
  1730. // You should design the code some other way not to need this.
  1731. //
  1732. // This relatively ugly name is intentional. It prevents clashes with
  1733. // similar functions users may have (e.g., down_cast). The internal
  1734. // namespace alone is not enough because the function can be found by ADL.
  1735. template<typename To, typename From> // use like this: DownCast_<T*>(foo);
  1736. inline To DownCast_(From* f) { // so we only accept pointers
  1737. // Ensures that To is a sub-type of From *. This test is here only
  1738. // for compile-time type checking, and has no overhead in an
  1739. // optimized build at run-time, as it will be optimized away
  1740. // completely.
  1741. if (false) {
  1742. const To to = NULL;
  1743. ::testing::internal::ImplicitCast_<From*>(to);
  1744. }
  1745. #if GTEST_HAS_RTTI
  1746. // RTTI: debug mode only!
  1747. GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
  1748. #endif
  1749. return static_cast<To>(f);
  1750. }
  1751. // Downcasts the pointer of type Base to Derived.
  1752. // Derived must be a subclass of Base. The parameter MUST
  1753. // point to a class of type Derived, not any subclass of it.
  1754. // When RTTI is available, the function performs a runtime
  1755. // check to enforce this.
  1756. template <class Derived, class Base>
  1757. Derived* CheckedDowncastToActualType(Base* base) {
  1758. #if GTEST_HAS_RTTI
  1759. GTEST_CHECK_(typeid(*base) == typeid(Derived));
  1760. return dynamic_cast<Derived*>(base); // NOLINT
  1761. #else
  1762. return static_cast<Derived*>(base); // Poor man's downcast.
  1763. #endif
  1764. }
  1765. #if GTEST_HAS_STREAM_REDIRECTION
  1766. // Defines the stderr capturer:
  1767. // CaptureStdout - starts capturing stdout.
  1768. // GetCapturedStdout - stops capturing stdout and returns the captured string.
  1769. // CaptureStderr - starts capturing stderr.
  1770. // GetCapturedStderr - stops capturing stderr and returns the captured string.
  1771. //
  1772. GTEST_API_ void CaptureStdout();
  1773. GTEST_API_ String GetCapturedStdout();
  1774. GTEST_API_ void CaptureStderr();
  1775. GTEST_API_ String GetCapturedStderr();
  1776. #endif // GTEST_HAS_STREAM_REDIRECTION
  1777. #if GTEST_HAS_DEATH_TEST
  1778. // A copy of all command line arguments. Set by InitGoogleTest().
  1779. extern ::std::vector<String> g_argvs;
  1780. // GTEST_HAS_DEATH_TEST implies we have ::std::string.
  1781. const ::std::vector<String>& GetArgvs();
  1782. #endif // GTEST_HAS_DEATH_TEST
  1783. // Defines synchronization primitives.
  1784. #if GTEST_HAS_PTHREAD
  1785. // Sleeps for (roughly) n milli-seconds. This function is only for
  1786. // testing Google Test's own constructs. Don't use it in user tests,
  1787. // either directly or indirectly.
  1788. inline void SleepMilliseconds(int n) {
  1789. const timespec time = {
  1790. 0, // 0 seconds.
  1791. n * 1000L * 1000L, // And n ms.
  1792. };
  1793. nanosleep(&time, NULL);
  1794. }
  1795. // Allows a controller thread to pause execution of newly created
  1796. // threads until notified. Instances of this class must be created
  1797. // and destroyed in the controller thread.
  1798. //
  1799. // This class is only for testing Google Test's own constructs. Do not
  1800. // use it in user tests, either directly or indirectly.
  1801. class Notification {
  1802. public:
  1803. Notification() : notified_(false) {}
  1804. // Notifies all threads created with this notification to start. Must
  1805. // be called from the controller thread.
  1806. void Notify() { notified_ = true; }
  1807. // Blocks until the controller thread notifies. Must be called from a test
  1808. // thread.
  1809. void WaitForNotification() {
  1810. while(!notified_) {
  1811. SleepMilliseconds(10);
  1812. }
  1813. }
  1814. private:
  1815. volatile bool notified_;
  1816. GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
  1817. };
  1818. // As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
  1819. // Consequently, it cannot select a correct instantiation of ThreadWithParam
  1820. // in order to call its Run(). Introducing ThreadWithParamBase as a
  1821. // non-templated base class for ThreadWithParam allows us to bypass this
  1822. // problem.
  1823. class ThreadWithParamBase {
  1824. public:
  1825. virtual ~ThreadWithParamBase() {}
  1826. virtual void Run() = 0;
  1827. };
  1828. // pthread_create() accepts a pointer to a function type with the C linkage.
  1829. // According to the Standard (7.5/1), function types with different linkages
  1830. // are different even if they are otherwise identical. Some compilers (for
  1831. // example, SunStudio) treat them as different types. Since class methods
  1832. // cannot be defined with C-linkage we need to define a free C-function to
  1833. // pass into pthread_create().
  1834. extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
  1835. static_cast<ThreadWithParamBase*>(thread)->Run();
  1836. return NULL;
  1837. }
  1838. // Helper class for testing Google Test's multi-threading constructs.
  1839. // To use it, write:
  1840. //
  1841. // void ThreadFunc(int param) { /* Do things with param */ }
  1842. // Notification thread_can_start;
  1843. // ...
  1844. // // The thread_can_start parameter is optional; you can supply NULL.
  1845. // ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
  1846. // thread_can_start.Notify();
  1847. //
  1848. // These classes are only for testing Google Test's own constructs. Do
  1849. // not use them in user tests, either directly or indirectly.
  1850. template <typename T>
  1851. class ThreadWithParam : public ThreadWithParamBase {
  1852. public:
  1853. typedef void (*UserThreadFunc)(T);
  1854. ThreadWithParam(
  1855. UserThreadFunc func, T param, Notification* thread_can_start)
  1856. : func_(func),
  1857. param_(param),
  1858. thread_can_start_(thread_can_start),
  1859. finished_(false) {
  1860. ThreadWithParamBase* const base = this;
  1861. // The thread can be created only after all fields except thread_
  1862. // have been initialized.
  1863. GTEST_CHECK_POSIX_SUCCESS_(
  1864. pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
  1865. }
  1866. ~ThreadWithParam() { Join(); }
  1867. void Join() {
  1868. if (!finished_) {
  1869. GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
  1870. finished_ = true;
  1871. }
  1872. }
  1873. virtual void Run() {
  1874. if (thread_can_start_ != NULL)
  1875. thread_can_start_->WaitForNotification();
  1876. func_(param_);
  1877. }
  1878. private:
  1879. const UserThreadFunc func_; // User-supplied thread function.
  1880. const T param_; // User-supplied parameter to the thread function.
  1881. // When non-NULL, used to block execution until the controller thread
  1882. // notifies.
  1883. Notification* const thread_can_start_;
  1884. bool finished_; // true iff we know that the thread function has finished.
  1885. pthread_t thread_; // The native thread object.
  1886. GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
  1887. };
  1888. // MutexBase and Mutex implement mutex on pthreads-based platforms. They
  1889. // are used in conjunction with class MutexLock:
  1890. //
  1891. // Mutex mutex;
  1892. // ...
  1893. // MutexLock lock(&mutex); // Acquires the mutex and releases it at the end
  1894. // // of the current scope.
  1895. //
  1896. // MutexBase implements behavior for both statically and dynamically
  1897. // allocated mutexes. Do not use MutexBase directly. Instead, write
  1898. // the following to define a static mutex:
  1899. //
  1900. // GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
  1901. //
  1902. // You can forward declare a static mutex like this:
  1903. //
  1904. // GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
  1905. //
  1906. // To create a dynamic mutex, just define an object of type Mutex.
  1907. class MutexBase {
  1908. public:
  1909. // Acquires this mutex.
  1910. void Lock() {
  1911. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
  1912. owner_ = pthread_self();
  1913. }
  1914. // Releases this mutex.
  1915. void Unlock() {
  1916. // We don't protect writing to owner_ here, as it's the caller's
  1917. // responsibility to ensure that the current thread holds the
  1918. // mutex when this is called.
  1919. owner_ = 0;
  1920. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
  1921. }
  1922. // Does nothing if the current thread holds the mutex. Otherwise, crashes
  1923. // with high probability.
  1924. void AssertHeld() const {
  1925. GTEST_CHECK_(owner_ == pthread_self())
  1926. << "The current thread is not holding the mutex @" << this;
  1927. }
  1928. // A static mutex may be used before main() is entered. It may even
  1929. // be used before the dynamic initialization stage. Therefore we
  1930. // must be able to initialize a static mutex object at link time.
  1931. // This means MutexBase has to be a POD and its member variables
  1932. // have to be public.
  1933. public:
  1934. pthread_mutex_t mutex_; // The underlying pthread mutex.
  1935. pthread_t owner_; // The thread holding the mutex; 0 means no one holds it.
  1936. };
  1937. // Forward-declares a static mutex.
  1938. # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
  1939. extern ::testing::internal::MutexBase mutex
  1940. // Defines and statically (i.e. at link time) initializes a static mutex.
  1941. # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
  1942. ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, 0 }
  1943. // The Mutex class can only be used for mutexes created at runtime. It
  1944. // shares its API with MutexBase otherwise.
  1945. class Mutex : public MutexBase {
  1946. public:
  1947. Mutex() {
  1948. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
  1949. owner_ = 0;
  1950. }
  1951. ~Mutex() {
  1952. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
  1953. }
  1954. private:
  1955. GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
  1956. };
  1957. // We cannot name this class MutexLock as the ctor declaration would
  1958. // conflict with a macro named MutexLock, which is defined on some
  1959. // platforms. Hence the typedef trick below.
  1960. class GTestMutexLock {
  1961. public:
  1962. explicit GTestMutexLock(MutexBase* mutex)
  1963. : mutex_(mutex) { mutex_->Lock(); }
  1964. ~GTestMutexLock() { mutex_->Unlock(); }
  1965. private:
  1966. MutexBase* const mutex_;
  1967. GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
  1968. };
  1969. typedef GTestMutexLock MutexLock;
  1970. // Helpers for ThreadLocal.
  1971. // pthread_key_create() requires DeleteThreadLocalValue() to have
  1972. // C-linkage. Therefore it cannot be templatized to access
  1973. // ThreadLocal<T>. Hence the need for class
  1974. // ThreadLocalValueHolderBase.
  1975. class ThreadLocalValueHolderBase {
  1976. public:
  1977. virtual ~ThreadLocalValueHolderBase() {}
  1978. };
  1979. // Called by pthread to delete thread-local data stored by
  1980. // pthread_setspecific().
  1981. extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
  1982. delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
  1983. }
  1984. // Implements thread-local storage on pthreads-based systems.
  1985. //
  1986. // // Thread 1
  1987. // ThreadLocal<int> tl(100); // 100 is the default value for each thread.
  1988. //
  1989. // // Thread 2
  1990. // tl.set(150); // Changes the value for thread 2 only.
  1991. // EXPECT_EQ(150, tl.get());
  1992. //
  1993. // // Thread 1
  1994. // EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value.
  1995. // tl.set(200);
  1996. // EXPECT_EQ(200, tl.get());
  1997. //
  1998. // The template type argument T must have a public copy constructor.
  1999. // In addition, the default ThreadLocal constructor requires T to have
  2000. // a public default constructor.
  2001. //
  2002. // An object managed for a thread by a ThreadLocal instance is deleted
  2003. // when the thread exits. Or, if the ThreadLocal instance dies in
  2004. // that thread, when the ThreadLocal dies. It's the user's
  2005. // responsibility to ensure that all other threads using a ThreadLocal
  2006. // have exited when it dies, or the per-thread objects for those
  2007. // threads will not be deleted.
  2008. //
  2009. // Google Test only uses global ThreadLocal objects. That means they
  2010. // will die after main() has returned. Therefore, no per-thread
  2011. // object managed by Google Test will be leaked as long as all threads
  2012. // using Google Test have exited when main() returns.
  2013. template <typename T>
  2014. class ThreadLocal {
  2015. public:
  2016. ThreadLocal() : key_(CreateKey()),
  2017. default_() {}
  2018. explicit ThreadLocal(const T& value) : key_(CreateKey()),
  2019. default_(value) {}
  2020. ~ThreadLocal() {
  2021. // Destroys the managed object for the current thread, if any.
  2022. DeleteThreadLocalValue(pthread_getspecific(key_));
  2023. // Releases resources associated with the key. This will *not*
  2024. // delete managed objects for other threads.
  2025. GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
  2026. }
  2027. T* pointer() { return GetOrCreateValue(); }
  2028. const T* pointer() const { return GetOrCreateValue(); }
  2029. const T& get() const { return *pointer(); }
  2030. void set(const T& value) { *pointer() = value; }
  2031. private:
  2032. // Holds a value of type T.
  2033. class ValueHolder : public ThreadLocalValueHolderBase {
  2034. public:
  2035. explicit ValueHolder(const T& value) : value_(value) {}
  2036. T* pointer() { return &value_; }
  2037. private:
  2038. T value_;
  2039. GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
  2040. };
  2041. static pthread_key_t CreateKey() {
  2042. pthread_key_t key;
  2043. // When a thread exits, DeleteThreadLocalValue() will be called on
  2044. // the object managed for that thread.
  2045. GTEST_CHECK_POSIX_SUCCESS_(
  2046. pthread_key_create(&key, &DeleteThreadLocalValue));
  2047. return key;
  2048. }
  2049. T* GetOrCreateValue() const {
  2050. ThreadLocalValueHolderBase* const holder =
  2051. static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
  2052. if (holder != NULL) {
  2053. return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
  2054. }
  2055. ValueHolder* const new_holder = new ValueHolder(default_);
  2056. ThreadLocalValueHolderBase* const holder_base = new_holder;
  2057. GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
  2058. return new_holder->pointer();
  2059. }
  2060. // A key pthreads uses for looking up per-thread values.
  2061. const pthread_key_t key_;
  2062. const T default_; // The default value for each thread.
  2063. GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
  2064. };
  2065. # define GTEST_IS_THREADSAFE 1
  2066. #else // GTEST_HAS_PTHREAD
  2067. // A dummy implementation of synchronization primitives (mutex, lock,
  2068. // and thread-local variable). Necessary for compiling Google Test where
  2069. // mutex is not supported - using Google Test in multiple threads is not
  2070. // supported on such platforms.
  2071. class Mutex {
  2072. public:
  2073. Mutex() {}
  2074. void AssertHeld() const {}
  2075. };
  2076. # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
  2077. extern ::testing::internal::Mutex mutex
  2078. # define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
  2079. class GTestMutexLock {
  2080. public:
  2081. explicit GTestMutexLock(Mutex*) {} // NOLINT
  2082. };
  2083. typedef GTestMutexLock MutexLock;
  2084. template <typename T>
  2085. class ThreadLocal {
  2086. public:
  2087. ThreadLocal() : value_() {}
  2088. explicit ThreadLocal(const T& value) : value_(value) {}
  2089. T* pointer() { return &value_; }
  2090. const T* pointer() const { return &value_; }
  2091. const T& get() const { return value_; }
  2092. void set(const T& value) { value_ = value; }
  2093. private:
  2094. T value_;
  2095. };
  2096. // The above synchronization primitives have dummy implementations.
  2097. // Therefore Google Test is not thread-safe.
  2098. # define GTEST_IS_THREADSAFE 0
  2099. #endif // GTEST_HAS_PTHREAD
  2100. // Returns the number of threads running in the process, or 0 to indicate that
  2101. // we cannot detect it.
  2102. GTEST_API_ size_t GetThreadCount();
  2103. // Passing non-POD classes through ellipsis (...) crashes the ARM
  2104. // compiler and generates a warning in Sun Studio. The Nokia Symbian
  2105. // and the IBM XL C/C++ compiler try to instantiate a copy constructor
  2106. // for objects passed through ellipsis (...), failing for uncopyable
  2107. // objects. We define this to ensure that only POD is passed through
  2108. // ellipsis on these systems.
  2109. #if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
  2110. // We lose support for NULL detection where the compiler doesn't like
  2111. // passing non-POD classes through ellipsis (...).
  2112. # define GTEST_ELLIPSIS_NEEDS_POD_ 1
  2113. #else
  2114. # define GTEST_CAN_COMPARE_NULL 1
  2115. #endif
  2116. // The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
  2117. // const T& and const T* in a function template. These compilers
  2118. // _can_ decide between class template specializations for T and T*,
  2119. // so a tr1::type_traits-like is_pointer works.
  2120. #if defined(__SYMBIAN32__) || defined(__IBMCPP__)
  2121. # define GTEST_NEEDS_IS_POINTER_ 1
  2122. #endif
  2123. template <bool bool_value>
  2124. struct bool_constant {
  2125. typedef bool_constant<bool_value> type;
  2126. static const bool value = bool_value;
  2127. };
  2128. template <bool bool_value> const bool bool_constant<bool_value>::value;
  2129. typedef bool_constant<false> false_type;
  2130. typedef bool_constant<true> true_type;
  2131. template <typename T>
  2132. struct is_pointer : public false_type {};
  2133. template <typename T>
  2134. struct is_pointer<T*> : public true_type {};
  2135. template <typename Iterator>
  2136. struct IteratorTraits {
  2137. typedef typename Iterator::value_type value_type;
  2138. };
  2139. template <typename T>
  2140. struct IteratorTraits<T*> {
  2141. typedef T value_type;
  2142. };
  2143. template <typename T>
  2144. struct IteratorTraits<const T*> {
  2145. typedef T value_type;
  2146. };
  2147. #if GTEST_OS_WINDOWS
  2148. # define GTEST_PATH_SEP_ "\\"
  2149. # define GTEST_HAS_ALT_PATH_SEP_ 1
  2150. // The biggest signed integer type the compiler supports.
  2151. typedef __int64 BiggestInt;
  2152. #else
  2153. # define GTEST_PATH_SEP_ "/"
  2154. # define GTEST_HAS_ALT_PATH_SEP_ 0
  2155. typedef long long BiggestInt; // NOLINT
  2156. #endif // GTEST_OS_WINDOWS
  2157. // Utilities for char.
  2158. // isspace(int ch) and friends accept an unsigned char or EOF. char
  2159. // may be signed, depending on the compiler (or compiler flags).
  2160. // Therefore we need to cast a char to unsigned char before calling
  2161. // isspace(), etc.
  2162. inline bool IsAlpha(char ch) {
  2163. return isalpha(static_cast<unsigned char>(ch)) != 0;
  2164. }
  2165. inline bool IsAlNum(char ch) {
  2166. return isalnum(static_cast<unsigned char>(ch)) != 0;
  2167. }
  2168. inline bool IsDigit(char ch) {
  2169. return isdigit(static_cast<unsigned char>(ch)) != 0;
  2170. }
  2171. inline bool IsLower(char ch) {
  2172. return islower(static_cast<unsigned char>(ch)) != 0;
  2173. }
  2174. inline bool IsSpace(char ch) {
  2175. return isspace(static_cast<unsigned char>(ch)) != 0;
  2176. }
  2177. inline bool IsUpper(char ch) {
  2178. return isupper(static_cast<unsigned char>(ch)) != 0;
  2179. }
  2180. inline bool IsXDigit(char ch) {
  2181. return isxdigit(static_cast<unsigned char>(ch)) != 0;
  2182. }
  2183. inline char ToLower(char ch) {
  2184. return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
  2185. }
  2186. inline char ToUpper(char ch) {
  2187. return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
  2188. }
  2189. // The testing::internal::posix namespace holds wrappers for common
  2190. // POSIX functions. These wrappers hide the differences between
  2191. // Windows/MSVC and POSIX systems. Since some compilers define these
  2192. // standard functions as macros, the wrapper cannot have the same name
  2193. // as the wrapped function.
  2194. namespace posix {
  2195. // Functions with a different name on Windows.
  2196. #if GTEST_OS_WINDOWS
  2197. typedef struct _stat StatStruct;
  2198. # ifdef __BORLANDC__
  2199. inline int IsATTY(int fd) { return isatty(fd); }
  2200. inline int StrCaseCmp(const char* s1, const char* s2) {
  2201. return stricmp(s1, s2);
  2202. }
  2203. inline char* StrDup(const char* src) { return strdup(src); }
  2204. # else // !__BORLANDC__
  2205. # if GTEST_OS_WINDOWS_MOBILE
  2206. inline int IsATTY(int /* fd */) { return 0; }
  2207. # else
  2208. inline int IsATTY(int fd) { return _isatty(fd); }
  2209. # endif // GTEST_OS_WINDOWS_MOBILE
  2210. inline int StrCaseCmp(const char* s1, const char* s2) {
  2211. return _stricmp(s1, s2);
  2212. }
  2213. inline char* StrDup(const char* src) { return _strdup(src); }
  2214. # endif // __BORLANDC__
  2215. # if GTEST_OS_WINDOWS_MOBILE
  2216. inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
  2217. // Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
  2218. // time and thus not defined there.
  2219. # else
  2220. inline int FileNo(FILE* file) { return _fileno(file); }
  2221. inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
  2222. inline int RmDir(const char* dir) { return _rmdir(dir); }
  2223. inline bool IsDir(const StatStruct& st) {
  2224. return (_S_IFDIR & st.st_mode) != 0;
  2225. }
  2226. # endif // GTEST_OS_WINDOWS_MOBILE
  2227. #else
  2228. typedef struct stat StatStruct;
  2229. inline int FileNo(FILE* file) { return fileno(file); }
  2230. inline int IsATTY(int fd) { return isatty(fd); }
  2231. inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
  2232. inline int StrCaseCmp(const char* s1, const char* s2) {
  2233. return strcasecmp(s1, s2);
  2234. }
  2235. inline char* StrDup(const char* src) { return strdup(src); }
  2236. inline int RmDir(const char* dir) { return rmdir(dir); }
  2237. inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
  2238. #endif // GTEST_OS_WINDOWS
  2239. // Functions deprecated by MSVC 8.0.
  2240. #ifdef _MSC_VER
  2241. // Temporarily disable warning 4996 (deprecated function).
  2242. # pragma warning(push)
  2243. # pragma warning(disable:4996)
  2244. #endif
  2245. inline const char* StrNCpy(char* dest, const char* src, size_t n) {
  2246. return strncpy(dest, src, n);
  2247. }
  2248. // ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
  2249. // StrError() aren't needed on Windows CE at this time and thus not
  2250. // defined there.
  2251. #if !GTEST_OS_WINDOWS_MOBILE
  2252. inline int ChDir(const char* dir) { return chdir(dir); }
  2253. #endif
  2254. inline FILE* FOpen(const char* path, const char* mode) {
  2255. return fopen(path, mode);
  2256. }
  2257. #if !GTEST_OS_WINDOWS_MOBILE
  2258. inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
  2259. return freopen(path, mode, stream);
  2260. }
  2261. inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
  2262. #endif
  2263. inline int FClose(FILE* fp) { return fclose(fp); }
  2264. #if !GTEST_OS_WINDOWS_MOBILE
  2265. inline int Read(int fd, void* buf, unsigned int count) {
  2266. return static_cast<int>(read(fd, buf, count));
  2267. }
  2268. inline int Write(int fd, const void* buf, unsigned int count) {
  2269. return static_cast<int>(write(fd, buf, count));
  2270. }
  2271. inline int Close(int fd) { return close(fd); }
  2272. inline const char* StrError(int errnum) { return strerror(errnum); }
  2273. #endif
  2274. inline const char* GetEnv(const char* name) {
  2275. #if GTEST_OS_WINDOWS_MOBILE
  2276. // We are on Windows CE, which has no environment variables.
  2277. return NULL;
  2278. #elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
  2279. // Environment variables which we programmatically clear will be set to the
  2280. // empty string rather than unset (NULL). Handle that case.
  2281. const char* const env = getenv(name);
  2282. return (env != NULL && env[0] != '\0') ? env : NULL;
  2283. #else
  2284. return getenv(name);
  2285. #endif
  2286. }
  2287. #ifdef _MSC_VER
  2288. # pragma warning(pop) // Restores the warning state.
  2289. #endif
  2290. #if GTEST_OS_WINDOWS_MOBILE
  2291. // Windows CE has no C library. The abort() function is used in
  2292. // several places in Google Test. This implementation provides a reasonable
  2293. // imitation of standard behaviour.
  2294. void Abort();
  2295. #else
  2296. inline void Abort() { abort(); }
  2297. #endif // GTEST_OS_WINDOWS_MOBILE
  2298. } // namespace posix
  2299. // The maximum number a BiggestInt can represent. This definition
  2300. // works no matter BiggestInt is represented in one's complement or
  2301. // two's complement.
  2302. //
  2303. // We cannot rely on numeric_limits in STL, as __int64 and long long
  2304. // are not part of standard C++ and numeric_limits doesn't need to be
  2305. // defined for them.
  2306. const BiggestInt kMaxBiggestInt =
  2307. ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
  2308. // This template class serves as a compile-time function from size to
  2309. // type. It maps a size in bytes to a primitive type with that
  2310. // size. e.g.
  2311. //
  2312. // TypeWithSize<4>::UInt
  2313. //
  2314. // is typedef-ed to be unsigned int (unsigned integer made up of 4
  2315. // bytes).
  2316. //
  2317. // Such functionality should belong to STL, but I cannot find it
  2318. // there.
  2319. //
  2320. // Google Test uses this class in the implementation of floating-point
  2321. // comparison.
  2322. //
  2323. // For now it only handles UInt (unsigned int) as that's all Google Test
  2324. // needs. Other types can be easily added in the future if need
  2325. // arises.
  2326. template <size_t size>
  2327. class TypeWithSize {
  2328. public:
  2329. // This prevents the user from using TypeWithSize<N> with incorrect
  2330. // values of N.
  2331. typedef void UInt;
  2332. };
  2333. // The specialization for size 4.
  2334. template <>
  2335. class TypeWithSize<4> {
  2336. public:
  2337. // unsigned int has size 4 in both gcc and MSVC.
  2338. //
  2339. // As base/basictypes.h doesn't compile on Windows, we cannot use
  2340. // uint32, uint64, and etc here.
  2341. typedef int Int;
  2342. typedef unsigned int UInt;
  2343. };
  2344. // The specialization for size 8.
  2345. template <>
  2346. class TypeWithSize<8> {
  2347. public:
  2348. #if GTEST_OS_WINDOWS
  2349. typedef __int64 Int;
  2350. typedef unsigned __int64 UInt;
  2351. #else
  2352. typedef long long Int; // NOLINT
  2353. typedef unsigned long long UInt; // NOLINT
  2354. #endif // GTEST_OS_WINDOWS
  2355. };
  2356. // Integer types of known sizes.
  2357. typedef TypeWithSize<4>::Int Int32;
  2358. typedef TypeWithSize<4>::UInt UInt32;
  2359. typedef TypeWithSize<8>::Int Int64;
  2360. typedef TypeWithSize<8>::UInt UInt64;
  2361. typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds.
  2362. // Utilities for command line flags and environment variables.
  2363. // Macro for referencing flags.
  2364. #define GTEST_FLAG(name) FLAGS_gtest_##name
  2365. // Macros for declaring flags.
  2366. #define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
  2367. #define GTEST_DECLARE_int32_(name) \
  2368. GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
  2369. #define GTEST_DECLARE_string_(name) \
  2370. GTEST_API_ extern ::testing::internal::String GTEST_FLAG(name)
  2371. // Macros for defining flags.
  2372. #define GTEST_DEFINE_bool_(name, default_val, doc) \
  2373. GTEST_API_ bool GTEST_FLAG(name) = (default_val)
  2374. #define GTEST_DEFINE_int32_(name, default_val, doc) \
  2375. GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
  2376. #define GTEST_DEFINE_string_(name, default_val, doc) \
  2377. GTEST_API_ ::testing::internal::String GTEST_FLAG(name) = (default_val)
  2378. // Parses 'str' for a 32-bit signed integer. If successful, writes the result
  2379. // to *value and returns true; otherwise leaves *value unchanged and returns
  2380. // false.
  2381. // TODO(chandlerc): Find a better way to refactor flag and environment parsing
  2382. // out of both gtest-port.cc and gtest.cc to avoid exporting this utility
  2383. // function.
  2384. bool ParseInt32(const Message& src_text, const char* str, Int32* value);
  2385. // Parses a bool/Int32/string from the environment variable
  2386. // corresponding to the given Google Test flag.
  2387. bool BoolFromGTestEnv(const char* flag, bool default_val);
  2388. GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
  2389. const char* StringFromGTestEnv(const char* flag, const char* default_val);
  2390. } // namespace internal
  2391. } // namespace testing
  2392. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
  2393. #if GTEST_OS_LINUX
  2394. # include <stdlib.h>
  2395. # include <sys/types.h>
  2396. # include <sys/wait.h>
  2397. # include <unistd.h>
  2398. #endif // GTEST_OS_LINUX
  2399. #include <ctype.h>
  2400. #include <string.h>
  2401. #include <iomanip>
  2402. #include <limits>
  2403. #include <set>
  2404. // Copyright 2005, Google Inc.
  2405. // All rights reserved.
  2406. //
  2407. // Redistribution and use in source and binary forms, with or without
  2408. // modification, are permitted provided that the following conditions are
  2409. // met:
  2410. //
  2411. // * Redistributions of source code must retain the above copyright
  2412. // notice, this list of conditions and the following disclaimer.
  2413. // * Redistributions in binary form must reproduce the above
  2414. // copyright notice, this list of conditions and the following disclaimer
  2415. // in the documentation and/or other materials provided with the
  2416. // distribution.
  2417. // * Neither the name of Google Inc. nor the names of its
  2418. // contributors may be used to endorse or promote products derived from
  2419. // this software without specific prior written permission.
  2420. //
  2421. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  2422. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  2423. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  2424. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  2425. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  2426. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  2427. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  2428. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  2429. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  2430. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  2431. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2432. //
  2433. // Authors: [email protected] (Zhanyong Wan), [email protected] (Sean Mcafee)
  2434. //
  2435. // The Google C++ Testing Framework (Google Test)
  2436. //
  2437. // This header file declares the String class and functions used internally by
  2438. // Google Test. They are subject to change without notice. They should not used
  2439. // by code external to Google Test.
  2440. //
  2441. // This header file is #included by <gtest/internal/gtest-internal.h>.
  2442. // It should not be #included by other files.
  2443. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
  2444. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
  2445. #ifdef __BORLANDC__
  2446. // string.h is not guaranteed to provide strcpy on C++ Builder.
  2447. # include <mem.h>
  2448. #endif
  2449. #include <string.h>
  2450. #include <string>
  2451. namespace testing {
  2452. namespace internal {
  2453. // String - a UTF-8 string class.
  2454. //
  2455. // For historic reasons, we don't use std::string.
  2456. //
  2457. // TODO([email protected]): replace this class with std::string or
  2458. // implement it in terms of the latter.
  2459. //
  2460. // Note that String can represent both NULL and the empty string,
  2461. // while std::string cannot represent NULL.
  2462. //
  2463. // NULL and the empty string are considered different. NULL is less
  2464. // than anything (including the empty string) except itself.
  2465. //
  2466. // This class only provides minimum functionality necessary for
  2467. // implementing Google Test. We do not intend to implement a full-fledged
  2468. // string class here.
  2469. //
  2470. // Since the purpose of this class is to provide a substitute for
  2471. // std::string on platforms where it cannot be used, we define a copy
  2472. // constructor and assignment operators such that we don't need
  2473. // conditional compilation in a lot of places.
  2474. //
  2475. // In order to make the representation efficient, the d'tor of String
  2476. // is not virtual. Therefore DO NOT INHERIT FROM String.
  2477. class GTEST_API_ String {
  2478. public:
  2479. // Static utility methods
  2480. // Returns the input enclosed in double quotes if it's not NULL;
  2481. // otherwise returns "(null)". For example, "\"Hello\"" is returned
  2482. // for input "Hello".
  2483. //
  2484. // This is useful for printing a C string in the syntax of a literal.
  2485. //
  2486. // Known issue: escape sequences are not handled yet.
  2487. static String ShowCStringQuoted(const char* c_str);
  2488. // Clones a 0-terminated C string, allocating memory using new. The
  2489. // caller is responsible for deleting the return value using
  2490. // delete[]. Returns the cloned string, or NULL if the input is
  2491. // NULL.
  2492. //
  2493. // This is different from strdup() in string.h, which allocates
  2494. // memory using malloc().
  2495. static const char* CloneCString(const char* c_str);
  2496. #if GTEST_OS_WINDOWS_MOBILE
  2497. // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
  2498. // able to pass strings to Win32 APIs on CE we need to convert them
  2499. // to 'Unicode', UTF-16.
  2500. // Creates a UTF-16 wide string from the given ANSI string, allocating
  2501. // memory using new. The caller is responsible for deleting the return
  2502. // value using delete[]. Returns the wide string, or NULL if the
  2503. // input is NULL.
  2504. //
  2505. // The wide string is created using the ANSI codepage (CP_ACP) to
  2506. // match the behaviour of the ANSI versions of Win32 calls and the
  2507. // C runtime.
  2508. static LPCWSTR AnsiToUtf16(const char* c_str);
  2509. // Creates an ANSI string from the given wide string, allocating
  2510. // memory using new. The caller is responsible for deleting the return
  2511. // value using delete[]. Returns the ANSI string, or NULL if the
  2512. // input is NULL.
  2513. //
  2514. // The returned string is created using the ANSI codepage (CP_ACP) to
  2515. // match the behaviour of the ANSI versions of Win32 calls and the
  2516. // C runtime.
  2517. static const char* Utf16ToAnsi(LPCWSTR utf16_str);
  2518. #endif
  2519. // Compares two C strings. Returns true iff they have the same content.
  2520. //
  2521. // Unlike strcmp(), this function can handle NULL argument(s). A
  2522. // NULL C string is considered different to any non-NULL C string,
  2523. // including the empty string.
  2524. static bool CStringEquals(const char* lhs, const char* rhs);
  2525. // Converts a wide C string to a String using the UTF-8 encoding.
  2526. // NULL will be converted to "(null)". If an error occurred during
  2527. // the conversion, "(failed to convert from wide string)" is
  2528. // returned.
  2529. static String ShowWideCString(const wchar_t* wide_c_str);
  2530. // Similar to ShowWideCString(), except that this function encloses
  2531. // the converted string in double quotes.
  2532. static String ShowWideCStringQuoted(const wchar_t* wide_c_str);
  2533. // Compares two wide C strings. Returns true iff they have the same
  2534. // content.
  2535. //
  2536. // Unlike wcscmp(), this function can handle NULL argument(s). A
  2537. // NULL C string is considered different to any non-NULL C string,
  2538. // including the empty string.
  2539. static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
  2540. // Compares two C strings, ignoring case. Returns true iff they
  2541. // have the same content.
  2542. //
  2543. // Unlike strcasecmp(), this function can handle NULL argument(s).
  2544. // A NULL C string is considered different to any non-NULL C string,
  2545. // including the empty string.
  2546. static bool CaseInsensitiveCStringEquals(const char* lhs,
  2547. const char* rhs);
  2548. // Compares two wide C strings, ignoring case. Returns true iff they
  2549. // have the same content.
  2550. //
  2551. // Unlike wcscasecmp(), this function can handle NULL argument(s).
  2552. // A NULL C string is considered different to any non-NULL wide C string,
  2553. // including the empty string.
  2554. // NB: The implementations on different platforms slightly differ.
  2555. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
  2556. // environment variable. On GNU platform this method uses wcscasecmp
  2557. // which compares according to LC_CTYPE category of the current locale.
  2558. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
  2559. // current locale.
  2560. static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
  2561. const wchar_t* rhs);
  2562. // Formats a list of arguments to a String, using the same format
  2563. // spec string as for printf.
  2564. //
  2565. // We do not use the StringPrintf class as it is not universally
  2566. // available.
  2567. //
  2568. // The result is limited to 4096 characters (including the tailing
  2569. // 0). If 4096 characters are not enough to format the input,
  2570. // "<buffer exceeded>" is returned.
  2571. static String Format(const char* format, ...);
  2572. // C'tors
  2573. // The default c'tor constructs a NULL string.
  2574. String() : c_str_(NULL), length_(0) {}
  2575. // Constructs a String by cloning a 0-terminated C string.
  2576. String(const char* a_c_str) { // NOLINT
  2577. if (a_c_str == NULL) {
  2578. c_str_ = NULL;
  2579. length_ = 0;
  2580. } else {
  2581. ConstructNonNull(a_c_str, strlen(a_c_str));
  2582. }
  2583. }
  2584. // Constructs a String by copying a given number of chars from a
  2585. // buffer. E.g. String("hello", 3) creates the string "hel",
  2586. // String("a\0bcd", 4) creates "a\0bc", String(NULL, 0) creates "",
  2587. // and String(NULL, 1) results in access violation.
  2588. String(const char* buffer, size_t a_length) {
  2589. ConstructNonNull(buffer, a_length);
  2590. }
  2591. // The copy c'tor creates a new copy of the string. The two
  2592. // String objects do not share content.
  2593. String(const String& str) : c_str_(NULL), length_(0) { *this = str; }
  2594. // D'tor. String is intended to be a final class, so the d'tor
  2595. // doesn't need to be virtual.
  2596. ~String() { delete[] c_str_; }
  2597. // Allows a String to be implicitly converted to an ::std::string or
  2598. // ::string, and vice versa. Converting a String containing a NULL
  2599. // pointer to ::std::string or ::string is undefined behavior.
  2600. // Converting a ::std::string or ::string containing an embedded NUL
  2601. // character to a String will result in the prefix up to the first
  2602. // NUL character.
  2603. String(const ::std::string& str) {
  2604. ConstructNonNull(str.c_str(), str.length());
  2605. }
  2606. operator ::std::string() const { return ::std::string(c_str(), length()); }
  2607. #if GTEST_HAS_GLOBAL_STRING
  2608. String(const ::string& str) {
  2609. ConstructNonNull(str.c_str(), str.length());
  2610. }
  2611. operator ::string() const { return ::string(c_str(), length()); }
  2612. #endif // GTEST_HAS_GLOBAL_STRING
  2613. // Returns true iff this is an empty string (i.e. "").
  2614. bool empty() const { return (c_str() != NULL) && (length() == 0); }
  2615. // Compares this with another String.
  2616. // Returns < 0 if this is less than rhs, 0 if this is equal to rhs, or > 0
  2617. // if this is greater than rhs.
  2618. int Compare(const String& rhs) const;
  2619. // Returns true iff this String equals the given C string. A NULL
  2620. // string and a non-NULL string are considered not equal.
  2621. bool operator==(const char* a_c_str) const { return Compare(a_c_str) == 0; }
  2622. // Returns true iff this String is less than the given String. A
  2623. // NULL string is considered less than "".
  2624. bool operator<(const String& rhs) const { return Compare(rhs) < 0; }
  2625. // Returns true iff this String doesn't equal the given C string. A NULL
  2626. // string and a non-NULL string are considered not equal.
  2627. bool operator!=(const char* a_c_str) const { return !(*this == a_c_str); }
  2628. // Returns true iff this String ends with the given suffix. *Any*
  2629. // String is considered to end with a NULL or empty suffix.
  2630. bool EndsWith(const char* suffix) const;
  2631. // Returns true iff this String ends with the given suffix, not considering
  2632. // case. Any String is considered to end with a NULL or empty suffix.
  2633. bool EndsWithCaseInsensitive(const char* suffix) const;
  2634. // Returns the length of the encapsulated string, or 0 if the
  2635. // string is NULL.
  2636. size_t length() const { return length_; }
  2637. // Gets the 0-terminated C string this String object represents.
  2638. // The String object still owns the string. Therefore the caller
  2639. // should NOT delete the return value.
  2640. const char* c_str() const { return c_str_; }
  2641. // Assigns a C string to this object. Self-assignment works.
  2642. const String& operator=(const char* a_c_str) {
  2643. return *this = String(a_c_str);
  2644. }
  2645. // Assigns a String object to this object. Self-assignment works.
  2646. const String& operator=(const String& rhs) {
  2647. if (this != &rhs) {
  2648. delete[] c_str_;
  2649. if (rhs.c_str() == NULL) {
  2650. c_str_ = NULL;
  2651. length_ = 0;
  2652. } else {
  2653. ConstructNonNull(rhs.c_str(), rhs.length());
  2654. }
  2655. }
  2656. return *this;
  2657. }
  2658. private:
  2659. // Constructs a non-NULL String from the given content. This
  2660. // function can only be called when c_str_ has not been allocated.
  2661. // ConstructNonNull(NULL, 0) results in an empty string ("").
  2662. // ConstructNonNull(NULL, non_zero) is undefined behavior.
  2663. void ConstructNonNull(const char* buffer, size_t a_length) {
  2664. char* const str = new char[a_length + 1];
  2665. memcpy(str, buffer, a_length);
  2666. str[a_length] = '\0';
  2667. c_str_ = str;
  2668. length_ = a_length;
  2669. }
  2670. const char* c_str_;
  2671. size_t length_;
  2672. }; // class String
  2673. // Streams a String to an ostream. Each '\0' character in the String
  2674. // is replaced with "\\0".
  2675. inline ::std::ostream& operator<<(::std::ostream& os, const String& str) {
  2676. if (str.c_str() == NULL) {
  2677. os << "(null)";
  2678. } else {
  2679. const char* const c_str = str.c_str();
  2680. for (size_t i = 0; i != str.length(); i++) {
  2681. if (c_str[i] == '\0') {
  2682. os << "\\0";
  2683. } else {
  2684. os << c_str[i];
  2685. }
  2686. }
  2687. }
  2688. return os;
  2689. }
  2690. // Gets the content of the stringstream's buffer as a String. Each '\0'
  2691. // character in the buffer is replaced with "\\0".
  2692. GTEST_API_ String StringStreamToString(::std::stringstream* stream);
  2693. // Converts a streamable value to a String. A NULL pointer is
  2694. // converted to "(null)". When the input value is a ::string,
  2695. // ::std::string, ::wstring, or ::std::wstring object, each NUL
  2696. // character in it is replaced with "\\0".
  2697. // Declared here but defined in gtest.h, so that it has access
  2698. // to the definition of the Message class, required by the ARM
  2699. // compiler.
  2700. template <typename T>
  2701. String StreamableToString(const T& streamable);
  2702. } // namespace internal
  2703. } // namespace testing
  2704. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
  2705. // Copyright 2008, Google Inc.
  2706. // All rights reserved.
  2707. //
  2708. // Redistribution and use in source and binary forms, with or without
  2709. // modification, are permitted provided that the following conditions are
  2710. // met:
  2711. //
  2712. // * Redistributions of source code must retain the above copyright
  2713. // notice, this list of conditions and the following disclaimer.
  2714. // * Redistributions in binary form must reproduce the above
  2715. // copyright notice, this list of conditions and the following disclaimer
  2716. // in the documentation and/or other materials provided with the
  2717. // distribution.
  2718. // * Neither the name of Google Inc. nor the names of its
  2719. // contributors may be used to endorse or promote products derived from
  2720. // this software without specific prior written permission.
  2721. //
  2722. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  2723. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  2724. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  2725. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  2726. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  2727. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  2728. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  2729. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  2730. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  2731. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  2732. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2733. //
  2734. // Author: [email protected] (Keith Ray)
  2735. //
  2736. // Google Test filepath utilities
  2737. //
  2738. // This header file declares classes and functions used internally by
  2739. // Google Test. They are subject to change without notice.
  2740. //
  2741. // This file is #included in <gtest/internal/gtest-internal.h>.
  2742. // Do not include this header file separately!
  2743. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
  2744. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
  2745. namespace testing {
  2746. namespace internal {
  2747. // FilePath - a class for file and directory pathname manipulation which
  2748. // handles platform-specific conventions (like the pathname separator).
  2749. // Used for helper functions for naming files in a directory for xml output.
  2750. // Except for Set methods, all methods are const or static, which provides an
  2751. // "immutable value object" -- useful for peace of mind.
  2752. // A FilePath with a value ending in a path separator ("like/this/") represents
  2753. // a directory, otherwise it is assumed to represent a file. In either case,
  2754. // it may or may not represent an actual file or directory in the file system.
  2755. // Names are NOT checked for syntax correctness -- no checking for illegal
  2756. // characters, malformed paths, etc.
  2757. class GTEST_API_ FilePath {
  2758. public:
  2759. FilePath() : pathname_("") { }
  2760. FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
  2761. explicit FilePath(const char* pathname) : pathname_(pathname) {
  2762. Normalize();
  2763. }
  2764. explicit FilePath(const String& pathname) : pathname_(pathname) {
  2765. Normalize();
  2766. }
  2767. FilePath& operator=(const FilePath& rhs) {
  2768. Set(rhs);
  2769. return *this;
  2770. }
  2771. void Set(const FilePath& rhs) {
  2772. pathname_ = rhs.pathname_;
  2773. }
  2774. String ToString() const { return pathname_; }
  2775. const char* c_str() const { return pathname_.c_str(); }
  2776. // Returns the current working directory, or "" if unsuccessful.
  2777. static FilePath GetCurrentDir();
  2778. // Given directory = "dir", base_name = "test", number = 0,
  2779. // extension = "xml", returns "dir/test.xml". If number is greater
  2780. // than zero (e.g., 12), returns "dir/test_12.xml".
  2781. // On Windows platform, uses \ as the separator rather than /.
  2782. static FilePath MakeFileName(const FilePath& directory,
  2783. const FilePath& base_name,
  2784. int number,
  2785. const char* extension);
  2786. // Given directory = "dir", relative_path = "test.xml",
  2787. // returns "dir/test.xml".
  2788. // On Windows, uses \ as the separator rather than /.
  2789. static FilePath ConcatPaths(const FilePath& directory,
  2790. const FilePath& relative_path);
  2791. // Returns a pathname for a file that does not currently exist. The pathname
  2792. // will be directory/base_name.extension or
  2793. // directory/base_name_<number>.extension if directory/base_name.extension
  2794. // already exists. The number will be incremented until a pathname is found
  2795. // that does not already exist.
  2796. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
  2797. // There could be a race condition if two or more processes are calling this
  2798. // function at the same time -- they could both pick the same filename.
  2799. static FilePath GenerateUniqueFileName(const FilePath& directory,
  2800. const FilePath& base_name,
  2801. const char* extension);
  2802. // Returns true iff the path is NULL or "".
  2803. bool IsEmpty() const { return c_str() == NULL || *c_str() == '\0'; }
  2804. // If input name has a trailing separator character, removes it and returns
  2805. // the name, otherwise return the name string unmodified.
  2806. // On Windows platform, uses \ as the separator, other platforms use /.
  2807. FilePath RemoveTrailingPathSeparator() const;
  2808. // Returns a copy of the FilePath with the directory part removed.
  2809. // Example: FilePath("path/to/file").RemoveDirectoryName() returns
  2810. // FilePath("file"). If there is no directory part ("just_a_file"), it returns
  2811. // the FilePath unmodified. If there is no file part ("just_a_dir/") it
  2812. // returns an empty FilePath ("").
  2813. // On Windows platform, '\' is the path separator, otherwise it is '/'.
  2814. FilePath RemoveDirectoryName() const;
  2815. // RemoveFileName returns the directory path with the filename removed.
  2816. // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
  2817. // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
  2818. // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
  2819. // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
  2820. // On Windows platform, '\' is the path separator, otherwise it is '/'.
  2821. FilePath RemoveFileName() const;
  2822. // Returns a copy of the FilePath with the case-insensitive extension removed.
  2823. // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
  2824. // FilePath("dir/file"). If a case-insensitive extension is not
  2825. // found, returns a copy of the original FilePath.
  2826. FilePath RemoveExtension(const char* extension) const;
  2827. // Creates directories so that path exists. Returns true if successful or if
  2828. // the directories already exist; returns false if unable to create
  2829. // directories for any reason. Will also return false if the FilePath does
  2830. // not represent a directory (that is, it doesn't end with a path separator).
  2831. bool CreateDirectoriesRecursively() const;
  2832. // Create the directory so that path exists. Returns true if successful or
  2833. // if the directory already exists; returns false if unable to create the
  2834. // directory for any reason, including if the parent directory does not
  2835. // exist. Not named "CreateDirectory" because that's a macro on Windows.
  2836. bool CreateFolder() const;
  2837. // Returns true if FilePath describes something in the file-system,
  2838. // either a file, directory, or whatever, and that something exists.
  2839. bool FileOrDirectoryExists() const;
  2840. // Returns true if pathname describes a directory in the file-system
  2841. // that exists.
  2842. bool DirectoryExists() const;
  2843. // Returns true if FilePath ends with a path separator, which indicates that
  2844. // it is intended to represent a directory. Returns false otherwise.
  2845. // This does NOT check that a directory (or file) actually exists.
  2846. bool IsDirectory() const;
  2847. // Returns true if pathname describes a root directory. (Windows has one
  2848. // root directory per disk drive.)
  2849. bool IsRootDirectory() const;
  2850. // Returns true if pathname describes an absolute path.
  2851. bool IsAbsolutePath() const;
  2852. private:
  2853. // Replaces multiple consecutive separators with a single separator.
  2854. // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
  2855. // redundancies that might be in a pathname involving "." or "..".
  2856. //
  2857. // A pathname with multiple consecutive separators may occur either through
  2858. // user error or as a result of some scripts or APIs that generate a pathname
  2859. // with a trailing separator. On other platforms the same API or script
  2860. // may NOT generate a pathname with a trailing "/". Then elsewhere that
  2861. // pathname may have another "/" and pathname components added to it,
  2862. // without checking for the separator already being there.
  2863. // The script language and operating system may allow paths like "foo//bar"
  2864. // but some of the functions in FilePath will not handle that correctly. In
  2865. // particular, RemoveTrailingPathSeparator() only removes one separator, and
  2866. // it is called in CreateDirectoriesRecursively() assuming that it will change
  2867. // a pathname from directory syntax (trailing separator) to filename syntax.
  2868. //
  2869. // On Windows this method also replaces the alternate path separator '/' with
  2870. // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
  2871. // "bar\\foo".
  2872. void Normalize();
  2873. // Returns a pointer to the last occurence of a valid path separator in
  2874. // the FilePath. On Windows, for example, both '/' and '\' are valid path
  2875. // separators. Returns NULL if no path separator was found.
  2876. const char* FindLastPathSeparator() const;
  2877. String pathname_;
  2878. }; // class FilePath
  2879. } // namespace internal
  2880. } // namespace testing
  2881. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
  2882. // This file was GENERATED by command:
  2883. // pump.py gtest-type-util.h.pump
  2884. // DO NOT EDIT BY HAND!!!
  2885. // Copyright 2008 Google Inc.
  2886. // All Rights Reserved.
  2887. //
  2888. // Redistribution and use in source and binary forms, with or without
  2889. // modification, are permitted provided that the following conditions are
  2890. // met:
  2891. //
  2892. // * Redistributions of source code must retain the above copyright
  2893. // notice, this list of conditions and the following disclaimer.
  2894. // * Redistributions in binary form must reproduce the above
  2895. // copyright notice, this list of conditions and the following disclaimer
  2896. // in the documentation and/or other materials provided with the
  2897. // distribution.
  2898. // * Neither the name of Google Inc. nor the names of its
  2899. // contributors may be used to endorse or promote products derived from
  2900. // this software without specific prior written permission.
  2901. //
  2902. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  2903. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  2904. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  2905. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  2906. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  2907. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  2908. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  2909. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  2910. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  2911. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  2912. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2913. //
  2914. // Author: [email protected] (Zhanyong Wan)
  2915. // Type utilities needed for implementing typed and type-parameterized
  2916. // tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
  2917. //
  2918. // Currently we support at most 50 types in a list, and at most 50
  2919. // type-parameterized tests in one type-parameterized test case.
  2920. // Please contact [email protected] if you need
  2921. // more.
  2922. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
  2923. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
  2924. // #ifdef __GNUC__ is too general here. It is possible to use gcc without using
  2925. // libstdc++ (which is where cxxabi.h comes from).
  2926. # ifdef __GLIBCXX__
  2927. # include <cxxabi.h>
  2928. # elif defined(__HP_aCC)
  2929. # include <acxx_demangle.h>
  2930. # endif // __GLIBCXX__
  2931. namespace testing {
  2932. namespace internal {
  2933. // GetTypeName<T>() returns a human-readable name of type T.
  2934. // NB: This function is also used in Google Mock, so don't move it inside of
  2935. // the typed-test-only section below.
  2936. template <typename T>
  2937. String GetTypeName() {
  2938. # if GTEST_HAS_RTTI
  2939. const char* const name = typeid(T).name();
  2940. # if defined(__GLIBCXX__) || defined(__HP_aCC)
  2941. int status = 0;
  2942. // gcc's implementation of typeid(T).name() mangles the type name,
  2943. // so we have to demangle it.
  2944. # ifdef __GLIBCXX__
  2945. using abi::__cxa_demangle;
  2946. # endif // __GLIBCXX__
  2947. char* const readable_name = __cxa_demangle(name, 0, 0, &status);
  2948. const String name_str(status == 0 ? readable_name : name);
  2949. free(readable_name);
  2950. return name_str;
  2951. # else
  2952. return name;
  2953. # endif // __GLIBCXX__ || __HP_aCC
  2954. # else
  2955. return "<type>";
  2956. # endif // GTEST_HAS_RTTI
  2957. }
  2958. #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  2959. // AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
  2960. // type. This can be used as a compile-time assertion to ensure that
  2961. // two types are equal.
  2962. template <typename T1, typename T2>
  2963. struct AssertTypeEq;
  2964. template <typename T>
  2965. struct AssertTypeEq<T, T> {
  2966. typedef bool type;
  2967. };
  2968. // A unique type used as the default value for the arguments of class
  2969. // template Types. This allows us to simulate variadic templates
  2970. // (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
  2971. // support directly.
  2972. struct None {};
  2973. // The following family of struct and struct templates are used to
  2974. // represent type lists. In particular, TypesN<T1, T2, ..., TN>
  2975. // represents a type list with N types (T1, T2, ..., and TN) in it.
  2976. // Except for Types0, every struct in the family has two member types:
  2977. // Head for the first type in the list, and Tail for the rest of the
  2978. // list.
  2979. // The empty type list.
  2980. struct Types0 {};
  2981. // Type lists of length 1, 2, 3, and so on.
  2982. template <typename T1>
  2983. struct Types1 {
  2984. typedef T1 Head;
  2985. typedef Types0 Tail;
  2986. };
  2987. template <typename T1, typename T2>
  2988. struct Types2 {
  2989. typedef T1 Head;
  2990. typedef Types1<T2> Tail;
  2991. };
  2992. template <typename T1, typename T2, typename T3>
  2993. struct Types3 {
  2994. typedef T1 Head;
  2995. typedef Types2<T2, T3> Tail;
  2996. };
  2997. template <typename T1, typename T2, typename T3, typename T4>
  2998. struct Types4 {
  2999. typedef T1 Head;
  3000. typedef Types3<T2, T3, T4> Tail;
  3001. };
  3002. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  3003. struct Types5 {
  3004. typedef T1 Head;
  3005. typedef Types4<T2, T3, T4, T5> Tail;
  3006. };
  3007. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3008. typename T6>
  3009. struct Types6 {
  3010. typedef T1 Head;
  3011. typedef Types5<T2, T3, T4, T5, T6> Tail;
  3012. };
  3013. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3014. typename T6, typename T7>
  3015. struct Types7 {
  3016. typedef T1 Head;
  3017. typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
  3018. };
  3019. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3020. typename T6, typename T7, typename T8>
  3021. struct Types8 {
  3022. typedef T1 Head;
  3023. typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
  3024. };
  3025. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3026. typename T6, typename T7, typename T8, typename T9>
  3027. struct Types9 {
  3028. typedef T1 Head;
  3029. typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
  3030. };
  3031. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3032. typename T6, typename T7, typename T8, typename T9, typename T10>
  3033. struct Types10 {
  3034. typedef T1 Head;
  3035. typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
  3036. };
  3037. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3038. typename T6, typename T7, typename T8, typename T9, typename T10,
  3039. typename T11>
  3040. struct Types11 {
  3041. typedef T1 Head;
  3042. typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
  3043. };
  3044. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3045. typename T6, typename T7, typename T8, typename T9, typename T10,
  3046. typename T11, typename T12>
  3047. struct Types12 {
  3048. typedef T1 Head;
  3049. typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
  3050. };
  3051. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3052. typename T6, typename T7, typename T8, typename T9, typename T10,
  3053. typename T11, typename T12, typename T13>
  3054. struct Types13 {
  3055. typedef T1 Head;
  3056. typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
  3057. };
  3058. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3059. typename T6, typename T7, typename T8, typename T9, typename T10,
  3060. typename T11, typename T12, typename T13, typename T14>
  3061. struct Types14 {
  3062. typedef T1 Head;
  3063. typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
  3064. };
  3065. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3066. typename T6, typename T7, typename T8, typename T9, typename T10,
  3067. typename T11, typename T12, typename T13, typename T14, typename T15>
  3068. struct Types15 {
  3069. typedef T1 Head;
  3070. typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  3071. T15> Tail;
  3072. };
  3073. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3074. typename T6, typename T7, typename T8, typename T9, typename T10,
  3075. typename T11, typename T12, typename T13, typename T14, typename T15,
  3076. typename T16>
  3077. struct Types16 {
  3078. typedef T1 Head;
  3079. typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3080. T16> Tail;
  3081. };
  3082. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3083. typename T6, typename T7, typename T8, typename T9, typename T10,
  3084. typename T11, typename T12, typename T13, typename T14, typename T15,
  3085. typename T16, typename T17>
  3086. struct Types17 {
  3087. typedef T1 Head;
  3088. typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3089. T16, T17> Tail;
  3090. };
  3091. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3092. typename T6, typename T7, typename T8, typename T9, typename T10,
  3093. typename T11, typename T12, typename T13, typename T14, typename T15,
  3094. typename T16, typename T17, typename T18>
  3095. struct Types18 {
  3096. typedef T1 Head;
  3097. typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3098. T16, T17, T18> Tail;
  3099. };
  3100. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3101. typename T6, typename T7, typename T8, typename T9, typename T10,
  3102. typename T11, typename T12, typename T13, typename T14, typename T15,
  3103. typename T16, typename T17, typename T18, typename T19>
  3104. struct Types19 {
  3105. typedef T1 Head;
  3106. typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3107. T16, T17, T18, T19> Tail;
  3108. };
  3109. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3110. typename T6, typename T7, typename T8, typename T9, typename T10,
  3111. typename T11, typename T12, typename T13, typename T14, typename T15,
  3112. typename T16, typename T17, typename T18, typename T19, typename T20>
  3113. struct Types20 {
  3114. typedef T1 Head;
  3115. typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3116. T16, T17, T18, T19, T20> Tail;
  3117. };
  3118. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3119. typename T6, typename T7, typename T8, typename T9, typename T10,
  3120. typename T11, typename T12, typename T13, typename T14, typename T15,
  3121. typename T16, typename T17, typename T18, typename T19, typename T20,
  3122. typename T21>
  3123. struct Types21 {
  3124. typedef T1 Head;
  3125. typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3126. T16, T17, T18, T19, T20, T21> Tail;
  3127. };
  3128. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3129. typename T6, typename T7, typename T8, typename T9, typename T10,
  3130. typename T11, typename T12, typename T13, typename T14, typename T15,
  3131. typename T16, typename T17, typename T18, typename T19, typename T20,
  3132. typename T21, typename T22>
  3133. struct Types22 {
  3134. typedef T1 Head;
  3135. typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3136. T16, T17, T18, T19, T20, T21, T22> Tail;
  3137. };
  3138. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3139. typename T6, typename T7, typename T8, typename T9, typename T10,
  3140. typename T11, typename T12, typename T13, typename T14, typename T15,
  3141. typename T16, typename T17, typename T18, typename T19, typename T20,
  3142. typename T21, typename T22, typename T23>
  3143. struct Types23 {
  3144. typedef T1 Head;
  3145. typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3146. T16, T17, T18, T19, T20, T21, T22, T23> Tail;
  3147. };
  3148. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3149. typename T6, typename T7, typename T8, typename T9, typename T10,
  3150. typename T11, typename T12, typename T13, typename T14, typename T15,
  3151. typename T16, typename T17, typename T18, typename T19, typename T20,
  3152. typename T21, typename T22, typename T23, typename T24>
  3153. struct Types24 {
  3154. typedef T1 Head;
  3155. typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3156. T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
  3157. };
  3158. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3159. typename T6, typename T7, typename T8, typename T9, typename T10,
  3160. typename T11, typename T12, typename T13, typename T14, typename T15,
  3161. typename T16, typename T17, typename T18, typename T19, typename T20,
  3162. typename T21, typename T22, typename T23, typename T24, typename T25>
  3163. struct Types25 {
  3164. typedef T1 Head;
  3165. typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3166. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
  3167. };
  3168. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3169. typename T6, typename T7, typename T8, typename T9, typename T10,
  3170. typename T11, typename T12, typename T13, typename T14, typename T15,
  3171. typename T16, typename T17, typename T18, typename T19, typename T20,
  3172. typename T21, typename T22, typename T23, typename T24, typename T25,
  3173. typename T26>
  3174. struct Types26 {
  3175. typedef T1 Head;
  3176. typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3177. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
  3178. };
  3179. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3180. typename T6, typename T7, typename T8, typename T9, typename T10,
  3181. typename T11, typename T12, typename T13, typename T14, typename T15,
  3182. typename T16, typename T17, typename T18, typename T19, typename T20,
  3183. typename T21, typename T22, typename T23, typename T24, typename T25,
  3184. typename T26, typename T27>
  3185. struct Types27 {
  3186. typedef T1 Head;
  3187. typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3188. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
  3189. };
  3190. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3191. typename T6, typename T7, typename T8, typename T9, typename T10,
  3192. typename T11, typename T12, typename T13, typename T14, typename T15,
  3193. typename T16, typename T17, typename T18, typename T19, typename T20,
  3194. typename T21, typename T22, typename T23, typename T24, typename T25,
  3195. typename T26, typename T27, typename T28>
  3196. struct Types28 {
  3197. typedef T1 Head;
  3198. typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3199. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
  3200. };
  3201. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3202. typename T6, typename T7, typename T8, typename T9, typename T10,
  3203. typename T11, typename T12, typename T13, typename T14, typename T15,
  3204. typename T16, typename T17, typename T18, typename T19, typename T20,
  3205. typename T21, typename T22, typename T23, typename T24, typename T25,
  3206. typename T26, typename T27, typename T28, typename T29>
  3207. struct Types29 {
  3208. typedef T1 Head;
  3209. typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3210. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  3211. T29> Tail;
  3212. };
  3213. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3214. typename T6, typename T7, typename T8, typename T9, typename T10,
  3215. typename T11, typename T12, typename T13, typename T14, typename T15,
  3216. typename T16, typename T17, typename T18, typename T19, typename T20,
  3217. typename T21, typename T22, typename T23, typename T24, typename T25,
  3218. typename T26, typename T27, typename T28, typename T29, typename T30>
  3219. struct Types30 {
  3220. typedef T1 Head;
  3221. typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3222. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3223. T30> Tail;
  3224. };
  3225. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3226. typename T6, typename T7, typename T8, typename T9, typename T10,
  3227. typename T11, typename T12, typename T13, typename T14, typename T15,
  3228. typename T16, typename T17, typename T18, typename T19, typename T20,
  3229. typename T21, typename T22, typename T23, typename T24, typename T25,
  3230. typename T26, typename T27, typename T28, typename T29, typename T30,
  3231. typename T31>
  3232. struct Types31 {
  3233. typedef T1 Head;
  3234. typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3235. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3236. T30, T31> Tail;
  3237. };
  3238. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3239. typename T6, typename T7, typename T8, typename T9, typename T10,
  3240. typename T11, typename T12, typename T13, typename T14, typename T15,
  3241. typename T16, typename T17, typename T18, typename T19, typename T20,
  3242. typename T21, typename T22, typename T23, typename T24, typename T25,
  3243. typename T26, typename T27, typename T28, typename T29, typename T30,
  3244. typename T31, typename T32>
  3245. struct Types32 {
  3246. typedef T1 Head;
  3247. typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3248. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3249. T30, T31, T32> Tail;
  3250. };
  3251. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3252. typename T6, typename T7, typename T8, typename T9, typename T10,
  3253. typename T11, typename T12, typename T13, typename T14, typename T15,
  3254. typename T16, typename T17, typename T18, typename T19, typename T20,
  3255. typename T21, typename T22, typename T23, typename T24, typename T25,
  3256. typename T26, typename T27, typename T28, typename T29, typename T30,
  3257. typename T31, typename T32, typename T33>
  3258. struct Types33 {
  3259. typedef T1 Head;
  3260. typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3261. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3262. T30, T31, T32, T33> Tail;
  3263. };
  3264. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3265. typename T6, typename T7, typename T8, typename T9, typename T10,
  3266. typename T11, typename T12, typename T13, typename T14, typename T15,
  3267. typename T16, typename T17, typename T18, typename T19, typename T20,
  3268. typename T21, typename T22, typename T23, typename T24, typename T25,
  3269. typename T26, typename T27, typename T28, typename T29, typename T30,
  3270. typename T31, typename T32, typename T33, typename T34>
  3271. struct Types34 {
  3272. typedef T1 Head;
  3273. typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3274. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3275. T30, T31, T32, T33, T34> Tail;
  3276. };
  3277. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3278. typename T6, typename T7, typename T8, typename T9, typename T10,
  3279. typename T11, typename T12, typename T13, typename T14, typename T15,
  3280. typename T16, typename T17, typename T18, typename T19, typename T20,
  3281. typename T21, typename T22, typename T23, typename T24, typename T25,
  3282. typename T26, typename T27, typename T28, typename T29, typename T30,
  3283. typename T31, typename T32, typename T33, typename T34, typename T35>
  3284. struct Types35 {
  3285. typedef T1 Head;
  3286. typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3287. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3288. T30, T31, T32, T33, T34, T35> Tail;
  3289. };
  3290. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3291. typename T6, typename T7, typename T8, typename T9, typename T10,
  3292. typename T11, typename T12, typename T13, typename T14, typename T15,
  3293. typename T16, typename T17, typename T18, typename T19, typename T20,
  3294. typename T21, typename T22, typename T23, typename T24, typename T25,
  3295. typename T26, typename T27, typename T28, typename T29, typename T30,
  3296. typename T31, typename T32, typename T33, typename T34, typename T35,
  3297. typename T36>
  3298. struct Types36 {
  3299. typedef T1 Head;
  3300. typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3301. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3302. T30, T31, T32, T33, T34, T35, T36> Tail;
  3303. };
  3304. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3305. typename T6, typename T7, typename T8, typename T9, typename T10,
  3306. typename T11, typename T12, typename T13, typename T14, typename T15,
  3307. typename T16, typename T17, typename T18, typename T19, typename T20,
  3308. typename T21, typename T22, typename T23, typename T24, typename T25,
  3309. typename T26, typename T27, typename T28, typename T29, typename T30,
  3310. typename T31, typename T32, typename T33, typename T34, typename T35,
  3311. typename T36, typename T37>
  3312. struct Types37 {
  3313. typedef T1 Head;
  3314. typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3315. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3316. T30, T31, T32, T33, T34, T35, T36, T37> Tail;
  3317. };
  3318. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3319. typename T6, typename T7, typename T8, typename T9, typename T10,
  3320. typename T11, typename T12, typename T13, typename T14, typename T15,
  3321. typename T16, typename T17, typename T18, typename T19, typename T20,
  3322. typename T21, typename T22, typename T23, typename T24, typename T25,
  3323. typename T26, typename T27, typename T28, typename T29, typename T30,
  3324. typename T31, typename T32, typename T33, typename T34, typename T35,
  3325. typename T36, typename T37, typename T38>
  3326. struct Types38 {
  3327. typedef T1 Head;
  3328. typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3329. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3330. T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
  3331. };
  3332. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3333. typename T6, typename T7, typename T8, typename T9, typename T10,
  3334. typename T11, typename T12, typename T13, typename T14, typename T15,
  3335. typename T16, typename T17, typename T18, typename T19, typename T20,
  3336. typename T21, typename T22, typename T23, typename T24, typename T25,
  3337. typename T26, typename T27, typename T28, typename T29, typename T30,
  3338. typename T31, typename T32, typename T33, typename T34, typename T35,
  3339. typename T36, typename T37, typename T38, typename T39>
  3340. struct Types39 {
  3341. typedef T1 Head;
  3342. typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3343. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3344. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
  3345. };
  3346. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3347. typename T6, typename T7, typename T8, typename T9, typename T10,
  3348. typename T11, typename T12, typename T13, typename T14, typename T15,
  3349. typename T16, typename T17, typename T18, typename T19, typename T20,
  3350. typename T21, typename T22, typename T23, typename T24, typename T25,
  3351. typename T26, typename T27, typename T28, typename T29, typename T30,
  3352. typename T31, typename T32, typename T33, typename T34, typename T35,
  3353. typename T36, typename T37, typename T38, typename T39, typename T40>
  3354. struct Types40 {
  3355. typedef T1 Head;
  3356. typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3357. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3358. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
  3359. };
  3360. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3361. typename T6, typename T7, typename T8, typename T9, typename T10,
  3362. typename T11, typename T12, typename T13, typename T14, typename T15,
  3363. typename T16, typename T17, typename T18, typename T19, typename T20,
  3364. typename T21, typename T22, typename T23, typename T24, typename T25,
  3365. typename T26, typename T27, typename T28, typename T29, typename T30,
  3366. typename T31, typename T32, typename T33, typename T34, typename T35,
  3367. typename T36, typename T37, typename T38, typename T39, typename T40,
  3368. typename T41>
  3369. struct Types41 {
  3370. typedef T1 Head;
  3371. typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3372. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3373. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
  3374. };
  3375. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3376. typename T6, typename T7, typename T8, typename T9, typename T10,
  3377. typename T11, typename T12, typename T13, typename T14, typename T15,
  3378. typename T16, typename T17, typename T18, typename T19, typename T20,
  3379. typename T21, typename T22, typename T23, typename T24, typename T25,
  3380. typename T26, typename T27, typename T28, typename T29, typename T30,
  3381. typename T31, typename T32, typename T33, typename T34, typename T35,
  3382. typename T36, typename T37, typename T38, typename T39, typename T40,
  3383. typename T41, typename T42>
  3384. struct Types42 {
  3385. typedef T1 Head;
  3386. typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3387. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3388. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
  3389. };
  3390. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3391. typename T6, typename T7, typename T8, typename T9, typename T10,
  3392. typename T11, typename T12, typename T13, typename T14, typename T15,
  3393. typename T16, typename T17, typename T18, typename T19, typename T20,
  3394. typename T21, typename T22, typename T23, typename T24, typename T25,
  3395. typename T26, typename T27, typename T28, typename T29, typename T30,
  3396. typename T31, typename T32, typename T33, typename T34, typename T35,
  3397. typename T36, typename T37, typename T38, typename T39, typename T40,
  3398. typename T41, typename T42, typename T43>
  3399. struct Types43 {
  3400. typedef T1 Head;
  3401. typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3402. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3403. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  3404. T43> Tail;
  3405. };
  3406. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3407. typename T6, typename T7, typename T8, typename T9, typename T10,
  3408. typename T11, typename T12, typename T13, typename T14, typename T15,
  3409. typename T16, typename T17, typename T18, typename T19, typename T20,
  3410. typename T21, typename T22, typename T23, typename T24, typename T25,
  3411. typename T26, typename T27, typename T28, typename T29, typename T30,
  3412. typename T31, typename T32, typename T33, typename T34, typename T35,
  3413. typename T36, typename T37, typename T38, typename T39, typename T40,
  3414. typename T41, typename T42, typename T43, typename T44>
  3415. struct Types44 {
  3416. typedef T1 Head;
  3417. typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3418. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3419. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3420. T44> Tail;
  3421. };
  3422. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3423. typename T6, typename T7, typename T8, typename T9, typename T10,
  3424. typename T11, typename T12, typename T13, typename T14, typename T15,
  3425. typename T16, typename T17, typename T18, typename T19, typename T20,
  3426. typename T21, typename T22, typename T23, typename T24, typename T25,
  3427. typename T26, typename T27, typename T28, typename T29, typename T30,
  3428. typename T31, typename T32, typename T33, typename T34, typename T35,
  3429. typename T36, typename T37, typename T38, typename T39, typename T40,
  3430. typename T41, typename T42, typename T43, typename T44, typename T45>
  3431. struct Types45 {
  3432. typedef T1 Head;
  3433. typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3434. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3435. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3436. T44, T45> Tail;
  3437. };
  3438. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3439. typename T6, typename T7, typename T8, typename T9, typename T10,
  3440. typename T11, typename T12, typename T13, typename T14, typename T15,
  3441. typename T16, typename T17, typename T18, typename T19, typename T20,
  3442. typename T21, typename T22, typename T23, typename T24, typename T25,
  3443. typename T26, typename T27, typename T28, typename T29, typename T30,
  3444. typename T31, typename T32, typename T33, typename T34, typename T35,
  3445. typename T36, typename T37, typename T38, typename T39, typename T40,
  3446. typename T41, typename T42, typename T43, typename T44, typename T45,
  3447. typename T46>
  3448. struct Types46 {
  3449. typedef T1 Head;
  3450. typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3451. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3452. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3453. T44, T45, T46> Tail;
  3454. };
  3455. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3456. typename T6, typename T7, typename T8, typename T9, typename T10,
  3457. typename T11, typename T12, typename T13, typename T14, typename T15,
  3458. typename T16, typename T17, typename T18, typename T19, typename T20,
  3459. typename T21, typename T22, typename T23, typename T24, typename T25,
  3460. typename T26, typename T27, typename T28, typename T29, typename T30,
  3461. typename T31, typename T32, typename T33, typename T34, typename T35,
  3462. typename T36, typename T37, typename T38, typename T39, typename T40,
  3463. typename T41, typename T42, typename T43, typename T44, typename T45,
  3464. typename T46, typename T47>
  3465. struct Types47 {
  3466. typedef T1 Head;
  3467. typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3468. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3469. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3470. T44, T45, T46, T47> Tail;
  3471. };
  3472. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3473. typename T6, typename T7, typename T8, typename T9, typename T10,
  3474. typename T11, typename T12, typename T13, typename T14, typename T15,
  3475. typename T16, typename T17, typename T18, typename T19, typename T20,
  3476. typename T21, typename T22, typename T23, typename T24, typename T25,
  3477. typename T26, typename T27, typename T28, typename T29, typename T30,
  3478. typename T31, typename T32, typename T33, typename T34, typename T35,
  3479. typename T36, typename T37, typename T38, typename T39, typename T40,
  3480. typename T41, typename T42, typename T43, typename T44, typename T45,
  3481. typename T46, typename T47, typename T48>
  3482. struct Types48 {
  3483. typedef T1 Head;
  3484. typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3485. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3486. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3487. T44, T45, T46, T47, T48> Tail;
  3488. };
  3489. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3490. typename T6, typename T7, typename T8, typename T9, typename T10,
  3491. typename T11, typename T12, typename T13, typename T14, typename T15,
  3492. typename T16, typename T17, typename T18, typename T19, typename T20,
  3493. typename T21, typename T22, typename T23, typename T24, typename T25,
  3494. typename T26, typename T27, typename T28, typename T29, typename T30,
  3495. typename T31, typename T32, typename T33, typename T34, typename T35,
  3496. typename T36, typename T37, typename T38, typename T39, typename T40,
  3497. typename T41, typename T42, typename T43, typename T44, typename T45,
  3498. typename T46, typename T47, typename T48, typename T49>
  3499. struct Types49 {
  3500. typedef T1 Head;
  3501. typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3502. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3503. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3504. T44, T45, T46, T47, T48, T49> Tail;
  3505. };
  3506. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3507. typename T6, typename T7, typename T8, typename T9, typename T10,
  3508. typename T11, typename T12, typename T13, typename T14, typename T15,
  3509. typename T16, typename T17, typename T18, typename T19, typename T20,
  3510. typename T21, typename T22, typename T23, typename T24, typename T25,
  3511. typename T26, typename T27, typename T28, typename T29, typename T30,
  3512. typename T31, typename T32, typename T33, typename T34, typename T35,
  3513. typename T36, typename T37, typename T38, typename T39, typename T40,
  3514. typename T41, typename T42, typename T43, typename T44, typename T45,
  3515. typename T46, typename T47, typename T48, typename T49, typename T50>
  3516. struct Types50 {
  3517. typedef T1 Head;
  3518. typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3519. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3520. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3521. T44, T45, T46, T47, T48, T49, T50> Tail;
  3522. };
  3523. } // namespace internal
  3524. // We don't want to require the users to write TypesN<...> directly,
  3525. // as that would require them to count the length. Types<...> is much
  3526. // easier to write, but generates horrible messages when there is a
  3527. // compiler error, as gcc insists on printing out each template
  3528. // argument, even if it has the default value (this means Types<int>
  3529. // will appear as Types<int, None, None, ..., None> in the compiler
  3530. // errors).
  3531. //
  3532. // Our solution is to combine the best part of the two approaches: a
  3533. // user would write Types<T1, ..., TN>, and Google Test will translate
  3534. // that to TypesN<T1, ..., TN> internally to make error messages
  3535. // readable. The translation is done by the 'type' member of the
  3536. // Types template.
  3537. template <typename T1 = internal::None, typename T2 = internal::None,
  3538. typename T3 = internal::None, typename T4 = internal::None,
  3539. typename T5 = internal::None, typename T6 = internal::None,
  3540. typename T7 = internal::None, typename T8 = internal::None,
  3541. typename T9 = internal::None, typename T10 = internal::None,
  3542. typename T11 = internal::None, typename T12 = internal::None,
  3543. typename T13 = internal::None, typename T14 = internal::None,
  3544. typename T15 = internal::None, typename T16 = internal::None,
  3545. typename T17 = internal::None, typename T18 = internal::None,
  3546. typename T19 = internal::None, typename T20 = internal::None,
  3547. typename T21 = internal::None, typename T22 = internal::None,
  3548. typename T23 = internal::None, typename T24 = internal::None,
  3549. typename T25 = internal::None, typename T26 = internal::None,
  3550. typename T27 = internal::None, typename T28 = internal::None,
  3551. typename T29 = internal::None, typename T30 = internal::None,
  3552. typename T31 = internal::None, typename T32 = internal::None,
  3553. typename T33 = internal::None, typename T34 = internal::None,
  3554. typename T35 = internal::None, typename T36 = internal::None,
  3555. typename T37 = internal::None, typename T38 = internal::None,
  3556. typename T39 = internal::None, typename T40 = internal::None,
  3557. typename T41 = internal::None, typename T42 = internal::None,
  3558. typename T43 = internal::None, typename T44 = internal::None,
  3559. typename T45 = internal::None, typename T46 = internal::None,
  3560. typename T47 = internal::None, typename T48 = internal::None,
  3561. typename T49 = internal::None, typename T50 = internal::None>
  3562. struct Types {
  3563. typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3564. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  3565. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  3566. T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
  3567. };
  3568. template <>
  3569. struct Types<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, internal::None, internal::None,
  3580. internal::None, internal::None, internal::None, internal::None,
  3581. internal::None, internal::None> {
  3582. typedef internal::Types0 type;
  3583. };
  3584. template <typename T1>
  3585. struct Types<T1, 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, internal::None, internal::None,
  3596. internal::None, internal::None, internal::None, internal::None,
  3597. internal::None, internal::None> {
  3598. typedef internal::Types1<T1> type;
  3599. };
  3600. template <typename T1, typename T2>
  3601. struct Types<T1, T2, 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, internal::None, internal::None, internal::None,
  3612. internal::None, internal::None, internal::None, internal::None,
  3613. internal::None> {
  3614. typedef internal::Types2<T1, T2> type;
  3615. };
  3616. template <typename T1, typename T2, typename T3>
  3617. struct Types<T1, T2, T3, 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. internal::None, internal::None, internal::None, internal::None,
  3628. internal::None, internal::None, internal::None, internal::None> {
  3629. typedef internal::Types3<T1, T2, T3> type;
  3630. };
  3631. template <typename T1, typename T2, typename T3, typename T4>
  3632. struct Types<T1, T2, T3, T4, 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, internal::None,
  3642. internal::None, internal::None, internal::None, internal::None,
  3643. internal::None, internal::None, internal::None> {
  3644. typedef internal::Types4<T1, T2, T3, T4> type;
  3645. };
  3646. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  3647. struct Types<T1, T2, T3, T4, T5, 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, internal::None,
  3657. internal::None, internal::None, internal::None, internal::None,
  3658. internal::None, internal::None, internal::None> {
  3659. typedef internal::Types5<T1, T2, T3, T4, T5> type;
  3660. };
  3661. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3662. typename T6>
  3663. struct Types<T1, T2, T3, T4, T5, T6, 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, internal::None, internal::None,
  3673. internal::None, internal::None, internal::None, internal::None,
  3674. internal::None, internal::None> {
  3675. typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
  3676. };
  3677. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3678. typename T6, typename T7>
  3679. struct Types<T1, T2, T3, T4, T5, T6, T7, 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, internal::None, internal::None, internal::None,
  3689. internal::None, internal::None, internal::None, internal::None,
  3690. internal::None> {
  3691. typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
  3692. };
  3693. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3694. typename T6, typename T7, typename T8>
  3695. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, 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. internal::None, internal::None, internal::None, internal::None,
  3705. internal::None, internal::None, internal::None, internal::None> {
  3706. typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
  3707. };
  3708. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3709. typename T6, typename T7, typename T8, typename T9>
  3710. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, 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. internal::None, internal::None, internal::None, internal::None,
  3720. internal::None, internal::None, internal::None, internal::None> {
  3721. typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
  3722. };
  3723. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3724. typename T6, typename T7, typename T8, typename T9, typename T10>
  3725. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, 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, internal::None,
  3734. internal::None, internal::None, internal::None, internal::None,
  3735. internal::None, internal::None, internal::None> {
  3736. typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
  3737. };
  3738. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3739. typename T6, typename T7, typename T8, typename T9, typename T10,
  3740. typename T11>
  3741. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 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, internal::None, internal::None,
  3750. internal::None, internal::None, internal::None, internal::None,
  3751. internal::None, internal::None> {
  3752. typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
  3753. };
  3754. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3755. typename T6, typename T7, typename T8, typename T9, typename T10,
  3756. typename T11, typename T12>
  3757. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, 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, internal::None, internal::None, internal::None,
  3766. internal::None, internal::None, internal::None, internal::None,
  3767. internal::None> {
  3768. typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  3769. T12> type;
  3770. };
  3771. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3772. typename T6, typename T7, typename T8, typename T9, typename T10,
  3773. typename T11, typename T12, typename T13>
  3774. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  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, internal::None, internal::None, internal::None,
  3783. internal::None, internal::None, internal::None, internal::None,
  3784. internal::None> {
  3785. typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3786. T13> type;
  3787. };
  3788. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3789. typename T6, typename T7, typename T8, typename T9, typename T10,
  3790. typename T11, typename T12, typename T13, typename T14>
  3791. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  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. internal::None, internal::None, internal::None, internal::None,
  3800. internal::None, internal::None, internal::None, internal::None> {
  3801. typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3802. T13, T14> type;
  3803. };
  3804. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3805. typename T6, typename T7, typename T8, typename T9, typename T10,
  3806. typename T11, typename T12, typename T13, typename T14, typename T15>
  3807. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  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, internal::None,
  3815. internal::None, internal::None, internal::None, internal::None,
  3816. internal::None, internal::None, internal::None> {
  3817. typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3818. T13, T14, T15> type;
  3819. };
  3820. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3821. typename T6, typename T7, typename T8, typename T9, typename T10,
  3822. typename T11, typename T12, typename T13, typename T14, typename T15,
  3823. typename T16>
  3824. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3825. T16, 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, internal::None, internal::None,
  3832. internal::None, internal::None, internal::None, internal::None,
  3833. internal::None, internal::None> {
  3834. typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3835. T13, T14, T15, T16> type;
  3836. };
  3837. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3838. typename T6, typename T7, typename T8, typename T9, typename T10,
  3839. typename T11, typename T12, typename T13, typename T14, typename T15,
  3840. typename T16, typename T17>
  3841. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3842. T16, T17, internal::None, internal::None, internal::None, internal::None,
  3843. internal::None, internal::None, internal::None, internal::None,
  3844. internal::None, internal::None, internal::None, internal::None,
  3845. internal::None, internal::None, internal::None, internal::None,
  3846. internal::None, internal::None, internal::None, internal::None,
  3847. internal::None, internal::None, internal::None, internal::None,
  3848. internal::None, internal::None, internal::None, internal::None,
  3849. internal::None, internal::None, internal::None, internal::None,
  3850. internal::None> {
  3851. typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3852. T13, T14, T15, T16, T17> type;
  3853. };
  3854. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3855. typename T6, typename T7, typename T8, typename T9, typename T10,
  3856. typename T11, typename T12, typename T13, typename T14, typename T15,
  3857. typename T16, typename T17, typename T18>
  3858. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3859. T16, T17, T18, internal::None, internal::None, internal::None,
  3860. internal::None, internal::None, internal::None, internal::None,
  3861. internal::None, internal::None, internal::None, internal::None,
  3862. internal::None, internal::None, internal::None, internal::None,
  3863. internal::None, internal::None, internal::None, internal::None,
  3864. internal::None, internal::None, internal::None, internal::None,
  3865. internal::None, internal::None, internal::None, internal::None,
  3866. internal::None, internal::None, internal::None, internal::None,
  3867. internal::None> {
  3868. typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3869. T13, T14, T15, T16, T17, T18> type;
  3870. };
  3871. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3872. typename T6, typename T7, typename T8, typename T9, typename T10,
  3873. typename T11, typename T12, typename T13, typename T14, typename T15,
  3874. typename T16, typename T17, typename T18, typename T19>
  3875. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3876. T16, T17, T18, T19, 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. internal::None, internal::None, internal::None, internal::None,
  3883. internal::None, internal::None, internal::None, internal::None> {
  3884. typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3885. T13, T14, T15, T16, T17, T18, T19> type;
  3886. };
  3887. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3888. typename T6, typename T7, typename T8, typename T9, typename T10,
  3889. typename T11, typename T12, typename T13, typename T14, typename T15,
  3890. typename T16, typename T17, typename T18, typename T19, typename T20>
  3891. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3892. T16, T17, T18, T19, T20, 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, internal::None,
  3898. internal::None, internal::None, internal::None, internal::None,
  3899. internal::None, internal::None, internal::None> {
  3900. typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3901. T13, T14, T15, T16, T17, T18, T19, T20> type;
  3902. };
  3903. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3904. typename T6, typename T7, typename T8, typename T9, typename T10,
  3905. typename T11, typename T12, typename T13, typename T14, typename T15,
  3906. typename T16, typename T17, typename T18, typename T19, typename T20,
  3907. typename T21>
  3908. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3909. T16, T17, T18, T19, T20, T21, 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, internal::None,
  3915. internal::None, internal::None, internal::None, internal::None,
  3916. internal::None, internal::None, internal::None> {
  3917. typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3918. T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
  3919. };
  3920. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3921. typename T6, typename T7, typename T8, typename T9, typename T10,
  3922. typename T11, typename T12, typename T13, typename T14, typename T15,
  3923. typename T16, typename T17, typename T18, typename T19, typename T20,
  3924. typename T21, typename T22>
  3925. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3926. T16, T17, T18, T19, T20, T21, T22, 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, internal::None, internal::None,
  3932. internal::None, internal::None, internal::None, internal::None,
  3933. internal::None, internal::None> {
  3934. typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3935. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
  3936. };
  3937. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3938. typename T6, typename T7, typename T8, typename T9, typename T10,
  3939. typename T11, typename T12, typename T13, typename T14, typename T15,
  3940. typename T16, typename T17, typename T18, typename T19, typename T20,
  3941. typename T21, typename T22, typename T23>
  3942. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3943. T16, T17, T18, T19, T20, T21, T22, T23, 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, internal::None, internal::None, internal::None,
  3949. internal::None, internal::None, internal::None, internal::None,
  3950. internal::None> {
  3951. typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3952. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
  3953. };
  3954. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3955. typename T6, typename T7, typename T8, typename T9, typename T10,
  3956. typename T11, typename T12, typename T13, typename T14, typename T15,
  3957. typename T16, typename T17, typename T18, typename T19, typename T20,
  3958. typename T21, typename T22, typename T23, typename T24>
  3959. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3960. T16, T17, T18, T19, T20, T21, T22, T23, T24, 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, internal::None, internal::None, internal::None,
  3966. internal::None, internal::None, internal::None, internal::None,
  3967. internal::None> {
  3968. typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3969. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
  3970. };
  3971. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3972. typename T6, typename T7, typename T8, typename T9, typename T10,
  3973. typename T11, typename T12, typename T13, typename T14, typename T15,
  3974. typename T16, typename T17, typename T18, typename T19, typename T20,
  3975. typename T21, typename T22, typename T23, typename T24, typename T25>
  3976. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3977. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, 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. internal::None, internal::None, internal::None, internal::None,
  3983. internal::None, internal::None, internal::None, internal::None> {
  3984. typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3985. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
  3986. };
  3987. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3988. typename T6, typename T7, typename T8, typename T9, typename T10,
  3989. typename T11, typename T12, typename T13, typename T14, typename T15,
  3990. typename T16, typename T17, typename T18, typename T19, typename T20,
  3991. typename T21, typename T22, typename T23, typename T24, typename T25,
  3992. typename T26>
  3993. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3994. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,
  3995. internal::None, internal::None, internal::None, internal::None,
  3996. internal::None, internal::None, internal::None, internal::None,
  3997. internal::None, internal::None, internal::None, internal::None,
  3998. internal::None, internal::None, internal::None, internal::None,
  3999. internal::None, internal::None, internal::None, internal::None,
  4000. internal::None, internal::None, internal::None> {
  4001. typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4002. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  4003. T26> type;
  4004. };
  4005. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4006. typename T6, typename T7, typename T8, typename T9, typename T10,
  4007. typename T11, typename T12, typename T13, typename T14, typename T15,
  4008. typename T16, typename T17, typename T18, typename T19, typename T20,
  4009. typename T21, typename T22, typename T23, typename T24, typename T25,
  4010. typename T26, typename T27>
  4011. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4012. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,
  4013. internal::None, internal::None, internal::None, internal::None,
  4014. internal::None, internal::None, internal::None, internal::None,
  4015. internal::None, internal::None, internal::None, internal::None,
  4016. internal::None, internal::None, internal::None, internal::None,
  4017. internal::None, internal::None, internal::None, internal::None,
  4018. internal::None, internal::None> {
  4019. typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4020. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4021. T27> type;
  4022. };
  4023. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4024. typename T6, typename T7, typename T8, typename T9, typename T10,
  4025. typename T11, typename T12, typename T13, typename T14, typename T15,
  4026. typename T16, typename T17, typename T18, typename T19, typename T20,
  4027. typename T21, typename T22, typename T23, typename T24, typename T25,
  4028. typename T26, typename T27, typename T28>
  4029. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4030. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4031. internal::None, internal::None, internal::None, internal::None,
  4032. internal::None, internal::None, internal::None, internal::None,
  4033. internal::None, internal::None, internal::None, internal::None,
  4034. internal::None, internal::None, internal::None, internal::None,
  4035. internal::None, internal::None, internal::None, internal::None,
  4036. internal::None, internal::None> {
  4037. typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4038. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4039. T27, T28> type;
  4040. };
  4041. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4042. typename T6, typename T7, typename T8, typename T9, typename T10,
  4043. typename T11, typename T12, typename T13, typename T14, typename T15,
  4044. typename T16, typename T17, typename T18, typename T19, typename T20,
  4045. typename T21, typename T22, typename T23, typename T24, typename T25,
  4046. typename T26, typename T27, typename T28, typename T29>
  4047. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4048. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  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, internal::None, internal::None, internal::None,
  4053. internal::None, internal::None, internal::None, internal::None,
  4054. internal::None> {
  4055. typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4056. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4057. T27, T28, T29> type;
  4058. };
  4059. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4060. typename T6, typename T7, typename T8, typename T9, typename T10,
  4061. typename T11, typename T12, typename T13, typename T14, typename T15,
  4062. typename T16, typename T17, typename T18, typename T19, typename T20,
  4063. typename T21, typename T22, typename T23, typename T24, typename T25,
  4064. typename T26, typename T27, typename T28, typename T29, typename T30>
  4065. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4066. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  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. internal::None, internal::None, internal::None, internal::None,
  4071. internal::None, internal::None, internal::None, internal::None> {
  4072. typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4073. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4074. T27, T28, T29, T30> type;
  4075. };
  4076. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4077. typename T6, typename T7, typename T8, typename T9, typename T10,
  4078. typename T11, typename T12, typename T13, typename T14, typename T15,
  4079. typename T16, typename T17, typename T18, typename T19, typename T20,
  4080. typename T21, typename T22, typename T23, typename T24, typename T25,
  4081. typename T26, typename T27, typename T28, typename T29, typename T30,
  4082. typename T31>
  4083. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4084. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4085. T31, internal::None, internal::None, internal::None, internal::None,
  4086. internal::None, internal::None, internal::None, internal::None,
  4087. internal::None, internal::None, internal::None, internal::None,
  4088. internal::None, internal::None, internal::None, internal::None,
  4089. internal::None, internal::None, internal::None> {
  4090. typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4091. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4092. T27, T28, T29, T30, T31> type;
  4093. };
  4094. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4095. typename T6, typename T7, typename T8, typename T9, typename T10,
  4096. typename T11, typename T12, typename T13, typename T14, typename T15,
  4097. typename T16, typename T17, typename T18, typename T19, typename T20,
  4098. typename T21, typename T22, typename T23, typename T24, typename T25,
  4099. typename T26, typename T27, typename T28, typename T29, typename T30,
  4100. typename T31, typename T32>
  4101. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4102. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4103. T31, T32, internal::None, internal::None, internal::None, internal::None,
  4104. internal::None, internal::None, internal::None, internal::None,
  4105. internal::None, internal::None, internal::None, internal::None,
  4106. internal::None, internal::None, internal::None, internal::None,
  4107. internal::None, internal::None> {
  4108. typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4109. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4110. T27, T28, T29, T30, T31, T32> type;
  4111. };
  4112. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4113. typename T6, typename T7, typename T8, typename T9, typename T10,
  4114. typename T11, typename T12, typename T13, typename T14, typename T15,
  4115. typename T16, typename T17, typename T18, typename T19, typename T20,
  4116. typename T21, typename T22, typename T23, typename T24, typename T25,
  4117. typename T26, typename T27, typename T28, typename T29, typename T30,
  4118. typename T31, typename T32, typename T33>
  4119. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4120. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4121. T31, T32, T33, internal::None, internal::None, internal::None,
  4122. internal::None, internal::None, internal::None, internal::None,
  4123. internal::None, internal::None, internal::None, internal::None,
  4124. internal::None, internal::None, internal::None, internal::None,
  4125. internal::None, internal::None> {
  4126. typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4127. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4128. T27, T28, T29, T30, T31, T32, T33> type;
  4129. };
  4130. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4131. typename T6, typename T7, typename T8, typename T9, typename T10,
  4132. typename T11, typename T12, typename T13, typename T14, typename T15,
  4133. typename T16, typename T17, typename T18, typename T19, typename T20,
  4134. typename T21, typename T22, typename T23, typename T24, typename T25,
  4135. typename T26, typename T27, typename T28, typename T29, typename T30,
  4136. typename T31, typename T32, typename T33, typename T34>
  4137. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4138. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4139. T31, T32, T33, T34, internal::None, internal::None, internal::None,
  4140. internal::None, internal::None, internal::None, internal::None,
  4141. internal::None, internal::None, internal::None, internal::None,
  4142. internal::None, internal::None, internal::None, internal::None,
  4143. internal::None> {
  4144. typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4145. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4146. T27, T28, T29, T30, T31, T32, T33, T34> type;
  4147. };
  4148. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4149. typename T6, typename T7, typename T8, typename T9, typename T10,
  4150. typename T11, typename T12, typename T13, typename T14, typename T15,
  4151. typename T16, typename T17, typename T18, typename T19, typename T20,
  4152. typename T21, typename T22, typename T23, typename T24, typename T25,
  4153. typename T26, typename T27, typename T28, typename T29, typename T30,
  4154. typename T31, typename T32, typename T33, typename T34, typename T35>
  4155. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4156. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4157. T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
  4158. internal::None, internal::None, internal::None, internal::None,
  4159. internal::None, internal::None, internal::None, internal::None,
  4160. internal::None, internal::None, internal::None, internal::None> {
  4161. typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4162. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4163. T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
  4164. };
  4165. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4166. typename T6, typename T7, typename T8, typename T9, typename T10,
  4167. typename T11, typename T12, typename T13, typename T14, typename T15,
  4168. typename T16, typename T17, typename T18, typename T19, typename T20,
  4169. typename T21, typename T22, typename T23, typename T24, typename T25,
  4170. typename T26, typename T27, typename T28, typename T29, typename T30,
  4171. typename T31, typename T32, typename T33, typename T34, typename T35,
  4172. typename T36>
  4173. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4174. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4175. T31, T32, T33, T34, T35, T36, internal::None, internal::None,
  4176. internal::None, internal::None, internal::None, internal::None,
  4177. internal::None, internal::None, internal::None, internal::None,
  4178. internal::None, internal::None, internal::None, internal::None> {
  4179. typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4180. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4181. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
  4182. };
  4183. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4184. typename T6, typename T7, typename T8, typename T9, typename T10,
  4185. typename T11, typename T12, typename T13, typename T14, typename T15,
  4186. typename T16, typename T17, typename T18, typename T19, typename T20,
  4187. typename T21, typename T22, typename T23, typename T24, typename T25,
  4188. typename T26, typename T27, typename T28, typename T29, typename T30,
  4189. typename T31, typename T32, typename T33, typename T34, typename T35,
  4190. typename T36, typename T37>
  4191. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4192. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4193. T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
  4194. internal::None, internal::None, internal::None, internal::None,
  4195. internal::None, internal::None, internal::None, internal::None,
  4196. internal::None, internal::None, internal::None> {
  4197. typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4198. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4199. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
  4200. };
  4201. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4202. typename T6, typename T7, typename T8, typename T9, typename T10,
  4203. typename T11, typename T12, typename T13, typename T14, typename T15,
  4204. typename T16, typename T17, typename T18, typename T19, typename T20,
  4205. typename T21, typename T22, typename T23, typename T24, typename T25,
  4206. typename T26, typename T27, typename T28, typename T29, typename T30,
  4207. typename T31, typename T32, typename T33, typename T34, typename T35,
  4208. typename T36, typename T37, typename T38>
  4209. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4210. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4211. T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
  4212. internal::None, internal::None, internal::None, internal::None,
  4213. internal::None, internal::None, internal::None, internal::None,
  4214. internal::None, internal::None> {
  4215. typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4216. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4217. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
  4218. };
  4219. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4220. typename T6, typename T7, typename T8, typename T9, typename T10,
  4221. typename T11, typename T12, typename T13, typename T14, typename T15,
  4222. typename T16, typename T17, typename T18, typename T19, typename T20,
  4223. typename T21, typename T22, typename T23, typename T24, typename T25,
  4224. typename T26, typename T27, typename T28, typename T29, typename T30,
  4225. typename T31, typename T32, typename T33, typename T34, typename T35,
  4226. typename T36, typename T37, typename T38, typename T39>
  4227. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4228. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4229. T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
  4230. internal::None, internal::None, internal::None, internal::None,
  4231. internal::None, internal::None, internal::None, internal::None,
  4232. internal::None, internal::None> {
  4233. typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4234. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4235. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
  4236. };
  4237. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4238. typename T6, typename T7, typename T8, typename T9, typename T10,
  4239. typename T11, typename T12, typename T13, typename T14, typename T15,
  4240. typename T16, typename T17, typename T18, typename T19, typename T20,
  4241. typename T21, typename T22, typename T23, typename T24, typename T25,
  4242. typename T26, typename T27, typename T28, typename T29, typename T30,
  4243. typename T31, typename T32, typename T33, typename T34, typename T35,
  4244. typename T36, typename T37, typename T38, typename T39, typename T40>
  4245. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4246. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4247. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
  4248. internal::None, internal::None, internal::None, internal::None,
  4249. internal::None, internal::None, internal::None, internal::None,
  4250. internal::None> {
  4251. typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4252. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4253. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  4254. T40> type;
  4255. };
  4256. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4257. typename T6, typename T7, typename T8, typename T9, typename T10,
  4258. typename T11, typename T12, typename T13, typename T14, typename T15,
  4259. typename T16, typename T17, typename T18, typename T19, typename T20,
  4260. typename T21, typename T22, typename T23, typename T24, typename T25,
  4261. typename T26, typename T27, typename T28, typename T29, typename T30,
  4262. typename T31, typename T32, typename T33, typename T34, typename T35,
  4263. typename T36, typename T37, typename T38, typename T39, typename T40,
  4264. typename T41>
  4265. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4266. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4267. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
  4268. internal::None, internal::None, internal::None, internal::None,
  4269. internal::None, internal::None, internal::None, internal::None> {
  4270. typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4271. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4272. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4273. T41> type;
  4274. };
  4275. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4276. typename T6, typename T7, typename T8, typename T9, typename T10,
  4277. typename T11, typename T12, typename T13, typename T14, typename T15,
  4278. typename T16, typename T17, typename T18, typename T19, typename T20,
  4279. typename T21, typename T22, typename T23, typename T24, typename T25,
  4280. typename T26, typename T27, typename T28, typename T29, typename T30,
  4281. typename T31, typename T32, typename T33, typename T34, typename T35,
  4282. typename T36, typename T37, typename T38, typename T39, typename T40,
  4283. typename T41, typename T42>
  4284. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4285. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4286. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
  4287. internal::None, internal::None, internal::None, internal::None,
  4288. internal::None, internal::None, internal::None> {
  4289. typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4290. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4291. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4292. T41, T42> type;
  4293. };
  4294. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4295. typename T6, typename T7, typename T8, typename T9, typename T10,
  4296. typename T11, typename T12, typename T13, typename T14, typename T15,
  4297. typename T16, typename T17, typename T18, typename T19, typename T20,
  4298. typename T21, typename T22, typename T23, typename T24, typename T25,
  4299. typename T26, typename T27, typename T28, typename T29, typename T30,
  4300. typename T31, typename T32, typename T33, typename T34, typename T35,
  4301. typename T36, typename T37, typename T38, typename T39, typename T40,
  4302. typename T41, typename T42, typename T43>
  4303. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4304. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4305. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  4306. internal::None, internal::None, internal::None, internal::None,
  4307. internal::None, internal::None, internal::None> {
  4308. typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4309. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4310. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4311. T41, T42, T43> type;
  4312. };
  4313. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4314. typename T6, typename T7, typename T8, typename T9, typename T10,
  4315. typename T11, typename T12, typename T13, typename T14, typename T15,
  4316. typename T16, typename T17, typename T18, typename T19, typename T20,
  4317. typename T21, typename T22, typename T23, typename T24, typename T25,
  4318. typename T26, typename T27, typename T28, typename T29, typename T30,
  4319. typename T31, typename T32, typename T33, typename T34, typename T35,
  4320. typename T36, typename T37, typename T38, typename T39, typename T40,
  4321. typename T41, typename T42, typename T43, typename T44>
  4322. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4323. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4324. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  4325. internal::None, internal::None, internal::None, internal::None,
  4326. internal::None, internal::None> {
  4327. typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4328. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4329. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4330. T41, T42, T43, T44> type;
  4331. };
  4332. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4333. typename T6, typename T7, typename T8, typename T9, typename T10,
  4334. typename T11, typename T12, typename T13, typename T14, typename T15,
  4335. typename T16, typename T17, typename T18, typename T19, typename T20,
  4336. typename T21, typename T22, typename T23, typename T24, typename T25,
  4337. typename T26, typename T27, typename T28, typename T29, typename T30,
  4338. typename T31, typename T32, typename T33, typename T34, typename T35,
  4339. typename T36, typename T37, typename T38, typename T39, typename T40,
  4340. typename T41, typename T42, typename T43, typename T44, typename T45>
  4341. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4342. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4343. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  4344. internal::None, internal::None, internal::None, internal::None,
  4345. internal::None> {
  4346. typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4347. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4348. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4349. T41, T42, T43, T44, T45> type;
  4350. };
  4351. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4352. typename T6, typename T7, typename T8, typename T9, typename T10,
  4353. typename T11, typename T12, typename T13, typename T14, typename T15,
  4354. typename T16, typename T17, typename T18, typename T19, typename T20,
  4355. typename T21, typename T22, typename T23, typename T24, typename T25,
  4356. typename T26, typename T27, typename T28, typename T29, typename T30,
  4357. typename T31, typename T32, typename T33, typename T34, typename T35,
  4358. typename T36, typename T37, typename T38, typename T39, typename T40,
  4359. typename T41, typename T42, typename T43, typename T44, typename T45,
  4360. typename T46>
  4361. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4362. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4363. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  4364. T46, internal::None, internal::None, internal::None, internal::None> {
  4365. typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4366. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4367. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4368. T41, T42, T43, T44, T45, T46> type;
  4369. };
  4370. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4371. typename T6, typename T7, typename T8, typename T9, typename T10,
  4372. typename T11, typename T12, typename T13, typename T14, typename T15,
  4373. typename T16, typename T17, typename T18, typename T19, typename T20,
  4374. typename T21, typename T22, typename T23, typename T24, typename T25,
  4375. typename T26, typename T27, typename T28, typename T29, typename T30,
  4376. typename T31, typename T32, typename T33, typename T34, typename T35,
  4377. typename T36, typename T37, typename T38, typename T39, typename T40,
  4378. typename T41, typename T42, typename T43, typename T44, typename T45,
  4379. typename T46, typename T47>
  4380. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4381. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4382. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  4383. T46, T47, internal::None, internal::None, internal::None> {
  4384. typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4385. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4386. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4387. T41, T42, T43, T44, T45, T46, T47> type;
  4388. };
  4389. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4390. typename T6, typename T7, typename T8, typename T9, typename T10,
  4391. typename T11, typename T12, typename T13, typename T14, typename T15,
  4392. typename T16, typename T17, typename T18, typename T19, typename T20,
  4393. typename T21, typename T22, typename T23, typename T24, typename T25,
  4394. typename T26, typename T27, typename T28, typename T29, typename T30,
  4395. typename T31, typename T32, typename T33, typename T34, typename T35,
  4396. typename T36, typename T37, typename T38, typename T39, typename T40,
  4397. typename T41, typename T42, typename T43, typename T44, typename T45,
  4398. typename T46, typename T47, typename T48>
  4399. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4400. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4401. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  4402. T46, T47, T48, internal::None, internal::None> {
  4403. typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4404. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4405. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4406. T41, T42, T43, T44, T45, T46, T47, T48> type;
  4407. };
  4408. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4409. typename T6, typename T7, typename T8, typename T9, typename T10,
  4410. typename T11, typename T12, typename T13, typename T14, typename T15,
  4411. typename T16, typename T17, typename T18, typename T19, typename T20,
  4412. typename T21, typename T22, typename T23, typename T24, typename T25,
  4413. typename T26, typename T27, typename T28, typename T29, typename T30,
  4414. typename T31, typename T32, typename T33, typename T34, typename T35,
  4415. typename T36, typename T37, typename T38, typename T39, typename T40,
  4416. typename T41, typename T42, typename T43, typename T44, typename T45,
  4417. typename T46, typename T47, typename T48, typename T49>
  4418. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4419. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4420. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  4421. T46, T47, T48, T49, internal::None> {
  4422. typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4423. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4424. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4425. T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
  4426. };
  4427. namespace internal {
  4428. # define GTEST_TEMPLATE_ template <typename T> class
  4429. // The template "selector" struct TemplateSel<Tmpl> is used to
  4430. // represent Tmpl, which must be a class template with one type
  4431. // parameter, as a type. TemplateSel<Tmpl>::Bind<T>::type is defined
  4432. // as the type Tmpl<T>. This allows us to actually instantiate the
  4433. // template "selected" by TemplateSel<Tmpl>.
  4434. //
  4435. // This trick is necessary for simulating typedef for class templates,
  4436. // which C++ doesn't support directly.
  4437. template <GTEST_TEMPLATE_ Tmpl>
  4438. struct TemplateSel {
  4439. template <typename T>
  4440. struct Bind {
  4441. typedef Tmpl<T> type;
  4442. };
  4443. };
  4444. # define GTEST_BIND_(TmplSel, T) \
  4445. TmplSel::template Bind<T>::type
  4446. // A unique struct template used as the default value for the
  4447. // arguments of class template Templates. This allows us to simulate
  4448. // variadic templates (e.g. Templates<int>, Templates<int, double>,
  4449. // and etc), which C++ doesn't support directly.
  4450. template <typename T>
  4451. struct NoneT {};
  4452. // The following family of struct and struct templates are used to
  4453. // represent template lists. In particular, TemplatesN<T1, T2, ...,
  4454. // TN> represents a list of N templates (T1, T2, ..., and TN). Except
  4455. // for Templates0, every struct in the family has two member types:
  4456. // Head for the selector of the first template in the list, and Tail
  4457. // for the rest of the list.
  4458. // The empty template list.
  4459. struct Templates0 {};
  4460. // Template lists of length 1, 2, 3, and so on.
  4461. template <GTEST_TEMPLATE_ T1>
  4462. struct Templates1 {
  4463. typedef TemplateSel<T1> Head;
  4464. typedef Templates0 Tail;
  4465. };
  4466. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
  4467. struct Templates2 {
  4468. typedef TemplateSel<T1> Head;
  4469. typedef Templates1<T2> Tail;
  4470. };
  4471. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
  4472. struct Templates3 {
  4473. typedef TemplateSel<T1> Head;
  4474. typedef Templates2<T2, T3> Tail;
  4475. };
  4476. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4477. GTEST_TEMPLATE_ T4>
  4478. struct Templates4 {
  4479. typedef TemplateSel<T1> Head;
  4480. typedef Templates3<T2, T3, T4> Tail;
  4481. };
  4482. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4483. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
  4484. struct Templates5 {
  4485. typedef TemplateSel<T1> Head;
  4486. typedef Templates4<T2, T3, T4, T5> Tail;
  4487. };
  4488. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4489. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
  4490. struct Templates6 {
  4491. typedef TemplateSel<T1> Head;
  4492. typedef Templates5<T2, T3, T4, T5, T6> Tail;
  4493. };
  4494. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4495. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4496. GTEST_TEMPLATE_ T7>
  4497. struct Templates7 {
  4498. typedef TemplateSel<T1> Head;
  4499. typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
  4500. };
  4501. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4502. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4503. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
  4504. struct Templates8 {
  4505. typedef TemplateSel<T1> Head;
  4506. typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
  4507. };
  4508. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4509. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4510. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
  4511. struct Templates9 {
  4512. typedef TemplateSel<T1> Head;
  4513. typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
  4514. };
  4515. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4516. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4517. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4518. GTEST_TEMPLATE_ T10>
  4519. struct Templates10 {
  4520. typedef TemplateSel<T1> Head;
  4521. typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
  4522. };
  4523. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4524. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4525. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4526. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
  4527. struct Templates11 {
  4528. typedef TemplateSel<T1> Head;
  4529. typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
  4530. };
  4531. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4532. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4533. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4534. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
  4535. struct Templates12 {
  4536. typedef TemplateSel<T1> Head;
  4537. typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
  4538. };
  4539. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4540. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4541. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4542. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4543. GTEST_TEMPLATE_ T13>
  4544. struct Templates13 {
  4545. typedef TemplateSel<T1> Head;
  4546. typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
  4547. };
  4548. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4549. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4550. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4551. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4552. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
  4553. struct Templates14 {
  4554. typedef TemplateSel<T1> Head;
  4555. typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  4556. T14> Tail;
  4557. };
  4558. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4559. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4560. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4561. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4562. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
  4563. struct Templates15 {
  4564. typedef TemplateSel<T1> Head;
  4565. typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4566. T15> Tail;
  4567. };
  4568. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4569. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4570. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4571. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4572. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4573. GTEST_TEMPLATE_ T16>
  4574. struct Templates16 {
  4575. typedef TemplateSel<T1> Head;
  4576. typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4577. T15, T16> Tail;
  4578. };
  4579. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4580. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4581. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4582. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4583. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4584. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
  4585. struct Templates17 {
  4586. typedef TemplateSel<T1> Head;
  4587. typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4588. T15, T16, T17> Tail;
  4589. };
  4590. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4591. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4592. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4593. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4594. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4595. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
  4596. struct Templates18 {
  4597. typedef TemplateSel<T1> Head;
  4598. typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4599. T15, T16, T17, T18> Tail;
  4600. };
  4601. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4602. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4603. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4604. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4605. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4606. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4607. GTEST_TEMPLATE_ T19>
  4608. struct Templates19 {
  4609. typedef TemplateSel<T1> Head;
  4610. typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4611. T15, T16, T17, T18, T19> Tail;
  4612. };
  4613. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4614. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4615. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4616. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4617. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4618. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4619. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
  4620. struct Templates20 {
  4621. typedef TemplateSel<T1> Head;
  4622. typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4623. T15, T16, T17, T18, T19, T20> Tail;
  4624. };
  4625. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4626. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4627. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4628. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4629. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4630. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4631. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
  4632. struct Templates21 {
  4633. typedef TemplateSel<T1> Head;
  4634. typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4635. T15, T16, T17, T18, T19, T20, T21> Tail;
  4636. };
  4637. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4638. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4639. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4640. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4641. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4642. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4643. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4644. GTEST_TEMPLATE_ T22>
  4645. struct Templates22 {
  4646. typedef TemplateSel<T1> Head;
  4647. typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4648. T15, T16, T17, T18, T19, T20, T21, T22> Tail;
  4649. };
  4650. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4651. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4652. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4653. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4654. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4655. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4656. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4657. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
  4658. struct Templates23 {
  4659. typedef TemplateSel<T1> Head;
  4660. typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4661. T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
  4662. };
  4663. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4664. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4665. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4666. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4667. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4668. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4669. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4670. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
  4671. struct Templates24 {
  4672. typedef TemplateSel<T1> Head;
  4673. typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4674. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
  4675. };
  4676. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4677. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4678. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4679. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4680. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4681. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4682. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4683. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4684. GTEST_TEMPLATE_ T25>
  4685. struct Templates25 {
  4686. typedef TemplateSel<T1> Head;
  4687. typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4688. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
  4689. };
  4690. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4691. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4692. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4693. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4694. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4695. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4696. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4697. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4698. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
  4699. struct Templates26 {
  4700. typedef TemplateSel<T1> Head;
  4701. typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4702. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
  4703. };
  4704. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4705. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4706. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4707. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4708. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4709. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4710. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4711. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4712. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
  4713. struct Templates27 {
  4714. typedef TemplateSel<T1> Head;
  4715. typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4716. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
  4717. };
  4718. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4719. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4720. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4721. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4722. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4723. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4724. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4725. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4726. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4727. GTEST_TEMPLATE_ T28>
  4728. struct Templates28 {
  4729. typedef TemplateSel<T1> Head;
  4730. typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4731. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  4732. T28> Tail;
  4733. };
  4734. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4735. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4736. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4737. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4738. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4739. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4740. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4741. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4742. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4743. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
  4744. struct Templates29 {
  4745. typedef TemplateSel<T1> Head;
  4746. typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4747. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4748. T29> Tail;
  4749. };
  4750. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4751. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4752. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4753. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4754. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4755. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4756. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4757. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4758. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4759. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
  4760. struct Templates30 {
  4761. typedef TemplateSel<T1> Head;
  4762. typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4763. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4764. T29, T30> Tail;
  4765. };
  4766. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4767. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4768. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4769. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4770. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4771. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4772. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4773. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4774. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4775. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4776. GTEST_TEMPLATE_ T31>
  4777. struct Templates31 {
  4778. typedef TemplateSel<T1> Head;
  4779. typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4780. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4781. T29, T30, T31> Tail;
  4782. };
  4783. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4784. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4785. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4786. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4787. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4788. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4789. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4790. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4791. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4792. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4793. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
  4794. struct Templates32 {
  4795. typedef TemplateSel<T1> Head;
  4796. typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4797. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4798. T29, T30, T31, T32> Tail;
  4799. };
  4800. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4801. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4802. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4803. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4804. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4805. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4806. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4807. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4808. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4809. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4810. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
  4811. struct Templates33 {
  4812. typedef TemplateSel<T1> Head;
  4813. typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4814. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4815. T29, T30, T31, T32, T33> Tail;
  4816. };
  4817. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4818. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4819. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4820. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4821. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4822. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4823. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4824. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4825. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4826. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4827. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4828. GTEST_TEMPLATE_ T34>
  4829. struct Templates34 {
  4830. typedef TemplateSel<T1> Head;
  4831. typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4832. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4833. T29, T30, T31, T32, T33, T34> Tail;
  4834. };
  4835. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4836. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4837. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4838. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4839. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4840. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4841. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4842. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4843. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4844. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4845. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4846. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
  4847. struct Templates35 {
  4848. typedef TemplateSel<T1> Head;
  4849. typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4850. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4851. T29, T30, T31, T32, T33, T34, T35> Tail;
  4852. };
  4853. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4854. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4855. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4856. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4857. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4858. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4859. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4860. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4861. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4862. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4863. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4864. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
  4865. struct Templates36 {
  4866. typedef TemplateSel<T1> Head;
  4867. typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4868. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4869. T29, T30, T31, T32, T33, T34, T35, T36> Tail;
  4870. };
  4871. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4872. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4873. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4874. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4875. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4876. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4877. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4878. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4879. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4880. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4881. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4882. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  4883. GTEST_TEMPLATE_ T37>
  4884. struct Templates37 {
  4885. typedef TemplateSel<T1> Head;
  4886. typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4887. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4888. T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
  4889. };
  4890. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4891. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4892. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4893. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4894. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4895. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4896. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4897. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4898. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4899. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4900. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4901. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  4902. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
  4903. struct Templates38 {
  4904. typedef TemplateSel<T1> Head;
  4905. typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4906. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4907. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
  4908. };
  4909. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4910. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4911. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4912. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4913. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4914. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4915. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4916. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4917. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4918. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4919. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4920. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  4921. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
  4922. struct Templates39 {
  4923. typedef TemplateSel<T1> Head;
  4924. typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4925. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4926. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
  4927. };
  4928. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4929. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4930. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4931. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4932. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4933. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4934. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4935. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4936. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4937. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4938. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4939. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  4940. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  4941. GTEST_TEMPLATE_ T40>
  4942. struct Templates40 {
  4943. typedef TemplateSel<T1> Head;
  4944. typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4945. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4946. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
  4947. };
  4948. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4949. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4950. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4951. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4952. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4953. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4954. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4955. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4956. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4957. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4958. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4959. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  4960. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  4961. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
  4962. struct Templates41 {
  4963. typedef TemplateSel<T1> Head;
  4964. typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4965. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4966. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
  4967. };
  4968. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4969. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4970. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4971. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4972. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4973. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4974. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4975. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4976. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4977. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4978. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4979. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  4980. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  4981. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
  4982. struct Templates42 {
  4983. typedef TemplateSel<T1> Head;
  4984. typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4985. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4986. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  4987. T42> Tail;
  4988. };
  4989. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4990. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4991. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4992. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4993. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4994. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4995. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4996. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4997. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4998. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4999. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5000. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5001. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5002. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5003. GTEST_TEMPLATE_ T43>
  5004. struct Templates43 {
  5005. typedef TemplateSel<T1> Head;
  5006. typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5007. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5008. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5009. T43> Tail;
  5010. };
  5011. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5012. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5013. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5014. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5015. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5016. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5017. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5018. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5019. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5020. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5021. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5022. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5023. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5024. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5025. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
  5026. struct Templates44 {
  5027. typedef TemplateSel<T1> Head;
  5028. typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5029. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5030. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5031. T43, T44> Tail;
  5032. };
  5033. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5034. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5035. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5036. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5037. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5038. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5039. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5040. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5041. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5042. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5043. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5044. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5045. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5046. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5047. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
  5048. struct Templates45 {
  5049. typedef TemplateSel<T1> Head;
  5050. typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5051. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5052. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5053. T43, T44, T45> Tail;
  5054. };
  5055. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5056. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5057. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5058. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5059. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5060. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5061. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5062. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5063. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5064. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5065. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5066. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5067. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5068. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5069. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5070. GTEST_TEMPLATE_ T46>
  5071. struct Templates46 {
  5072. typedef TemplateSel<T1> Head;
  5073. typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5074. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5075. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5076. T43, T44, T45, T46> Tail;
  5077. };
  5078. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5079. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5080. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5081. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5082. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5083. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5084. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5085. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5086. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5087. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5088. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5089. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5090. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5091. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5092. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5093. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
  5094. struct Templates47 {
  5095. typedef TemplateSel<T1> Head;
  5096. typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5097. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5098. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5099. T43, T44, T45, T46, T47> Tail;
  5100. };
  5101. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5102. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5103. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5104. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5105. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5106. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5107. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5108. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5109. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5110. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5111. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5112. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5113. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5114. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5115. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5116. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
  5117. struct Templates48 {
  5118. typedef TemplateSel<T1> Head;
  5119. typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5120. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5121. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5122. T43, T44, T45, T46, T47, T48> Tail;
  5123. };
  5124. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5125. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5126. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5127. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5128. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5129. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5130. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5131. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5132. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5133. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5134. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5135. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5136. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5137. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5138. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5139. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
  5140. GTEST_TEMPLATE_ T49>
  5141. struct Templates49 {
  5142. typedef TemplateSel<T1> Head;
  5143. typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5144. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5145. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5146. T43, T44, T45, T46, T47, T48, T49> Tail;
  5147. };
  5148. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5149. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5150. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5151. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5152. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5153. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5154. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5155. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5156. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5157. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5158. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5159. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5160. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5161. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5162. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5163. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
  5164. GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
  5165. struct Templates50 {
  5166. typedef TemplateSel<T1> Head;
  5167. typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5168. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5169. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5170. T43, T44, T45, T46, T47, T48, T49, T50> Tail;
  5171. };
  5172. // We don't want to require the users to write TemplatesN<...> directly,
  5173. // as that would require them to count the length. Templates<...> is much
  5174. // easier to write, but generates horrible messages when there is a
  5175. // compiler error, as gcc insists on printing out each template
  5176. // argument, even if it has the default value (this means Templates<list>
  5177. // will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
  5178. // errors).
  5179. //
  5180. // Our solution is to combine the best part of the two approaches: a
  5181. // user would write Templates<T1, ..., TN>, and Google Test will translate
  5182. // that to TemplatesN<T1, ..., TN> internally to make error messages
  5183. // readable. The translation is done by the 'type' member of the
  5184. // Templates template.
  5185. template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
  5186. GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
  5187. GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
  5188. GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
  5189. GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
  5190. GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
  5191. GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
  5192. GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
  5193. GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
  5194. GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
  5195. GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
  5196. GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
  5197. GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
  5198. GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
  5199. GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
  5200. GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
  5201. GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
  5202. GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
  5203. GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
  5204. GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
  5205. GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
  5206. GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
  5207. GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
  5208. GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
  5209. GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
  5210. struct Templates {
  5211. typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5212. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5213. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5214. T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
  5215. };
  5216. template <>
  5217. struct Templates<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, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5221. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5222. NoneT> {
  5223. typedef Templates0 type;
  5224. };
  5225. template <GTEST_TEMPLATE_ T1>
  5226. struct Templates<T1, 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, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5230. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5231. NoneT> {
  5232. typedef Templates1<T1> type;
  5233. };
  5234. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
  5235. struct Templates<T1, T2, 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, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5239. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5240. NoneT> {
  5241. typedef Templates2<T1, T2> type;
  5242. };
  5243. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
  5244. struct Templates<T1, T2, T3, 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. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5248. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5249. typedef Templates3<T1, T2, T3> type;
  5250. };
  5251. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5252. GTEST_TEMPLATE_ T4>
  5253. struct Templates<T1, T2, T3, T4, 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. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5257. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5258. typedef Templates4<T1, T2, T3, T4> type;
  5259. };
  5260. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5261. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
  5262. struct Templates<T1, T2, T3, T4, T5, 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, NoneT,
  5265. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5266. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5267. typedef Templates5<T1, T2, T3, T4, T5> type;
  5268. };
  5269. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5270. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
  5271. struct Templates<T1, T2, T3, T4, T5, T6, 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, NoneT,
  5274. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5275. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5276. typedef Templates6<T1, T2, T3, T4, T5, T6> type;
  5277. };
  5278. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5279. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5280. GTEST_TEMPLATE_ T7>
  5281. struct Templates<T1, T2, T3, T4, T5, T6, T7, 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, NoneT, NoneT,
  5284. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5285. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5286. typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
  5287. };
  5288. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5289. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5290. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
  5291. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
  5292. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5293. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5294. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5295. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5296. typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
  5297. };
  5298. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5299. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5300. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
  5301. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
  5302. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5303. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5304. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5305. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5306. typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
  5307. };
  5308. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5309. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5310. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5311. GTEST_TEMPLATE_ T10>
  5312. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
  5313. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5314. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5315. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5316. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5317. typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
  5318. };
  5319. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5320. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5321. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5322. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
  5323. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
  5324. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5325. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5326. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5327. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5328. typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
  5329. };
  5330. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5331. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5332. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5333. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
  5334. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
  5335. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5336. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5337. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5338. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5339. typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
  5340. };
  5341. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5342. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5343. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5344. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5345. GTEST_TEMPLATE_ T13>
  5346. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
  5347. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5348. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5349. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5350. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5351. typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5352. T13> type;
  5353. };
  5354. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5355. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5356. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5357. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5358. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
  5359. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5360. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5361. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5362. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5363. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5364. typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5365. T14> type;
  5366. };
  5367. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5368. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5369. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5370. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5371. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
  5372. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5373. T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5374. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5375. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5376. NoneT, NoneT, NoneT, NoneT, NoneT> {
  5377. typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5378. T14, T15> type;
  5379. };
  5380. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5381. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5382. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5383. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5384. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5385. GTEST_TEMPLATE_ T16>
  5386. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5387. T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5388. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5389. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5390. NoneT, NoneT, NoneT, NoneT, NoneT> {
  5391. typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5392. T14, T15, T16> type;
  5393. };
  5394. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5395. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5396. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5397. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5398. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5399. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
  5400. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5401. T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5402. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5403. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5404. NoneT, NoneT, NoneT, NoneT, NoneT> {
  5405. typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5406. T14, T15, T16, T17> type;
  5407. };
  5408. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5409. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5410. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5411. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5412. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5413. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
  5414. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5415. T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5416. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5417. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5418. NoneT, NoneT, NoneT, NoneT> {
  5419. typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5420. T14, T15, T16, T17, T18> type;
  5421. };
  5422. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5423. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5424. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5425. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5426. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5427. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5428. GTEST_TEMPLATE_ T19>
  5429. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5430. T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5431. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5432. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5433. NoneT, NoneT, NoneT, NoneT> {
  5434. typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5435. T14, T15, T16, T17, T18, T19> type;
  5436. };
  5437. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5438. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5439. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5440. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5441. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5442. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5443. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
  5444. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5445. T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5446. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5447. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5448. NoneT, NoneT, NoneT, NoneT> {
  5449. typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5450. T14, T15, T16, T17, T18, T19, T20> type;
  5451. };
  5452. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5453. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5454. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5455. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5456. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5457. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5458. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
  5459. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5460. T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
  5461. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5462. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5463. NoneT, NoneT, NoneT, NoneT> {
  5464. typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5465. T14, T15, T16, T17, T18, T19, T20, T21> type;
  5466. };
  5467. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5468. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5469. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5470. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5471. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5472. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5473. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5474. GTEST_TEMPLATE_ T22>
  5475. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5476. T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
  5477. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5478. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5479. NoneT, NoneT, NoneT> {
  5480. typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5481. T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
  5482. };
  5483. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5484. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5485. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5486. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5487. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5488. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5489. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5490. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
  5491. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5492. T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
  5493. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5494. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5495. NoneT, NoneT, NoneT> {
  5496. typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5497. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
  5498. };
  5499. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5500. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5501. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5502. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5503. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5504. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5505. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5506. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
  5507. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5508. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
  5509. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5510. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5511. NoneT, NoneT, NoneT> {
  5512. typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5513. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
  5514. };
  5515. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5516. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5517. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5518. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5519. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5520. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5521. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5522. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5523. GTEST_TEMPLATE_ T25>
  5524. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5525. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
  5526. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5527. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5528. NoneT, NoneT> {
  5529. typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5530. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
  5531. };
  5532. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5533. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5534. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5535. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5536. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5537. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5538. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5539. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5540. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
  5541. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5542. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
  5543. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5544. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5545. NoneT, NoneT> {
  5546. typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5547. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
  5548. };
  5549. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5550. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5551. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5552. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5553. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5554. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5555. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5556. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5557. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
  5558. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5559. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
  5560. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5561. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5562. NoneT, NoneT> {
  5563. typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5564. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5565. T27> type;
  5566. };
  5567. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5568. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5569. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5570. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5571. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5572. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5573. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5574. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5575. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5576. GTEST_TEMPLATE_ T28>
  5577. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5578. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5579. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5580. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5581. NoneT, NoneT> {
  5582. typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5583. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5584. T28> type;
  5585. };
  5586. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5587. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5588. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5589. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5590. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5591. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5592. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5593. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5594. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5595. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
  5596. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5597. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5598. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5599. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5600. NoneT> {
  5601. typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5602. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5603. T28, T29> type;
  5604. };
  5605. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5606. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5607. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5608. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5609. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5610. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5611. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5612. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5613. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5614. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
  5615. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5616. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5617. T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5618. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5619. typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5620. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5621. T28, T29, T30> type;
  5622. };
  5623. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5624. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5625. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5626. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5627. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5628. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5629. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5630. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5631. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5632. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5633. GTEST_TEMPLATE_ T31>
  5634. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5635. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5636. T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5637. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5638. typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5639. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5640. T28, T29, T30, T31> type;
  5641. };
  5642. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5643. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5644. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5645. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5646. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5647. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5648. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5649. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5650. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5651. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5652. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
  5653. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5654. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5655. T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5656. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5657. typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5658. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5659. T28, T29, T30, T31, T32> type;
  5660. };
  5661. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5662. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5663. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5664. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5665. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5666. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5667. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5668. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5669. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5670. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5671. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
  5672. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5673. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5674. T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5675. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5676. typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5677. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5678. T28, T29, T30, T31, T32, T33> type;
  5679. };
  5680. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5681. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5682. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5683. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5684. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5685. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5686. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5687. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5688. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5689. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5690. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5691. GTEST_TEMPLATE_ T34>
  5692. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5693. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5694. T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5695. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5696. typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5697. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5698. T28, T29, T30, T31, T32, T33, T34> type;
  5699. };
  5700. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5701. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5702. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5703. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5704. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5705. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5706. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5707. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5708. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5709. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5710. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5711. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
  5712. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5713. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5714. T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5715. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5716. typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5717. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5718. T28, T29, T30, T31, T32, T33, T34, T35> type;
  5719. };
  5720. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5721. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5722. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5723. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5724. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5725. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5726. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5727. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5728. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5729. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5730. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5731. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
  5732. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5733. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5734. T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
  5735. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5736. typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5737. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5738. T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
  5739. };
  5740. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5741. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5742. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5743. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5744. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5745. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5746. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5747. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5748. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5749. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5750. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5751. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5752. GTEST_TEMPLATE_ T37>
  5753. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5754. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5755. T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
  5756. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5757. typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5758. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5759. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
  5760. };
  5761. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5762. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5763. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5764. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5765. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5766. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5767. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5768. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5769. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5770. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5771. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5772. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5773. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
  5774. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5775. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5776. T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
  5777. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5778. typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5779. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5780. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
  5781. };
  5782. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5783. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5784. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5785. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5786. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5787. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5788. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5789. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5790. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5791. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5792. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5793. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5794. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
  5795. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5796. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5797. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
  5798. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5799. typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5800. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5801. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
  5802. };
  5803. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5804. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5805. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5806. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5807. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5808. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5809. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5810. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5811. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5812. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5813. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5814. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5815. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5816. GTEST_TEMPLATE_ T40>
  5817. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5818. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5819. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
  5820. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5821. typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5822. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5823. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
  5824. };
  5825. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5826. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5827. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5828. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5829. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5830. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5831. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5832. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5833. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5834. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5835. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5836. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5837. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5838. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
  5839. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5840. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5841. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
  5842. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5843. typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5844. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5845. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  5846. T41> type;
  5847. };
  5848. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5849. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5850. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5851. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5852. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5853. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5854. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5855. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5856. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5857. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5858. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5859. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5860. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5861. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
  5862. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5863. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5864. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
  5865. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5866. typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5867. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5868. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5869. T42> type;
  5870. };
  5871. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5872. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5873. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5874. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5875. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5876. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5877. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5878. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5879. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5880. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5881. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5882. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5883. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5884. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5885. GTEST_TEMPLATE_ T43>
  5886. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5887. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5888. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  5889. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5890. typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5891. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5892. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5893. T42, T43> type;
  5894. };
  5895. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5896. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5897. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5898. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5899. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5900. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5901. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5902. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5903. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5904. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5905. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5906. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5907. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5908. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5909. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
  5910. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5911. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5912. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  5913. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5914. typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5915. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5916. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5917. T42, T43, T44> type;
  5918. };
  5919. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5920. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5921. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5922. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5923. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5924. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5925. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5926. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5927. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5928. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5929. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5930. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5931. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5932. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5933. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
  5934. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5935. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5936. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  5937. T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5938. typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5939. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5940. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5941. T42, T43, T44, T45> type;
  5942. };
  5943. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5944. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5945. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5946. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5947. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5948. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5949. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5950. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5951. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5952. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5953. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5954. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5955. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5956. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5957. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5958. GTEST_TEMPLATE_ T46>
  5959. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5960. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5961. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  5962. T45, T46, NoneT, NoneT, NoneT, NoneT> {
  5963. typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5964. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5965. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5966. T42, T43, T44, T45, T46> type;
  5967. };
  5968. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5969. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5970. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5971. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5972. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5973. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5974. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5975. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5976. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5977. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5978. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5979. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5980. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5981. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5982. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5983. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
  5984. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5985. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5986. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  5987. T45, T46, T47, NoneT, NoneT, NoneT> {
  5988. typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5989. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5990. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5991. T42, T43, T44, T45, T46, T47> type;
  5992. };
  5993. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5994. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5995. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5996. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5997. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5998. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5999. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6000. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6001. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6002. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6003. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6004. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6005. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6006. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6007. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6008. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
  6009. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6010. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6011. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  6012. T45, T46, T47, T48, NoneT, NoneT> {
  6013. typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6014. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6015. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6016. T42, T43, T44, T45, T46, T47, T48> type;
  6017. };
  6018. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6019. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6020. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6021. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6022. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6023. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6024. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6025. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6026. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6027. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6028. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6029. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6030. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6031. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6032. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6033. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
  6034. GTEST_TEMPLATE_ T49>
  6035. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6036. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6037. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  6038. T45, T46, T47, T48, T49, NoneT> {
  6039. typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6040. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6041. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6042. T42, T43, T44, T45, T46, T47, T48, T49> type;
  6043. };
  6044. // The TypeList template makes it possible to use either a single type
  6045. // or a Types<...> list in TYPED_TEST_CASE() and
  6046. // INSTANTIATE_TYPED_TEST_CASE_P().
  6047. template <typename T>
  6048. struct TypeList { typedef Types1<T> type; };
  6049. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  6050. typename T6, typename T7, typename T8, typename T9, typename T10,
  6051. typename T11, typename T12, typename T13, typename T14, typename T15,
  6052. typename T16, typename T17, typename T18, typename T19, typename T20,
  6053. typename T21, typename T22, typename T23, typename T24, typename T25,
  6054. typename T26, typename T27, typename T28, typename T29, typename T30,
  6055. typename T31, typename T32, typename T33, typename T34, typename T35,
  6056. typename T36, typename T37, typename T38, typename T39, typename T40,
  6057. typename T41, typename T42, typename T43, typename T44, typename T45,
  6058. typename T46, typename T47, typename T48, typename T49, typename T50>
  6059. struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6060. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6061. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  6062. T44, T45, T46, T47, T48, T49, T50> > {
  6063. typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  6064. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  6065. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  6066. T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
  6067. };
  6068. #endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  6069. } // namespace internal
  6070. } // namespace testing
  6071. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
  6072. // Due to C++ preprocessor weirdness, we need double indirection to
  6073. // concatenate two tokens when one of them is __LINE__. Writing
  6074. //
  6075. // foo ## __LINE__
  6076. //
  6077. // will result in the token foo__LINE__, instead of foo followed by
  6078. // the current line number. For more details, see
  6079. // http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
  6080. #define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
  6081. #define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
  6082. // Google Test defines the testing::Message class to allow construction of
  6083. // test messages via the << operator. The idea is that anything
  6084. // streamable to std::ostream can be streamed to a testing::Message.
  6085. // This allows a user to use his own types in Google Test assertions by
  6086. // overloading the << operator.
  6087. //
  6088. // util/gtl/stl_logging-inl.h overloads << for STL containers. These
  6089. // overloads cannot be defined in the std namespace, as that will be
  6090. // undefined behavior. Therefore, they are defined in the global
  6091. // namespace instead.
  6092. //
  6093. // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
  6094. // overloads are visible in either the std namespace or the global
  6095. // namespace, but not other namespaces, including the testing
  6096. // namespace which Google Test's Message class is in.
  6097. //
  6098. // To allow STL containers (and other types that has a << operator
  6099. // defined in the global namespace) to be used in Google Test assertions,
  6100. // testing::Message must access the custom << operator from the global
  6101. // namespace. Hence this helper function.
  6102. //
  6103. // Note: Jeffrey Yasskin suggested an alternative fix by "using
  6104. // ::operator<<;" in the definition of Message's operator<<. That fix
  6105. // doesn't require a helper function, but unfortunately doesn't
  6106. // compile with MSVC.
  6107. template <typename T>
  6108. inline void GTestStreamToHelper(std::ostream* os, const T& val) {
  6109. *os << val;
  6110. }
  6111. class ProtocolMessage;
  6112. namespace proto2 { class Message; }
  6113. namespace testing {
  6114. // Forward declarations.
  6115. class AssertionResult; // Result of an assertion.
  6116. class Message; // Represents a failure message.
  6117. class Test; // Represents a test.
  6118. class TestInfo; // Information about a test.
  6119. class TestPartResult; // Result of a test part.
  6120. class UnitTest; // A collection of test cases.
  6121. template <typename T>
  6122. ::std::string PrintToString(const T& value);
  6123. namespace internal {
  6124. struct TraceInfo; // Information about a trace point.
  6125. class ScopedTrace; // Implements scoped trace.
  6126. class TestInfoImpl; // Opaque implementation of TestInfo
  6127. class UnitTestImpl; // Opaque implementation of UnitTest
  6128. // How many times InitGoogleTest() has been called.
  6129. extern int g_init_gtest_count;
  6130. // The text used in failure messages to indicate the start of the
  6131. // stack trace.
  6132. GTEST_API_ extern const char kStackTraceMarker[];
  6133. // A secret type that Google Test users don't know about. It has no
  6134. // definition on purpose. Therefore it's impossible to create a
  6135. // Secret object, which is what we want.
  6136. class Secret;
  6137. // Two overloaded helpers for checking at compile time whether an
  6138. // expression is a null pointer literal (i.e. NULL or any 0-valued
  6139. // compile-time integral constant). Their return values have
  6140. // different sizes, so we can use sizeof() to test which version is
  6141. // picked by the compiler. These helpers have no implementations, as
  6142. // we only need their signatures.
  6143. //
  6144. // Given IsNullLiteralHelper(x), the compiler will pick the first
  6145. // version if x can be implicitly converted to Secret*, and pick the
  6146. // second version otherwise. Since Secret is a secret and incomplete
  6147. // type, the only expression a user can write that has type Secret* is
  6148. // a null pointer literal. Therefore, we know that x is a null
  6149. // pointer literal if and only if the first version is picked by the
  6150. // compiler.
  6151. char IsNullLiteralHelper(Secret* p);
  6152. char (&IsNullLiteralHelper(...))[2]; // NOLINT
  6153. // A compile-time bool constant that is true if and only if x is a
  6154. // null pointer literal (i.e. NULL or any 0-valued compile-time
  6155. // integral constant).
  6156. #ifdef GTEST_ELLIPSIS_NEEDS_POD_
  6157. // We lose support for NULL detection where the compiler doesn't like
  6158. // passing non-POD classes through ellipsis (...).
  6159. # define GTEST_IS_NULL_LITERAL_(x) false
  6160. #else
  6161. # define GTEST_IS_NULL_LITERAL_(x) \
  6162. (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
  6163. #endif // GTEST_ELLIPSIS_NEEDS_POD_
  6164. // Appends the user-supplied message to the Google-Test-generated message.
  6165. GTEST_API_ String AppendUserMessage(const String& gtest_msg,
  6166. const Message& user_msg);
  6167. // A helper class for creating scoped traces in user programs.
  6168. class GTEST_API_ ScopedTrace {
  6169. public:
  6170. // The c'tor pushes the given source file location and message onto
  6171. // a trace stack maintained by Google Test.
  6172. ScopedTrace(const char* file, int line, const Message& message);
  6173. // The d'tor pops the info pushed by the c'tor.
  6174. //
  6175. // Note that the d'tor is not virtual in order to be efficient.
  6176. // Don't inherit from ScopedTrace!
  6177. ~ScopedTrace();
  6178. private:
  6179. GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
  6180. } GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its
  6181. // c'tor and d'tor. Therefore it doesn't
  6182. // need to be used otherwise.
  6183. // Converts a streamable value to a String. A NULL pointer is
  6184. // converted to "(null)". When the input value is a ::string,
  6185. // ::std::string, ::wstring, or ::std::wstring object, each NUL
  6186. // character in it is replaced with "\\0".
  6187. // Declared here but defined in gtest.h, so that it has access
  6188. // to the definition of the Message class, required by the ARM
  6189. // compiler.
  6190. template <typename T>
  6191. String StreamableToString(const T& streamable);
  6192. // The Symbian compiler has a bug that prevents it from selecting the
  6193. // correct overload of FormatForComparisonFailureMessage (see below)
  6194. // unless we pass the first argument by reference. If we do that,
  6195. // however, Visual Age C++ 10.1 generates a compiler error. Therefore
  6196. // we only apply the work-around for Symbian.
  6197. #if defined(__SYMBIAN32__)
  6198. # define GTEST_CREF_WORKAROUND_ const&
  6199. #else
  6200. # define GTEST_CREF_WORKAROUND_
  6201. #endif
  6202. // When this operand is a const char* or char*, if the other operand
  6203. // is a ::std::string or ::string, we print this operand as a C string
  6204. // rather than a pointer (we do the same for wide strings); otherwise
  6205. // we print it as a pointer to be safe.
  6206. // This internal macro is used to avoid duplicated code.
  6207. #define GTEST_FORMAT_IMPL_(operand2_type, operand1_printer)\
  6208. inline String FormatForComparisonFailureMessage(\
  6209. operand2_type::value_type* GTEST_CREF_WORKAROUND_ str, \
  6210. const operand2_type& /*operand2*/) {\
  6211. return operand1_printer(str);\
  6212. }\
  6213. inline String FormatForComparisonFailureMessage(\
  6214. const operand2_type::value_type* GTEST_CREF_WORKAROUND_ str, \
  6215. const operand2_type& /*operand2*/) {\
  6216. return operand1_printer(str);\
  6217. }
  6218. GTEST_FORMAT_IMPL_(::std::string, String::ShowCStringQuoted)
  6219. #if GTEST_HAS_STD_WSTRING
  6220. GTEST_FORMAT_IMPL_(::std::wstring, String::ShowWideCStringQuoted)
  6221. #endif // GTEST_HAS_STD_WSTRING
  6222. #if GTEST_HAS_GLOBAL_STRING
  6223. GTEST_FORMAT_IMPL_(::string, String::ShowCStringQuoted)
  6224. #endif // GTEST_HAS_GLOBAL_STRING
  6225. #if GTEST_HAS_GLOBAL_WSTRING
  6226. GTEST_FORMAT_IMPL_(::wstring, String::ShowWideCStringQuoted)
  6227. #endif // GTEST_HAS_GLOBAL_WSTRING
  6228. #undef GTEST_FORMAT_IMPL_
  6229. // The next four overloads handle the case where the operand being
  6230. // printed is a char/wchar_t pointer and the other operand is not a
  6231. // string/wstring object. In such cases, we just print the operand as
  6232. // a pointer to be safe.
  6233. #define GTEST_FORMAT_CHAR_PTR_IMPL_(CharType) \
  6234. template <typename T> \
  6235. String FormatForComparisonFailureMessage(CharType* GTEST_CREF_WORKAROUND_ p, \
  6236. const T&) { \
  6237. return PrintToString(static_cast<const void*>(p)); \
  6238. }
  6239. GTEST_FORMAT_CHAR_PTR_IMPL_(char)
  6240. GTEST_FORMAT_CHAR_PTR_IMPL_(const char)
  6241. GTEST_FORMAT_CHAR_PTR_IMPL_(wchar_t)
  6242. GTEST_FORMAT_CHAR_PTR_IMPL_(const wchar_t)
  6243. #undef GTEST_FORMAT_CHAR_PTR_IMPL_
  6244. // Constructs and returns the message for an equality assertion
  6245. // (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
  6246. //
  6247. // The first four parameters are the expressions used in the assertion
  6248. // and their values, as strings. For example, for ASSERT_EQ(foo, bar)
  6249. // where foo is 5 and bar is 6, we have:
  6250. //
  6251. // expected_expression: "foo"
  6252. // actual_expression: "bar"
  6253. // expected_value: "5"
  6254. // actual_value: "6"
  6255. //
  6256. // The ignoring_case parameter is true iff the assertion is a
  6257. // *_STRCASEEQ*. When it's true, the string " (ignoring case)" will
  6258. // be inserted into the message.
  6259. GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
  6260. const char* actual_expression,
  6261. const String& expected_value,
  6262. const String& actual_value,
  6263. bool ignoring_case);
  6264. // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
  6265. GTEST_API_ String GetBoolAssertionFailureMessage(
  6266. const AssertionResult& assertion_result,
  6267. const char* expression_text,
  6268. const char* actual_predicate_value,
  6269. const char* expected_predicate_value);
  6270. // This template class represents an IEEE floating-point number
  6271. // (either single-precision or double-precision, depending on the
  6272. // template parameters).
  6273. //
  6274. // The purpose of this class is to do more sophisticated number
  6275. // comparison. (Due to round-off error, etc, it's very unlikely that
  6276. // two floating-points will be equal exactly. Hence a naive
  6277. // comparison by the == operation often doesn't work.)
  6278. //
  6279. // Format of IEEE floating-point:
  6280. //
  6281. // The most-significant bit being the leftmost, an IEEE
  6282. // floating-point looks like
  6283. //
  6284. // sign_bit exponent_bits fraction_bits
  6285. //
  6286. // Here, sign_bit is a single bit that designates the sign of the
  6287. // number.
  6288. //
  6289. // For float, there are 8 exponent bits and 23 fraction bits.
  6290. //
  6291. // For double, there are 11 exponent bits and 52 fraction bits.
  6292. //
  6293. // More details can be found at
  6294. // http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
  6295. //
  6296. // Template parameter:
  6297. //
  6298. // RawType: the raw floating-point type (either float or double)
  6299. template <typename RawType>
  6300. class FloatingPoint {
  6301. public:
  6302. // Defines the unsigned integer type that has the same size as the
  6303. // floating point number.
  6304. typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
  6305. // Constants.
  6306. // # of bits in a number.
  6307. static const size_t kBitCount = 8*sizeof(RawType);
  6308. // # of fraction bits in a number.
  6309. static const size_t kFractionBitCount =
  6310. std::numeric_limits<RawType>::digits - 1;
  6311. // # of exponent bits in a number.
  6312. static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
  6313. // The mask for the sign bit.
  6314. static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
  6315. // The mask for the fraction bits.
  6316. static const Bits kFractionBitMask =
  6317. ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
  6318. // The mask for the exponent bits.
  6319. static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
  6320. // How many ULP's (Units in the Last Place) we want to tolerate when
  6321. // comparing two numbers. The larger the value, the more error we
  6322. // allow. A 0 value means that two numbers must be exactly the same
  6323. // to be considered equal.
  6324. //
  6325. // The maximum error of a single floating-point operation is 0.5
  6326. // units in the last place. On Intel CPU's, all floating-point
  6327. // calculations are done with 80-bit precision, while double has 64
  6328. // bits. Therefore, 4 should be enough for ordinary use.
  6329. //
  6330. // See the following article for more details on ULP:
  6331. // http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm.
  6332. static const size_t kMaxUlps = 4;
  6333. // Constructs a FloatingPoint from a raw floating-point number.
  6334. //
  6335. // On an Intel CPU, passing a non-normalized NAN (Not a Number)
  6336. // around may change its bits, although the new value is guaranteed
  6337. // to be also a NAN. Therefore, don't expect this constructor to
  6338. // preserve the bits in x when x is a NAN.
  6339. explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
  6340. // Static methods
  6341. // Reinterprets a bit pattern as a floating-point number.
  6342. //
  6343. // This function is needed to test the AlmostEquals() method.
  6344. static RawType ReinterpretBits(const Bits bits) {
  6345. FloatingPoint fp(0);
  6346. fp.u_.bits_ = bits;
  6347. return fp.u_.value_;
  6348. }
  6349. // Returns the floating-point number that represent positive infinity.
  6350. static RawType Infinity() {
  6351. return ReinterpretBits(kExponentBitMask);
  6352. }
  6353. // Non-static methods
  6354. // Returns the bits that represents this number.
  6355. const Bits &bits() const { return u_.bits_; }
  6356. // Returns the exponent bits of this number.
  6357. Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
  6358. // Returns the fraction bits of this number.
  6359. Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
  6360. // Returns the sign bit of this number.
  6361. Bits sign_bit() const { return kSignBitMask & u_.bits_; }
  6362. // Returns true iff this is NAN (not a number).
  6363. bool is_nan() const {
  6364. // It's a NAN if the exponent bits are all ones and the fraction
  6365. // bits are not entirely zeros.
  6366. return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
  6367. }
  6368. // Returns true iff this number is at most kMaxUlps ULP's away from
  6369. // rhs. In particular, this function:
  6370. //
  6371. // - returns false if either number is (or both are) NAN.
  6372. // - treats really large numbers as almost equal to infinity.
  6373. // - thinks +0.0 and -0.0 are 0 DLP's apart.
  6374. bool AlmostEquals(const FloatingPoint& rhs) const {
  6375. // The IEEE standard says that any comparison operation involving
  6376. // a NAN must return false.
  6377. if (is_nan() || rhs.is_nan()) return false;
  6378. return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
  6379. <= kMaxUlps;
  6380. }
  6381. private:
  6382. // The data type used to store the actual floating-point number.
  6383. union FloatingPointUnion {
  6384. RawType value_; // The raw floating-point number.
  6385. Bits bits_; // The bits that represent the number.
  6386. };
  6387. // Converts an integer from the sign-and-magnitude representation to
  6388. // the biased representation. More precisely, let N be 2 to the
  6389. // power of (kBitCount - 1), an integer x is represented by the
  6390. // unsigned number x + N.
  6391. //
  6392. // For instance,
  6393. //
  6394. // -N + 1 (the most negative number representable using
  6395. // sign-and-magnitude) is represented by 1;
  6396. // 0 is represented by N; and
  6397. // N - 1 (the biggest number representable using
  6398. // sign-and-magnitude) is represented by 2N - 1.
  6399. //
  6400. // Read http://en.wikipedia.org/wiki/Signed_number_representations
  6401. // for more details on signed number representations.
  6402. static Bits SignAndMagnitudeToBiased(const Bits &sam) {
  6403. if (kSignBitMask & sam) {
  6404. // sam represents a negative number.
  6405. return ~sam + 1;
  6406. } else {
  6407. // sam represents a positive number.
  6408. return kSignBitMask | sam;
  6409. }
  6410. }
  6411. // Given two numbers in the sign-and-magnitude representation,
  6412. // returns the distance between them as an unsigned number.
  6413. static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
  6414. const Bits &sam2) {
  6415. const Bits biased1 = SignAndMagnitudeToBiased(sam1);
  6416. const Bits biased2 = SignAndMagnitudeToBiased(sam2);
  6417. return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
  6418. }
  6419. FloatingPointUnion u_;
  6420. };
  6421. // Typedefs the instances of the FloatingPoint template class that we
  6422. // care to use.
  6423. typedef FloatingPoint<float> Float;
  6424. typedef FloatingPoint<double> Double;
  6425. // In order to catch the mistake of putting tests that use different
  6426. // test fixture classes in the same test case, we need to assign
  6427. // unique IDs to fixture classes and compare them. The TypeId type is
  6428. // used to hold such IDs. The user should treat TypeId as an opaque
  6429. // type: the only operation allowed on TypeId values is to compare
  6430. // them for equality using the == operator.
  6431. typedef const void* TypeId;
  6432. template <typename T>
  6433. class TypeIdHelper {
  6434. public:
  6435. // dummy_ must not have a const type. Otherwise an overly eager
  6436. // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
  6437. // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
  6438. static bool dummy_;
  6439. };
  6440. template <typename T>
  6441. bool TypeIdHelper<T>::dummy_ = false;
  6442. // GetTypeId<T>() returns the ID of type T. Different values will be
  6443. // returned for different types. Calling the function twice with the
  6444. // same type argument is guaranteed to return the same ID.
  6445. template <typename T>
  6446. TypeId GetTypeId() {
  6447. // The compiler is required to allocate a different
  6448. // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
  6449. // the template. Therefore, the address of dummy_ is guaranteed to
  6450. // be unique.
  6451. return &(TypeIdHelper<T>::dummy_);
  6452. }
  6453. // Returns the type ID of ::testing::Test. Always call this instead
  6454. // of GetTypeId< ::testing::Test>() to get the type ID of
  6455. // ::testing::Test, as the latter may give the wrong result due to a
  6456. // suspected linker bug when compiling Google Test as a Mac OS X
  6457. // framework.
  6458. GTEST_API_ TypeId GetTestTypeId();
  6459. // Defines the abstract factory interface that creates instances
  6460. // of a Test object.
  6461. class TestFactoryBase {
  6462. public:
  6463. virtual ~TestFactoryBase() {}
  6464. // Creates a test instance to run. The instance is both created and destroyed
  6465. // within TestInfoImpl::Run()
  6466. virtual Test* CreateTest() = 0;
  6467. protected:
  6468. TestFactoryBase() {}
  6469. private:
  6470. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
  6471. };
  6472. // This class provides implementation of TeastFactoryBase interface.
  6473. // It is used in TEST and TEST_F macros.
  6474. template <class TestClass>
  6475. class TestFactoryImpl : public TestFactoryBase {
  6476. public:
  6477. virtual Test* CreateTest() { return new TestClass; }
  6478. };
  6479. #if GTEST_OS_WINDOWS
  6480. // Predicate-formatters for implementing the HRESULT checking macros
  6481. // {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
  6482. // We pass a long instead of HRESULT to avoid causing an
  6483. // include dependency for the HRESULT type.
  6484. GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
  6485. long hr); // NOLINT
  6486. GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
  6487. long hr); // NOLINT
  6488. #endif // GTEST_OS_WINDOWS
  6489. // Types of SetUpTestCase() and TearDownTestCase() functions.
  6490. typedef void (*SetUpTestCaseFunc)();
  6491. typedef void (*TearDownTestCaseFunc)();
  6492. // Creates a new TestInfo object and registers it with Google Test;
  6493. // returns the created object.
  6494. //
  6495. // Arguments:
  6496. //
  6497. // test_case_name: name of the test case
  6498. // name: name of the test
  6499. // type_param the name of the test's type parameter, or NULL if
  6500. // this is not a typed or a type-parameterized test.
  6501. // value_param text representation of the test's value parameter,
  6502. // or NULL if this is not a type-parameterized test.
  6503. // fixture_class_id: ID of the test fixture class
  6504. // set_up_tc: pointer to the function that sets up the test case
  6505. // tear_down_tc: pointer to the function that tears down the test case
  6506. // factory: pointer to the factory that creates a test object.
  6507. // The newly created TestInfo instance will assume
  6508. // ownership of the factory object.
  6509. GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
  6510. const char* test_case_name, const char* name,
  6511. const char* type_param,
  6512. const char* value_param,
  6513. TypeId fixture_class_id,
  6514. SetUpTestCaseFunc set_up_tc,
  6515. TearDownTestCaseFunc tear_down_tc,
  6516. TestFactoryBase* factory);
  6517. // If *pstr starts with the given prefix, modifies *pstr to be right
  6518. // past the prefix and returns true; otherwise leaves *pstr unchanged
  6519. // and returns false. None of pstr, *pstr, and prefix can be NULL.
  6520. GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
  6521. #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  6522. // State of the definition of a type-parameterized test case.
  6523. class GTEST_API_ TypedTestCasePState {
  6524. public:
  6525. TypedTestCasePState() : registered_(false) {}
  6526. // Adds the given test name to defined_test_names_ and return true
  6527. // if the test case hasn't been registered; otherwise aborts the
  6528. // program.
  6529. bool AddTestName(const char* file, int line, const char* case_name,
  6530. const char* test_name) {
  6531. if (registered_) {
  6532. fprintf(stderr, "%s Test %s must be defined before "
  6533. "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
  6534. FormatFileLocation(file, line).c_str(), test_name, case_name);
  6535. fflush(stderr);
  6536. posix::Abort();
  6537. }
  6538. defined_test_names_.insert(test_name);
  6539. return true;
  6540. }
  6541. // Verifies that registered_tests match the test names in
  6542. // defined_test_names_; returns registered_tests if successful, or
  6543. // aborts the program otherwise.
  6544. const char* VerifyRegisteredTestNames(
  6545. const char* file, int line, const char* registered_tests);
  6546. private:
  6547. bool registered_;
  6548. ::std::set<const char*> defined_test_names_;
  6549. };
  6550. // Skips to the first non-space char after the first comma in 'str';
  6551. // returns NULL if no comma is found in 'str'.
  6552. inline const char* SkipComma(const char* str) {
  6553. const char* comma = strchr(str, ',');
  6554. if (comma == NULL) {
  6555. return NULL;
  6556. }
  6557. while (IsSpace(*(++comma))) {}
  6558. return comma;
  6559. }
  6560. // Returns the prefix of 'str' before the first comma in it; returns
  6561. // the entire string if it contains no comma.
  6562. inline String GetPrefixUntilComma(const char* str) {
  6563. const char* comma = strchr(str, ',');
  6564. return comma == NULL ? String(str) : String(str, comma - str);
  6565. }
  6566. // TypeParameterizedTest<Fixture, TestSel, Types>::Register()
  6567. // registers a list of type-parameterized tests with Google Test. The
  6568. // return value is insignificant - we just need to return something
  6569. // such that we can call this function in a namespace scope.
  6570. //
  6571. // Implementation note: The GTEST_TEMPLATE_ macro declares a template
  6572. // template parameter. It's defined in gtest-type-util.h.
  6573. template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
  6574. class TypeParameterizedTest {
  6575. public:
  6576. // 'index' is the index of the test in the type list 'Types'
  6577. // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
  6578. // Types). Valid values for 'index' are [0, N - 1] where N is the
  6579. // length of Types.
  6580. static bool Register(const char* prefix, const char* case_name,
  6581. const char* test_names, int index) {
  6582. typedef typename Types::Head Type;
  6583. typedef Fixture<Type> FixtureClass;
  6584. typedef typename GTEST_BIND_(TestSel, Type) TestClass;
  6585. // First, registers the first type-parameterized test in the type
  6586. // list.
  6587. MakeAndRegisterTestInfo(
  6588. String::Format("%s%s%s/%d", prefix, prefix[0] == '\0' ? "" : "/",
  6589. case_name, index).c_str(),
  6590. GetPrefixUntilComma(test_names).c_str(),
  6591. GetTypeName<Type>().c_str(),
  6592. NULL, // No value parameter.
  6593. GetTypeId<FixtureClass>(),
  6594. TestClass::SetUpTestCase,
  6595. TestClass::TearDownTestCase,
  6596. new TestFactoryImpl<TestClass>);
  6597. // Next, recurses (at compile time) with the tail of the type list.
  6598. return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
  6599. ::Register(prefix, case_name, test_names, index + 1);
  6600. }
  6601. };
  6602. // The base case for the compile time recursion.
  6603. template <GTEST_TEMPLATE_ Fixture, class TestSel>
  6604. class TypeParameterizedTest<Fixture, TestSel, Types0> {
  6605. public:
  6606. static bool Register(const char* /*prefix*/, const char* /*case_name*/,
  6607. const char* /*test_names*/, int /*index*/) {
  6608. return true;
  6609. }
  6610. };
  6611. // TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
  6612. // registers *all combinations* of 'Tests' and 'Types' with Google
  6613. // Test. The return value is insignificant - we just need to return
  6614. // something such that we can call this function in a namespace scope.
  6615. template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
  6616. class TypeParameterizedTestCase {
  6617. public:
  6618. static bool Register(const char* prefix, const char* case_name,
  6619. const char* test_names) {
  6620. typedef typename Tests::Head Head;
  6621. // First, register the first test in 'Test' for each type in 'Types'.
  6622. TypeParameterizedTest<Fixture, Head, Types>::Register(
  6623. prefix, case_name, test_names, 0);
  6624. // Next, recurses (at compile time) with the tail of the test list.
  6625. return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
  6626. ::Register(prefix, case_name, SkipComma(test_names));
  6627. }
  6628. };
  6629. // The base case for the compile time recursion.
  6630. template <GTEST_TEMPLATE_ Fixture, typename Types>
  6631. class TypeParameterizedTestCase<Fixture, Templates0, Types> {
  6632. public:
  6633. static bool Register(const char* /*prefix*/, const char* /*case_name*/,
  6634. const char* /*test_names*/) {
  6635. return true;
  6636. }
  6637. };
  6638. #endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  6639. // Returns the current OS stack trace as a String.
  6640. //
  6641. // The maximum number of stack frames to be included is specified by
  6642. // the gtest_stack_trace_depth flag. The skip_count parameter
  6643. // specifies the number of top frames to be skipped, which doesn't
  6644. // count against the number of frames to be included.
  6645. //
  6646. // For example, if Foo() calls Bar(), which in turn calls
  6647. // GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
  6648. // the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
  6649. GTEST_API_ String GetCurrentOsStackTraceExceptTop(UnitTest* unit_test,
  6650. int skip_count);
  6651. // Helpers for suppressing warnings on unreachable code or constant
  6652. // condition.
  6653. // Always returns true.
  6654. GTEST_API_ bool AlwaysTrue();
  6655. // Always returns false.
  6656. inline bool AlwaysFalse() { return !AlwaysTrue(); }
  6657. // Helper for suppressing false warning from Clang on a const char*
  6658. // variable declared in a conditional expression always being NULL in
  6659. // the else branch.
  6660. struct GTEST_API_ ConstCharPtr {
  6661. ConstCharPtr(const char* str) : value(str) {}
  6662. operator bool() const { return true; }
  6663. const char* value;
  6664. };
  6665. // A simple Linear Congruential Generator for generating random
  6666. // numbers with a uniform distribution. Unlike rand() and srand(), it
  6667. // doesn't use global state (and therefore can't interfere with user
  6668. // code). Unlike rand_r(), it's portable. An LCG isn't very random,
  6669. // but it's good enough for our purposes.
  6670. class GTEST_API_ Random {
  6671. public:
  6672. static const UInt32 kMaxRange = 1u << 31;
  6673. explicit Random(UInt32 seed) : state_(seed) {}
  6674. void Reseed(UInt32 seed) { state_ = seed; }
  6675. // Generates a random number from [0, range). Crashes if 'range' is
  6676. // 0 or greater than kMaxRange.
  6677. UInt32 Generate(UInt32 range);
  6678. private:
  6679. UInt32 state_;
  6680. GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
  6681. };
  6682. // Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
  6683. // compiler error iff T1 and T2 are different types.
  6684. template <typename T1, typename T2>
  6685. struct CompileAssertTypesEqual;
  6686. template <typename T>
  6687. struct CompileAssertTypesEqual<T, T> {
  6688. };
  6689. // Removes the reference from a type if it is a reference type,
  6690. // otherwise leaves it unchanged. This is the same as
  6691. // tr1::remove_reference, which is not widely available yet.
  6692. template <typename T>
  6693. struct RemoveReference { typedef T type; }; // NOLINT
  6694. template <typename T>
  6695. struct RemoveReference<T&> { typedef T type; }; // NOLINT
  6696. // A handy wrapper around RemoveReference that works when the argument
  6697. // T depends on template parameters.
  6698. #define GTEST_REMOVE_REFERENCE_(T) \
  6699. typename ::testing::internal::RemoveReference<T>::type
  6700. // Removes const from a type if it is a const type, otherwise leaves
  6701. // it unchanged. This is the same as tr1::remove_const, which is not
  6702. // widely available yet.
  6703. template <typename T>
  6704. struct RemoveConst { typedef T type; }; // NOLINT
  6705. template <typename T>
  6706. struct RemoveConst<const T> { typedef T type; }; // NOLINT
  6707. // MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
  6708. // definition to fail to remove the const in 'const int[3]' and 'const
  6709. // char[3][4]'. The following specialization works around the bug.
  6710. // However, it causes trouble with GCC and thus needs to be
  6711. // conditionally compiled.
  6712. #if defined(_MSC_VER) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
  6713. template <typename T, size_t N>
  6714. struct RemoveConst<const T[N]> {
  6715. typedef typename RemoveConst<T>::type type[N];
  6716. };
  6717. #endif
  6718. // A handy wrapper around RemoveConst that works when the argument
  6719. // T depends on template parameters.
  6720. #define GTEST_REMOVE_CONST_(T) \
  6721. typename ::testing::internal::RemoveConst<T>::type
  6722. // Turns const U&, U&, const U, and U all into U.
  6723. #define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
  6724. GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
  6725. // Adds reference to a type if it is not a reference type,
  6726. // otherwise leaves it unchanged. This is the same as
  6727. // tr1::add_reference, which is not widely available yet.
  6728. template <typename T>
  6729. struct AddReference { typedef T& type; }; // NOLINT
  6730. template <typename T>
  6731. struct AddReference<T&> { typedef T& type; }; // NOLINT
  6732. // A handy wrapper around AddReference that works when the argument T
  6733. // depends on template parameters.
  6734. #define GTEST_ADD_REFERENCE_(T) \
  6735. typename ::testing::internal::AddReference<T>::type
  6736. // Adds a reference to const on top of T as necessary. For example,
  6737. // it transforms
  6738. //
  6739. // char ==> const char&
  6740. // const char ==> const char&
  6741. // char& ==> const char&
  6742. // const char& ==> const char&
  6743. //
  6744. // The argument T must depend on some template parameters.
  6745. #define GTEST_REFERENCE_TO_CONST_(T) \
  6746. GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T))
  6747. // ImplicitlyConvertible<From, To>::value is a compile-time bool
  6748. // constant that's true iff type From can be implicitly converted to
  6749. // type To.
  6750. template <typename From, typename To>
  6751. class ImplicitlyConvertible {
  6752. private:
  6753. // We need the following helper functions only for their types.
  6754. // They have no implementations.
  6755. // MakeFrom() is an expression whose type is From. We cannot simply
  6756. // use From(), as the type From may not have a public default
  6757. // constructor.
  6758. static From MakeFrom();
  6759. // These two functions are overloaded. Given an expression
  6760. // Helper(x), the compiler will pick the first version if x can be
  6761. // implicitly converted to type To; otherwise it will pick the
  6762. // second version.
  6763. //
  6764. // The first version returns a value of size 1, and the second
  6765. // version returns a value of size 2. Therefore, by checking the
  6766. // size of Helper(x), which can be done at compile time, we can tell
  6767. // which version of Helper() is used, and hence whether x can be
  6768. // implicitly converted to type To.
  6769. static char Helper(To);
  6770. static char (&Helper(...))[2]; // NOLINT
  6771. // We have to put the 'public' section after the 'private' section,
  6772. // or MSVC refuses to compile the code.
  6773. public:
  6774. // MSVC warns about implicitly converting from double to int for
  6775. // possible loss of data, so we need to temporarily disable the
  6776. // warning.
  6777. #ifdef _MSC_VER
  6778. # pragma warning(push) // Saves the current warning state.
  6779. # pragma warning(disable:4244) // Temporarily disables warning 4244.
  6780. static const bool value =
  6781. sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
  6782. # pragma warning(pop) // Restores the warning state.
  6783. #elif defined(__BORLANDC__)
  6784. // C++Builder cannot use member overload resolution during template
  6785. // instantiation. The simplest workaround is to use its C++0x type traits
  6786. // functions (C++Builder 2009 and above only).
  6787. static const bool value = __is_convertible(From, To);
  6788. #else
  6789. static const bool value =
  6790. sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
  6791. #endif // _MSV_VER
  6792. };
  6793. template <typename From, typename To>
  6794. const bool ImplicitlyConvertible<From, To>::value;
  6795. // IsAProtocolMessage<T>::value is a compile-time bool constant that's
  6796. // true iff T is type ProtocolMessage, proto2::Message, or a subclass
  6797. // of those.
  6798. template <typename T>
  6799. struct IsAProtocolMessage
  6800. : public bool_constant<
  6801. ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
  6802. ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
  6803. };
  6804. // When the compiler sees expression IsContainerTest<C>(0), if C is an
  6805. // STL-style container class, the first overload of IsContainerTest
  6806. // will be viable (since both C::iterator* and C::const_iterator* are
  6807. // valid types and NULL can be implicitly converted to them). It will
  6808. // be picked over the second overload as 'int' is a perfect match for
  6809. // the type of argument 0. If C::iterator or C::const_iterator is not
  6810. // a valid type, the first overload is not viable, and the second
  6811. // overload will be picked. Therefore, we can determine whether C is
  6812. // a container class by checking the type of IsContainerTest<C>(0).
  6813. // The value of the expression is insignificant.
  6814. //
  6815. // Note that we look for both C::iterator and C::const_iterator. The
  6816. // reason is that C++ injects the name of a class as a member of the
  6817. // class itself (e.g. you can refer to class iterator as either
  6818. // 'iterator' or 'iterator::iterator'). If we look for C::iterator
  6819. // only, for example, we would mistakenly think that a class named
  6820. // iterator is an STL container.
  6821. //
  6822. // Also note that the simpler approach of overloading
  6823. // IsContainerTest(typename C::const_iterator*) and
  6824. // IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
  6825. typedef int IsContainer;
  6826. template <class C>
  6827. IsContainer IsContainerTest(int /* dummy */,
  6828. typename C::iterator* /* it */ = NULL,
  6829. typename C::const_iterator* /* const_it */ = NULL) {
  6830. return 0;
  6831. }
  6832. typedef char IsNotContainer;
  6833. template <class C>
  6834. IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
  6835. // EnableIf<condition>::type is void when 'Cond' is true, and
  6836. // undefined when 'Cond' is false. To use SFINAE to make a function
  6837. // overload only apply when a particular expression is true, add
  6838. // "typename EnableIf<expression>::type* = 0" as the last parameter.
  6839. template<bool> struct EnableIf;
  6840. template<> struct EnableIf<true> { typedef void type; }; // NOLINT
  6841. // Utilities for native arrays.
  6842. // ArrayEq() compares two k-dimensional native arrays using the
  6843. // elements' operator==, where k can be any integer >= 0. When k is
  6844. // 0, ArrayEq() degenerates into comparing a single pair of values.
  6845. template <typename T, typename U>
  6846. bool ArrayEq(const T* lhs, size_t size, const U* rhs);
  6847. // This generic version is used when k is 0.
  6848. template <typename T, typename U>
  6849. inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
  6850. // This overload is used when k >= 1.
  6851. template <typename T, typename U, size_t N>
  6852. inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
  6853. return internal::ArrayEq(lhs, N, rhs);
  6854. }
  6855. // This helper reduces code bloat. If we instead put its logic inside
  6856. // the previous ArrayEq() function, arrays with different sizes would
  6857. // lead to different copies of the template code.
  6858. template <typename T, typename U>
  6859. bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
  6860. for (size_t i = 0; i != size; i++) {
  6861. if (!internal::ArrayEq(lhs[i], rhs[i]))
  6862. return false;
  6863. }
  6864. return true;
  6865. }
  6866. // Finds the first element in the iterator range [begin, end) that
  6867. // equals elem. Element may be a native array type itself.
  6868. template <typename Iter, typename Element>
  6869. Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
  6870. for (Iter it = begin; it != end; ++it) {
  6871. if (internal::ArrayEq(*it, elem))
  6872. return it;
  6873. }
  6874. return end;
  6875. }
  6876. // CopyArray() copies a k-dimensional native array using the elements'
  6877. // operator=, where k can be any integer >= 0. When k is 0,
  6878. // CopyArray() degenerates into copying a single value.
  6879. template <typename T, typename U>
  6880. void CopyArray(const T* from, size_t size, U* to);
  6881. // This generic version is used when k is 0.
  6882. template <typename T, typename U>
  6883. inline void CopyArray(const T& from, U* to) { *to = from; }
  6884. // This overload is used when k >= 1.
  6885. template <typename T, typename U, size_t N>
  6886. inline void CopyArray(const T(&from)[N], U(*to)[N]) {
  6887. internal::CopyArray(from, N, *to);
  6888. }
  6889. // This helper reduces code bloat. If we instead put its logic inside
  6890. // the previous CopyArray() function, arrays with different sizes
  6891. // would lead to different copies of the template code.
  6892. template <typename T, typename U>
  6893. void CopyArray(const T* from, size_t size, U* to) {
  6894. for (size_t i = 0; i != size; i++) {
  6895. internal::CopyArray(from[i], to + i);
  6896. }
  6897. }
  6898. // The relation between an NativeArray object (see below) and the
  6899. // native array it represents.
  6900. enum RelationToSource {
  6901. kReference, // The NativeArray references the native array.
  6902. kCopy // The NativeArray makes a copy of the native array and
  6903. // owns the copy.
  6904. };
  6905. // Adapts a native array to a read-only STL-style container. Instead
  6906. // of the complete STL container concept, this adaptor only implements
  6907. // members useful for Google Mock's container matchers. New members
  6908. // should be added as needed. To simplify the implementation, we only
  6909. // support Element being a raw type (i.e. having no top-level const or
  6910. // reference modifier). It's the client's responsibility to satisfy
  6911. // this requirement. Element can be an array type itself (hence
  6912. // multi-dimensional arrays are supported).
  6913. template <typename Element>
  6914. class NativeArray {
  6915. public:
  6916. // STL-style container typedefs.
  6917. typedef Element value_type;
  6918. typedef Element* iterator;
  6919. typedef const Element* const_iterator;
  6920. // Constructs from a native array.
  6921. NativeArray(const Element* array, size_t count, RelationToSource relation) {
  6922. Init(array, count, relation);
  6923. }
  6924. // Copy constructor.
  6925. NativeArray(const NativeArray& rhs) {
  6926. Init(rhs.array_, rhs.size_, rhs.relation_to_source_);
  6927. }
  6928. ~NativeArray() {
  6929. // Ensures that the user doesn't instantiate NativeArray with a
  6930. // const or reference type.
  6931. static_cast<void>(StaticAssertTypeEqHelper<Element,
  6932. GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>());
  6933. if (relation_to_source_ == kCopy)
  6934. delete[] array_;
  6935. }
  6936. // STL-style container methods.
  6937. size_t size() const { return size_; }
  6938. const_iterator begin() const { return array_; }
  6939. const_iterator end() const { return array_ + size_; }
  6940. bool operator==(const NativeArray& rhs) const {
  6941. return size() == rhs.size() &&
  6942. ArrayEq(begin(), size(), rhs.begin());
  6943. }
  6944. private:
  6945. // Initializes this object; makes a copy of the input array if
  6946. // 'relation' is kCopy.
  6947. void Init(const Element* array, size_t a_size, RelationToSource relation) {
  6948. if (relation == kReference) {
  6949. array_ = array;
  6950. } else {
  6951. Element* const copy = new Element[a_size];
  6952. CopyArray(array, a_size, copy);
  6953. array_ = copy;
  6954. }
  6955. size_ = a_size;
  6956. relation_to_source_ = relation;
  6957. }
  6958. const Element* array_;
  6959. size_t size_;
  6960. RelationToSource relation_to_source_;
  6961. GTEST_DISALLOW_ASSIGN_(NativeArray);
  6962. };
  6963. } // namespace internal
  6964. } // namespace testing
  6965. #define GTEST_MESSAGE_AT_(file, line, message, result_type) \
  6966. ::testing::internal::AssertHelper(result_type, file, line, message) \
  6967. = ::testing::Message()
  6968. #define GTEST_MESSAGE_(message, result_type) \
  6969. GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
  6970. #define GTEST_FATAL_FAILURE_(message) \
  6971. return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
  6972. #define GTEST_NONFATAL_FAILURE_(message) \
  6973. GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
  6974. #define GTEST_SUCCESS_(message) \
  6975. GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
  6976. // Suppresses MSVC warnings 4072 (unreachable code) for the code following
  6977. // statement if it returns or throws (or doesn't return or throw in some
  6978. // situations).
  6979. #define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
  6980. if (::testing::internal::AlwaysTrue()) { statement; }
  6981. #define GTEST_TEST_THROW_(statement, expected_exception, fail) \
  6982. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  6983. if (::testing::internal::ConstCharPtr gtest_msg = "") { \
  6984. bool gtest_caught_expected = false; \
  6985. try { \
  6986. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  6987. } \
  6988. catch (expected_exception const&) { \
  6989. gtest_caught_expected = true; \
  6990. } \
  6991. catch (...) { \
  6992. gtest_msg.value = \
  6993. "Expected: " #statement " throws an exception of type " \
  6994. #expected_exception ".\n Actual: it throws a different type."; \
  6995. goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
  6996. } \
  6997. if (!gtest_caught_expected) { \
  6998. gtest_msg.value = \
  6999. "Expected: " #statement " throws an exception of type " \
  7000. #expected_exception ".\n Actual: it throws nothing."; \
  7001. goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
  7002. } \
  7003. } else \
  7004. GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
  7005. fail(gtest_msg.value)
  7006. #define GTEST_TEST_NO_THROW_(statement, fail) \
  7007. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7008. if (::testing::internal::AlwaysTrue()) { \
  7009. try { \
  7010. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7011. } \
  7012. catch (...) { \
  7013. goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
  7014. } \
  7015. } else \
  7016. GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
  7017. fail("Expected: " #statement " doesn't throw an exception.\n" \
  7018. " Actual: it throws.")
  7019. #define GTEST_TEST_ANY_THROW_(statement, fail) \
  7020. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7021. if (::testing::internal::AlwaysTrue()) { \
  7022. bool gtest_caught_any = false; \
  7023. try { \
  7024. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7025. } \
  7026. catch (...) { \
  7027. gtest_caught_any = true; \
  7028. } \
  7029. if (!gtest_caught_any) { \
  7030. goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
  7031. } \
  7032. } else \
  7033. GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
  7034. fail("Expected: " #statement " throws an exception.\n" \
  7035. " Actual: it doesn't.")
  7036. // Implements Boolean test assertions such as EXPECT_TRUE. expression can be
  7037. // either a boolean expression or an AssertionResult. text is a textual
  7038. // represenation of expression as it was passed into the EXPECT_TRUE.
  7039. #define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
  7040. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7041. if (const ::testing::AssertionResult gtest_ar_ = \
  7042. ::testing::AssertionResult(expression)) \
  7043. ; \
  7044. else \
  7045. fail(::testing::internal::GetBoolAssertionFailureMessage(\
  7046. gtest_ar_, text, #actual, #expected).c_str())
  7047. #define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
  7048. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7049. if (::testing::internal::AlwaysTrue()) { \
  7050. ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
  7051. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7052. if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
  7053. goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
  7054. } \
  7055. } else \
  7056. GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
  7057. fail("Expected: " #statement " doesn't generate new fatal " \
  7058. "failures in the current thread.\n" \
  7059. " Actual: it does.")
  7060. // Expands to the name of the class that implements the given test.
  7061. #define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
  7062. test_case_name##_##test_name##_Test
  7063. // Helper macro for defining tests.
  7064. #define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
  7065. class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
  7066. public:\
  7067. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
  7068. private:\
  7069. virtual void TestBody();\
  7070. static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
  7071. GTEST_DISALLOW_COPY_AND_ASSIGN_(\
  7072. GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
  7073. };\
  7074. \
  7075. ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
  7076. ::test_info_ =\
  7077. ::testing::internal::MakeAndRegisterTestInfo(\
  7078. #test_case_name, #test_name, NULL, NULL, \
  7079. (parent_id), \
  7080. parent_class::SetUpTestCase, \
  7081. parent_class::TearDownTestCase, \
  7082. new ::testing::internal::TestFactoryImpl<\
  7083. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
  7084. void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
  7085. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
  7086. // Copyright 2005, Google Inc.
  7087. // All rights reserved.
  7088. //
  7089. // Redistribution and use in source and binary forms, with or without
  7090. // modification, are permitted provided that the following conditions are
  7091. // met:
  7092. //
  7093. // * Redistributions of source code must retain the above copyright
  7094. // notice, this list of conditions and the following disclaimer.
  7095. // * Redistributions in binary form must reproduce the above
  7096. // copyright notice, this list of conditions and the following disclaimer
  7097. // in the documentation and/or other materials provided with the
  7098. // distribution.
  7099. // * Neither the name of Google Inc. nor the names of its
  7100. // contributors may be used to endorse or promote products derived from
  7101. // this software without specific prior written permission.
  7102. //
  7103. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  7104. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  7105. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  7106. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7107. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  7108. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  7109. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  7110. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  7111. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  7112. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  7113. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  7114. //
  7115. // Author: [email protected] (Zhanyong Wan)
  7116. //
  7117. // The Google C++ Testing Framework (Google Test)
  7118. //
  7119. // This header file defines the public API for death tests. It is
  7120. // #included by gtest.h so a user doesn't need to include this
  7121. // directly.
  7122. #ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
  7123. #define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
  7124. // Copyright 2005, Google Inc.
  7125. // All rights reserved.
  7126. //
  7127. // Redistribution and use in source and binary forms, with or without
  7128. // modification, are permitted provided that the following conditions are
  7129. // met:
  7130. //
  7131. // * Redistributions of source code must retain the above copyright
  7132. // notice, this list of conditions and the following disclaimer.
  7133. // * Redistributions in binary form must reproduce the above
  7134. // copyright notice, this list of conditions and the following disclaimer
  7135. // in the documentation and/or other materials provided with the
  7136. // distribution.
  7137. // * Neither the name of Google Inc. nor the names of its
  7138. // contributors may be used to endorse or promote products derived from
  7139. // this software without specific prior written permission.
  7140. //
  7141. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  7142. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  7143. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  7144. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7145. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  7146. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  7147. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  7148. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  7149. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  7150. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  7151. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  7152. //
  7153. // Authors: [email protected] (Zhanyong Wan), [email protected] (Sean Mcafee)
  7154. //
  7155. // The Google C++ Testing Framework (Google Test)
  7156. //
  7157. // This header file defines internal utilities needed for implementing
  7158. // death tests. They are subject to change without notice.
  7159. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
  7160. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
  7161. #include <stdio.h>
  7162. namespace testing {
  7163. namespace internal {
  7164. GTEST_DECLARE_string_(internal_run_death_test);
  7165. // Names of the flags (needed for parsing Google Test flags).
  7166. const char kDeathTestStyleFlag[] = "death_test_style";
  7167. const char kDeathTestUseFork[] = "death_test_use_fork";
  7168. const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
  7169. #if GTEST_HAS_DEATH_TEST
  7170. // DeathTest is a class that hides much of the complexity of the
  7171. // GTEST_DEATH_TEST_ macro. It is abstract; its static Create method
  7172. // returns a concrete class that depends on the prevailing death test
  7173. // style, as defined by the --gtest_death_test_style and/or
  7174. // --gtest_internal_run_death_test flags.
  7175. // In describing the results of death tests, these terms are used with
  7176. // the corresponding definitions:
  7177. //
  7178. // exit status: The integer exit information in the format specified
  7179. // by wait(2)
  7180. // exit code: The integer code passed to exit(3), _exit(2), or
  7181. // returned from main()
  7182. class GTEST_API_ DeathTest {
  7183. public:
  7184. // Create returns false if there was an error determining the
  7185. // appropriate action to take for the current death test; for example,
  7186. // if the gtest_death_test_style flag is set to an invalid value.
  7187. // The LastMessage method will return a more detailed message in that
  7188. // case. Otherwise, the DeathTest pointer pointed to by the "test"
  7189. // argument is set. If the death test should be skipped, the pointer
  7190. // is set to NULL; otherwise, it is set to the address of a new concrete
  7191. // DeathTest object that controls the execution of the current test.
  7192. static bool Create(const char* statement, const RE* regex,
  7193. const char* file, int line, DeathTest** test);
  7194. DeathTest();
  7195. virtual ~DeathTest() { }
  7196. // A helper class that aborts a death test when it's deleted.
  7197. class ReturnSentinel {
  7198. public:
  7199. explicit ReturnSentinel(DeathTest* test) : test_(test) { }
  7200. ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
  7201. private:
  7202. DeathTest* const test_;
  7203. GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
  7204. } GTEST_ATTRIBUTE_UNUSED_;
  7205. // An enumeration of possible roles that may be taken when a death
  7206. // test is encountered. EXECUTE means that the death test logic should
  7207. // be executed immediately. OVERSEE means that the program should prepare
  7208. // the appropriate environment for a child process to execute the death
  7209. // test, then wait for it to complete.
  7210. enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
  7211. // An enumeration of the three reasons that a test might be aborted.
  7212. enum AbortReason {
  7213. TEST_ENCOUNTERED_RETURN_STATEMENT,
  7214. TEST_THREW_EXCEPTION,
  7215. TEST_DID_NOT_DIE
  7216. };
  7217. // Assumes one of the above roles.
  7218. virtual TestRole AssumeRole() = 0;
  7219. // Waits for the death test to finish and returns its status.
  7220. virtual int Wait() = 0;
  7221. // Returns true if the death test passed; that is, the test process
  7222. // exited during the test, its exit status matches a user-supplied
  7223. // predicate, and its stderr output matches a user-supplied regular
  7224. // expression.
  7225. // The user-supplied predicate may be a macro expression rather
  7226. // than a function pointer or functor, or else Wait and Passed could
  7227. // be combined.
  7228. virtual bool Passed(bool exit_status_ok) = 0;
  7229. // Signals that the death test did not die as expected.
  7230. virtual void Abort(AbortReason reason) = 0;
  7231. // Returns a human-readable outcome message regarding the outcome of
  7232. // the last death test.
  7233. static const char* LastMessage();
  7234. static void set_last_death_test_message(const String& message);
  7235. private:
  7236. // A string containing a description of the outcome of the last death test.
  7237. static String last_death_test_message_;
  7238. GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
  7239. };
  7240. // Factory interface for death tests. May be mocked out for testing.
  7241. class DeathTestFactory {
  7242. public:
  7243. virtual ~DeathTestFactory() { }
  7244. virtual bool Create(const char* statement, const RE* regex,
  7245. const char* file, int line, DeathTest** test) = 0;
  7246. };
  7247. // A concrete DeathTestFactory implementation for normal use.
  7248. class DefaultDeathTestFactory : public DeathTestFactory {
  7249. public:
  7250. virtual bool Create(const char* statement, const RE* regex,
  7251. const char* file, int line, DeathTest** test);
  7252. };
  7253. // Returns true if exit_status describes a process that was terminated
  7254. // by a signal, or exited normally with a nonzero exit code.
  7255. GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
  7256. // Traps C++ exceptions escaping statement and reports them as test
  7257. // failures. Note that trapping SEH exceptions is not implemented here.
  7258. # if GTEST_HAS_EXCEPTIONS
  7259. # define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
  7260. try { \
  7261. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7262. } catch (const ::std::exception& gtest_exception) { \
  7263. fprintf(\
  7264. stderr, \
  7265. "\n%s: Caught std::exception-derived exception escaping the " \
  7266. "death test statement. Exception message: %s\n", \
  7267. ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
  7268. gtest_exception.what()); \
  7269. fflush(stderr); \
  7270. death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
  7271. } catch (...) { \
  7272. death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
  7273. }
  7274. # else
  7275. # define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
  7276. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
  7277. # endif
  7278. // This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
  7279. // ASSERT_EXIT*, and EXPECT_EXIT*.
  7280. # define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
  7281. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7282. if (::testing::internal::AlwaysTrue()) { \
  7283. const ::testing::internal::RE& gtest_regex = (regex); \
  7284. ::testing::internal::DeathTest* gtest_dt; \
  7285. if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \
  7286. __FILE__, __LINE__, &gtest_dt)) { \
  7287. goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
  7288. } \
  7289. if (gtest_dt != NULL) { \
  7290. ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
  7291. gtest_dt_ptr(gtest_dt); \
  7292. switch (gtest_dt->AssumeRole()) { \
  7293. case ::testing::internal::DeathTest::OVERSEE_TEST: \
  7294. if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
  7295. goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
  7296. } \
  7297. break; \
  7298. case ::testing::internal::DeathTest::EXECUTE_TEST: { \
  7299. ::testing::internal::DeathTest::ReturnSentinel \
  7300. gtest_sentinel(gtest_dt); \
  7301. GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
  7302. gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
  7303. break; \
  7304. } \
  7305. default: \
  7306. break; \
  7307. } \
  7308. } \
  7309. } else \
  7310. GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
  7311. fail(::testing::internal::DeathTest::LastMessage())
  7312. // The symbol "fail" here expands to something into which a message
  7313. // can be streamed.
  7314. // A class representing the parsed contents of the
  7315. // --gtest_internal_run_death_test flag, as it existed when
  7316. // RUN_ALL_TESTS was called.
  7317. class InternalRunDeathTestFlag {
  7318. public:
  7319. InternalRunDeathTestFlag(const String& a_file,
  7320. int a_line,
  7321. int an_index,
  7322. int a_write_fd)
  7323. : file_(a_file), line_(a_line), index_(an_index),
  7324. write_fd_(a_write_fd) {}
  7325. ~InternalRunDeathTestFlag() {
  7326. if (write_fd_ >= 0)
  7327. posix::Close(write_fd_);
  7328. }
  7329. String file() const { return file_; }
  7330. int line() const { return line_; }
  7331. int index() const { return index_; }
  7332. int write_fd() const { return write_fd_; }
  7333. private:
  7334. String file_;
  7335. int line_;
  7336. int index_;
  7337. int write_fd_;
  7338. GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
  7339. };
  7340. // Returns a newly created InternalRunDeathTestFlag object with fields
  7341. // initialized from the GTEST_FLAG(internal_run_death_test) flag if
  7342. // the flag is specified; otherwise returns NULL.
  7343. InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
  7344. #else // GTEST_HAS_DEATH_TEST
  7345. // This macro is used for implementing macros such as
  7346. // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
  7347. // death tests are not supported. Those macros must compile on such systems
  7348. // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
  7349. // systems that support death tests. This allows one to write such a macro
  7350. // on a system that does not support death tests and be sure that it will
  7351. // compile on a death-test supporting system.
  7352. //
  7353. // Parameters:
  7354. // statement - A statement that a macro such as EXPECT_DEATH would test
  7355. // for program termination. This macro has to make sure this
  7356. // statement is compiled but not executed, to ensure that
  7357. // EXPECT_DEATH_IF_SUPPORTED compiles with a certain
  7358. // parameter iff EXPECT_DEATH compiles with it.
  7359. // regex - A regex that a macro such as EXPECT_DEATH would use to test
  7360. // the output of statement. This parameter has to be
  7361. // compiled but not evaluated by this macro, to ensure that
  7362. // this macro only accepts expressions that a macro such as
  7363. // EXPECT_DEATH would accept.
  7364. // terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
  7365. // and a return statement for ASSERT_DEATH_IF_SUPPORTED.
  7366. // This ensures that ASSERT_DEATH_IF_SUPPORTED will not
  7367. // compile inside functions where ASSERT_DEATH doesn't
  7368. // compile.
  7369. //
  7370. // The branch that has an always false condition is used to ensure that
  7371. // statement and regex are compiled (and thus syntactically correct) but
  7372. // never executed. The unreachable code macro protects the terminator
  7373. // statement from generating an 'unreachable code' warning in case
  7374. // statement unconditionally returns or throws. The Message constructor at
  7375. // the end allows the syntax of streaming additional messages into the
  7376. // macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
  7377. # define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \
  7378. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7379. if (::testing::internal::AlwaysTrue()) { \
  7380. GTEST_LOG_(WARNING) \
  7381. << "Death tests are not supported on this platform.\n" \
  7382. << "Statement '" #statement "' cannot be verified."; \
  7383. } else if (::testing::internal::AlwaysFalse()) { \
  7384. ::testing::internal::RE::PartialMatch(".*", (regex)); \
  7385. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7386. terminator; \
  7387. } else \
  7388. ::testing::Message()
  7389. #endif // GTEST_HAS_DEATH_TEST
  7390. } // namespace internal
  7391. } // namespace testing
  7392. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
  7393. namespace testing {
  7394. // This flag controls the style of death tests. Valid values are "threadsafe",
  7395. // meaning that the death test child process will re-execute the test binary
  7396. // from the start, running only a single death test, or "fast",
  7397. // meaning that the child process will execute the test logic immediately
  7398. // after forking.
  7399. GTEST_DECLARE_string_(death_test_style);
  7400. #if GTEST_HAS_DEATH_TEST
  7401. // The following macros are useful for writing death tests.
  7402. // Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
  7403. // executed:
  7404. //
  7405. // 1. It generates a warning if there is more than one active
  7406. // thread. This is because it's safe to fork() or clone() only
  7407. // when there is a single thread.
  7408. //
  7409. // 2. The parent process clone()s a sub-process and runs the death
  7410. // test in it; the sub-process exits with code 0 at the end of the
  7411. // death test, if it hasn't exited already.
  7412. //
  7413. // 3. The parent process waits for the sub-process to terminate.
  7414. //
  7415. // 4. The parent process checks the exit code and error message of
  7416. // the sub-process.
  7417. //
  7418. // Examples:
  7419. //
  7420. // ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
  7421. // for (int i = 0; i < 5; i++) {
  7422. // EXPECT_DEATH(server.ProcessRequest(i),
  7423. // "Invalid request .* in ProcessRequest()")
  7424. // << "Failed to die on request " << i);
  7425. // }
  7426. //
  7427. // ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
  7428. //
  7429. // bool KilledBySIGHUP(int exit_code) {
  7430. // return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
  7431. // }
  7432. //
  7433. // ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
  7434. //
  7435. // On the regular expressions used in death tests:
  7436. //
  7437. // On POSIX-compliant systems (*nix), we use the <regex.h> library,
  7438. // which uses the POSIX extended regex syntax.
  7439. //
  7440. // On other platforms (e.g. Windows), we only support a simple regex
  7441. // syntax implemented as part of Google Test. This limited
  7442. // implementation should be enough most of the time when writing
  7443. // death tests; though it lacks many features you can find in PCRE
  7444. // or POSIX extended regex syntax. For example, we don't support
  7445. // union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
  7446. // repetition count ("x{5,7}"), among others.
  7447. //
  7448. // Below is the syntax that we do support. We chose it to be a
  7449. // subset of both PCRE and POSIX extended regex, so it's easy to
  7450. // learn wherever you come from. In the following: 'A' denotes a
  7451. // literal character, period (.), or a single \\ escape sequence;
  7452. // 'x' and 'y' denote regular expressions; 'm' and 'n' are for
  7453. // natural numbers.
  7454. //
  7455. // c matches any literal character c
  7456. // \\d matches any decimal digit
  7457. // \\D matches any character that's not a decimal digit
  7458. // \\f matches \f
  7459. // \\n matches \n
  7460. // \\r matches \r
  7461. // \\s matches any ASCII whitespace, including \n
  7462. // \\S matches any character that's not a whitespace
  7463. // \\t matches \t
  7464. // \\v matches \v
  7465. // \\w matches any letter, _, or decimal digit
  7466. // \\W matches any character that \\w doesn't match
  7467. // \\c matches any literal character c, which must be a punctuation
  7468. // . matches any single character except \n
  7469. // A? matches 0 or 1 occurrences of A
  7470. // A* matches 0 or many occurrences of A
  7471. // A+ matches 1 or many occurrences of A
  7472. // ^ matches the beginning of a string (not that of each line)
  7473. // $ matches the end of a string (not that of each line)
  7474. // xy matches x followed by y
  7475. //
  7476. // If you accidentally use PCRE or POSIX extended regex features
  7477. // not implemented by us, you will get a run-time failure. In that
  7478. // case, please try to rewrite your regular expression within the
  7479. // above syntax.
  7480. //
  7481. // This implementation is *not* meant to be as highly tuned or robust
  7482. // as a compiled regex library, but should perform well enough for a
  7483. // death test, which already incurs significant overhead by launching
  7484. // a child process.
  7485. //
  7486. // Known caveats:
  7487. //
  7488. // A "threadsafe" style death test obtains the path to the test
  7489. // program from argv[0] and re-executes it in the sub-process. For
  7490. // simplicity, the current implementation doesn't search the PATH
  7491. // when launching the sub-process. This means that the user must
  7492. // invoke the test program via a path that contains at least one
  7493. // path separator (e.g. path/to/foo_test and
  7494. // /absolute/path/to/bar_test are fine, but foo_test is not). This
  7495. // is rarely a problem as people usually don't put the test binary
  7496. // directory in PATH.
  7497. //
  7498. // TODO([email protected]): make thread-safe death tests search the PATH.
  7499. // Asserts that a given statement causes the program to exit, with an
  7500. // integer exit status that satisfies predicate, and emitting error output
  7501. // that matches regex.
  7502. # define ASSERT_EXIT(statement, predicate, regex) \
  7503. GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
  7504. // Like ASSERT_EXIT, but continues on to successive tests in the
  7505. // test case, if any:
  7506. # define EXPECT_EXIT(statement, predicate, regex) \
  7507. GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
  7508. // Asserts that a given statement causes the program to exit, either by
  7509. // explicitly exiting with a nonzero exit code or being killed by a
  7510. // signal, and emitting error output that matches regex.
  7511. # define ASSERT_DEATH(statement, regex) \
  7512. ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
  7513. // Like ASSERT_DEATH, but continues on to successive tests in the
  7514. // test case, if any:
  7515. # define EXPECT_DEATH(statement, regex) \
  7516. EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
  7517. // Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
  7518. // Tests that an exit code describes a normal exit with a given exit code.
  7519. class GTEST_API_ ExitedWithCode {
  7520. public:
  7521. explicit ExitedWithCode(int exit_code);
  7522. bool operator()(int exit_status) const;
  7523. private:
  7524. // No implementation - assignment is unsupported.
  7525. void operator=(const ExitedWithCode& other);
  7526. const int exit_code_;
  7527. };
  7528. # if !GTEST_OS_WINDOWS
  7529. // Tests that an exit code describes an exit due to termination by a
  7530. // given signal.
  7531. class GTEST_API_ KilledBySignal {
  7532. public:
  7533. explicit KilledBySignal(int signum);
  7534. bool operator()(int exit_status) const;
  7535. private:
  7536. const int signum_;
  7537. };
  7538. # endif // !GTEST_OS_WINDOWS
  7539. // EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
  7540. // The death testing framework causes this to have interesting semantics,
  7541. // since the sideeffects of the call are only visible in opt mode, and not
  7542. // in debug mode.
  7543. //
  7544. // In practice, this can be used to test functions that utilize the
  7545. // LOG(DFATAL) macro using the following style:
  7546. //
  7547. // int DieInDebugOr12(int* sideeffect) {
  7548. // if (sideeffect) {
  7549. // *sideeffect = 12;
  7550. // }
  7551. // LOG(DFATAL) << "death";
  7552. // return 12;
  7553. // }
  7554. //
  7555. // TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
  7556. // int sideeffect = 0;
  7557. // // Only asserts in dbg.
  7558. // EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
  7559. //
  7560. // #ifdef NDEBUG
  7561. // // opt-mode has sideeffect visible.
  7562. // EXPECT_EQ(12, sideeffect);
  7563. // #else
  7564. // // dbg-mode no visible sideeffect.
  7565. // EXPECT_EQ(0, sideeffect);
  7566. // #endif
  7567. // }
  7568. //
  7569. // This will assert that DieInDebugReturn12InOpt() crashes in debug
  7570. // mode, usually due to a DCHECK or LOG(DFATAL), but returns the
  7571. // appropriate fallback value (12 in this case) in opt mode. If you
  7572. // need to test that a function has appropriate side-effects in opt
  7573. // mode, include assertions against the side-effects. A general
  7574. // pattern for this is:
  7575. //
  7576. // EXPECT_DEBUG_DEATH({
  7577. // // Side-effects here will have an effect after this statement in
  7578. // // opt mode, but none in debug mode.
  7579. // EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
  7580. // }, "death");
  7581. //
  7582. # ifdef NDEBUG
  7583. # define EXPECT_DEBUG_DEATH(statement, regex) \
  7584. do { statement; } while (::testing::internal::AlwaysFalse())
  7585. # define ASSERT_DEBUG_DEATH(statement, regex) \
  7586. do { statement; } while (::testing::internal::AlwaysFalse())
  7587. # else
  7588. # define EXPECT_DEBUG_DEATH(statement, regex) \
  7589. EXPECT_DEATH(statement, regex)
  7590. # define ASSERT_DEBUG_DEATH(statement, regex) \
  7591. ASSERT_DEATH(statement, regex)
  7592. # endif // NDEBUG for EXPECT_DEBUG_DEATH
  7593. #endif // GTEST_HAS_DEATH_TEST
  7594. // EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
  7595. // ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
  7596. // death tests are supported; otherwise they just issue a warning. This is
  7597. // useful when you are combining death test assertions with normal test
  7598. // assertions in one test.
  7599. #if GTEST_HAS_DEATH_TEST
  7600. # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
  7601. EXPECT_DEATH(statement, regex)
  7602. # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
  7603. ASSERT_DEATH(statement, regex)
  7604. #else
  7605. # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
  7606. GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
  7607. # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
  7608. GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)
  7609. #endif
  7610. } // namespace testing
  7611. #endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
  7612. // Copyright 2005, Google Inc.
  7613. // All rights reserved.
  7614. //
  7615. // Redistribution and use in source and binary forms, with or without
  7616. // modification, are permitted provided that the following conditions are
  7617. // met:
  7618. //
  7619. // * Redistributions of source code must retain the above copyright
  7620. // notice, this list of conditions and the following disclaimer.
  7621. // * Redistributions in binary form must reproduce the above
  7622. // copyright notice, this list of conditions and the following disclaimer
  7623. // in the documentation and/or other materials provided with the
  7624. // distribution.
  7625. // * Neither the name of Google Inc. nor the names of its
  7626. // contributors may be used to endorse or promote products derived from
  7627. // this software without specific prior written permission.
  7628. //
  7629. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  7630. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  7631. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  7632. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7633. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  7634. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  7635. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  7636. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  7637. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  7638. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  7639. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  7640. //
  7641. // Author: [email protected] (Zhanyong Wan)
  7642. //
  7643. // The Google C++ Testing Framework (Google Test)
  7644. //
  7645. // This header file defines the Message class.
  7646. //
  7647. // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
  7648. // leave some internal implementation details in this header file.
  7649. // They are clearly marked by comments like this:
  7650. //
  7651. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  7652. //
  7653. // Such code is NOT meant to be used by a user directly, and is subject
  7654. // to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
  7655. // program!
  7656. #ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
  7657. #define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
  7658. #include <limits>
  7659. namespace testing {
  7660. // The Message class works like an ostream repeater.
  7661. //
  7662. // Typical usage:
  7663. //
  7664. // 1. You stream a bunch of values to a Message object.
  7665. // It will remember the text in a stringstream.
  7666. // 2. Then you stream the Message object to an ostream.
  7667. // This causes the text in the Message to be streamed
  7668. // to the ostream.
  7669. //
  7670. // For example;
  7671. //
  7672. // testing::Message foo;
  7673. // foo << 1 << " != " << 2;
  7674. // std::cout << foo;
  7675. //
  7676. // will print "1 != 2".
  7677. //
  7678. // Message is not intended to be inherited from. In particular, its
  7679. // destructor is not virtual.
  7680. //
  7681. // Note that stringstream behaves differently in gcc and in MSVC. You
  7682. // can stream a NULL char pointer to it in the former, but not in the
  7683. // latter (it causes an access violation if you do). The Message
  7684. // class hides this difference by treating a NULL char pointer as
  7685. // "(null)".
  7686. class GTEST_API_ Message {
  7687. private:
  7688. // The type of basic IO manipulators (endl, ends, and flush) for
  7689. // narrow streams.
  7690. typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
  7691. public:
  7692. // Constructs an empty Message.
  7693. // We allocate the stringstream separately because otherwise each use of
  7694. // ASSERT/EXPECT in a procedure adds over 200 bytes to the procedure's
  7695. // stack frame leading to huge stack frames in some cases; gcc does not reuse
  7696. // the stack space.
  7697. Message() : ss_(new ::std::stringstream) {
  7698. // By default, we want there to be enough precision when printing
  7699. // a double to a Message.
  7700. *ss_ << std::setprecision(std::numeric_limits<double>::digits10 + 2);
  7701. }
  7702. // Copy constructor.
  7703. Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT
  7704. *ss_ << msg.GetString();
  7705. }
  7706. // Constructs a Message from a C-string.
  7707. explicit Message(const char* str) : ss_(new ::std::stringstream) {
  7708. *ss_ << str;
  7709. }
  7710. #if GTEST_OS_SYMBIAN
  7711. // Streams a value (either a pointer or not) to this object.
  7712. template <typename T>
  7713. inline Message& operator <<(const T& value) {
  7714. StreamHelper(typename internal::is_pointer<T>::type(), value);
  7715. return *this;
  7716. }
  7717. #else
  7718. // Streams a non-pointer value to this object.
  7719. template <typename T>
  7720. inline Message& operator <<(const T& val) {
  7721. ::GTestStreamToHelper(ss_.get(), val);
  7722. return *this;
  7723. }
  7724. // Streams a pointer value to this object.
  7725. //
  7726. // This function is an overload of the previous one. When you
  7727. // stream a pointer to a Message, this definition will be used as it
  7728. // is more specialized. (The C++ Standard, section
  7729. // [temp.func.order].) If you stream a non-pointer, then the
  7730. // previous definition will be used.
  7731. //
  7732. // The reason for this overload is that streaming a NULL pointer to
  7733. // ostream is undefined behavior. Depending on the compiler, you
  7734. // may get "0", "(nil)", "(null)", or an access violation. To
  7735. // ensure consistent result across compilers, we always treat NULL
  7736. // as "(null)".
  7737. template <typename T>
  7738. inline Message& operator <<(T* const& pointer) { // NOLINT
  7739. if (pointer == NULL) {
  7740. *ss_ << "(null)";
  7741. } else {
  7742. ::GTestStreamToHelper(ss_.get(), pointer);
  7743. }
  7744. return *this;
  7745. }
  7746. #endif // GTEST_OS_SYMBIAN
  7747. // Since the basic IO manipulators are overloaded for both narrow
  7748. // and wide streams, we have to provide this specialized definition
  7749. // of operator <<, even though its body is the same as the
  7750. // templatized version above. Without this definition, streaming
  7751. // endl or other basic IO manipulators to Message will confuse the
  7752. // compiler.
  7753. Message& operator <<(BasicNarrowIoManip val) {
  7754. *ss_ << val;
  7755. return *this;
  7756. }
  7757. // Instead of 1/0, we want to see true/false for bool values.
  7758. Message& operator <<(bool b) {
  7759. return *this << (b ? "true" : "false");
  7760. }
  7761. // These two overloads allow streaming a wide C string to a Message
  7762. // using the UTF-8 encoding.
  7763. Message& operator <<(const wchar_t* wide_c_str) {
  7764. return *this << internal::String::ShowWideCString(wide_c_str);
  7765. }
  7766. Message& operator <<(wchar_t* wide_c_str) {
  7767. return *this << internal::String::ShowWideCString(wide_c_str);
  7768. }
  7769. #if GTEST_HAS_STD_WSTRING
  7770. // Converts the given wide string to a narrow string using the UTF-8
  7771. // encoding, and streams the result to this Message object.
  7772. Message& operator <<(const ::std::wstring& wstr);
  7773. #endif // GTEST_HAS_STD_WSTRING
  7774. #if GTEST_HAS_GLOBAL_WSTRING
  7775. // Converts the given wide string to a narrow string using the UTF-8
  7776. // encoding, and streams the result to this Message object.
  7777. Message& operator <<(const ::wstring& wstr);
  7778. #endif // GTEST_HAS_GLOBAL_WSTRING
  7779. // Gets the text streamed to this object so far as a String.
  7780. // Each '\0' character in the buffer is replaced with "\\0".
  7781. //
  7782. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  7783. internal::String GetString() const {
  7784. return internal::StringStreamToString(ss_.get());
  7785. }
  7786. private:
  7787. #if GTEST_OS_SYMBIAN
  7788. // These are needed as the Nokia Symbian Compiler cannot decide between
  7789. // const T& and const T* in a function template. The Nokia compiler _can_
  7790. // decide between class template specializations for T and T*, so a
  7791. // tr1::type_traits-like is_pointer works, and we can overload on that.
  7792. template <typename T>
  7793. inline void StreamHelper(internal::true_type /*dummy*/, T* pointer) {
  7794. if (pointer == NULL) {
  7795. *ss_ << "(null)";
  7796. } else {
  7797. ::GTestStreamToHelper(ss_.get(), pointer);
  7798. }
  7799. }
  7800. template <typename T>
  7801. inline void StreamHelper(internal::false_type /*dummy*/, const T& value) {
  7802. ::GTestStreamToHelper(ss_.get(), value);
  7803. }
  7804. #endif // GTEST_OS_SYMBIAN
  7805. // We'll hold the text streamed to this object here.
  7806. const internal::scoped_ptr< ::std::stringstream> ss_;
  7807. // We declare (but don't implement) this to prevent the compiler
  7808. // from implementing the assignment operator.
  7809. void operator=(const Message&);
  7810. };
  7811. // Streams a Message to an ostream.
  7812. inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
  7813. return os << sb.GetString();
  7814. }
  7815. } // namespace testing
  7816. #endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
  7817. // This file was GENERATED by command:
  7818. // pump.py gtest-param-test.h.pump
  7819. // DO NOT EDIT BY HAND!!!
  7820. // Copyright 2008, Google Inc.
  7821. // All rights reserved.
  7822. //
  7823. // Redistribution and use in source and binary forms, with or without
  7824. // modification, are permitted provided that the following conditions are
  7825. // met:
  7826. //
  7827. // * Redistributions of source code must retain the above copyright
  7828. // notice, this list of conditions and the following disclaimer.
  7829. // * Redistributions in binary form must reproduce the above
  7830. // copyright notice, this list of conditions and the following disclaimer
  7831. // in the documentation and/or other materials provided with the
  7832. // distribution.
  7833. // * Neither the name of Google Inc. nor the names of its
  7834. // contributors may be used to endorse or promote products derived from
  7835. // this software without specific prior written permission.
  7836. //
  7837. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  7838. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  7839. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  7840. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7841. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  7842. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  7843. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  7844. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  7845. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  7846. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  7847. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  7848. //
  7849. // Authors: [email protected] (Vlad Losev)
  7850. //
  7851. // Macros and functions for implementing parameterized tests
  7852. // in Google C++ Testing Framework (Google Test)
  7853. //
  7854. // This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
  7855. //
  7856. #ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
  7857. #define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
  7858. // Value-parameterized tests allow you to test your code with different
  7859. // parameters without writing multiple copies of the same test.
  7860. //
  7861. // Here is how you use value-parameterized tests:
  7862. #if 0
  7863. // To write value-parameterized tests, first you should define a fixture
  7864. // class. It is usually derived from testing::TestWithParam<T> (see below for
  7865. // another inheritance scheme that's sometimes useful in more complicated
  7866. // class hierarchies), where the type of your parameter values.
  7867. // TestWithParam<T> is itself derived from testing::Test. T can be any
  7868. // copyable type. If it's a raw pointer, you are responsible for managing the
  7869. // lifespan of the pointed values.
  7870. class FooTest : public ::testing::TestWithParam<const char*> {
  7871. // You can implement all the usual class fixture members here.
  7872. };
  7873. // Then, use the TEST_P macro to define as many parameterized tests
  7874. // for this fixture as you want. The _P suffix is for "parameterized"
  7875. // or "pattern", whichever you prefer to think.
  7876. TEST_P(FooTest, DoesBlah) {
  7877. // Inside a test, access the test parameter with the GetParam() method
  7878. // of the TestWithParam<T> class:
  7879. EXPECT_TRUE(foo.Blah(GetParam()));
  7880. ...
  7881. }
  7882. TEST_P(FooTest, HasBlahBlah) {
  7883. ...
  7884. }
  7885. // Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
  7886. // case with any set of parameters you want. Google Test defines a number
  7887. // of functions for generating test parameters. They return what we call
  7888. // (surprise!) parameter generators. Here is a summary of them, which
  7889. // are all in the testing namespace:
  7890. //
  7891. //
  7892. // Range(begin, end [, step]) - Yields values {begin, begin+step,
  7893. // begin+step+step, ...}. The values do not
  7894. // include end. step defaults to 1.
  7895. // Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}.
  7896. // ValuesIn(container) - Yields values from a C-style array, an STL
  7897. // ValuesIn(begin,end) container, or an iterator range [begin, end).
  7898. // Bool() - Yields sequence {false, true}.
  7899. // Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product
  7900. // for the math savvy) of the values generated
  7901. // by the N generators.
  7902. //
  7903. // For more details, see comments at the definitions of these functions below
  7904. // in this file.
  7905. //
  7906. // The following statement will instantiate tests from the FooTest test case
  7907. // each with parameter values "meeny", "miny", and "moe".
  7908. INSTANTIATE_TEST_CASE_P(InstantiationName,
  7909. FooTest,
  7910. Values("meeny", "miny", "moe"));
  7911. // To distinguish different instances of the pattern, (yes, you
  7912. // can instantiate it more then once) the first argument to the
  7913. // INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
  7914. // actual test case name. Remember to pick unique prefixes for different
  7915. // instantiations. The tests from the instantiation above will have
  7916. // these names:
  7917. //
  7918. // * InstantiationName/FooTest.DoesBlah/0 for "meeny"
  7919. // * InstantiationName/FooTest.DoesBlah/1 for "miny"
  7920. // * InstantiationName/FooTest.DoesBlah/2 for "moe"
  7921. // * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
  7922. // * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
  7923. // * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
  7924. //
  7925. // You can use these names in --gtest_filter.
  7926. //
  7927. // This statement will instantiate all tests from FooTest again, each
  7928. // with parameter values "cat" and "dog":
  7929. const char* pets[] = {"cat", "dog"};
  7930. INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
  7931. // The tests from the instantiation above will have these names:
  7932. //
  7933. // * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
  7934. // * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
  7935. // * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
  7936. // * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
  7937. //
  7938. // Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
  7939. // in the given test case, whether their definitions come before or
  7940. // AFTER the INSTANTIATE_TEST_CASE_P statement.
  7941. //
  7942. // Please also note that generator expressions (including parameters to the
  7943. // generators) are evaluated in InitGoogleTest(), after main() has started.
  7944. // This allows the user on one hand, to adjust generator parameters in order
  7945. // to dynamically determine a set of tests to run and on the other hand,
  7946. // give the user a chance to inspect the generated tests with Google Test
  7947. // reflection API before RUN_ALL_TESTS() is executed.
  7948. //
  7949. // You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
  7950. // for more examples.
  7951. //
  7952. // In the future, we plan to publish the API for defining new parameter
  7953. // generators. But for now this interface remains part of the internal
  7954. // implementation and is subject to change.
  7955. //
  7956. //
  7957. // A parameterized test fixture must be derived from testing::Test and from
  7958. // testing::WithParamInterface<T>, where T is the type of the parameter
  7959. // values. Inheriting from TestWithParam<T> satisfies that requirement because
  7960. // TestWithParam<T> inherits from both Test and WithParamInterface. In more
  7961. // complicated hierarchies, however, it is occasionally useful to inherit
  7962. // separately from Test and WithParamInterface. For example:
  7963. class BaseTest : public ::testing::Test {
  7964. // You can inherit all the usual members for a non-parameterized test
  7965. // fixture here.
  7966. };
  7967. class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
  7968. // The usual test fixture members go here too.
  7969. };
  7970. TEST_F(BaseTest, HasFoo) {
  7971. // This is an ordinary non-parameterized test.
  7972. }
  7973. TEST_P(DerivedTest, DoesBlah) {
  7974. // GetParam works just the same here as if you inherit from TestWithParam.
  7975. EXPECT_TRUE(foo.Blah(GetParam()));
  7976. }
  7977. #endif // 0
  7978. #if !GTEST_OS_SYMBIAN
  7979. # include <utility>
  7980. #endif
  7981. // scripts/fuse_gtest.py depends on gtest's own header being #included
  7982. // *unconditionally*. Therefore these #includes cannot be moved
  7983. // inside #if GTEST_HAS_PARAM_TEST.
  7984. // Copyright 2008 Google Inc.
  7985. // All Rights Reserved.
  7986. //
  7987. // Redistribution and use in source and binary forms, with or without
  7988. // modification, are permitted provided that the following conditions are
  7989. // met:
  7990. //
  7991. // * Redistributions of source code must retain the above copyright
  7992. // notice, this list of conditions and the following disclaimer.
  7993. // * Redistributions in binary form must reproduce the above
  7994. // copyright notice, this list of conditions and the following disclaimer
  7995. // in the documentation and/or other materials provided with the
  7996. // distribution.
  7997. // * Neither the name of Google Inc. nor the names of its
  7998. // contributors may be used to endorse or promote products derived from
  7999. // this software without specific prior written permission.
  8000. //
  8001. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8002. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  8003. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8004. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  8005. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8006. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  8007. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  8008. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  8009. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  8010. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  8011. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8012. //
  8013. // Author: [email protected] (Vlad Losev)
  8014. // Type and function utilities for implementing parameterized tests.
  8015. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
  8016. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
  8017. #include <iterator>
  8018. #include <utility>
  8019. #include <vector>
  8020. // scripts/fuse_gtest.py depends on gtest's own header being #included
  8021. // *unconditionally*. Therefore these #includes cannot be moved
  8022. // inside #if GTEST_HAS_PARAM_TEST.
  8023. // Copyright 2003 Google Inc.
  8024. // All rights reserved.
  8025. //
  8026. // Redistribution and use in source and binary forms, with or without
  8027. // modification, are permitted provided that the following conditions are
  8028. // met:
  8029. //
  8030. // * Redistributions of source code must retain the above copyright
  8031. // notice, this list of conditions and the following disclaimer.
  8032. // * Redistributions in binary form must reproduce the above
  8033. // copyright notice, this list of conditions and the following disclaimer
  8034. // in the documentation and/or other materials provided with the
  8035. // distribution.
  8036. // * Neither the name of Google Inc. nor the names of its
  8037. // contributors may be used to endorse or promote products derived from
  8038. // this software without specific prior written permission.
  8039. //
  8040. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8041. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  8042. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8043. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  8044. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8045. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  8046. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  8047. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  8048. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  8049. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  8050. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8051. //
  8052. // Authors: Dan Egnor ([email protected])
  8053. //
  8054. // A "smart" pointer type with reference tracking. Every pointer to a
  8055. // particular object is kept on a circular linked list. When the last pointer
  8056. // to an object is destroyed or reassigned, the object is deleted.
  8057. //
  8058. // Used properly, this deletes the object when the last reference goes away.
  8059. // There are several caveats:
  8060. // - Like all reference counting schemes, cycles lead to leaks.
  8061. // - Each smart pointer is actually two pointers (8 bytes instead of 4).
  8062. // - Every time a pointer is assigned, the entire list of pointers to that
  8063. // object is traversed. This class is therefore NOT SUITABLE when there
  8064. // will often be more than two or three pointers to a particular object.
  8065. // - References are only tracked as long as linked_ptr<> objects are copied.
  8066. // If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
  8067. // will happen (double deletion).
  8068. //
  8069. // A good use of this class is storing object references in STL containers.
  8070. // You can safely put linked_ptr<> in a vector<>.
  8071. // Other uses may not be as good.
  8072. //
  8073. // Note: If you use an incomplete type with linked_ptr<>, the class
  8074. // *containing* linked_ptr<> must have a constructor and destructor (even
  8075. // if they do nothing!).
  8076. //
  8077. // Bill Gibbons suggested we use something like this.
  8078. //
  8079. // Thread Safety:
  8080. // Unlike other linked_ptr implementations, in this implementation
  8081. // a linked_ptr object is thread-safe in the sense that:
  8082. // - it's safe to copy linked_ptr objects concurrently,
  8083. // - it's safe to copy *from* a linked_ptr and read its underlying
  8084. // raw pointer (e.g. via get()) concurrently, and
  8085. // - it's safe to write to two linked_ptrs that point to the same
  8086. // shared object concurrently.
  8087. // TODO([email protected]): rename this to safe_linked_ptr to avoid
  8088. // confusion with normal linked_ptr.
  8089. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
  8090. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
  8091. #include <stdlib.h>
  8092. #include <assert.h>
  8093. namespace testing {
  8094. namespace internal {
  8095. // Protects copying of all linked_ptr objects.
  8096. GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
  8097. // This is used internally by all instances of linked_ptr<>. It needs to be
  8098. // a non-template class because different types of linked_ptr<> can refer to
  8099. // the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
  8100. // So, it needs to be possible for different types of linked_ptr to participate
  8101. // in the same circular linked list, so we need a single class type here.
  8102. //
  8103. // DO NOT USE THIS CLASS DIRECTLY YOURSELF. Use linked_ptr<T>.
  8104. class linked_ptr_internal {
  8105. public:
  8106. // Create a new circle that includes only this instance.
  8107. void join_new() {
  8108. next_ = this;
  8109. }
  8110. // Many linked_ptr operations may change p.link_ for some linked_ptr
  8111. // variable p in the same circle as this object. Therefore we need
  8112. // to prevent two such operations from occurring concurrently.
  8113. //
  8114. // Note that different types of linked_ptr objects can coexist in a
  8115. // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
  8116. // linked_ptr<Derived2>). Therefore we must use a single mutex to
  8117. // protect all linked_ptr objects. This can create serious
  8118. // contention in production code, but is acceptable in a testing
  8119. // framework.
  8120. // Join an existing circle.
  8121. // L < g_linked_ptr_mutex
  8122. void join(linked_ptr_internal const* ptr) {
  8123. MutexLock lock(&g_linked_ptr_mutex);
  8124. linked_ptr_internal const* p = ptr;
  8125. while (p->next_ != ptr) p = p->next_;
  8126. p->next_ = this;
  8127. next_ = ptr;
  8128. }
  8129. // Leave whatever circle we're part of. Returns true if we were the
  8130. // last member of the circle. Once this is done, you can join() another.
  8131. // L < g_linked_ptr_mutex
  8132. bool depart() {
  8133. MutexLock lock(&g_linked_ptr_mutex);
  8134. if (next_ == this) return true;
  8135. linked_ptr_internal const* p = next_;
  8136. while (p->next_ != this) p = p->next_;
  8137. p->next_ = next_;
  8138. return false;
  8139. }
  8140. private:
  8141. mutable linked_ptr_internal const* next_;
  8142. };
  8143. template <typename T>
  8144. class linked_ptr {
  8145. public:
  8146. typedef T element_type;
  8147. // Take over ownership of a raw pointer. This should happen as soon as
  8148. // possible after the object is created.
  8149. explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
  8150. ~linked_ptr() { depart(); }
  8151. // Copy an existing linked_ptr<>, adding ourselves to the list of references.
  8152. template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
  8153. linked_ptr(linked_ptr const& ptr) { // NOLINT
  8154. assert(&ptr != this);
  8155. copy(&ptr);
  8156. }
  8157. // Assignment releases the old value and acquires the new.
  8158. template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
  8159. depart();
  8160. copy(&ptr);
  8161. return *this;
  8162. }
  8163. linked_ptr& operator=(linked_ptr const& ptr) {
  8164. if (&ptr != this) {
  8165. depart();
  8166. copy(&ptr);
  8167. }
  8168. return *this;
  8169. }
  8170. // Smart pointer members.
  8171. void reset(T* ptr = NULL) {
  8172. depart();
  8173. capture(ptr);
  8174. }
  8175. T* get() const { return value_; }
  8176. T* operator->() const { return value_; }
  8177. T& operator*() const { return *value_; }
  8178. bool operator==(T* p) const { return value_ == p; }
  8179. bool operator!=(T* p) const { return value_ != p; }
  8180. template <typename U>
  8181. bool operator==(linked_ptr<U> const& ptr) const {
  8182. return value_ == ptr.get();
  8183. }
  8184. template <typename U>
  8185. bool operator!=(linked_ptr<U> const& ptr) const {
  8186. return value_ != ptr.get();
  8187. }
  8188. private:
  8189. template <typename U>
  8190. friend class linked_ptr;
  8191. T* value_;
  8192. linked_ptr_internal link_;
  8193. void depart() {
  8194. if (link_.depart()) delete value_;
  8195. }
  8196. void capture(T* ptr) {
  8197. value_ = ptr;
  8198. link_.join_new();
  8199. }
  8200. template <typename U> void copy(linked_ptr<U> const* ptr) {
  8201. value_ = ptr->get();
  8202. if (value_)
  8203. link_.join(&ptr->link_);
  8204. else
  8205. link_.join_new();
  8206. }
  8207. };
  8208. template<typename T> inline
  8209. bool operator==(T* ptr, const linked_ptr<T>& x) {
  8210. return ptr == x.get();
  8211. }
  8212. template<typename T> inline
  8213. bool operator!=(T* ptr, const linked_ptr<T>& x) {
  8214. return ptr != x.get();
  8215. }
  8216. // A function to convert T* into linked_ptr<T>
  8217. // Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
  8218. // for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
  8219. template <typename T>
  8220. linked_ptr<T> make_linked_ptr(T* ptr) {
  8221. return linked_ptr<T>(ptr);
  8222. }
  8223. } // namespace internal
  8224. } // namespace testing
  8225. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
  8226. // Copyright 2007, Google Inc.
  8227. // All rights reserved.
  8228. //
  8229. // Redistribution and use in source and binary forms, with or without
  8230. // modification, are permitted provided that the following conditions are
  8231. // met:
  8232. //
  8233. // * Redistributions of source code must retain the above copyright
  8234. // notice, this list of conditions and the following disclaimer.
  8235. // * Redistributions in binary form must reproduce the above
  8236. // copyright notice, this list of conditions and the following disclaimer
  8237. // in the documentation and/or other materials provided with the
  8238. // distribution.
  8239. // * Neither the name of Google Inc. nor the names of its
  8240. // contributors may be used to endorse or promote products derived from
  8241. // this software without specific prior written permission.
  8242. //
  8243. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8244. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  8245. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8246. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  8247. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8248. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  8249. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  8250. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  8251. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  8252. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  8253. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8254. //
  8255. // Author: [email protected] (Zhanyong Wan)
  8256. // Google Test - The Google C++ Testing Framework
  8257. //
  8258. // This file implements a universal value printer that can print a
  8259. // value of any type T:
  8260. //
  8261. // void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
  8262. //
  8263. // A user can teach this function how to print a class type T by
  8264. // defining either operator<<() or PrintTo() in the namespace that
  8265. // defines T. More specifically, the FIRST defined function in the
  8266. // following list will be used (assuming T is defined in namespace
  8267. // foo):
  8268. //
  8269. // 1. foo::PrintTo(const T&, ostream*)
  8270. // 2. operator<<(ostream&, const T&) defined in either foo or the
  8271. // global namespace.
  8272. //
  8273. // If none of the above is defined, it will print the debug string of
  8274. // the value if it is a protocol buffer, or print the raw bytes in the
  8275. // value otherwise.
  8276. //
  8277. // To aid debugging: when T is a reference type, the address of the
  8278. // value is also printed; when T is a (const) char pointer, both the
  8279. // pointer value and the NUL-terminated string it points to are
  8280. // printed.
  8281. //
  8282. // We also provide some convenient wrappers:
  8283. //
  8284. // // Prints a value to a string. For a (const or not) char
  8285. // // pointer, the NUL-terminated string (but not the pointer) is
  8286. // // printed.
  8287. // std::string ::testing::PrintToString(const T& value);
  8288. //
  8289. // // Prints a value tersely: for a reference type, the referenced
  8290. // // value (but not the address) is printed; for a (const or not) char
  8291. // // pointer, the NUL-terminated string (but not the pointer) is
  8292. // // printed.
  8293. // void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
  8294. //
  8295. // // Prints value using the type inferred by the compiler. The difference
  8296. // // from UniversalTersePrint() is that this function prints both the
  8297. // // pointer and the NUL-terminated string for a (const or not) char pointer.
  8298. // void ::testing::internal::UniversalPrint(const T& value, ostream*);
  8299. //
  8300. // // Prints the fields of a tuple tersely to a string vector, one
  8301. // // element for each field. Tuple support must be enabled in
  8302. // // gtest-port.h.
  8303. // std::vector<string> UniversalTersePrintTupleFieldsToStrings(
  8304. // const Tuple& value);
  8305. //
  8306. // Known limitation:
  8307. //
  8308. // The print primitives print the elements of an STL-style container
  8309. // using the compiler-inferred type of *iter where iter is a
  8310. // const_iterator of the container. When const_iterator is an input
  8311. // iterator but not a forward iterator, this inferred type may not
  8312. // match value_type, and the print output may be incorrect. In
  8313. // practice, this is rarely a problem as for most containers
  8314. // const_iterator is a forward iterator. We'll fix this if there's an
  8315. // actual need for it. Note that this fix cannot rely on value_type
  8316. // being defined as many user-defined container types don't have
  8317. // value_type.
  8318. #ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
  8319. #define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
  8320. #include <ostream> // NOLINT
  8321. #include <sstream>
  8322. #include <string>
  8323. #include <utility>
  8324. #include <vector>
  8325. namespace testing {
  8326. // Definitions in the 'internal' and 'internal2' name spaces are
  8327. // subject to change without notice. DO NOT USE THEM IN USER CODE!
  8328. namespace internal2 {
  8329. // Prints the given number of bytes in the given object to the given
  8330. // ostream.
  8331. GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
  8332. size_t count,
  8333. ::std::ostream* os);
  8334. // For selecting which printer to use when a given type has neither <<
  8335. // nor PrintTo().
  8336. enum TypeKind {
  8337. kProtobuf, // a protobuf type
  8338. kConvertibleToInteger, // a type implicitly convertible to BiggestInt
  8339. // (e.g. a named or unnamed enum type)
  8340. kOtherType // anything else
  8341. };
  8342. // TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
  8343. // by the universal printer to print a value of type T when neither
  8344. // operator<< nor PrintTo() is defined for T, where kTypeKind is the
  8345. // "kind" of T as defined by enum TypeKind.
  8346. template <typename T, TypeKind kTypeKind>
  8347. class TypeWithoutFormatter {
  8348. public:
  8349. // This default version is called when kTypeKind is kOtherType.
  8350. static void PrintValue(const T& value, ::std::ostream* os) {
  8351. PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value),
  8352. sizeof(value), os);
  8353. }
  8354. };
  8355. // We print a protobuf using its ShortDebugString() when the string
  8356. // doesn't exceed this many characters; otherwise we print it using
  8357. // DebugString() for better readability.
  8358. const size_t kProtobufOneLinerMaxLength = 50;
  8359. template <typename T>
  8360. class TypeWithoutFormatter<T, kProtobuf> {
  8361. public:
  8362. static void PrintValue(const T& value, ::std::ostream* os) {
  8363. const ::testing::internal::string short_str = value.ShortDebugString();
  8364. const ::testing::internal::string pretty_str =
  8365. short_str.length() <= kProtobufOneLinerMaxLength ?
  8366. short_str : ("\n" + value.DebugString());
  8367. *os << ("<" + pretty_str + ">");
  8368. }
  8369. };
  8370. template <typename T>
  8371. class TypeWithoutFormatter<T, kConvertibleToInteger> {
  8372. public:
  8373. // Since T has no << operator or PrintTo() but can be implicitly
  8374. // converted to BiggestInt, we print it as a BiggestInt.
  8375. //
  8376. // Most likely T is an enum type (either named or unnamed), in which
  8377. // case printing it as an integer is the desired behavior. In case
  8378. // T is not an enum, printing it as an integer is the best we can do
  8379. // given that it has no user-defined printer.
  8380. static void PrintValue(const T& value, ::std::ostream* os) {
  8381. const internal::BiggestInt kBigInt = value;
  8382. *os << kBigInt;
  8383. }
  8384. };
  8385. // Prints the given value to the given ostream. If the value is a
  8386. // protocol message, its debug string is printed; if it's an enum or
  8387. // of a type implicitly convertible to BiggestInt, it's printed as an
  8388. // integer; otherwise the bytes in the value are printed. This is
  8389. // what UniversalPrinter<T>::Print() does when it knows nothing about
  8390. // type T and T has neither << operator nor PrintTo().
  8391. //
  8392. // A user can override this behavior for a class type Foo by defining
  8393. // a << operator in the namespace where Foo is defined.
  8394. //
  8395. // We put this operator in namespace 'internal2' instead of 'internal'
  8396. // to simplify the implementation, as much code in 'internal' needs to
  8397. // use << in STL, which would conflict with our own << were it defined
  8398. // in 'internal'.
  8399. //
  8400. // Note that this operator<< takes a generic std::basic_ostream<Char,
  8401. // CharTraits> type instead of the more restricted std::ostream. If
  8402. // we define it to take an std::ostream instead, we'll get an
  8403. // "ambiguous overloads" compiler error when trying to print a type
  8404. // Foo that supports streaming to std::basic_ostream<Char,
  8405. // CharTraits>, as the compiler cannot tell whether
  8406. // operator<<(std::ostream&, const T&) or
  8407. // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
  8408. // specific.
  8409. template <typename Char, typename CharTraits, typename T>
  8410. ::std::basic_ostream<Char, CharTraits>& operator<<(
  8411. ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
  8412. TypeWithoutFormatter<T,
  8413. (internal::IsAProtocolMessage<T>::value ? kProtobuf :
  8414. internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ?
  8415. kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
  8416. return os;
  8417. }
  8418. } // namespace internal2
  8419. } // namespace testing
  8420. // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
  8421. // magic needed for implementing UniversalPrinter won't work.
  8422. namespace testing_internal {
  8423. // Used to print a value that is not an STL-style container when the
  8424. // user doesn't define PrintTo() for it.
  8425. template <typename T>
  8426. void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
  8427. // With the following statement, during unqualified name lookup,
  8428. // testing::internal2::operator<< appears as if it was declared in
  8429. // the nearest enclosing namespace that contains both
  8430. // ::testing_internal and ::testing::internal2, i.e. the global
  8431. // namespace. For more details, refer to the C++ Standard section
  8432. // 7.3.4-1 [namespace.udir]. This allows us to fall back onto
  8433. // testing::internal2::operator<< in case T doesn't come with a <<
  8434. // operator.
  8435. //
  8436. // We cannot write 'using ::testing::internal2::operator<<;', which
  8437. // gcc 3.3 fails to compile due to a compiler bug.
  8438. using namespace ::testing::internal2; // NOLINT
  8439. // Assuming T is defined in namespace foo, in the next statement,
  8440. // the compiler will consider all of:
  8441. //
  8442. // 1. foo::operator<< (thanks to Koenig look-up),
  8443. // 2. ::operator<< (as the current namespace is enclosed in ::),
  8444. // 3. testing::internal2::operator<< (thanks to the using statement above).
  8445. //
  8446. // The operator<< whose type matches T best will be picked.
  8447. //
  8448. // We deliberately allow #2 to be a candidate, as sometimes it's
  8449. // impossible to define #1 (e.g. when foo is ::std, defining
  8450. // anything in it is undefined behavior unless you are a compiler
  8451. // vendor.).
  8452. *os << value;
  8453. }
  8454. } // namespace testing_internal
  8455. namespace testing {
  8456. namespace internal {
  8457. // UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
  8458. // value to the given ostream. The caller must ensure that
  8459. // 'ostream_ptr' is not NULL, or the behavior is undefined.
  8460. //
  8461. // We define UniversalPrinter as a class template (as opposed to a
  8462. // function template), as we need to partially specialize it for
  8463. // reference types, which cannot be done with function templates.
  8464. template <typename T>
  8465. class UniversalPrinter;
  8466. template <typename T>
  8467. void UniversalPrint(const T& value, ::std::ostream* os);
  8468. // Used to print an STL-style container when the user doesn't define
  8469. // a PrintTo() for it.
  8470. template <typename C>
  8471. void DefaultPrintTo(IsContainer /* dummy */,
  8472. false_type /* is not a pointer */,
  8473. const C& container, ::std::ostream* os) {
  8474. const size_t kMaxCount = 32; // The maximum number of elements to print.
  8475. *os << '{';
  8476. size_t count = 0;
  8477. for (typename C::const_iterator it = container.begin();
  8478. it != container.end(); ++it, ++count) {
  8479. if (count > 0) {
  8480. *os << ',';
  8481. if (count == kMaxCount) { // Enough has been printed.
  8482. *os << " ...";
  8483. break;
  8484. }
  8485. }
  8486. *os << ' ';
  8487. // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
  8488. // handle *it being a native array.
  8489. internal::UniversalPrint(*it, os);
  8490. }
  8491. if (count > 0) {
  8492. *os << ' ';
  8493. }
  8494. *os << '}';
  8495. }
  8496. // Used to print a pointer that is neither a char pointer nor a member
  8497. // pointer, when the user doesn't define PrintTo() for it. (A member
  8498. // variable pointer or member function pointer doesn't really point to
  8499. // a location in the address space. Their representation is
  8500. // implementation-defined. Therefore they will be printed as raw
  8501. // bytes.)
  8502. template <typename T>
  8503. void DefaultPrintTo(IsNotContainer /* dummy */,
  8504. true_type /* is a pointer */,
  8505. T* p, ::std::ostream* os) {
  8506. if (p == NULL) {
  8507. *os << "NULL";
  8508. } else {
  8509. // C++ doesn't allow casting from a function pointer to any object
  8510. // pointer.
  8511. //
  8512. // IsTrue() silences warnings: "Condition is always true",
  8513. // "unreachable code".
  8514. if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {
  8515. // T is not a function type. We just call << to print p,
  8516. // relying on ADL to pick up user-defined << for their pointer
  8517. // types, if any.
  8518. *os << p;
  8519. } else {
  8520. // T is a function type, so '*os << p' doesn't do what we want
  8521. // (it just prints p as bool). We want to print p as a const
  8522. // void*. However, we cannot cast it to const void* directly,
  8523. // even using reinterpret_cast, as earlier versions of gcc
  8524. // (e.g. 3.4.5) cannot compile the cast when p is a function
  8525. // pointer. Casting to UInt64 first solves the problem.
  8526. *os << reinterpret_cast<const void*>(
  8527. reinterpret_cast<internal::UInt64>(p));
  8528. }
  8529. }
  8530. }
  8531. // Used to print a non-container, non-pointer value when the user
  8532. // doesn't define PrintTo() for it.
  8533. template <typename T>
  8534. void DefaultPrintTo(IsNotContainer /* dummy */,
  8535. false_type /* is not a pointer */,
  8536. const T& value, ::std::ostream* os) {
  8537. ::testing_internal::DefaultPrintNonContainerTo(value, os);
  8538. }
  8539. // Prints the given value using the << operator if it has one;
  8540. // otherwise prints the bytes in it. This is what
  8541. // UniversalPrinter<T>::Print() does when PrintTo() is not specialized
  8542. // or overloaded for type T.
  8543. //
  8544. // A user can override this behavior for a class type Foo by defining
  8545. // an overload of PrintTo() in the namespace where Foo is defined. We
  8546. // give the user this option as sometimes defining a << operator for
  8547. // Foo is not desirable (e.g. the coding style may prevent doing it,
  8548. // or there is already a << operator but it doesn't do what the user
  8549. // wants).
  8550. template <typename T>
  8551. void PrintTo(const T& value, ::std::ostream* os) {
  8552. // DefaultPrintTo() is overloaded. The type of its first two
  8553. // arguments determine which version will be picked. If T is an
  8554. // STL-style container, the version for container will be called; if
  8555. // T is a pointer, the pointer version will be called; otherwise the
  8556. // generic version will be called.
  8557. //
  8558. // Note that we check for container types here, prior to we check
  8559. // for protocol message types in our operator<<. The rationale is:
  8560. //
  8561. // For protocol messages, we want to give people a chance to
  8562. // override Google Mock's format by defining a PrintTo() or
  8563. // operator<<. For STL containers, other formats can be
  8564. // incompatible with Google Mock's format for the container
  8565. // elements; therefore we check for container types here to ensure
  8566. // that our format is used.
  8567. //
  8568. // The second argument of DefaultPrintTo() is needed to bypass a bug
  8569. // in Symbian's C++ compiler that prevents it from picking the right
  8570. // overload between:
  8571. //
  8572. // PrintTo(const T& x, ...);
  8573. // PrintTo(T* x, ...);
  8574. DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);
  8575. }
  8576. // The following list of PrintTo() overloads tells
  8577. // UniversalPrinter<T>::Print() how to print standard types (built-in
  8578. // types, strings, plain arrays, and pointers).
  8579. // Overloads for various char types.
  8580. GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
  8581. GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
  8582. inline void PrintTo(char c, ::std::ostream* os) {
  8583. // When printing a plain char, we always treat it as unsigned. This
  8584. // way, the output won't be affected by whether the compiler thinks
  8585. // char is signed or not.
  8586. PrintTo(static_cast<unsigned char>(c), os);
  8587. }
  8588. // Overloads for other simple built-in types.
  8589. inline void PrintTo(bool x, ::std::ostream* os) {
  8590. *os << (x ? "true" : "false");
  8591. }
  8592. // Overload for wchar_t type.
  8593. // Prints a wchar_t as a symbol if it is printable or as its internal
  8594. // code otherwise and also as its decimal code (except for L'\0').
  8595. // The L'\0' char is printed as "L'\\0'". The decimal code is printed
  8596. // as signed integer when wchar_t is implemented by the compiler
  8597. // as a signed type and is printed as an unsigned integer when wchar_t
  8598. // is implemented as an unsigned type.
  8599. GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
  8600. // Overloads for C strings.
  8601. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
  8602. inline void PrintTo(char* s, ::std::ostream* os) {
  8603. PrintTo(ImplicitCast_<const char*>(s), os);
  8604. }
  8605. // signed/unsigned char is often used for representing binary data, so
  8606. // we print pointers to it as void* to be safe.
  8607. inline void PrintTo(const signed char* s, ::std::ostream* os) {
  8608. PrintTo(ImplicitCast_<const void*>(s), os);
  8609. }
  8610. inline void PrintTo(signed char* s, ::std::ostream* os) {
  8611. PrintTo(ImplicitCast_<const void*>(s), os);
  8612. }
  8613. inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
  8614. PrintTo(ImplicitCast_<const void*>(s), os);
  8615. }
  8616. inline void PrintTo(unsigned char* s, ::std::ostream* os) {
  8617. PrintTo(ImplicitCast_<const void*>(s), os);
  8618. }
  8619. // MSVC can be configured to define wchar_t as a typedef of unsigned
  8620. // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
  8621. // type. When wchar_t is a typedef, defining an overload for const
  8622. // wchar_t* would cause unsigned short* be printed as a wide string,
  8623. // possibly causing invalid memory accesses.
  8624. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
  8625. // Overloads for wide C strings
  8626. GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
  8627. inline void PrintTo(wchar_t* s, ::std::ostream* os) {
  8628. PrintTo(ImplicitCast_<const wchar_t*>(s), os);
  8629. }
  8630. #endif
  8631. // Overload for C arrays. Multi-dimensional arrays are printed
  8632. // properly.
  8633. // Prints the given number of elements in an array, without printing
  8634. // the curly braces.
  8635. template <typename T>
  8636. void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
  8637. UniversalPrint(a[0], os);
  8638. for (size_t i = 1; i != count; i++) {
  8639. *os << ", ";
  8640. UniversalPrint(a[i], os);
  8641. }
  8642. }
  8643. // Overloads for ::string and ::std::string.
  8644. #if GTEST_HAS_GLOBAL_STRING
  8645. GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
  8646. inline void PrintTo(const ::string& s, ::std::ostream* os) {
  8647. PrintStringTo(s, os);
  8648. }
  8649. #endif // GTEST_HAS_GLOBAL_STRING
  8650. GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
  8651. inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
  8652. PrintStringTo(s, os);
  8653. }
  8654. // Overloads for ::wstring and ::std::wstring.
  8655. #if GTEST_HAS_GLOBAL_WSTRING
  8656. GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
  8657. inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
  8658. PrintWideStringTo(s, os);
  8659. }
  8660. #endif // GTEST_HAS_GLOBAL_WSTRING
  8661. #if GTEST_HAS_STD_WSTRING
  8662. GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
  8663. inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
  8664. PrintWideStringTo(s, os);
  8665. }
  8666. #endif // GTEST_HAS_STD_WSTRING
  8667. #if GTEST_HAS_TR1_TUPLE
  8668. // Overload for ::std::tr1::tuple. Needed for printing function arguments,
  8669. // which are packed as tuples.
  8670. // Helper function for printing a tuple. T must be instantiated with
  8671. // a tuple type.
  8672. template <typename T>
  8673. void PrintTupleTo(const T& t, ::std::ostream* os);
  8674. // Overloaded PrintTo() for tuples of various arities. We support
  8675. // tuples of up-to 10 fields. The following implementation works
  8676. // regardless of whether tr1::tuple is implemented using the
  8677. // non-standard variadic template feature or not.
  8678. inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
  8679. PrintTupleTo(t, os);
  8680. }
  8681. template <typename T1>
  8682. void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
  8683. PrintTupleTo(t, os);
  8684. }
  8685. template <typename T1, typename T2>
  8686. void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
  8687. PrintTupleTo(t, os);
  8688. }
  8689. template <typename T1, typename T2, typename T3>
  8690. void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
  8691. PrintTupleTo(t, os);
  8692. }
  8693. template <typename T1, typename T2, typename T3, typename T4>
  8694. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
  8695. PrintTupleTo(t, os);
  8696. }
  8697. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  8698. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
  8699. ::std::ostream* os) {
  8700. PrintTupleTo(t, os);
  8701. }
  8702. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  8703. typename T6>
  8704. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
  8705. ::std::ostream* os) {
  8706. PrintTupleTo(t, os);
  8707. }
  8708. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  8709. typename T6, typename T7>
  8710. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
  8711. ::std::ostream* os) {
  8712. PrintTupleTo(t, os);
  8713. }
  8714. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  8715. typename T6, typename T7, typename T8>
  8716. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
  8717. ::std::ostream* os) {
  8718. PrintTupleTo(t, os);
  8719. }
  8720. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  8721. typename T6, typename T7, typename T8, typename T9>
  8722. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
  8723. ::std::ostream* os) {
  8724. PrintTupleTo(t, os);
  8725. }
  8726. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  8727. typename T6, typename T7, typename T8, typename T9, typename T10>
  8728. void PrintTo(
  8729. const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
  8730. ::std::ostream* os) {
  8731. PrintTupleTo(t, os);
  8732. }
  8733. #endif // GTEST_HAS_TR1_TUPLE
  8734. // Overload for std::pair.
  8735. template <typename T1, typename T2>
  8736. void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
  8737. *os << '(';
  8738. // We cannot use UniversalPrint(value.first, os) here, as T1 may be
  8739. // a reference type. The same for printing value.second.
  8740. UniversalPrinter<T1>::Print(value.first, os);
  8741. *os << ", ";
  8742. UniversalPrinter<T2>::Print(value.second, os);
  8743. *os << ')';
  8744. }
  8745. // Implements printing a non-reference type T by letting the compiler
  8746. // pick the right overload of PrintTo() for T.
  8747. template <typename T>
  8748. class UniversalPrinter {
  8749. public:
  8750. // MSVC warns about adding const to a function type, so we want to
  8751. // disable the warning.
  8752. #ifdef _MSC_VER
  8753. # pragma warning(push) // Saves the current warning state.
  8754. # pragma warning(disable:4180) // Temporarily disables warning 4180.
  8755. #endif // _MSC_VER
  8756. // Note: we deliberately don't call this PrintTo(), as that name
  8757. // conflicts with ::testing::internal::PrintTo in the body of the
  8758. // function.
  8759. static void Print(const T& value, ::std::ostream* os) {
  8760. // By default, ::testing::internal::PrintTo() is used for printing
  8761. // the value.
  8762. //
  8763. // Thanks to Koenig look-up, if T is a class and has its own
  8764. // PrintTo() function defined in its namespace, that function will
  8765. // be visible here. Since it is more specific than the generic ones
  8766. // in ::testing::internal, it will be picked by the compiler in the
  8767. // following statement - exactly what we want.
  8768. PrintTo(value, os);
  8769. }
  8770. #ifdef _MSC_VER
  8771. # pragma warning(pop) // Restores the warning state.
  8772. #endif // _MSC_VER
  8773. };
  8774. // UniversalPrintArray(begin, len, os) prints an array of 'len'
  8775. // elements, starting at address 'begin'.
  8776. template <typename T>
  8777. void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
  8778. if (len == 0) {
  8779. *os << "{}";
  8780. } else {
  8781. *os << "{ ";
  8782. const size_t kThreshold = 18;
  8783. const size_t kChunkSize = 8;
  8784. // If the array has more than kThreshold elements, we'll have to
  8785. // omit some details by printing only the first and the last
  8786. // kChunkSize elements.
  8787. // TODO([email protected]): let the user control the threshold using a flag.
  8788. if (len <= kThreshold) {
  8789. PrintRawArrayTo(begin, len, os);
  8790. } else {
  8791. PrintRawArrayTo(begin, kChunkSize, os);
  8792. *os << ", ..., ";
  8793. PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
  8794. }
  8795. *os << " }";
  8796. }
  8797. }
  8798. // This overload prints a (const) char array compactly.
  8799. GTEST_API_ void UniversalPrintArray(const char* begin,
  8800. size_t len,
  8801. ::std::ostream* os);
  8802. // Implements printing an array type T[N].
  8803. template <typename T, size_t N>
  8804. class UniversalPrinter<T[N]> {
  8805. public:
  8806. // Prints the given array, omitting some elements when there are too
  8807. // many.
  8808. static void Print(const T (&a)[N], ::std::ostream* os) {
  8809. UniversalPrintArray(a, N, os);
  8810. }
  8811. };
  8812. // Implements printing a reference type T&.
  8813. template <typename T>
  8814. class UniversalPrinter<T&> {
  8815. public:
  8816. // MSVC warns about adding const to a function type, so we want to
  8817. // disable the warning.
  8818. #ifdef _MSC_VER
  8819. # pragma warning(push) // Saves the current warning state.
  8820. # pragma warning(disable:4180) // Temporarily disables warning 4180.
  8821. #endif // _MSC_VER
  8822. static void Print(const T& value, ::std::ostream* os) {
  8823. // Prints the address of the value. We use reinterpret_cast here
  8824. // as static_cast doesn't compile when T is a function type.
  8825. *os << "@" << reinterpret_cast<const void*>(&value) << " ";
  8826. // Then prints the value itself.
  8827. UniversalPrint(value, os);
  8828. }
  8829. #ifdef _MSC_VER
  8830. # pragma warning(pop) // Restores the warning state.
  8831. #endif // _MSC_VER
  8832. };
  8833. // Prints a value tersely: for a reference type, the referenced value
  8834. // (but not the address) is printed; for a (const) char pointer, the
  8835. // NUL-terminated string (but not the pointer) is printed.
  8836. template <typename T>
  8837. void UniversalTersePrint(const T& value, ::std::ostream* os) {
  8838. UniversalPrint(value, os);
  8839. }
  8840. inline void UniversalTersePrint(const char* str, ::std::ostream* os) {
  8841. if (str == NULL) {
  8842. *os << "NULL";
  8843. } else {
  8844. UniversalPrint(string(str), os);
  8845. }
  8846. }
  8847. inline void UniversalTersePrint(char* str, ::std::ostream* os) {
  8848. UniversalTersePrint(static_cast<const char*>(str), os);
  8849. }
  8850. // Prints a value using the type inferred by the compiler. The
  8851. // difference between this and UniversalTersePrint() is that for a
  8852. // (const) char pointer, this prints both the pointer and the
  8853. // NUL-terminated string.
  8854. template <typename T>
  8855. void UniversalPrint(const T& value, ::std::ostream* os) {
  8856. UniversalPrinter<T>::Print(value, os);
  8857. }
  8858. #if GTEST_HAS_TR1_TUPLE
  8859. typedef ::std::vector<string> Strings;
  8860. // This helper template allows PrintTo() for tuples and
  8861. // UniversalTersePrintTupleFieldsToStrings() to be defined by
  8862. // induction on the number of tuple fields. The idea is that
  8863. // TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
  8864. // fields in tuple t, and can be defined in terms of
  8865. // TuplePrefixPrinter<N - 1>.
  8866. // The inductive case.
  8867. template <size_t N>
  8868. struct TuplePrefixPrinter {
  8869. // Prints the first N fields of a tuple.
  8870. template <typename Tuple>
  8871. static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
  8872. TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
  8873. *os << ", ";
  8874. UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>
  8875. ::Print(::std::tr1::get<N - 1>(t), os);
  8876. }
  8877. // Tersely prints the first N fields of a tuple to a string vector,
  8878. // one element for each field.
  8879. template <typename Tuple>
  8880. static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
  8881. TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
  8882. ::std::stringstream ss;
  8883. UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);
  8884. strings->push_back(ss.str());
  8885. }
  8886. };
  8887. // Base cases.
  8888. template <>
  8889. struct TuplePrefixPrinter<0> {
  8890. template <typename Tuple>
  8891. static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
  8892. template <typename Tuple>
  8893. static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
  8894. };
  8895. // We have to specialize the entire TuplePrefixPrinter<> class
  8896. // template here, even though the definition of
  8897. // TersePrintPrefixToStrings() is the same as the generic version, as
  8898. // Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't
  8899. // support specializing a method template of a class template.
  8900. template <>
  8901. struct TuplePrefixPrinter<1> {
  8902. template <typename Tuple>
  8903. static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
  8904. UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::
  8905. Print(::std::tr1::get<0>(t), os);
  8906. }
  8907. template <typename Tuple>
  8908. static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
  8909. ::std::stringstream ss;
  8910. UniversalTersePrint(::std::tr1::get<0>(t), &ss);
  8911. strings->push_back(ss.str());
  8912. }
  8913. };
  8914. // Helper function for printing a tuple. T must be instantiated with
  8915. // a tuple type.
  8916. template <typename T>
  8917. void PrintTupleTo(const T& t, ::std::ostream* os) {
  8918. *os << "(";
  8919. TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::
  8920. PrintPrefixTo(t, os);
  8921. *os << ")";
  8922. }
  8923. // Prints the fields of a tuple tersely to a string vector, one
  8924. // element for each field. See the comment before
  8925. // UniversalTersePrint() for how we define "tersely".
  8926. template <typename Tuple>
  8927. Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
  8928. Strings result;
  8929. TuplePrefixPrinter< ::std::tr1::tuple_size<Tuple>::value>::
  8930. TersePrintPrefixToStrings(value, &result);
  8931. return result;
  8932. }
  8933. #endif // GTEST_HAS_TR1_TUPLE
  8934. } // namespace internal
  8935. template <typename T>
  8936. ::std::string PrintToString(const T& value) {
  8937. ::std::stringstream ss;
  8938. internal::UniversalTersePrint(value, &ss);
  8939. return ss.str();
  8940. }
  8941. } // namespace testing
  8942. #endif // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
  8943. #if GTEST_HAS_PARAM_TEST
  8944. namespace testing {
  8945. namespace internal {
  8946. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  8947. //
  8948. // Outputs a message explaining invalid registration of different
  8949. // fixture class for the same test case. This may happen when
  8950. // TEST_P macro is used to define two tests with the same name
  8951. // but in different namespaces.
  8952. GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
  8953. const char* file, int line);
  8954. template <typename> class ParamGeneratorInterface;
  8955. template <typename> class ParamGenerator;
  8956. // Interface for iterating over elements provided by an implementation
  8957. // of ParamGeneratorInterface<T>.
  8958. template <typename T>
  8959. class ParamIteratorInterface {
  8960. public:
  8961. virtual ~ParamIteratorInterface() {}
  8962. // A pointer to the base generator instance.
  8963. // Used only for the purposes of iterator comparison
  8964. // to make sure that two iterators belong to the same generator.
  8965. virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
  8966. // Advances iterator to point to the next element
  8967. // provided by the generator. The caller is responsible
  8968. // for not calling Advance() on an iterator equal to
  8969. // BaseGenerator()->End().
  8970. virtual void Advance() = 0;
  8971. // Clones the iterator object. Used for implementing copy semantics
  8972. // of ParamIterator<T>.
  8973. virtual ParamIteratorInterface* Clone() const = 0;
  8974. // Dereferences the current iterator and provides (read-only) access
  8975. // to the pointed value. It is the caller's responsibility not to call
  8976. // Current() on an iterator equal to BaseGenerator()->End().
  8977. // Used for implementing ParamGenerator<T>::operator*().
  8978. virtual const T* Current() const = 0;
  8979. // Determines whether the given iterator and other point to the same
  8980. // element in the sequence generated by the generator.
  8981. // Used for implementing ParamGenerator<T>::operator==().
  8982. virtual bool Equals(const ParamIteratorInterface& other) const = 0;
  8983. };
  8984. // Class iterating over elements provided by an implementation of
  8985. // ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
  8986. // and implements the const forward iterator concept.
  8987. template <typename T>
  8988. class ParamIterator {
  8989. public:
  8990. typedef T value_type;
  8991. typedef const T& reference;
  8992. typedef ptrdiff_t difference_type;
  8993. // ParamIterator assumes ownership of the impl_ pointer.
  8994. ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
  8995. ParamIterator& operator=(const ParamIterator& other) {
  8996. if (this != &other)
  8997. impl_.reset(other.impl_->Clone());
  8998. return *this;
  8999. }
  9000. const T& operator*() const { return *impl_->Current(); }
  9001. const T* operator->() const { return impl_->Current(); }
  9002. // Prefix version of operator++.
  9003. ParamIterator& operator++() {
  9004. impl_->Advance();
  9005. return *this;
  9006. }
  9007. // Postfix version of operator++.
  9008. ParamIterator operator++(int /*unused*/) {
  9009. ParamIteratorInterface<T>* clone = impl_->Clone();
  9010. impl_->Advance();
  9011. return ParamIterator(clone);
  9012. }
  9013. bool operator==(const ParamIterator& other) const {
  9014. return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
  9015. }
  9016. bool operator!=(const ParamIterator& other) const {
  9017. return !(*this == other);
  9018. }
  9019. private:
  9020. friend class ParamGenerator<T>;
  9021. explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
  9022. scoped_ptr<ParamIteratorInterface<T> > impl_;
  9023. };
  9024. // ParamGeneratorInterface<T> is the binary interface to access generators
  9025. // defined in other translation units.
  9026. template <typename T>
  9027. class ParamGeneratorInterface {
  9028. public:
  9029. typedef T ParamType;
  9030. virtual ~ParamGeneratorInterface() {}
  9031. // Generator interface definition
  9032. virtual ParamIteratorInterface<T>* Begin() const = 0;
  9033. virtual ParamIteratorInterface<T>* End() const = 0;
  9034. };
  9035. // Wraps ParamGeneratorInterface<T> and provides general generator syntax
  9036. // compatible with the STL Container concept.
  9037. // This class implements copy initialization semantics and the contained
  9038. // ParamGeneratorInterface<T> instance is shared among all copies
  9039. // of the original object. This is possible because that instance is immutable.
  9040. template<typename T>
  9041. class ParamGenerator {
  9042. public:
  9043. typedef ParamIterator<T> iterator;
  9044. explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
  9045. ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
  9046. ParamGenerator& operator=(const ParamGenerator& other) {
  9047. impl_ = other.impl_;
  9048. return *this;
  9049. }
  9050. iterator begin() const { return iterator(impl_->Begin()); }
  9051. iterator end() const { return iterator(impl_->End()); }
  9052. private:
  9053. linked_ptr<const ParamGeneratorInterface<T> > impl_;
  9054. };
  9055. // Generates values from a range of two comparable values. Can be used to
  9056. // generate sequences of user-defined types that implement operator+() and
  9057. // operator<().
  9058. // This class is used in the Range() function.
  9059. template <typename T, typename IncrementT>
  9060. class RangeGenerator : public ParamGeneratorInterface<T> {
  9061. public:
  9062. RangeGenerator(T begin, T end, IncrementT step)
  9063. : begin_(begin), end_(end),
  9064. step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
  9065. virtual ~RangeGenerator() {}
  9066. virtual ParamIteratorInterface<T>* Begin() const {
  9067. return new Iterator(this, begin_, 0, step_);
  9068. }
  9069. virtual ParamIteratorInterface<T>* End() const {
  9070. return new Iterator(this, end_, end_index_, step_);
  9071. }
  9072. private:
  9073. class Iterator : public ParamIteratorInterface<T> {
  9074. public:
  9075. Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
  9076. IncrementT step)
  9077. : base_(base), value_(value), index_(index), step_(step) {}
  9078. virtual ~Iterator() {}
  9079. virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
  9080. return base_;
  9081. }
  9082. virtual void Advance() {
  9083. value_ = value_ + step_;
  9084. index_++;
  9085. }
  9086. virtual ParamIteratorInterface<T>* Clone() const {
  9087. return new Iterator(*this);
  9088. }
  9089. virtual const T* Current() const { return &value_; }
  9090. virtual bool Equals(const ParamIteratorInterface<T>& other) const {
  9091. // Having the same base generator guarantees that the other
  9092. // iterator is of the same type and we can downcast.
  9093. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  9094. << "The program attempted to compare iterators "
  9095. << "from different generators." << std::endl;
  9096. const int other_index =
  9097. CheckedDowncastToActualType<const Iterator>(&other)->index_;
  9098. return index_ == other_index;
  9099. }
  9100. private:
  9101. Iterator(const Iterator& other)
  9102. : ParamIteratorInterface<T>(),
  9103. base_(other.base_), value_(other.value_), index_(other.index_),
  9104. step_(other.step_) {}
  9105. // No implementation - assignment is unsupported.
  9106. void operator=(const Iterator& other);
  9107. const ParamGeneratorInterface<T>* const base_;
  9108. T value_;
  9109. int index_;
  9110. const IncrementT step_;
  9111. }; // class RangeGenerator::Iterator
  9112. static int CalculateEndIndex(const T& begin,
  9113. const T& end,
  9114. const IncrementT& step) {
  9115. int end_index = 0;
  9116. for (T i = begin; i < end; i = i + step)
  9117. end_index++;
  9118. return end_index;
  9119. }
  9120. // No implementation - assignment is unsupported.
  9121. void operator=(const RangeGenerator& other);
  9122. const T begin_;
  9123. const T end_;
  9124. const IncrementT step_;
  9125. // The index for the end() iterator. All the elements in the generated
  9126. // sequence are indexed (0-based) to aid iterator comparison.
  9127. const int end_index_;
  9128. }; // class RangeGenerator
  9129. // Generates values from a pair of STL-style iterators. Used in the
  9130. // ValuesIn() function. The elements are copied from the source range
  9131. // since the source can be located on the stack, and the generator
  9132. // is likely to persist beyond that stack frame.
  9133. template <typename T>
  9134. class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
  9135. public:
  9136. template <typename ForwardIterator>
  9137. ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
  9138. : container_(begin, end) {}
  9139. virtual ~ValuesInIteratorRangeGenerator() {}
  9140. virtual ParamIteratorInterface<T>* Begin() const {
  9141. return new Iterator(this, container_.begin());
  9142. }
  9143. virtual ParamIteratorInterface<T>* End() const {
  9144. return new Iterator(this, container_.end());
  9145. }
  9146. private:
  9147. typedef typename ::std::vector<T> ContainerType;
  9148. class Iterator : public ParamIteratorInterface<T> {
  9149. public:
  9150. Iterator(const ParamGeneratorInterface<T>* base,
  9151. typename ContainerType::const_iterator iterator)
  9152. : base_(base), iterator_(iterator) {}
  9153. virtual ~Iterator() {}
  9154. virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
  9155. return base_;
  9156. }
  9157. virtual void Advance() {
  9158. ++iterator_;
  9159. value_.reset();
  9160. }
  9161. virtual ParamIteratorInterface<T>* Clone() const {
  9162. return new Iterator(*this);
  9163. }
  9164. // We need to use cached value referenced by iterator_ because *iterator_
  9165. // can return a temporary object (and of type other then T), so just
  9166. // having "return &*iterator_;" doesn't work.
  9167. // value_ is updated here and not in Advance() because Advance()
  9168. // can advance iterator_ beyond the end of the range, and we cannot
  9169. // detect that fact. The client code, on the other hand, is
  9170. // responsible for not calling Current() on an out-of-range iterator.
  9171. virtual const T* Current() const {
  9172. if (value_.get() == NULL)
  9173. value_.reset(new T(*iterator_));
  9174. return value_.get();
  9175. }
  9176. virtual bool Equals(const ParamIteratorInterface<T>& other) const {
  9177. // Having the same base generator guarantees that the other
  9178. // iterator is of the same type and we can downcast.
  9179. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  9180. << "The program attempted to compare iterators "
  9181. << "from different generators." << std::endl;
  9182. return iterator_ ==
  9183. CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
  9184. }
  9185. private:
  9186. Iterator(const Iterator& other)
  9187. // The explicit constructor call suppresses a false warning
  9188. // emitted by gcc when supplied with the -Wextra option.
  9189. : ParamIteratorInterface<T>(),
  9190. base_(other.base_),
  9191. iterator_(other.iterator_) {}
  9192. const ParamGeneratorInterface<T>* const base_;
  9193. typename ContainerType::const_iterator iterator_;
  9194. // A cached value of *iterator_. We keep it here to allow access by
  9195. // pointer in the wrapping iterator's operator->().
  9196. // value_ needs to be mutable to be accessed in Current().
  9197. // Use of scoped_ptr helps manage cached value's lifetime,
  9198. // which is bound by the lifespan of the iterator itself.
  9199. mutable scoped_ptr<const T> value_;
  9200. }; // class ValuesInIteratorRangeGenerator::Iterator
  9201. // No implementation - assignment is unsupported.
  9202. void operator=(const ValuesInIteratorRangeGenerator& other);
  9203. const ContainerType container_;
  9204. }; // class ValuesInIteratorRangeGenerator
  9205. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9206. //
  9207. // Stores a parameter value and later creates tests parameterized with that
  9208. // value.
  9209. template <class TestClass>
  9210. class ParameterizedTestFactory : public TestFactoryBase {
  9211. public:
  9212. typedef typename TestClass::ParamType ParamType;
  9213. explicit ParameterizedTestFactory(ParamType parameter) :
  9214. parameter_(parameter) {}
  9215. virtual Test* CreateTest() {
  9216. TestClass::SetParam(&parameter_);
  9217. return new TestClass();
  9218. }
  9219. private:
  9220. const ParamType parameter_;
  9221. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
  9222. };
  9223. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9224. //
  9225. // TestMetaFactoryBase is a base class for meta-factories that create
  9226. // test factories for passing into MakeAndRegisterTestInfo function.
  9227. template <class ParamType>
  9228. class TestMetaFactoryBase {
  9229. public:
  9230. virtual ~TestMetaFactoryBase() {}
  9231. virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
  9232. };
  9233. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9234. //
  9235. // TestMetaFactory creates test factories for passing into
  9236. // MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
  9237. // ownership of test factory pointer, same factory object cannot be passed
  9238. // into that method twice. But ParameterizedTestCaseInfo is going to call
  9239. // it for each Test/Parameter value combination. Thus it needs meta factory
  9240. // creator class.
  9241. template <class TestCase>
  9242. class TestMetaFactory
  9243. : public TestMetaFactoryBase<typename TestCase::ParamType> {
  9244. public:
  9245. typedef typename TestCase::ParamType ParamType;
  9246. TestMetaFactory() {}
  9247. virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
  9248. return new ParameterizedTestFactory<TestCase>(parameter);
  9249. }
  9250. private:
  9251. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
  9252. };
  9253. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9254. //
  9255. // ParameterizedTestCaseInfoBase is a generic interface
  9256. // to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
  9257. // accumulates test information provided by TEST_P macro invocations
  9258. // and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
  9259. // and uses that information to register all resulting test instances
  9260. // in RegisterTests method. The ParameterizeTestCaseRegistry class holds
  9261. // a collection of pointers to the ParameterizedTestCaseInfo objects
  9262. // and calls RegisterTests() on each of them when asked.
  9263. class ParameterizedTestCaseInfoBase {
  9264. public:
  9265. virtual ~ParameterizedTestCaseInfoBase() {}
  9266. // Base part of test case name for display purposes.
  9267. virtual const string& GetTestCaseName() const = 0;
  9268. // Test case id to verify identity.
  9269. virtual TypeId GetTestCaseTypeId() const = 0;
  9270. // UnitTest class invokes this method to register tests in this
  9271. // test case right before running them in RUN_ALL_TESTS macro.
  9272. // This method should not be called more then once on any single
  9273. // instance of a ParameterizedTestCaseInfoBase derived class.
  9274. virtual void RegisterTests() = 0;
  9275. protected:
  9276. ParameterizedTestCaseInfoBase() {}
  9277. private:
  9278. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
  9279. };
  9280. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9281. //
  9282. // ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
  9283. // macro invocations for a particular test case and generators
  9284. // obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
  9285. // test case. It registers tests with all values generated by all
  9286. // generators when asked.
  9287. template <class TestCase>
  9288. class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
  9289. public:
  9290. // ParamType and GeneratorCreationFunc are private types but are required
  9291. // for declarations of public methods AddTestPattern() and
  9292. // AddTestCaseInstantiation().
  9293. typedef typename TestCase::ParamType ParamType;
  9294. // A function that returns an instance of appropriate generator type.
  9295. typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
  9296. explicit ParameterizedTestCaseInfo(const char* name)
  9297. : test_case_name_(name) {}
  9298. // Test case base name for display purposes.
  9299. virtual const string& GetTestCaseName() const { return test_case_name_; }
  9300. // Test case id to verify identity.
  9301. virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
  9302. // TEST_P macro uses AddTestPattern() to record information
  9303. // about a single test in a LocalTestInfo structure.
  9304. // test_case_name is the base name of the test case (without invocation
  9305. // prefix). test_base_name is the name of an individual test without
  9306. // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
  9307. // test case base name and DoBar is test base name.
  9308. void AddTestPattern(const char* test_case_name,
  9309. const char* test_base_name,
  9310. TestMetaFactoryBase<ParamType>* meta_factory) {
  9311. tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
  9312. test_base_name,
  9313. meta_factory)));
  9314. }
  9315. // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
  9316. // about a generator.
  9317. int AddTestCaseInstantiation(const string& instantiation_name,
  9318. GeneratorCreationFunc* func,
  9319. const char* /* file */,
  9320. int /* line */) {
  9321. instantiations_.push_back(::std::make_pair(instantiation_name, func));
  9322. return 0; // Return value used only to run this method in namespace scope.
  9323. }
  9324. // UnitTest class invokes this method to register tests in this test case
  9325. // test cases right before running tests in RUN_ALL_TESTS macro.
  9326. // This method should not be called more then once on any single
  9327. // instance of a ParameterizedTestCaseInfoBase derived class.
  9328. // UnitTest has a guard to prevent from calling this method more then once.
  9329. virtual void RegisterTests() {
  9330. for (typename TestInfoContainer::iterator test_it = tests_.begin();
  9331. test_it != tests_.end(); ++test_it) {
  9332. linked_ptr<TestInfo> test_info = *test_it;
  9333. for (typename InstantiationContainer::iterator gen_it =
  9334. instantiations_.begin(); gen_it != instantiations_.end();
  9335. ++gen_it) {
  9336. const string& instantiation_name = gen_it->first;
  9337. ParamGenerator<ParamType> generator((*gen_it->second)());
  9338. Message test_case_name_stream;
  9339. if ( !instantiation_name.empty() )
  9340. test_case_name_stream << instantiation_name << "/";
  9341. test_case_name_stream << test_info->test_case_base_name;
  9342. int i = 0;
  9343. for (typename ParamGenerator<ParamType>::iterator param_it =
  9344. generator.begin();
  9345. param_it != generator.end(); ++param_it, ++i) {
  9346. Message test_name_stream;
  9347. test_name_stream << test_info->test_base_name << "/" << i;
  9348. MakeAndRegisterTestInfo(
  9349. test_case_name_stream.GetString().c_str(),
  9350. test_name_stream.GetString().c_str(),
  9351. NULL, // No type parameter.
  9352. PrintToString(*param_it).c_str(),
  9353. GetTestCaseTypeId(),
  9354. TestCase::SetUpTestCase,
  9355. TestCase::TearDownTestCase,
  9356. test_info->test_meta_factory->CreateTestFactory(*param_it));
  9357. } // for param_it
  9358. } // for gen_it
  9359. } // for test_it
  9360. } // RegisterTests
  9361. private:
  9362. // LocalTestInfo structure keeps information about a single test registered
  9363. // with TEST_P macro.
  9364. struct TestInfo {
  9365. TestInfo(const char* a_test_case_base_name,
  9366. const char* a_test_base_name,
  9367. TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
  9368. test_case_base_name(a_test_case_base_name),
  9369. test_base_name(a_test_base_name),
  9370. test_meta_factory(a_test_meta_factory) {}
  9371. const string test_case_base_name;
  9372. const string test_base_name;
  9373. const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
  9374. };
  9375. typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
  9376. // Keeps pairs of <Instantiation name, Sequence generator creation function>
  9377. // received from INSTANTIATE_TEST_CASE_P macros.
  9378. typedef ::std::vector<std::pair<string, GeneratorCreationFunc*> >
  9379. InstantiationContainer;
  9380. const string test_case_name_;
  9381. TestInfoContainer tests_;
  9382. InstantiationContainer instantiations_;
  9383. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
  9384. }; // class ParameterizedTestCaseInfo
  9385. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9386. //
  9387. // ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
  9388. // classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
  9389. // macros use it to locate their corresponding ParameterizedTestCaseInfo
  9390. // descriptors.
  9391. class ParameterizedTestCaseRegistry {
  9392. public:
  9393. ParameterizedTestCaseRegistry() {}
  9394. ~ParameterizedTestCaseRegistry() {
  9395. for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
  9396. it != test_case_infos_.end(); ++it) {
  9397. delete *it;
  9398. }
  9399. }
  9400. // Looks up or creates and returns a structure containing information about
  9401. // tests and instantiations of a particular test case.
  9402. template <class TestCase>
  9403. ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
  9404. const char* test_case_name,
  9405. const char* file,
  9406. int line) {
  9407. ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
  9408. for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
  9409. it != test_case_infos_.end(); ++it) {
  9410. if ((*it)->GetTestCaseName() == test_case_name) {
  9411. if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
  9412. // Complain about incorrect usage of Google Test facilities
  9413. // and terminate the program since we cannot guaranty correct
  9414. // test case setup and tear-down in this case.
  9415. ReportInvalidTestCaseType(test_case_name, file, line);
  9416. posix::Abort();
  9417. } else {
  9418. // At this point we are sure that the object we found is of the same
  9419. // type we are looking for, so we downcast it to that type
  9420. // without further checks.
  9421. typed_test_info = CheckedDowncastToActualType<
  9422. ParameterizedTestCaseInfo<TestCase> >(*it);
  9423. }
  9424. break;
  9425. }
  9426. }
  9427. if (typed_test_info == NULL) {
  9428. typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name);
  9429. test_case_infos_.push_back(typed_test_info);
  9430. }
  9431. return typed_test_info;
  9432. }
  9433. void RegisterTests() {
  9434. for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
  9435. it != test_case_infos_.end(); ++it) {
  9436. (*it)->RegisterTests();
  9437. }
  9438. }
  9439. private:
  9440. typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
  9441. TestCaseInfoContainer test_case_infos_;
  9442. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
  9443. };
  9444. } // namespace internal
  9445. } // namespace testing
  9446. #endif // GTEST_HAS_PARAM_TEST
  9447. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
  9448. // This file was GENERATED by command:
  9449. // pump.py gtest-param-util-generated.h.pump
  9450. // DO NOT EDIT BY HAND!!!
  9451. // Copyright 2008 Google Inc.
  9452. // All Rights Reserved.
  9453. //
  9454. // Redistribution and use in source and binary forms, with or without
  9455. // modification, are permitted provided that the following conditions are
  9456. // met:
  9457. //
  9458. // * Redistributions of source code must retain the above copyright
  9459. // notice, this list of conditions and the following disclaimer.
  9460. // * Redistributions in binary form must reproduce the above
  9461. // copyright notice, this list of conditions and the following disclaimer
  9462. // in the documentation and/or other materials provided with the
  9463. // distribution.
  9464. // * Neither the name of Google Inc. nor the names of its
  9465. // contributors may be used to endorse or promote products derived from
  9466. // this software without specific prior written permission.
  9467. //
  9468. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  9469. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  9470. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  9471. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  9472. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  9473. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  9474. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  9475. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  9476. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  9477. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  9478. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  9479. //
  9480. // Author: [email protected] (Vlad Losev)
  9481. // Type and function utilities for implementing parameterized tests.
  9482. // This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
  9483. //
  9484. // Currently Google Test supports at most 50 arguments in Values,
  9485. // and at most 10 arguments in Combine. Please contact
  9486. // [email protected] if you need more.
  9487. // Please note that the number of arguments to Combine is limited
  9488. // by the maximum arity of the implementation of tr1::tuple which is
  9489. // currently set at 10.
  9490. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
  9491. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
  9492. // scripts/fuse_gtest.py depends on gtest's own header being #included
  9493. // *unconditionally*. Therefore these #includes cannot be moved
  9494. // inside #if GTEST_HAS_PARAM_TEST.
  9495. #if GTEST_HAS_PARAM_TEST
  9496. namespace testing {
  9497. // Forward declarations of ValuesIn(), which is implemented in
  9498. // include/gtest/gtest-param-test.h.
  9499. template <typename ForwardIterator>
  9500. internal::ParamGenerator<
  9501. typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
  9502. ValuesIn(ForwardIterator begin, ForwardIterator end);
  9503. template <typename T, size_t N>
  9504. internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
  9505. template <class Container>
  9506. internal::ParamGenerator<typename Container::value_type> ValuesIn(
  9507. const Container& container);
  9508. namespace internal {
  9509. // Used in the Values() function to provide polymorphic capabilities.
  9510. template <typename T1>
  9511. class ValueArray1 {
  9512. public:
  9513. explicit ValueArray1(T1 v1) : v1_(v1) {}
  9514. template <typename T>
  9515. operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }
  9516. private:
  9517. // No implementation - assignment is unsupported.
  9518. void operator=(const ValueArray1& other);
  9519. const T1 v1_;
  9520. };
  9521. template <typename T1, typename T2>
  9522. class ValueArray2 {
  9523. public:
  9524. ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
  9525. template <typename T>
  9526. operator ParamGenerator<T>() const {
  9527. const T array[] = {v1_, v2_};
  9528. return ValuesIn(array);
  9529. }
  9530. private:
  9531. // No implementation - assignment is unsupported.
  9532. void operator=(const ValueArray2& other);
  9533. const T1 v1_;
  9534. const T2 v2_;
  9535. };
  9536. template <typename T1, typename T2, typename T3>
  9537. class ValueArray3 {
  9538. public:
  9539. ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
  9540. template <typename T>
  9541. operator ParamGenerator<T>() const {
  9542. const T array[] = {v1_, v2_, v3_};
  9543. return ValuesIn(array);
  9544. }
  9545. private:
  9546. // No implementation - assignment is unsupported.
  9547. void operator=(const ValueArray3& other);
  9548. const T1 v1_;
  9549. const T2 v2_;
  9550. const T3 v3_;
  9551. };
  9552. template <typename T1, typename T2, typename T3, typename T4>
  9553. class ValueArray4 {
  9554. public:
  9555. ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
  9556. v4_(v4) {}
  9557. template <typename T>
  9558. operator ParamGenerator<T>() const {
  9559. const T array[] = {v1_, v2_, v3_, v4_};
  9560. return ValuesIn(array);
  9561. }
  9562. private:
  9563. // No implementation - assignment is unsupported.
  9564. void operator=(const ValueArray4& other);
  9565. const T1 v1_;
  9566. const T2 v2_;
  9567. const T3 v3_;
  9568. const T4 v4_;
  9569. };
  9570. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  9571. class ValueArray5 {
  9572. public:
  9573. ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
  9574. v4_(v4), v5_(v5) {}
  9575. template <typename T>
  9576. operator ParamGenerator<T>() const {
  9577. const T array[] = {v1_, v2_, v3_, v4_, v5_};
  9578. return ValuesIn(array);
  9579. }
  9580. private:
  9581. // No implementation - assignment is unsupported.
  9582. void operator=(const ValueArray5& other);
  9583. const T1 v1_;
  9584. const T2 v2_;
  9585. const T3 v3_;
  9586. const T4 v4_;
  9587. const T5 v5_;
  9588. };
  9589. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9590. typename T6>
  9591. class ValueArray6 {
  9592. public:
  9593. ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
  9594. v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
  9595. template <typename T>
  9596. operator ParamGenerator<T>() const {
  9597. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_};
  9598. return ValuesIn(array);
  9599. }
  9600. private:
  9601. // No implementation - assignment is unsupported.
  9602. void operator=(const ValueArray6& other);
  9603. const T1 v1_;
  9604. const T2 v2_;
  9605. const T3 v3_;
  9606. const T4 v4_;
  9607. const T5 v5_;
  9608. const T6 v6_;
  9609. };
  9610. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9611. typename T6, typename T7>
  9612. class ValueArray7 {
  9613. public:
  9614. ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
  9615. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
  9616. template <typename T>
  9617. operator ParamGenerator<T>() const {
  9618. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_};
  9619. return ValuesIn(array);
  9620. }
  9621. private:
  9622. // No implementation - assignment is unsupported.
  9623. void operator=(const ValueArray7& other);
  9624. const T1 v1_;
  9625. const T2 v2_;
  9626. const T3 v3_;
  9627. const T4 v4_;
  9628. const T5 v5_;
  9629. const T6 v6_;
  9630. const T7 v7_;
  9631. };
  9632. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9633. typename T6, typename T7, typename T8>
  9634. class ValueArray8 {
  9635. public:
  9636. ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  9637. T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  9638. v8_(v8) {}
  9639. template <typename T>
  9640. operator ParamGenerator<T>() const {
  9641. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_};
  9642. return ValuesIn(array);
  9643. }
  9644. private:
  9645. // No implementation - assignment is unsupported.
  9646. void operator=(const ValueArray8& other);
  9647. const T1 v1_;
  9648. const T2 v2_;
  9649. const T3 v3_;
  9650. const T4 v4_;
  9651. const T5 v5_;
  9652. const T6 v6_;
  9653. const T7 v7_;
  9654. const T8 v8_;
  9655. };
  9656. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9657. typename T6, typename T7, typename T8, typename T9>
  9658. class ValueArray9 {
  9659. public:
  9660. ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  9661. T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  9662. v8_(v8), v9_(v9) {}
  9663. template <typename T>
  9664. operator ParamGenerator<T>() const {
  9665. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_};
  9666. return ValuesIn(array);
  9667. }
  9668. private:
  9669. // No implementation - assignment is unsupported.
  9670. void operator=(const ValueArray9& other);
  9671. const T1 v1_;
  9672. const T2 v2_;
  9673. const T3 v3_;
  9674. const T4 v4_;
  9675. const T5 v5_;
  9676. const T6 v6_;
  9677. const T7 v7_;
  9678. const T8 v8_;
  9679. const T9 v9_;
  9680. };
  9681. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9682. typename T6, typename T7, typename T8, typename T9, typename T10>
  9683. class ValueArray10 {
  9684. public:
  9685. ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9686. T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  9687. v8_(v8), v9_(v9), v10_(v10) {}
  9688. template <typename T>
  9689. operator ParamGenerator<T>() const {
  9690. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_};
  9691. return ValuesIn(array);
  9692. }
  9693. private:
  9694. // No implementation - assignment is unsupported.
  9695. void operator=(const ValueArray10& other);
  9696. const T1 v1_;
  9697. const T2 v2_;
  9698. const T3 v3_;
  9699. const T4 v4_;
  9700. const T5 v5_;
  9701. const T6 v6_;
  9702. const T7 v7_;
  9703. const T8 v8_;
  9704. const T9 v9_;
  9705. const T10 v10_;
  9706. };
  9707. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9708. typename T6, typename T7, typename T8, typename T9, typename T10,
  9709. typename T11>
  9710. class ValueArray11 {
  9711. public:
  9712. ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9713. T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  9714. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
  9715. template <typename T>
  9716. operator ParamGenerator<T>() const {
  9717. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_};
  9718. return ValuesIn(array);
  9719. }
  9720. private:
  9721. // No implementation - assignment is unsupported.
  9722. void operator=(const ValueArray11& other);
  9723. const T1 v1_;
  9724. const T2 v2_;
  9725. const T3 v3_;
  9726. const T4 v4_;
  9727. const T5 v5_;
  9728. const T6 v6_;
  9729. const T7 v7_;
  9730. const T8 v8_;
  9731. const T9 v9_;
  9732. const T10 v10_;
  9733. const T11 v11_;
  9734. };
  9735. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9736. typename T6, typename T7, typename T8, typename T9, typename T10,
  9737. typename T11, typename T12>
  9738. class ValueArray12 {
  9739. public:
  9740. ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9741. T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  9742. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
  9743. template <typename T>
  9744. operator ParamGenerator<T>() const {
  9745. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9746. v12_};
  9747. return ValuesIn(array);
  9748. }
  9749. private:
  9750. // No implementation - assignment is unsupported.
  9751. void operator=(const ValueArray12& other);
  9752. const T1 v1_;
  9753. const T2 v2_;
  9754. const T3 v3_;
  9755. const T4 v4_;
  9756. const T5 v5_;
  9757. const T6 v6_;
  9758. const T7 v7_;
  9759. const T8 v8_;
  9760. const T9 v9_;
  9761. const T10 v10_;
  9762. const T11 v11_;
  9763. const T12 v12_;
  9764. };
  9765. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9766. typename T6, typename T7, typename T8, typename T9, typename T10,
  9767. typename T11, typename T12, typename T13>
  9768. class ValueArray13 {
  9769. public:
  9770. ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9771. T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  9772. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  9773. v12_(v12), v13_(v13) {}
  9774. template <typename T>
  9775. operator ParamGenerator<T>() const {
  9776. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9777. v12_, v13_};
  9778. return ValuesIn(array);
  9779. }
  9780. private:
  9781. // No implementation - assignment is unsupported.
  9782. void operator=(const ValueArray13& other);
  9783. const T1 v1_;
  9784. const T2 v2_;
  9785. const T3 v3_;
  9786. const T4 v4_;
  9787. const T5 v5_;
  9788. const T6 v6_;
  9789. const T7 v7_;
  9790. const T8 v8_;
  9791. const T9 v9_;
  9792. const T10 v10_;
  9793. const T11 v11_;
  9794. const T12 v12_;
  9795. const T13 v13_;
  9796. };
  9797. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9798. typename T6, typename T7, typename T8, typename T9, typename T10,
  9799. typename T11, typename T12, typename T13, typename T14>
  9800. class ValueArray14 {
  9801. public:
  9802. ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9803. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
  9804. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  9805. v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
  9806. template <typename T>
  9807. operator ParamGenerator<T>() const {
  9808. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9809. v12_, v13_, v14_};
  9810. return ValuesIn(array);
  9811. }
  9812. private:
  9813. // No implementation - assignment is unsupported.
  9814. void operator=(const ValueArray14& other);
  9815. const T1 v1_;
  9816. const T2 v2_;
  9817. const T3 v3_;
  9818. const T4 v4_;
  9819. const T5 v5_;
  9820. const T6 v6_;
  9821. const T7 v7_;
  9822. const T8 v8_;
  9823. const T9 v9_;
  9824. const T10 v10_;
  9825. const T11 v11_;
  9826. const T12 v12_;
  9827. const T13 v13_;
  9828. const T14 v14_;
  9829. };
  9830. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9831. typename T6, typename T7, typename T8, typename T9, typename T10,
  9832. typename T11, typename T12, typename T13, typename T14, typename T15>
  9833. class ValueArray15 {
  9834. public:
  9835. ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9836. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
  9837. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  9838. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
  9839. template <typename T>
  9840. operator ParamGenerator<T>() const {
  9841. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9842. v12_, v13_, v14_, v15_};
  9843. return ValuesIn(array);
  9844. }
  9845. private:
  9846. // No implementation - assignment is unsupported.
  9847. void operator=(const ValueArray15& other);
  9848. const T1 v1_;
  9849. const T2 v2_;
  9850. const T3 v3_;
  9851. const T4 v4_;
  9852. const T5 v5_;
  9853. const T6 v6_;
  9854. const T7 v7_;
  9855. const T8 v8_;
  9856. const T9 v9_;
  9857. const T10 v10_;
  9858. const T11 v11_;
  9859. const T12 v12_;
  9860. const T13 v13_;
  9861. const T14 v14_;
  9862. const T15 v15_;
  9863. };
  9864. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9865. typename T6, typename T7, typename T8, typename T9, typename T10,
  9866. typename T11, typename T12, typename T13, typename T14, typename T15,
  9867. typename T16>
  9868. class ValueArray16 {
  9869. public:
  9870. ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9871. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
  9872. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  9873. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  9874. v16_(v16) {}
  9875. template <typename T>
  9876. operator ParamGenerator<T>() const {
  9877. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9878. v12_, v13_, v14_, v15_, v16_};
  9879. return ValuesIn(array);
  9880. }
  9881. private:
  9882. // No implementation - assignment is unsupported.
  9883. void operator=(const ValueArray16& other);
  9884. const T1 v1_;
  9885. const T2 v2_;
  9886. const T3 v3_;
  9887. const T4 v4_;
  9888. const T5 v5_;
  9889. const T6 v6_;
  9890. const T7 v7_;
  9891. const T8 v8_;
  9892. const T9 v9_;
  9893. const T10 v10_;
  9894. const T11 v11_;
  9895. const T12 v12_;
  9896. const T13 v13_;
  9897. const T14 v14_;
  9898. const T15 v15_;
  9899. const T16 v16_;
  9900. };
  9901. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9902. typename T6, typename T7, typename T8, typename T9, typename T10,
  9903. typename T11, typename T12, typename T13, typename T14, typename T15,
  9904. typename T16, typename T17>
  9905. class ValueArray17 {
  9906. public:
  9907. ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9908. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
  9909. T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  9910. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  9911. v15_(v15), v16_(v16), v17_(v17) {}
  9912. template <typename T>
  9913. operator ParamGenerator<T>() const {
  9914. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9915. v12_, v13_, v14_, v15_, v16_, v17_};
  9916. return ValuesIn(array);
  9917. }
  9918. private:
  9919. // No implementation - assignment is unsupported.
  9920. void operator=(const ValueArray17& other);
  9921. const T1 v1_;
  9922. const T2 v2_;
  9923. const T3 v3_;
  9924. const T4 v4_;
  9925. const T5 v5_;
  9926. const T6 v6_;
  9927. const T7 v7_;
  9928. const T8 v8_;
  9929. const T9 v9_;
  9930. const T10 v10_;
  9931. const T11 v11_;
  9932. const T12 v12_;
  9933. const T13 v13_;
  9934. const T14 v14_;
  9935. const T15 v15_;
  9936. const T16 v16_;
  9937. const T17 v17_;
  9938. };
  9939. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9940. typename T6, typename T7, typename T8, typename T9, typename T10,
  9941. typename T11, typename T12, typename T13, typename T14, typename T15,
  9942. typename T16, typename T17, typename T18>
  9943. class ValueArray18 {
  9944. public:
  9945. ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9946. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  9947. T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  9948. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  9949. v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
  9950. template <typename T>
  9951. operator ParamGenerator<T>() const {
  9952. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9953. v12_, v13_, v14_, v15_, v16_, v17_, v18_};
  9954. return ValuesIn(array);
  9955. }
  9956. private:
  9957. // No implementation - assignment is unsupported.
  9958. void operator=(const ValueArray18& other);
  9959. const T1 v1_;
  9960. const T2 v2_;
  9961. const T3 v3_;
  9962. const T4 v4_;
  9963. const T5 v5_;
  9964. const T6 v6_;
  9965. const T7 v7_;
  9966. const T8 v8_;
  9967. const T9 v9_;
  9968. const T10 v10_;
  9969. const T11 v11_;
  9970. const T12 v12_;
  9971. const T13 v13_;
  9972. const T14 v14_;
  9973. const T15 v15_;
  9974. const T16 v16_;
  9975. const T17 v17_;
  9976. const T18 v18_;
  9977. };
  9978. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9979. typename T6, typename T7, typename T8, typename T9, typename T10,
  9980. typename T11, typename T12, typename T13, typename T14, typename T15,
  9981. typename T16, typename T17, typename T18, typename T19>
  9982. class ValueArray19 {
  9983. public:
  9984. ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9985. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  9986. T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  9987. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  9988. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
  9989. template <typename T>
  9990. operator ParamGenerator<T>() const {
  9991. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9992. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_};
  9993. return ValuesIn(array);
  9994. }
  9995. private:
  9996. // No implementation - assignment is unsupported.
  9997. void operator=(const ValueArray19& other);
  9998. const T1 v1_;
  9999. const T2 v2_;
  10000. const T3 v3_;
  10001. const T4 v4_;
  10002. const T5 v5_;
  10003. const T6 v6_;
  10004. const T7 v7_;
  10005. const T8 v8_;
  10006. const T9 v9_;
  10007. const T10 v10_;
  10008. const T11 v11_;
  10009. const T12 v12_;
  10010. const T13 v13_;
  10011. const T14 v14_;
  10012. const T15 v15_;
  10013. const T16 v16_;
  10014. const T17 v17_;
  10015. const T18 v18_;
  10016. const T19 v19_;
  10017. };
  10018. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10019. typename T6, typename T7, typename T8, typename T9, typename T10,
  10020. typename T11, typename T12, typename T13, typename T14, typename T15,
  10021. typename T16, typename T17, typename T18, typename T19, typename T20>
  10022. class ValueArray20 {
  10023. public:
  10024. ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10025. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10026. T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  10027. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  10028. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  10029. v19_(v19), v20_(v20) {}
  10030. template <typename T>
  10031. operator ParamGenerator<T>() const {
  10032. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10033. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_};
  10034. return ValuesIn(array);
  10035. }
  10036. private:
  10037. // No implementation - assignment is unsupported.
  10038. void operator=(const ValueArray20& other);
  10039. const T1 v1_;
  10040. const T2 v2_;
  10041. const T3 v3_;
  10042. const T4 v4_;
  10043. const T5 v5_;
  10044. const T6 v6_;
  10045. const T7 v7_;
  10046. const T8 v8_;
  10047. const T9 v9_;
  10048. const T10 v10_;
  10049. const T11 v11_;
  10050. const T12 v12_;
  10051. const T13 v13_;
  10052. const T14 v14_;
  10053. const T15 v15_;
  10054. const T16 v16_;
  10055. const T17 v17_;
  10056. const T18 v18_;
  10057. const T19 v19_;
  10058. const T20 v20_;
  10059. };
  10060. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10061. typename T6, typename T7, typename T8, typename T9, typename T10,
  10062. typename T11, typename T12, typename T13, typename T14, typename T15,
  10063. typename T16, typename T17, typename T18, typename T19, typename T20,
  10064. typename T21>
  10065. class ValueArray21 {
  10066. public:
  10067. ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10068. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10069. T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  10070. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  10071. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  10072. v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
  10073. template <typename T>
  10074. operator ParamGenerator<T>() const {
  10075. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10076. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_};
  10077. return ValuesIn(array);
  10078. }
  10079. private:
  10080. // No implementation - assignment is unsupported.
  10081. void operator=(const ValueArray21& other);
  10082. const T1 v1_;
  10083. const T2 v2_;
  10084. const T3 v3_;
  10085. const T4 v4_;
  10086. const T5 v5_;
  10087. const T6 v6_;
  10088. const T7 v7_;
  10089. const T8 v8_;
  10090. const T9 v9_;
  10091. const T10 v10_;
  10092. const T11 v11_;
  10093. const T12 v12_;
  10094. const T13 v13_;
  10095. const T14 v14_;
  10096. const T15 v15_;
  10097. const T16 v16_;
  10098. const T17 v17_;
  10099. const T18 v18_;
  10100. const T19 v19_;
  10101. const T20 v20_;
  10102. const T21 v21_;
  10103. };
  10104. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10105. typename T6, typename T7, typename T8, typename T9, typename T10,
  10106. typename T11, typename T12, typename T13, typename T14, typename T15,
  10107. typename T16, typename T17, typename T18, typename T19, typename T20,
  10108. typename T21, typename T22>
  10109. class ValueArray22 {
  10110. public:
  10111. ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10112. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10113. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
  10114. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  10115. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  10116. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
  10117. template <typename T>
  10118. operator ParamGenerator<T>() const {
  10119. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10120. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_};
  10121. return ValuesIn(array);
  10122. }
  10123. private:
  10124. // No implementation - assignment is unsupported.
  10125. void operator=(const ValueArray22& other);
  10126. const T1 v1_;
  10127. const T2 v2_;
  10128. const T3 v3_;
  10129. const T4 v4_;
  10130. const T5 v5_;
  10131. const T6 v6_;
  10132. const T7 v7_;
  10133. const T8 v8_;
  10134. const T9 v9_;
  10135. const T10 v10_;
  10136. const T11 v11_;
  10137. const T12 v12_;
  10138. const T13 v13_;
  10139. const T14 v14_;
  10140. const T15 v15_;
  10141. const T16 v16_;
  10142. const T17 v17_;
  10143. const T18 v18_;
  10144. const T19 v19_;
  10145. const T20 v20_;
  10146. const T21 v21_;
  10147. const T22 v22_;
  10148. };
  10149. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10150. typename T6, typename T7, typename T8, typename T9, typename T10,
  10151. typename T11, typename T12, typename T13, typename T14, typename T15,
  10152. typename T16, typename T17, typename T18, typename T19, typename T20,
  10153. typename T21, typename T22, typename T23>
  10154. class ValueArray23 {
  10155. public:
  10156. ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10157. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10158. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
  10159. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  10160. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  10161. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  10162. v23_(v23) {}
  10163. template <typename T>
  10164. operator ParamGenerator<T>() const {
  10165. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10166. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_,
  10167. v23_};
  10168. return ValuesIn(array);
  10169. }
  10170. private:
  10171. // No implementation - assignment is unsupported.
  10172. void operator=(const ValueArray23& other);
  10173. const T1 v1_;
  10174. const T2 v2_;
  10175. const T3 v3_;
  10176. const T4 v4_;
  10177. const T5 v5_;
  10178. const T6 v6_;
  10179. const T7 v7_;
  10180. const T8 v8_;
  10181. const T9 v9_;
  10182. const T10 v10_;
  10183. const T11 v11_;
  10184. const T12 v12_;
  10185. const T13 v13_;
  10186. const T14 v14_;
  10187. const T15 v15_;
  10188. const T16 v16_;
  10189. const T17 v17_;
  10190. const T18 v18_;
  10191. const T19 v19_;
  10192. const T20 v20_;
  10193. const T21 v21_;
  10194. const T22 v22_;
  10195. const T23 v23_;
  10196. };
  10197. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10198. typename T6, typename T7, typename T8, typename T9, typename T10,
  10199. typename T11, typename T12, typename T13, typename T14, typename T15,
  10200. typename T16, typename T17, typename T18, typename T19, typename T20,
  10201. typename T21, typename T22, typename T23, typename T24>
  10202. class ValueArray24 {
  10203. public:
  10204. ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10205. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10206. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
  10207. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  10208. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  10209. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  10210. v22_(v22), v23_(v23), v24_(v24) {}
  10211. template <typename T>
  10212. operator ParamGenerator<T>() const {
  10213. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10214. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10215. v24_};
  10216. return ValuesIn(array);
  10217. }
  10218. private:
  10219. // No implementation - assignment is unsupported.
  10220. void operator=(const ValueArray24& other);
  10221. const T1 v1_;
  10222. const T2 v2_;
  10223. const T3 v3_;
  10224. const T4 v4_;
  10225. const T5 v5_;
  10226. const T6 v6_;
  10227. const T7 v7_;
  10228. const T8 v8_;
  10229. const T9 v9_;
  10230. const T10 v10_;
  10231. const T11 v11_;
  10232. const T12 v12_;
  10233. const T13 v13_;
  10234. const T14 v14_;
  10235. const T15 v15_;
  10236. const T16 v16_;
  10237. const T17 v17_;
  10238. const T18 v18_;
  10239. const T19 v19_;
  10240. const T20 v20_;
  10241. const T21 v21_;
  10242. const T22 v22_;
  10243. const T23 v23_;
  10244. const T24 v24_;
  10245. };
  10246. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10247. typename T6, typename T7, typename T8, typename T9, typename T10,
  10248. typename T11, typename T12, typename T13, typename T14, typename T15,
  10249. typename T16, typename T17, typename T18, typename T19, typename T20,
  10250. typename T21, typename T22, typename T23, typename T24, typename T25>
  10251. class ValueArray25 {
  10252. public:
  10253. ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10254. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10255. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
  10256. T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  10257. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  10258. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  10259. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
  10260. template <typename T>
  10261. operator ParamGenerator<T>() const {
  10262. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10263. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10264. v24_, v25_};
  10265. return ValuesIn(array);
  10266. }
  10267. private:
  10268. // No implementation - assignment is unsupported.
  10269. void operator=(const ValueArray25& other);
  10270. const T1 v1_;
  10271. const T2 v2_;
  10272. const T3 v3_;
  10273. const T4 v4_;
  10274. const T5 v5_;
  10275. const T6 v6_;
  10276. const T7 v7_;
  10277. const T8 v8_;
  10278. const T9 v9_;
  10279. const T10 v10_;
  10280. const T11 v11_;
  10281. const T12 v12_;
  10282. const T13 v13_;
  10283. const T14 v14_;
  10284. const T15 v15_;
  10285. const T16 v16_;
  10286. const T17 v17_;
  10287. const T18 v18_;
  10288. const T19 v19_;
  10289. const T20 v20_;
  10290. const T21 v21_;
  10291. const T22 v22_;
  10292. const T23 v23_;
  10293. const T24 v24_;
  10294. const T25 v25_;
  10295. };
  10296. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10297. typename T6, typename T7, typename T8, typename T9, typename T10,
  10298. typename T11, typename T12, typename T13, typename T14, typename T15,
  10299. typename T16, typename T17, typename T18, typename T19, typename T20,
  10300. typename T21, typename T22, typename T23, typename T24, typename T25,
  10301. typename T26>
  10302. class ValueArray26 {
  10303. public:
  10304. ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10305. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10306. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10307. T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  10308. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  10309. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  10310. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
  10311. template <typename T>
  10312. operator ParamGenerator<T>() const {
  10313. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10314. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10315. v24_, v25_, v26_};
  10316. return ValuesIn(array);
  10317. }
  10318. private:
  10319. // No implementation - assignment is unsupported.
  10320. void operator=(const ValueArray26& other);
  10321. const T1 v1_;
  10322. const T2 v2_;
  10323. const T3 v3_;
  10324. const T4 v4_;
  10325. const T5 v5_;
  10326. const T6 v6_;
  10327. const T7 v7_;
  10328. const T8 v8_;
  10329. const T9 v9_;
  10330. const T10 v10_;
  10331. const T11 v11_;
  10332. const T12 v12_;
  10333. const T13 v13_;
  10334. const T14 v14_;
  10335. const T15 v15_;
  10336. const T16 v16_;
  10337. const T17 v17_;
  10338. const T18 v18_;
  10339. const T19 v19_;
  10340. const T20 v20_;
  10341. const T21 v21_;
  10342. const T22 v22_;
  10343. const T23 v23_;
  10344. const T24 v24_;
  10345. const T25 v25_;
  10346. const T26 v26_;
  10347. };
  10348. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10349. typename T6, typename T7, typename T8, typename T9, typename T10,
  10350. typename T11, typename T12, typename T13, typename T14, typename T15,
  10351. typename T16, typename T17, typename T18, typename T19, typename T20,
  10352. typename T21, typename T22, typename T23, typename T24, typename T25,
  10353. typename T26, typename T27>
  10354. class ValueArray27 {
  10355. public:
  10356. ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10357. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10358. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10359. T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  10360. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  10361. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
  10362. v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
  10363. v26_(v26), v27_(v27) {}
  10364. template <typename T>
  10365. operator ParamGenerator<T>() const {
  10366. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10367. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10368. v24_, v25_, v26_, v27_};
  10369. return ValuesIn(array);
  10370. }
  10371. private:
  10372. // No implementation - assignment is unsupported.
  10373. void operator=(const ValueArray27& other);
  10374. const T1 v1_;
  10375. const T2 v2_;
  10376. const T3 v3_;
  10377. const T4 v4_;
  10378. const T5 v5_;
  10379. const T6 v6_;
  10380. const T7 v7_;
  10381. const T8 v8_;
  10382. const T9 v9_;
  10383. const T10 v10_;
  10384. const T11 v11_;
  10385. const T12 v12_;
  10386. const T13 v13_;
  10387. const T14 v14_;
  10388. const T15 v15_;
  10389. const T16 v16_;
  10390. const T17 v17_;
  10391. const T18 v18_;
  10392. const T19 v19_;
  10393. const T20 v20_;
  10394. const T21 v21_;
  10395. const T22 v22_;
  10396. const T23 v23_;
  10397. const T24 v24_;
  10398. const T25 v25_;
  10399. const T26 v26_;
  10400. const T27 v27_;
  10401. };
  10402. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10403. typename T6, typename T7, typename T8, typename T9, typename T10,
  10404. typename T11, typename T12, typename T13, typename T14, typename T15,
  10405. typename T16, typename T17, typename T18, typename T19, typename T20,
  10406. typename T21, typename T22, typename T23, typename T24, typename T25,
  10407. typename T26, typename T27, typename T28>
  10408. class ValueArray28 {
  10409. public:
  10410. ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10411. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10412. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10413. T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  10414. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  10415. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  10416. v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
  10417. v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
  10418. template <typename T>
  10419. operator ParamGenerator<T>() const {
  10420. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10421. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10422. v24_, v25_, v26_, v27_, v28_};
  10423. return ValuesIn(array);
  10424. }
  10425. private:
  10426. // No implementation - assignment is unsupported.
  10427. void operator=(const ValueArray28& other);
  10428. const T1 v1_;
  10429. const T2 v2_;
  10430. const T3 v3_;
  10431. const T4 v4_;
  10432. const T5 v5_;
  10433. const T6 v6_;
  10434. const T7 v7_;
  10435. const T8 v8_;
  10436. const T9 v9_;
  10437. const T10 v10_;
  10438. const T11 v11_;
  10439. const T12 v12_;
  10440. const T13 v13_;
  10441. const T14 v14_;
  10442. const T15 v15_;
  10443. const T16 v16_;
  10444. const T17 v17_;
  10445. const T18 v18_;
  10446. const T19 v19_;
  10447. const T20 v20_;
  10448. const T21 v21_;
  10449. const T22 v22_;
  10450. const T23 v23_;
  10451. const T24 v24_;
  10452. const T25 v25_;
  10453. const T26 v26_;
  10454. const T27 v27_;
  10455. const T28 v28_;
  10456. };
  10457. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10458. typename T6, typename T7, typename T8, typename T9, typename T10,
  10459. typename T11, typename T12, typename T13, typename T14, typename T15,
  10460. typename T16, typename T17, typename T18, typename T19, typename T20,
  10461. typename T21, typename T22, typename T23, typename T24, typename T25,
  10462. typename T26, typename T27, typename T28, typename T29>
  10463. class ValueArray29 {
  10464. public:
  10465. ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10466. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10467. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10468. T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  10469. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  10470. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  10471. v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
  10472. v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
  10473. template <typename T>
  10474. operator ParamGenerator<T>() const {
  10475. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10476. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10477. v24_, v25_, v26_, v27_, v28_, v29_};
  10478. return ValuesIn(array);
  10479. }
  10480. private:
  10481. // No implementation - assignment is unsupported.
  10482. void operator=(const ValueArray29& other);
  10483. const T1 v1_;
  10484. const T2 v2_;
  10485. const T3 v3_;
  10486. const T4 v4_;
  10487. const T5 v5_;
  10488. const T6 v6_;
  10489. const T7 v7_;
  10490. const T8 v8_;
  10491. const T9 v9_;
  10492. const T10 v10_;
  10493. const T11 v11_;
  10494. const T12 v12_;
  10495. const T13 v13_;
  10496. const T14 v14_;
  10497. const T15 v15_;
  10498. const T16 v16_;
  10499. const T17 v17_;
  10500. const T18 v18_;
  10501. const T19 v19_;
  10502. const T20 v20_;
  10503. const T21 v21_;
  10504. const T22 v22_;
  10505. const T23 v23_;
  10506. const T24 v24_;
  10507. const T25 v25_;
  10508. const T26 v26_;
  10509. const T27 v27_;
  10510. const T28 v28_;
  10511. const T29 v29_;
  10512. };
  10513. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10514. typename T6, typename T7, typename T8, typename T9, typename T10,
  10515. typename T11, typename T12, typename T13, typename T14, typename T15,
  10516. typename T16, typename T17, typename T18, typename T19, typename T20,
  10517. typename T21, typename T22, typename T23, typename T24, typename T25,
  10518. typename T26, typename T27, typename T28, typename T29, typename T30>
  10519. class ValueArray30 {
  10520. public:
  10521. ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10522. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10523. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10524. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
  10525. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  10526. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  10527. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  10528. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  10529. v29_(v29), v30_(v30) {}
  10530. template <typename T>
  10531. operator ParamGenerator<T>() const {
  10532. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10533. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10534. v24_, v25_, v26_, v27_, v28_, v29_, v30_};
  10535. return ValuesIn(array);
  10536. }
  10537. private:
  10538. // No implementation - assignment is unsupported.
  10539. void operator=(const ValueArray30& other);
  10540. const T1 v1_;
  10541. const T2 v2_;
  10542. const T3 v3_;
  10543. const T4 v4_;
  10544. const T5 v5_;
  10545. const T6 v6_;
  10546. const T7 v7_;
  10547. const T8 v8_;
  10548. const T9 v9_;
  10549. const T10 v10_;
  10550. const T11 v11_;
  10551. const T12 v12_;
  10552. const T13 v13_;
  10553. const T14 v14_;
  10554. const T15 v15_;
  10555. const T16 v16_;
  10556. const T17 v17_;
  10557. const T18 v18_;
  10558. const T19 v19_;
  10559. const T20 v20_;
  10560. const T21 v21_;
  10561. const T22 v22_;
  10562. const T23 v23_;
  10563. const T24 v24_;
  10564. const T25 v25_;
  10565. const T26 v26_;
  10566. const T27 v27_;
  10567. const T28 v28_;
  10568. const T29 v29_;
  10569. const T30 v30_;
  10570. };
  10571. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10572. typename T6, typename T7, typename T8, typename T9, typename T10,
  10573. typename T11, typename T12, typename T13, typename T14, typename T15,
  10574. typename T16, typename T17, typename T18, typename T19, typename T20,
  10575. typename T21, typename T22, typename T23, typename T24, typename T25,
  10576. typename T26, typename T27, typename T28, typename T29, typename T30,
  10577. typename T31>
  10578. class ValueArray31 {
  10579. public:
  10580. ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10581. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10582. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10583. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
  10584. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  10585. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  10586. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  10587. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  10588. v29_(v29), v30_(v30), v31_(v31) {}
  10589. template <typename T>
  10590. operator ParamGenerator<T>() const {
  10591. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10592. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10593. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_};
  10594. return ValuesIn(array);
  10595. }
  10596. private:
  10597. // No implementation - assignment is unsupported.
  10598. void operator=(const ValueArray31& other);
  10599. const T1 v1_;
  10600. const T2 v2_;
  10601. const T3 v3_;
  10602. const T4 v4_;
  10603. const T5 v5_;
  10604. const T6 v6_;
  10605. const T7 v7_;
  10606. const T8 v8_;
  10607. const T9 v9_;
  10608. const T10 v10_;
  10609. const T11 v11_;
  10610. const T12 v12_;
  10611. const T13 v13_;
  10612. const T14 v14_;
  10613. const T15 v15_;
  10614. const T16 v16_;
  10615. const T17 v17_;
  10616. const T18 v18_;
  10617. const T19 v19_;
  10618. const T20 v20_;
  10619. const T21 v21_;
  10620. const T22 v22_;
  10621. const T23 v23_;
  10622. const T24 v24_;
  10623. const T25 v25_;
  10624. const T26 v26_;
  10625. const T27 v27_;
  10626. const T28 v28_;
  10627. const T29 v29_;
  10628. const T30 v30_;
  10629. const T31 v31_;
  10630. };
  10631. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10632. typename T6, typename T7, typename T8, typename T9, typename T10,
  10633. typename T11, typename T12, typename T13, typename T14, typename T15,
  10634. typename T16, typename T17, typename T18, typename T19, typename T20,
  10635. typename T21, typename T22, typename T23, typename T24, typename T25,
  10636. typename T26, typename T27, typename T28, typename T29, typename T30,
  10637. typename T31, typename T32>
  10638. class ValueArray32 {
  10639. public:
  10640. ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10641. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10642. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10643. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
  10644. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  10645. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  10646. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  10647. v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
  10648. v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
  10649. template <typename T>
  10650. operator ParamGenerator<T>() const {
  10651. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10652. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10653. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_};
  10654. return ValuesIn(array);
  10655. }
  10656. private:
  10657. // No implementation - assignment is unsupported.
  10658. void operator=(const ValueArray32& other);
  10659. const T1 v1_;
  10660. const T2 v2_;
  10661. const T3 v3_;
  10662. const T4 v4_;
  10663. const T5 v5_;
  10664. const T6 v6_;
  10665. const T7 v7_;
  10666. const T8 v8_;
  10667. const T9 v9_;
  10668. const T10 v10_;
  10669. const T11 v11_;
  10670. const T12 v12_;
  10671. const T13 v13_;
  10672. const T14 v14_;
  10673. const T15 v15_;
  10674. const T16 v16_;
  10675. const T17 v17_;
  10676. const T18 v18_;
  10677. const T19 v19_;
  10678. const T20 v20_;
  10679. const T21 v21_;
  10680. const T22 v22_;
  10681. const T23 v23_;
  10682. const T24 v24_;
  10683. const T25 v25_;
  10684. const T26 v26_;
  10685. const T27 v27_;
  10686. const T28 v28_;
  10687. const T29 v29_;
  10688. const T30 v30_;
  10689. const T31 v31_;
  10690. const T32 v32_;
  10691. };
  10692. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10693. typename T6, typename T7, typename T8, typename T9, typename T10,
  10694. typename T11, typename T12, typename T13, typename T14, typename T15,
  10695. typename T16, typename T17, typename T18, typename T19, typename T20,
  10696. typename T21, typename T22, typename T23, typename T24, typename T25,
  10697. typename T26, typename T27, typename T28, typename T29, typename T30,
  10698. typename T31, typename T32, typename T33>
  10699. class ValueArray33 {
  10700. public:
  10701. ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10702. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10703. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10704. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
  10705. T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  10706. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  10707. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  10708. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  10709. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  10710. v33_(v33) {}
  10711. template <typename T>
  10712. operator ParamGenerator<T>() const {
  10713. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10714. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10715. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_};
  10716. return ValuesIn(array);
  10717. }
  10718. private:
  10719. // No implementation - assignment is unsupported.
  10720. void operator=(const ValueArray33& other);
  10721. const T1 v1_;
  10722. const T2 v2_;
  10723. const T3 v3_;
  10724. const T4 v4_;
  10725. const T5 v5_;
  10726. const T6 v6_;
  10727. const T7 v7_;
  10728. const T8 v8_;
  10729. const T9 v9_;
  10730. const T10 v10_;
  10731. const T11 v11_;
  10732. const T12 v12_;
  10733. const T13 v13_;
  10734. const T14 v14_;
  10735. const T15 v15_;
  10736. const T16 v16_;
  10737. const T17 v17_;
  10738. const T18 v18_;
  10739. const T19 v19_;
  10740. const T20 v20_;
  10741. const T21 v21_;
  10742. const T22 v22_;
  10743. const T23 v23_;
  10744. const T24 v24_;
  10745. const T25 v25_;
  10746. const T26 v26_;
  10747. const T27 v27_;
  10748. const T28 v28_;
  10749. const T29 v29_;
  10750. const T30 v30_;
  10751. const T31 v31_;
  10752. const T32 v32_;
  10753. const T33 v33_;
  10754. };
  10755. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10756. typename T6, typename T7, typename T8, typename T9, typename T10,
  10757. typename T11, typename T12, typename T13, typename T14, typename T15,
  10758. typename T16, typename T17, typename T18, typename T19, typename T20,
  10759. typename T21, typename T22, typename T23, typename T24, typename T25,
  10760. typename T26, typename T27, typename T28, typename T29, typename T30,
  10761. typename T31, typename T32, typename T33, typename T34>
  10762. class ValueArray34 {
  10763. public:
  10764. ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10765. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10766. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10767. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  10768. T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  10769. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  10770. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  10771. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  10772. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  10773. v33_(v33), v34_(v34) {}
  10774. template <typename T>
  10775. operator ParamGenerator<T>() const {
  10776. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10777. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10778. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_};
  10779. return ValuesIn(array);
  10780. }
  10781. private:
  10782. // No implementation - assignment is unsupported.
  10783. void operator=(const ValueArray34& other);
  10784. const T1 v1_;
  10785. const T2 v2_;
  10786. const T3 v3_;
  10787. const T4 v4_;
  10788. const T5 v5_;
  10789. const T6 v6_;
  10790. const T7 v7_;
  10791. const T8 v8_;
  10792. const T9 v9_;
  10793. const T10 v10_;
  10794. const T11 v11_;
  10795. const T12 v12_;
  10796. const T13 v13_;
  10797. const T14 v14_;
  10798. const T15 v15_;
  10799. const T16 v16_;
  10800. const T17 v17_;
  10801. const T18 v18_;
  10802. const T19 v19_;
  10803. const T20 v20_;
  10804. const T21 v21_;
  10805. const T22 v22_;
  10806. const T23 v23_;
  10807. const T24 v24_;
  10808. const T25 v25_;
  10809. const T26 v26_;
  10810. const T27 v27_;
  10811. const T28 v28_;
  10812. const T29 v29_;
  10813. const T30 v30_;
  10814. const T31 v31_;
  10815. const T32 v32_;
  10816. const T33 v33_;
  10817. const T34 v34_;
  10818. };
  10819. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10820. typename T6, typename T7, typename T8, typename T9, typename T10,
  10821. typename T11, typename T12, typename T13, typename T14, typename T15,
  10822. typename T16, typename T17, typename T18, typename T19, typename T20,
  10823. typename T21, typename T22, typename T23, typename T24, typename T25,
  10824. typename T26, typename T27, typename T28, typename T29, typename T30,
  10825. typename T31, typename T32, typename T33, typename T34, typename T35>
  10826. class ValueArray35 {
  10827. public:
  10828. ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10829. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10830. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10831. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  10832. T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  10833. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  10834. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
  10835. v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
  10836. v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
  10837. v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
  10838. template <typename T>
  10839. operator ParamGenerator<T>() const {
  10840. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10841. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10842. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_,
  10843. v35_};
  10844. return ValuesIn(array);
  10845. }
  10846. private:
  10847. // No implementation - assignment is unsupported.
  10848. void operator=(const ValueArray35& other);
  10849. const T1 v1_;
  10850. const T2 v2_;
  10851. const T3 v3_;
  10852. const T4 v4_;
  10853. const T5 v5_;
  10854. const T6 v6_;
  10855. const T7 v7_;
  10856. const T8 v8_;
  10857. const T9 v9_;
  10858. const T10 v10_;
  10859. const T11 v11_;
  10860. const T12 v12_;
  10861. const T13 v13_;
  10862. const T14 v14_;
  10863. const T15 v15_;
  10864. const T16 v16_;
  10865. const T17 v17_;
  10866. const T18 v18_;
  10867. const T19 v19_;
  10868. const T20 v20_;
  10869. const T21 v21_;
  10870. const T22 v22_;
  10871. const T23 v23_;
  10872. const T24 v24_;
  10873. const T25 v25_;
  10874. const T26 v26_;
  10875. const T27 v27_;
  10876. const T28 v28_;
  10877. const T29 v29_;
  10878. const T30 v30_;
  10879. const T31 v31_;
  10880. const T32 v32_;
  10881. const T33 v33_;
  10882. const T34 v34_;
  10883. const T35 v35_;
  10884. };
  10885. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10886. typename T6, typename T7, typename T8, typename T9, typename T10,
  10887. typename T11, typename T12, typename T13, typename T14, typename T15,
  10888. typename T16, typename T17, typename T18, typename T19, typename T20,
  10889. typename T21, typename T22, typename T23, typename T24, typename T25,
  10890. typename T26, typename T27, typename T28, typename T29, typename T30,
  10891. typename T31, typename T32, typename T33, typename T34, typename T35,
  10892. typename T36>
  10893. class ValueArray36 {
  10894. public:
  10895. ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10896. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10897. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10898. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  10899. T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  10900. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  10901. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  10902. v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
  10903. v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
  10904. v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
  10905. template <typename T>
  10906. operator ParamGenerator<T>() const {
  10907. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10908. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10909. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  10910. v36_};
  10911. return ValuesIn(array);
  10912. }
  10913. private:
  10914. // No implementation - assignment is unsupported.
  10915. void operator=(const ValueArray36& other);
  10916. const T1 v1_;
  10917. const T2 v2_;
  10918. const T3 v3_;
  10919. const T4 v4_;
  10920. const T5 v5_;
  10921. const T6 v6_;
  10922. const T7 v7_;
  10923. const T8 v8_;
  10924. const T9 v9_;
  10925. const T10 v10_;
  10926. const T11 v11_;
  10927. const T12 v12_;
  10928. const T13 v13_;
  10929. const T14 v14_;
  10930. const T15 v15_;
  10931. const T16 v16_;
  10932. const T17 v17_;
  10933. const T18 v18_;
  10934. const T19 v19_;
  10935. const T20 v20_;
  10936. const T21 v21_;
  10937. const T22 v22_;
  10938. const T23 v23_;
  10939. const T24 v24_;
  10940. const T25 v25_;
  10941. const T26 v26_;
  10942. const T27 v27_;
  10943. const T28 v28_;
  10944. const T29 v29_;
  10945. const T30 v30_;
  10946. const T31 v31_;
  10947. const T32 v32_;
  10948. const T33 v33_;
  10949. const T34 v34_;
  10950. const T35 v35_;
  10951. const T36 v36_;
  10952. };
  10953. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10954. typename T6, typename T7, typename T8, typename T9, typename T10,
  10955. typename T11, typename T12, typename T13, typename T14, typename T15,
  10956. typename T16, typename T17, typename T18, typename T19, typename T20,
  10957. typename T21, typename T22, typename T23, typename T24, typename T25,
  10958. typename T26, typename T27, typename T28, typename T29, typename T30,
  10959. typename T31, typename T32, typename T33, typename T34, typename T35,
  10960. typename T36, typename T37>
  10961. class ValueArray37 {
  10962. public:
  10963. ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10964. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10965. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10966. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  10967. T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  10968. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  10969. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  10970. v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
  10971. v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
  10972. v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
  10973. v36_(v36), v37_(v37) {}
  10974. template <typename T>
  10975. operator ParamGenerator<T>() const {
  10976. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10977. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10978. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  10979. v36_, v37_};
  10980. return ValuesIn(array);
  10981. }
  10982. private:
  10983. // No implementation - assignment is unsupported.
  10984. void operator=(const ValueArray37& other);
  10985. const T1 v1_;
  10986. const T2 v2_;
  10987. const T3 v3_;
  10988. const T4 v4_;
  10989. const T5 v5_;
  10990. const T6 v6_;
  10991. const T7 v7_;
  10992. const T8 v8_;
  10993. const T9 v9_;
  10994. const T10 v10_;
  10995. const T11 v11_;
  10996. const T12 v12_;
  10997. const T13 v13_;
  10998. const T14 v14_;
  10999. const T15 v15_;
  11000. const T16 v16_;
  11001. const T17 v17_;
  11002. const T18 v18_;
  11003. const T19 v19_;
  11004. const T20 v20_;
  11005. const T21 v21_;
  11006. const T22 v22_;
  11007. const T23 v23_;
  11008. const T24 v24_;
  11009. const T25 v25_;
  11010. const T26 v26_;
  11011. const T27 v27_;
  11012. const T28 v28_;
  11013. const T29 v29_;
  11014. const T30 v30_;
  11015. const T31 v31_;
  11016. const T32 v32_;
  11017. const T33 v33_;
  11018. const T34 v34_;
  11019. const T35 v35_;
  11020. const T36 v36_;
  11021. const T37 v37_;
  11022. };
  11023. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11024. typename T6, typename T7, typename T8, typename T9, typename T10,
  11025. typename T11, typename T12, typename T13, typename T14, typename T15,
  11026. typename T16, typename T17, typename T18, typename T19, typename T20,
  11027. typename T21, typename T22, typename T23, typename T24, typename T25,
  11028. typename T26, typename T27, typename T28, typename T29, typename T30,
  11029. typename T31, typename T32, typename T33, typename T34, typename T35,
  11030. typename T36, typename T37, typename T38>
  11031. class ValueArray38 {
  11032. public:
  11033. ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11034. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11035. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11036. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11037. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
  11038. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11039. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  11040. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  11041. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  11042. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  11043. v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
  11044. template <typename T>
  11045. operator ParamGenerator<T>() const {
  11046. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11047. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11048. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11049. v36_, v37_, v38_};
  11050. return ValuesIn(array);
  11051. }
  11052. private:
  11053. // No implementation - assignment is unsupported.
  11054. void operator=(const ValueArray38& other);
  11055. const T1 v1_;
  11056. const T2 v2_;
  11057. const T3 v3_;
  11058. const T4 v4_;
  11059. const T5 v5_;
  11060. const T6 v6_;
  11061. const T7 v7_;
  11062. const T8 v8_;
  11063. const T9 v9_;
  11064. const T10 v10_;
  11065. const T11 v11_;
  11066. const T12 v12_;
  11067. const T13 v13_;
  11068. const T14 v14_;
  11069. const T15 v15_;
  11070. const T16 v16_;
  11071. const T17 v17_;
  11072. const T18 v18_;
  11073. const T19 v19_;
  11074. const T20 v20_;
  11075. const T21 v21_;
  11076. const T22 v22_;
  11077. const T23 v23_;
  11078. const T24 v24_;
  11079. const T25 v25_;
  11080. const T26 v26_;
  11081. const T27 v27_;
  11082. const T28 v28_;
  11083. const T29 v29_;
  11084. const T30 v30_;
  11085. const T31 v31_;
  11086. const T32 v32_;
  11087. const T33 v33_;
  11088. const T34 v34_;
  11089. const T35 v35_;
  11090. const T36 v36_;
  11091. const T37 v37_;
  11092. const T38 v38_;
  11093. };
  11094. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11095. typename T6, typename T7, typename T8, typename T9, typename T10,
  11096. typename T11, typename T12, typename T13, typename T14, typename T15,
  11097. typename T16, typename T17, typename T18, typename T19, typename T20,
  11098. typename T21, typename T22, typename T23, typename T24, typename T25,
  11099. typename T26, typename T27, typename T28, typename T29, typename T30,
  11100. typename T31, typename T32, typename T33, typename T34, typename T35,
  11101. typename T36, typename T37, typename T38, typename T39>
  11102. class ValueArray39 {
  11103. public:
  11104. ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11105. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11106. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11107. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11108. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
  11109. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11110. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  11111. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  11112. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  11113. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  11114. v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
  11115. template <typename T>
  11116. operator ParamGenerator<T>() const {
  11117. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11118. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11119. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11120. v36_, v37_, v38_, v39_};
  11121. return ValuesIn(array);
  11122. }
  11123. private:
  11124. // No implementation - assignment is unsupported.
  11125. void operator=(const ValueArray39& other);
  11126. const T1 v1_;
  11127. const T2 v2_;
  11128. const T3 v3_;
  11129. const T4 v4_;
  11130. const T5 v5_;
  11131. const T6 v6_;
  11132. const T7 v7_;
  11133. const T8 v8_;
  11134. const T9 v9_;
  11135. const T10 v10_;
  11136. const T11 v11_;
  11137. const T12 v12_;
  11138. const T13 v13_;
  11139. const T14 v14_;
  11140. const T15 v15_;
  11141. const T16 v16_;
  11142. const T17 v17_;
  11143. const T18 v18_;
  11144. const T19 v19_;
  11145. const T20 v20_;
  11146. const T21 v21_;
  11147. const T22 v22_;
  11148. const T23 v23_;
  11149. const T24 v24_;
  11150. const T25 v25_;
  11151. const T26 v26_;
  11152. const T27 v27_;
  11153. const T28 v28_;
  11154. const T29 v29_;
  11155. const T30 v30_;
  11156. const T31 v31_;
  11157. const T32 v32_;
  11158. const T33 v33_;
  11159. const T34 v34_;
  11160. const T35 v35_;
  11161. const T36 v36_;
  11162. const T37 v37_;
  11163. const T38 v38_;
  11164. const T39 v39_;
  11165. };
  11166. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11167. typename T6, typename T7, typename T8, typename T9, typename T10,
  11168. typename T11, typename T12, typename T13, typename T14, typename T15,
  11169. typename T16, typename T17, typename T18, typename T19, typename T20,
  11170. typename T21, typename T22, typename T23, typename T24, typename T25,
  11171. typename T26, typename T27, typename T28, typename T29, typename T30,
  11172. typename T31, typename T32, typename T33, typename T34, typename T35,
  11173. typename T36, typename T37, typename T38, typename T39, typename T40>
  11174. class ValueArray40 {
  11175. public:
  11176. ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11177. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11178. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11179. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11180. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
  11181. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  11182. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  11183. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  11184. v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
  11185. v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
  11186. v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
  11187. v40_(v40) {}
  11188. template <typename T>
  11189. operator ParamGenerator<T>() const {
  11190. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11191. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11192. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11193. v36_, v37_, v38_, v39_, v40_};
  11194. return ValuesIn(array);
  11195. }
  11196. private:
  11197. // No implementation - assignment is unsupported.
  11198. void operator=(const ValueArray40& other);
  11199. const T1 v1_;
  11200. const T2 v2_;
  11201. const T3 v3_;
  11202. const T4 v4_;
  11203. const T5 v5_;
  11204. const T6 v6_;
  11205. const T7 v7_;
  11206. const T8 v8_;
  11207. const T9 v9_;
  11208. const T10 v10_;
  11209. const T11 v11_;
  11210. const T12 v12_;
  11211. const T13 v13_;
  11212. const T14 v14_;
  11213. const T15 v15_;
  11214. const T16 v16_;
  11215. const T17 v17_;
  11216. const T18 v18_;
  11217. const T19 v19_;
  11218. const T20 v20_;
  11219. const T21 v21_;
  11220. const T22 v22_;
  11221. const T23 v23_;
  11222. const T24 v24_;
  11223. const T25 v25_;
  11224. const T26 v26_;
  11225. const T27 v27_;
  11226. const T28 v28_;
  11227. const T29 v29_;
  11228. const T30 v30_;
  11229. const T31 v31_;
  11230. const T32 v32_;
  11231. const T33 v33_;
  11232. const T34 v34_;
  11233. const T35 v35_;
  11234. const T36 v36_;
  11235. const T37 v37_;
  11236. const T38 v38_;
  11237. const T39 v39_;
  11238. const T40 v40_;
  11239. };
  11240. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11241. typename T6, typename T7, typename T8, typename T9, typename T10,
  11242. typename T11, typename T12, typename T13, typename T14, typename T15,
  11243. typename T16, typename T17, typename T18, typename T19, typename T20,
  11244. typename T21, typename T22, typename T23, typename T24, typename T25,
  11245. typename T26, typename T27, typename T28, typename T29, typename T30,
  11246. typename T31, typename T32, typename T33, typename T34, typename T35,
  11247. typename T36, typename T37, typename T38, typename T39, typename T40,
  11248. typename T41>
  11249. class ValueArray41 {
  11250. public:
  11251. ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11252. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11253. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11254. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11255. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
  11256. T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11257. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11258. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  11259. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  11260. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  11261. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  11262. v39_(v39), v40_(v40), v41_(v41) {}
  11263. template <typename T>
  11264. operator ParamGenerator<T>() const {
  11265. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11266. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11267. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11268. v36_, v37_, v38_, v39_, v40_, v41_};
  11269. return ValuesIn(array);
  11270. }
  11271. private:
  11272. // No implementation - assignment is unsupported.
  11273. void operator=(const ValueArray41& other);
  11274. const T1 v1_;
  11275. const T2 v2_;
  11276. const T3 v3_;
  11277. const T4 v4_;
  11278. const T5 v5_;
  11279. const T6 v6_;
  11280. const T7 v7_;
  11281. const T8 v8_;
  11282. const T9 v9_;
  11283. const T10 v10_;
  11284. const T11 v11_;
  11285. const T12 v12_;
  11286. const T13 v13_;
  11287. const T14 v14_;
  11288. const T15 v15_;
  11289. const T16 v16_;
  11290. const T17 v17_;
  11291. const T18 v18_;
  11292. const T19 v19_;
  11293. const T20 v20_;
  11294. const T21 v21_;
  11295. const T22 v22_;
  11296. const T23 v23_;
  11297. const T24 v24_;
  11298. const T25 v25_;
  11299. const T26 v26_;
  11300. const T27 v27_;
  11301. const T28 v28_;
  11302. const T29 v29_;
  11303. const T30 v30_;
  11304. const T31 v31_;
  11305. const T32 v32_;
  11306. const T33 v33_;
  11307. const T34 v34_;
  11308. const T35 v35_;
  11309. const T36 v36_;
  11310. const T37 v37_;
  11311. const T38 v38_;
  11312. const T39 v39_;
  11313. const T40 v40_;
  11314. const T41 v41_;
  11315. };
  11316. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11317. typename T6, typename T7, typename T8, typename T9, typename T10,
  11318. typename T11, typename T12, typename T13, typename T14, typename T15,
  11319. typename T16, typename T17, typename T18, typename T19, typename T20,
  11320. typename T21, typename T22, typename T23, typename T24, typename T25,
  11321. typename T26, typename T27, typename T28, typename T29, typename T30,
  11322. typename T31, typename T32, typename T33, typename T34, typename T35,
  11323. typename T36, typename T37, typename T38, typename T39, typename T40,
  11324. typename T41, typename T42>
  11325. class ValueArray42 {
  11326. public:
  11327. ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11328. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11329. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11330. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11331. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11332. T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11333. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11334. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  11335. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  11336. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  11337. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  11338. v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
  11339. template <typename T>
  11340. operator ParamGenerator<T>() const {
  11341. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11342. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11343. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11344. v36_, v37_, v38_, v39_, v40_, v41_, v42_};
  11345. return ValuesIn(array);
  11346. }
  11347. private:
  11348. // No implementation - assignment is unsupported.
  11349. void operator=(const ValueArray42& other);
  11350. const T1 v1_;
  11351. const T2 v2_;
  11352. const T3 v3_;
  11353. const T4 v4_;
  11354. const T5 v5_;
  11355. const T6 v6_;
  11356. const T7 v7_;
  11357. const T8 v8_;
  11358. const T9 v9_;
  11359. const T10 v10_;
  11360. const T11 v11_;
  11361. const T12 v12_;
  11362. const T13 v13_;
  11363. const T14 v14_;
  11364. const T15 v15_;
  11365. const T16 v16_;
  11366. const T17 v17_;
  11367. const T18 v18_;
  11368. const T19 v19_;
  11369. const T20 v20_;
  11370. const T21 v21_;
  11371. const T22 v22_;
  11372. const T23 v23_;
  11373. const T24 v24_;
  11374. const T25 v25_;
  11375. const T26 v26_;
  11376. const T27 v27_;
  11377. const T28 v28_;
  11378. const T29 v29_;
  11379. const T30 v30_;
  11380. const T31 v31_;
  11381. const T32 v32_;
  11382. const T33 v33_;
  11383. const T34 v34_;
  11384. const T35 v35_;
  11385. const T36 v36_;
  11386. const T37 v37_;
  11387. const T38 v38_;
  11388. const T39 v39_;
  11389. const T40 v40_;
  11390. const T41 v41_;
  11391. const T42 v42_;
  11392. };
  11393. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11394. typename T6, typename T7, typename T8, typename T9, typename T10,
  11395. typename T11, typename T12, typename T13, typename T14, typename T15,
  11396. typename T16, typename T17, typename T18, typename T19, typename T20,
  11397. typename T21, typename T22, typename T23, typename T24, typename T25,
  11398. typename T26, typename T27, typename T28, typename T29, typename T30,
  11399. typename T31, typename T32, typename T33, typename T34, typename T35,
  11400. typename T36, typename T37, typename T38, typename T39, typename T40,
  11401. typename T41, typename T42, typename T43>
  11402. class ValueArray43 {
  11403. public:
  11404. ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11405. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11406. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11407. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11408. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11409. T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  11410. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  11411. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
  11412. v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
  11413. v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
  11414. v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
  11415. v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
  11416. template <typename T>
  11417. operator ParamGenerator<T>() const {
  11418. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11419. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11420. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11421. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_};
  11422. return ValuesIn(array);
  11423. }
  11424. private:
  11425. // No implementation - assignment is unsupported.
  11426. void operator=(const ValueArray43& other);
  11427. const T1 v1_;
  11428. const T2 v2_;
  11429. const T3 v3_;
  11430. const T4 v4_;
  11431. const T5 v5_;
  11432. const T6 v6_;
  11433. const T7 v7_;
  11434. const T8 v8_;
  11435. const T9 v9_;
  11436. const T10 v10_;
  11437. const T11 v11_;
  11438. const T12 v12_;
  11439. const T13 v13_;
  11440. const T14 v14_;
  11441. const T15 v15_;
  11442. const T16 v16_;
  11443. const T17 v17_;
  11444. const T18 v18_;
  11445. const T19 v19_;
  11446. const T20 v20_;
  11447. const T21 v21_;
  11448. const T22 v22_;
  11449. const T23 v23_;
  11450. const T24 v24_;
  11451. const T25 v25_;
  11452. const T26 v26_;
  11453. const T27 v27_;
  11454. const T28 v28_;
  11455. const T29 v29_;
  11456. const T30 v30_;
  11457. const T31 v31_;
  11458. const T32 v32_;
  11459. const T33 v33_;
  11460. const T34 v34_;
  11461. const T35 v35_;
  11462. const T36 v36_;
  11463. const T37 v37_;
  11464. const T38 v38_;
  11465. const T39 v39_;
  11466. const T40 v40_;
  11467. const T41 v41_;
  11468. const T42 v42_;
  11469. const T43 v43_;
  11470. };
  11471. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11472. typename T6, typename T7, typename T8, typename T9, typename T10,
  11473. typename T11, typename T12, typename T13, typename T14, typename T15,
  11474. typename T16, typename T17, typename T18, typename T19, typename T20,
  11475. typename T21, typename T22, typename T23, typename T24, typename T25,
  11476. typename T26, typename T27, typename T28, typename T29, typename T30,
  11477. typename T31, typename T32, typename T33, typename T34, typename T35,
  11478. typename T36, typename T37, typename T38, typename T39, typename T40,
  11479. typename T41, typename T42, typename T43, typename T44>
  11480. class ValueArray44 {
  11481. public:
  11482. ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11483. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11484. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11485. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11486. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11487. T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  11488. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  11489. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  11490. v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
  11491. v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
  11492. v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
  11493. v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
  11494. v43_(v43), v44_(v44) {}
  11495. template <typename T>
  11496. operator ParamGenerator<T>() const {
  11497. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11498. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11499. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11500. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_};
  11501. return ValuesIn(array);
  11502. }
  11503. private:
  11504. // No implementation - assignment is unsupported.
  11505. void operator=(const ValueArray44& other);
  11506. const T1 v1_;
  11507. const T2 v2_;
  11508. const T3 v3_;
  11509. const T4 v4_;
  11510. const T5 v5_;
  11511. const T6 v6_;
  11512. const T7 v7_;
  11513. const T8 v8_;
  11514. const T9 v9_;
  11515. const T10 v10_;
  11516. const T11 v11_;
  11517. const T12 v12_;
  11518. const T13 v13_;
  11519. const T14 v14_;
  11520. const T15 v15_;
  11521. const T16 v16_;
  11522. const T17 v17_;
  11523. const T18 v18_;
  11524. const T19 v19_;
  11525. const T20 v20_;
  11526. const T21 v21_;
  11527. const T22 v22_;
  11528. const T23 v23_;
  11529. const T24 v24_;
  11530. const T25 v25_;
  11531. const T26 v26_;
  11532. const T27 v27_;
  11533. const T28 v28_;
  11534. const T29 v29_;
  11535. const T30 v30_;
  11536. const T31 v31_;
  11537. const T32 v32_;
  11538. const T33 v33_;
  11539. const T34 v34_;
  11540. const T35 v35_;
  11541. const T36 v36_;
  11542. const T37 v37_;
  11543. const T38 v38_;
  11544. const T39 v39_;
  11545. const T40 v40_;
  11546. const T41 v41_;
  11547. const T42 v42_;
  11548. const T43 v43_;
  11549. const T44 v44_;
  11550. };
  11551. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11552. typename T6, typename T7, typename T8, typename T9, typename T10,
  11553. typename T11, typename T12, typename T13, typename T14, typename T15,
  11554. typename T16, typename T17, typename T18, typename T19, typename T20,
  11555. typename T21, typename T22, typename T23, typename T24, typename T25,
  11556. typename T26, typename T27, typename T28, typename T29, typename T30,
  11557. typename T31, typename T32, typename T33, typename T34, typename T35,
  11558. typename T36, typename T37, typename T38, typename T39, typename T40,
  11559. typename T41, typename T42, typename T43, typename T44, typename T45>
  11560. class ValueArray45 {
  11561. public:
  11562. ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11563. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11564. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11565. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11566. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11567. T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  11568. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  11569. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  11570. v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
  11571. v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
  11572. v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
  11573. v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
  11574. v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
  11575. template <typename T>
  11576. operator ParamGenerator<T>() const {
  11577. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11578. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11579. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11580. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_};
  11581. return ValuesIn(array);
  11582. }
  11583. private:
  11584. // No implementation - assignment is unsupported.
  11585. void operator=(const ValueArray45& other);
  11586. const T1 v1_;
  11587. const T2 v2_;
  11588. const T3 v3_;
  11589. const T4 v4_;
  11590. const T5 v5_;
  11591. const T6 v6_;
  11592. const T7 v7_;
  11593. const T8 v8_;
  11594. const T9 v9_;
  11595. const T10 v10_;
  11596. const T11 v11_;
  11597. const T12 v12_;
  11598. const T13 v13_;
  11599. const T14 v14_;
  11600. const T15 v15_;
  11601. const T16 v16_;
  11602. const T17 v17_;
  11603. const T18 v18_;
  11604. const T19 v19_;
  11605. const T20 v20_;
  11606. const T21 v21_;
  11607. const T22 v22_;
  11608. const T23 v23_;
  11609. const T24 v24_;
  11610. const T25 v25_;
  11611. const T26 v26_;
  11612. const T27 v27_;
  11613. const T28 v28_;
  11614. const T29 v29_;
  11615. const T30 v30_;
  11616. const T31 v31_;
  11617. const T32 v32_;
  11618. const T33 v33_;
  11619. const T34 v34_;
  11620. const T35 v35_;
  11621. const T36 v36_;
  11622. const T37 v37_;
  11623. const T38 v38_;
  11624. const T39 v39_;
  11625. const T40 v40_;
  11626. const T41 v41_;
  11627. const T42 v42_;
  11628. const T43 v43_;
  11629. const T44 v44_;
  11630. const T45 v45_;
  11631. };
  11632. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11633. typename T6, typename T7, typename T8, typename T9, typename T10,
  11634. typename T11, typename T12, typename T13, typename T14, typename T15,
  11635. typename T16, typename T17, typename T18, typename T19, typename T20,
  11636. typename T21, typename T22, typename T23, typename T24, typename T25,
  11637. typename T26, typename T27, typename T28, typename T29, typename T30,
  11638. typename T31, typename T32, typename T33, typename T34, typename T35,
  11639. typename T36, typename T37, typename T38, typename T39, typename T40,
  11640. typename T41, typename T42, typename T43, typename T44, typename T45,
  11641. typename T46>
  11642. class ValueArray46 {
  11643. public:
  11644. ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11645. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11646. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11647. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11648. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11649. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
  11650. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11651. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  11652. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  11653. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  11654. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  11655. v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
  11656. v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
  11657. template <typename T>
  11658. operator ParamGenerator<T>() const {
  11659. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11660. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11661. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11662. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_};
  11663. return ValuesIn(array);
  11664. }
  11665. private:
  11666. // No implementation - assignment is unsupported.
  11667. void operator=(const ValueArray46& other);
  11668. const T1 v1_;
  11669. const T2 v2_;
  11670. const T3 v3_;
  11671. const T4 v4_;
  11672. const T5 v5_;
  11673. const T6 v6_;
  11674. const T7 v7_;
  11675. const T8 v8_;
  11676. const T9 v9_;
  11677. const T10 v10_;
  11678. const T11 v11_;
  11679. const T12 v12_;
  11680. const T13 v13_;
  11681. const T14 v14_;
  11682. const T15 v15_;
  11683. const T16 v16_;
  11684. const T17 v17_;
  11685. const T18 v18_;
  11686. const T19 v19_;
  11687. const T20 v20_;
  11688. const T21 v21_;
  11689. const T22 v22_;
  11690. const T23 v23_;
  11691. const T24 v24_;
  11692. const T25 v25_;
  11693. const T26 v26_;
  11694. const T27 v27_;
  11695. const T28 v28_;
  11696. const T29 v29_;
  11697. const T30 v30_;
  11698. const T31 v31_;
  11699. const T32 v32_;
  11700. const T33 v33_;
  11701. const T34 v34_;
  11702. const T35 v35_;
  11703. const T36 v36_;
  11704. const T37 v37_;
  11705. const T38 v38_;
  11706. const T39 v39_;
  11707. const T40 v40_;
  11708. const T41 v41_;
  11709. const T42 v42_;
  11710. const T43 v43_;
  11711. const T44 v44_;
  11712. const T45 v45_;
  11713. const T46 v46_;
  11714. };
  11715. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11716. typename T6, typename T7, typename T8, typename T9, typename T10,
  11717. typename T11, typename T12, typename T13, typename T14, typename T15,
  11718. typename T16, typename T17, typename T18, typename T19, typename T20,
  11719. typename T21, typename T22, typename T23, typename T24, typename T25,
  11720. typename T26, typename T27, typename T28, typename T29, typename T30,
  11721. typename T31, typename T32, typename T33, typename T34, typename T35,
  11722. typename T36, typename T37, typename T38, typename T39, typename T40,
  11723. typename T41, typename T42, typename T43, typename T44, typename T45,
  11724. typename T46, typename T47>
  11725. class ValueArray47 {
  11726. public:
  11727. ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11728. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11729. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11730. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11731. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11732. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
  11733. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11734. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  11735. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  11736. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  11737. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  11738. v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
  11739. v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
  11740. v47_(v47) {}
  11741. template <typename T>
  11742. operator ParamGenerator<T>() const {
  11743. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11744. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11745. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11746. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_,
  11747. v47_};
  11748. return ValuesIn(array);
  11749. }
  11750. private:
  11751. // No implementation - assignment is unsupported.
  11752. void operator=(const ValueArray47& other);
  11753. const T1 v1_;
  11754. const T2 v2_;
  11755. const T3 v3_;
  11756. const T4 v4_;
  11757. const T5 v5_;
  11758. const T6 v6_;
  11759. const T7 v7_;
  11760. const T8 v8_;
  11761. const T9 v9_;
  11762. const T10 v10_;
  11763. const T11 v11_;
  11764. const T12 v12_;
  11765. const T13 v13_;
  11766. const T14 v14_;
  11767. const T15 v15_;
  11768. const T16 v16_;
  11769. const T17 v17_;
  11770. const T18 v18_;
  11771. const T19 v19_;
  11772. const T20 v20_;
  11773. const T21 v21_;
  11774. const T22 v22_;
  11775. const T23 v23_;
  11776. const T24 v24_;
  11777. const T25 v25_;
  11778. const T26 v26_;
  11779. const T27 v27_;
  11780. const T28 v28_;
  11781. const T29 v29_;
  11782. const T30 v30_;
  11783. const T31 v31_;
  11784. const T32 v32_;
  11785. const T33 v33_;
  11786. const T34 v34_;
  11787. const T35 v35_;
  11788. const T36 v36_;
  11789. const T37 v37_;
  11790. const T38 v38_;
  11791. const T39 v39_;
  11792. const T40 v40_;
  11793. const T41 v41_;
  11794. const T42 v42_;
  11795. const T43 v43_;
  11796. const T44 v44_;
  11797. const T45 v45_;
  11798. const T46 v46_;
  11799. const T47 v47_;
  11800. };
  11801. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11802. typename T6, typename T7, typename T8, typename T9, typename T10,
  11803. typename T11, typename T12, typename T13, typename T14, typename T15,
  11804. typename T16, typename T17, typename T18, typename T19, typename T20,
  11805. typename T21, typename T22, typename T23, typename T24, typename T25,
  11806. typename T26, typename T27, typename T28, typename T29, typename T30,
  11807. typename T31, typename T32, typename T33, typename T34, typename T35,
  11808. typename T36, typename T37, typename T38, typename T39, typename T40,
  11809. typename T41, typename T42, typename T43, typename T44, typename T45,
  11810. typename T46, typename T47, typename T48>
  11811. class ValueArray48 {
  11812. public:
  11813. ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11814. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11815. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11816. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11817. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11818. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
  11819. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  11820. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  11821. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  11822. v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
  11823. v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
  11824. v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
  11825. v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
  11826. v46_(v46), v47_(v47), v48_(v48) {}
  11827. template <typename T>
  11828. operator ParamGenerator<T>() const {
  11829. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11830. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11831. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11832. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_,
  11833. v48_};
  11834. return ValuesIn(array);
  11835. }
  11836. private:
  11837. // No implementation - assignment is unsupported.
  11838. void operator=(const ValueArray48& other);
  11839. const T1 v1_;
  11840. const T2 v2_;
  11841. const T3 v3_;
  11842. const T4 v4_;
  11843. const T5 v5_;
  11844. const T6 v6_;
  11845. const T7 v7_;
  11846. const T8 v8_;
  11847. const T9 v9_;
  11848. const T10 v10_;
  11849. const T11 v11_;
  11850. const T12 v12_;
  11851. const T13 v13_;
  11852. const T14 v14_;
  11853. const T15 v15_;
  11854. const T16 v16_;
  11855. const T17 v17_;
  11856. const T18 v18_;
  11857. const T19 v19_;
  11858. const T20 v20_;
  11859. const T21 v21_;
  11860. const T22 v22_;
  11861. const T23 v23_;
  11862. const T24 v24_;
  11863. const T25 v25_;
  11864. const T26 v26_;
  11865. const T27 v27_;
  11866. const T28 v28_;
  11867. const T29 v29_;
  11868. const T30 v30_;
  11869. const T31 v31_;
  11870. const T32 v32_;
  11871. const T33 v33_;
  11872. const T34 v34_;
  11873. const T35 v35_;
  11874. const T36 v36_;
  11875. const T37 v37_;
  11876. const T38 v38_;
  11877. const T39 v39_;
  11878. const T40 v40_;
  11879. const T41 v41_;
  11880. const T42 v42_;
  11881. const T43 v43_;
  11882. const T44 v44_;
  11883. const T45 v45_;
  11884. const T46 v46_;
  11885. const T47 v47_;
  11886. const T48 v48_;
  11887. };
  11888. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11889. typename T6, typename T7, typename T8, typename T9, typename T10,
  11890. typename T11, typename T12, typename T13, typename T14, typename T15,
  11891. typename T16, typename T17, typename T18, typename T19, typename T20,
  11892. typename T21, typename T22, typename T23, typename T24, typename T25,
  11893. typename T26, typename T27, typename T28, typename T29, typename T30,
  11894. typename T31, typename T32, typename T33, typename T34, typename T35,
  11895. typename T36, typename T37, typename T38, typename T39, typename T40,
  11896. typename T41, typename T42, typename T43, typename T44, typename T45,
  11897. typename T46, typename T47, typename T48, typename T49>
  11898. class ValueArray49 {
  11899. public:
  11900. ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11901. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11902. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11903. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11904. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11905. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
  11906. T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11907. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11908. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  11909. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  11910. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  11911. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  11912. v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
  11913. v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
  11914. template <typename T>
  11915. operator ParamGenerator<T>() const {
  11916. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11917. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11918. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11919. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_,
  11920. v48_, v49_};
  11921. return ValuesIn(array);
  11922. }
  11923. private:
  11924. // No implementation - assignment is unsupported.
  11925. void operator=(const ValueArray49& other);
  11926. const T1 v1_;
  11927. const T2 v2_;
  11928. const T3 v3_;
  11929. const T4 v4_;
  11930. const T5 v5_;
  11931. const T6 v6_;
  11932. const T7 v7_;
  11933. const T8 v8_;
  11934. const T9 v9_;
  11935. const T10 v10_;
  11936. const T11 v11_;
  11937. const T12 v12_;
  11938. const T13 v13_;
  11939. const T14 v14_;
  11940. const T15 v15_;
  11941. const T16 v16_;
  11942. const T17 v17_;
  11943. const T18 v18_;
  11944. const T19 v19_;
  11945. const T20 v20_;
  11946. const T21 v21_;
  11947. const T22 v22_;
  11948. const T23 v23_;
  11949. const T24 v24_;
  11950. const T25 v25_;
  11951. const T26 v26_;
  11952. const T27 v27_;
  11953. const T28 v28_;
  11954. const T29 v29_;
  11955. const T30 v30_;
  11956. const T31 v31_;
  11957. const T32 v32_;
  11958. const T33 v33_;
  11959. const T34 v34_;
  11960. const T35 v35_;
  11961. const T36 v36_;
  11962. const T37 v37_;
  11963. const T38 v38_;
  11964. const T39 v39_;
  11965. const T40 v40_;
  11966. const T41 v41_;
  11967. const T42 v42_;
  11968. const T43 v43_;
  11969. const T44 v44_;
  11970. const T45 v45_;
  11971. const T46 v46_;
  11972. const T47 v47_;
  11973. const T48 v48_;
  11974. const T49 v49_;
  11975. };
  11976. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11977. typename T6, typename T7, typename T8, typename T9, typename T10,
  11978. typename T11, typename T12, typename T13, typename T14, typename T15,
  11979. typename T16, typename T17, typename T18, typename T19, typename T20,
  11980. typename T21, typename T22, typename T23, typename T24, typename T25,
  11981. typename T26, typename T27, typename T28, typename T29, typename T30,
  11982. typename T31, typename T32, typename T33, typename T34, typename T35,
  11983. typename T36, typename T37, typename T38, typename T39, typename T40,
  11984. typename T41, typename T42, typename T43, typename T44, typename T45,
  11985. typename T46, typename T47, typename T48, typename T49, typename T50>
  11986. class ValueArray50 {
  11987. public:
  11988. ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11989. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11990. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11991. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11992. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11993. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
  11994. T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11995. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11996. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  11997. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  11998. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  11999. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  12000. v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
  12001. v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
  12002. template <typename T>
  12003. operator ParamGenerator<T>() const {
  12004. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  12005. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  12006. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  12007. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_,
  12008. v48_, v49_, v50_};
  12009. return ValuesIn(array);
  12010. }
  12011. private:
  12012. // No implementation - assignment is unsupported.
  12013. void operator=(const ValueArray50& other);
  12014. const T1 v1_;
  12015. const T2 v2_;
  12016. const T3 v3_;
  12017. const T4 v4_;
  12018. const T5 v5_;
  12019. const T6 v6_;
  12020. const T7 v7_;
  12021. const T8 v8_;
  12022. const T9 v9_;
  12023. const T10 v10_;
  12024. const T11 v11_;
  12025. const T12 v12_;
  12026. const T13 v13_;
  12027. const T14 v14_;
  12028. const T15 v15_;
  12029. const T16 v16_;
  12030. const T17 v17_;
  12031. const T18 v18_;
  12032. const T19 v19_;
  12033. const T20 v20_;
  12034. const T21 v21_;
  12035. const T22 v22_;
  12036. const T23 v23_;
  12037. const T24 v24_;
  12038. const T25 v25_;
  12039. const T26 v26_;
  12040. const T27 v27_;
  12041. const T28 v28_;
  12042. const T29 v29_;
  12043. const T30 v30_;
  12044. const T31 v31_;
  12045. const T32 v32_;
  12046. const T33 v33_;
  12047. const T34 v34_;
  12048. const T35 v35_;
  12049. const T36 v36_;
  12050. const T37 v37_;
  12051. const T38 v38_;
  12052. const T39 v39_;
  12053. const T40 v40_;
  12054. const T41 v41_;
  12055. const T42 v42_;
  12056. const T43 v43_;
  12057. const T44 v44_;
  12058. const T45 v45_;
  12059. const T46 v46_;
  12060. const T47 v47_;
  12061. const T48 v48_;
  12062. const T49 v49_;
  12063. const T50 v50_;
  12064. };
  12065. # if GTEST_HAS_COMBINE
  12066. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  12067. //
  12068. // Generates values from the Cartesian product of values produced
  12069. // by the argument generators.
  12070. //
  12071. template <typename T1, typename T2>
  12072. class CartesianProductGenerator2
  12073. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {
  12074. public:
  12075. typedef ::std::tr1::tuple<T1, T2> ParamType;
  12076. CartesianProductGenerator2(const ParamGenerator<T1>& g1,
  12077. const ParamGenerator<T2>& g2)
  12078. : g1_(g1), g2_(g2) {}
  12079. virtual ~CartesianProductGenerator2() {}
  12080. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12081. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
  12082. }
  12083. virtual ParamIteratorInterface<ParamType>* End() const {
  12084. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
  12085. }
  12086. private:
  12087. class Iterator : public ParamIteratorInterface<ParamType> {
  12088. public:
  12089. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12090. const ParamGenerator<T1>& g1,
  12091. const typename ParamGenerator<T1>::iterator& current1,
  12092. const ParamGenerator<T2>& g2,
  12093. const typename ParamGenerator<T2>::iterator& current2)
  12094. : base_(base),
  12095. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12096. begin2_(g2.begin()), end2_(g2.end()), current2_(current2) {
  12097. ComputeCurrentValue();
  12098. }
  12099. virtual ~Iterator() {}
  12100. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12101. return base_;
  12102. }
  12103. // Advance should not be called on beyond-of-range iterators
  12104. // so no component iterators must be beyond end of range, either.
  12105. virtual void Advance() {
  12106. assert(!AtEnd());
  12107. ++current2_;
  12108. if (current2_ == end2_) {
  12109. current2_ = begin2_;
  12110. ++current1_;
  12111. }
  12112. ComputeCurrentValue();
  12113. }
  12114. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12115. return new Iterator(*this);
  12116. }
  12117. virtual const ParamType* Current() const { return &current_value_; }
  12118. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12119. // Having the same base generator guarantees that the other
  12120. // iterator is of the same type and we can downcast.
  12121. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12122. << "The program attempted to compare iterators "
  12123. << "from different generators." << std::endl;
  12124. const Iterator* typed_other =
  12125. CheckedDowncastToActualType<const Iterator>(&other);
  12126. // We must report iterators equal if they both point beyond their
  12127. // respective ranges. That can happen in a variety of fashions,
  12128. // so we have to consult AtEnd().
  12129. return (AtEnd() && typed_other->AtEnd()) ||
  12130. (
  12131. current1_ == typed_other->current1_ &&
  12132. current2_ == typed_other->current2_);
  12133. }
  12134. private:
  12135. Iterator(const Iterator& other)
  12136. : base_(other.base_),
  12137. begin1_(other.begin1_),
  12138. end1_(other.end1_),
  12139. current1_(other.current1_),
  12140. begin2_(other.begin2_),
  12141. end2_(other.end2_),
  12142. current2_(other.current2_) {
  12143. ComputeCurrentValue();
  12144. }
  12145. void ComputeCurrentValue() {
  12146. if (!AtEnd())
  12147. current_value_ = ParamType(*current1_, *current2_);
  12148. }
  12149. bool AtEnd() const {
  12150. // We must report iterator past the end of the range when either of the
  12151. // component iterators has reached the end of its range.
  12152. return
  12153. current1_ == end1_ ||
  12154. current2_ == end2_;
  12155. }
  12156. // No implementation - assignment is unsupported.
  12157. void operator=(const Iterator& other);
  12158. const ParamGeneratorInterface<ParamType>* const base_;
  12159. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12160. // current[i]_ is the actual traversing iterator.
  12161. const typename ParamGenerator<T1>::iterator begin1_;
  12162. const typename ParamGenerator<T1>::iterator end1_;
  12163. typename ParamGenerator<T1>::iterator current1_;
  12164. const typename ParamGenerator<T2>::iterator begin2_;
  12165. const typename ParamGenerator<T2>::iterator end2_;
  12166. typename ParamGenerator<T2>::iterator current2_;
  12167. ParamType current_value_;
  12168. }; // class CartesianProductGenerator2::Iterator
  12169. // No implementation - assignment is unsupported.
  12170. void operator=(const CartesianProductGenerator2& other);
  12171. const ParamGenerator<T1> g1_;
  12172. const ParamGenerator<T2> g2_;
  12173. }; // class CartesianProductGenerator2
  12174. template <typename T1, typename T2, typename T3>
  12175. class CartesianProductGenerator3
  12176. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {
  12177. public:
  12178. typedef ::std::tr1::tuple<T1, T2, T3> ParamType;
  12179. CartesianProductGenerator3(const ParamGenerator<T1>& g1,
  12180. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
  12181. : g1_(g1), g2_(g2), g3_(g3) {}
  12182. virtual ~CartesianProductGenerator3() {}
  12183. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12184. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12185. g3_.begin());
  12186. }
  12187. virtual ParamIteratorInterface<ParamType>* End() const {
  12188. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
  12189. }
  12190. private:
  12191. class Iterator : public ParamIteratorInterface<ParamType> {
  12192. public:
  12193. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12194. const ParamGenerator<T1>& g1,
  12195. const typename ParamGenerator<T1>::iterator& current1,
  12196. const ParamGenerator<T2>& g2,
  12197. const typename ParamGenerator<T2>::iterator& current2,
  12198. const ParamGenerator<T3>& g3,
  12199. const typename ParamGenerator<T3>::iterator& current3)
  12200. : base_(base),
  12201. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12202. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  12203. begin3_(g3.begin()), end3_(g3.end()), current3_(current3) {
  12204. ComputeCurrentValue();
  12205. }
  12206. virtual ~Iterator() {}
  12207. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12208. return base_;
  12209. }
  12210. // Advance should not be called on beyond-of-range iterators
  12211. // so no component iterators must be beyond end of range, either.
  12212. virtual void Advance() {
  12213. assert(!AtEnd());
  12214. ++current3_;
  12215. if (current3_ == end3_) {
  12216. current3_ = begin3_;
  12217. ++current2_;
  12218. }
  12219. if (current2_ == end2_) {
  12220. current2_ = begin2_;
  12221. ++current1_;
  12222. }
  12223. ComputeCurrentValue();
  12224. }
  12225. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12226. return new Iterator(*this);
  12227. }
  12228. virtual const ParamType* Current() const { return &current_value_; }
  12229. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12230. // Having the same base generator guarantees that the other
  12231. // iterator is of the same type and we can downcast.
  12232. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12233. << "The program attempted to compare iterators "
  12234. << "from different generators." << std::endl;
  12235. const Iterator* typed_other =
  12236. CheckedDowncastToActualType<const Iterator>(&other);
  12237. // We must report iterators equal if they both point beyond their
  12238. // respective ranges. That can happen in a variety of fashions,
  12239. // so we have to consult AtEnd().
  12240. return (AtEnd() && typed_other->AtEnd()) ||
  12241. (
  12242. current1_ == typed_other->current1_ &&
  12243. current2_ == typed_other->current2_ &&
  12244. current3_ == typed_other->current3_);
  12245. }
  12246. private:
  12247. Iterator(const Iterator& other)
  12248. : base_(other.base_),
  12249. begin1_(other.begin1_),
  12250. end1_(other.end1_),
  12251. current1_(other.current1_),
  12252. begin2_(other.begin2_),
  12253. end2_(other.end2_),
  12254. current2_(other.current2_),
  12255. begin3_(other.begin3_),
  12256. end3_(other.end3_),
  12257. current3_(other.current3_) {
  12258. ComputeCurrentValue();
  12259. }
  12260. void ComputeCurrentValue() {
  12261. if (!AtEnd())
  12262. current_value_ = ParamType(*current1_, *current2_, *current3_);
  12263. }
  12264. bool AtEnd() const {
  12265. // We must report iterator past the end of the range when either of the
  12266. // component iterators has reached the end of its range.
  12267. return
  12268. current1_ == end1_ ||
  12269. current2_ == end2_ ||
  12270. current3_ == end3_;
  12271. }
  12272. // No implementation - assignment is unsupported.
  12273. void operator=(const Iterator& other);
  12274. const ParamGeneratorInterface<ParamType>* const base_;
  12275. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12276. // current[i]_ is the actual traversing iterator.
  12277. const typename ParamGenerator<T1>::iterator begin1_;
  12278. const typename ParamGenerator<T1>::iterator end1_;
  12279. typename ParamGenerator<T1>::iterator current1_;
  12280. const typename ParamGenerator<T2>::iterator begin2_;
  12281. const typename ParamGenerator<T2>::iterator end2_;
  12282. typename ParamGenerator<T2>::iterator current2_;
  12283. const typename ParamGenerator<T3>::iterator begin3_;
  12284. const typename ParamGenerator<T3>::iterator end3_;
  12285. typename ParamGenerator<T3>::iterator current3_;
  12286. ParamType current_value_;
  12287. }; // class CartesianProductGenerator3::Iterator
  12288. // No implementation - assignment is unsupported.
  12289. void operator=(const CartesianProductGenerator3& other);
  12290. const ParamGenerator<T1> g1_;
  12291. const ParamGenerator<T2> g2_;
  12292. const ParamGenerator<T3> g3_;
  12293. }; // class CartesianProductGenerator3
  12294. template <typename T1, typename T2, typename T3, typename T4>
  12295. class CartesianProductGenerator4
  12296. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {
  12297. public:
  12298. typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;
  12299. CartesianProductGenerator4(const ParamGenerator<T1>& g1,
  12300. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  12301. const ParamGenerator<T4>& g4)
  12302. : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
  12303. virtual ~CartesianProductGenerator4() {}
  12304. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12305. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12306. g3_.begin(), g4_, g4_.begin());
  12307. }
  12308. virtual ParamIteratorInterface<ParamType>* End() const {
  12309. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  12310. g4_, g4_.end());
  12311. }
  12312. private:
  12313. class Iterator : public ParamIteratorInterface<ParamType> {
  12314. public:
  12315. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12316. const ParamGenerator<T1>& g1,
  12317. const typename ParamGenerator<T1>::iterator& current1,
  12318. const ParamGenerator<T2>& g2,
  12319. const typename ParamGenerator<T2>::iterator& current2,
  12320. const ParamGenerator<T3>& g3,
  12321. const typename ParamGenerator<T3>::iterator& current3,
  12322. const ParamGenerator<T4>& g4,
  12323. const typename ParamGenerator<T4>::iterator& current4)
  12324. : base_(base),
  12325. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12326. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  12327. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  12328. begin4_(g4.begin()), end4_(g4.end()), current4_(current4) {
  12329. ComputeCurrentValue();
  12330. }
  12331. virtual ~Iterator() {}
  12332. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12333. return base_;
  12334. }
  12335. // Advance should not be called on beyond-of-range iterators
  12336. // so no component iterators must be beyond end of range, either.
  12337. virtual void Advance() {
  12338. assert(!AtEnd());
  12339. ++current4_;
  12340. if (current4_ == end4_) {
  12341. current4_ = begin4_;
  12342. ++current3_;
  12343. }
  12344. if (current3_ == end3_) {
  12345. current3_ = begin3_;
  12346. ++current2_;
  12347. }
  12348. if (current2_ == end2_) {
  12349. current2_ = begin2_;
  12350. ++current1_;
  12351. }
  12352. ComputeCurrentValue();
  12353. }
  12354. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12355. return new Iterator(*this);
  12356. }
  12357. virtual const ParamType* Current() const { return &current_value_; }
  12358. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12359. // Having the same base generator guarantees that the other
  12360. // iterator is of the same type and we can downcast.
  12361. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12362. << "The program attempted to compare iterators "
  12363. << "from different generators." << std::endl;
  12364. const Iterator* typed_other =
  12365. CheckedDowncastToActualType<const Iterator>(&other);
  12366. // We must report iterators equal if they both point beyond their
  12367. // respective ranges. That can happen in a variety of fashions,
  12368. // so we have to consult AtEnd().
  12369. return (AtEnd() && typed_other->AtEnd()) ||
  12370. (
  12371. current1_ == typed_other->current1_ &&
  12372. current2_ == typed_other->current2_ &&
  12373. current3_ == typed_other->current3_ &&
  12374. current4_ == typed_other->current4_);
  12375. }
  12376. private:
  12377. Iterator(const Iterator& other)
  12378. : base_(other.base_),
  12379. begin1_(other.begin1_),
  12380. end1_(other.end1_),
  12381. current1_(other.current1_),
  12382. begin2_(other.begin2_),
  12383. end2_(other.end2_),
  12384. current2_(other.current2_),
  12385. begin3_(other.begin3_),
  12386. end3_(other.end3_),
  12387. current3_(other.current3_),
  12388. begin4_(other.begin4_),
  12389. end4_(other.end4_),
  12390. current4_(other.current4_) {
  12391. ComputeCurrentValue();
  12392. }
  12393. void ComputeCurrentValue() {
  12394. if (!AtEnd())
  12395. current_value_ = ParamType(*current1_, *current2_, *current3_,
  12396. *current4_);
  12397. }
  12398. bool AtEnd() const {
  12399. // We must report iterator past the end of the range when either of the
  12400. // component iterators has reached the end of its range.
  12401. return
  12402. current1_ == end1_ ||
  12403. current2_ == end2_ ||
  12404. current3_ == end3_ ||
  12405. current4_ == end4_;
  12406. }
  12407. // No implementation - assignment is unsupported.
  12408. void operator=(const Iterator& other);
  12409. const ParamGeneratorInterface<ParamType>* const base_;
  12410. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12411. // current[i]_ is the actual traversing iterator.
  12412. const typename ParamGenerator<T1>::iterator begin1_;
  12413. const typename ParamGenerator<T1>::iterator end1_;
  12414. typename ParamGenerator<T1>::iterator current1_;
  12415. const typename ParamGenerator<T2>::iterator begin2_;
  12416. const typename ParamGenerator<T2>::iterator end2_;
  12417. typename ParamGenerator<T2>::iterator current2_;
  12418. const typename ParamGenerator<T3>::iterator begin3_;
  12419. const typename ParamGenerator<T3>::iterator end3_;
  12420. typename ParamGenerator<T3>::iterator current3_;
  12421. const typename ParamGenerator<T4>::iterator begin4_;
  12422. const typename ParamGenerator<T4>::iterator end4_;
  12423. typename ParamGenerator<T4>::iterator current4_;
  12424. ParamType current_value_;
  12425. }; // class CartesianProductGenerator4::Iterator
  12426. // No implementation - assignment is unsupported.
  12427. void operator=(const CartesianProductGenerator4& other);
  12428. const ParamGenerator<T1> g1_;
  12429. const ParamGenerator<T2> g2_;
  12430. const ParamGenerator<T3> g3_;
  12431. const ParamGenerator<T4> g4_;
  12432. }; // class CartesianProductGenerator4
  12433. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  12434. class CartesianProductGenerator5
  12435. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {
  12436. public:
  12437. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;
  12438. CartesianProductGenerator5(const ParamGenerator<T1>& g1,
  12439. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  12440. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
  12441. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
  12442. virtual ~CartesianProductGenerator5() {}
  12443. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12444. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12445. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
  12446. }
  12447. virtual ParamIteratorInterface<ParamType>* End() const {
  12448. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  12449. g4_, g4_.end(), g5_, g5_.end());
  12450. }
  12451. private:
  12452. class Iterator : public ParamIteratorInterface<ParamType> {
  12453. public:
  12454. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12455. const ParamGenerator<T1>& g1,
  12456. const typename ParamGenerator<T1>::iterator& current1,
  12457. const ParamGenerator<T2>& g2,
  12458. const typename ParamGenerator<T2>::iterator& current2,
  12459. const ParamGenerator<T3>& g3,
  12460. const typename ParamGenerator<T3>::iterator& current3,
  12461. const ParamGenerator<T4>& g4,
  12462. const typename ParamGenerator<T4>::iterator& current4,
  12463. const ParamGenerator<T5>& g5,
  12464. const typename ParamGenerator<T5>::iterator& current5)
  12465. : base_(base),
  12466. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12467. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  12468. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  12469. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  12470. begin5_(g5.begin()), end5_(g5.end()), current5_(current5) {
  12471. ComputeCurrentValue();
  12472. }
  12473. virtual ~Iterator() {}
  12474. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12475. return base_;
  12476. }
  12477. // Advance should not be called on beyond-of-range iterators
  12478. // so no component iterators must be beyond end of range, either.
  12479. virtual void Advance() {
  12480. assert(!AtEnd());
  12481. ++current5_;
  12482. if (current5_ == end5_) {
  12483. current5_ = begin5_;
  12484. ++current4_;
  12485. }
  12486. if (current4_ == end4_) {
  12487. current4_ = begin4_;
  12488. ++current3_;
  12489. }
  12490. if (current3_ == end3_) {
  12491. current3_ = begin3_;
  12492. ++current2_;
  12493. }
  12494. if (current2_ == end2_) {
  12495. current2_ = begin2_;
  12496. ++current1_;
  12497. }
  12498. ComputeCurrentValue();
  12499. }
  12500. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12501. return new Iterator(*this);
  12502. }
  12503. virtual const ParamType* Current() const { return &current_value_; }
  12504. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12505. // Having the same base generator guarantees that the other
  12506. // iterator is of the same type and we can downcast.
  12507. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12508. << "The program attempted to compare iterators "
  12509. << "from different generators." << std::endl;
  12510. const Iterator* typed_other =
  12511. CheckedDowncastToActualType<const Iterator>(&other);
  12512. // We must report iterators equal if they both point beyond their
  12513. // respective ranges. That can happen in a variety of fashions,
  12514. // so we have to consult AtEnd().
  12515. return (AtEnd() && typed_other->AtEnd()) ||
  12516. (
  12517. current1_ == typed_other->current1_ &&
  12518. current2_ == typed_other->current2_ &&
  12519. current3_ == typed_other->current3_ &&
  12520. current4_ == typed_other->current4_ &&
  12521. current5_ == typed_other->current5_);
  12522. }
  12523. private:
  12524. Iterator(const Iterator& other)
  12525. : base_(other.base_),
  12526. begin1_(other.begin1_),
  12527. end1_(other.end1_),
  12528. current1_(other.current1_),
  12529. begin2_(other.begin2_),
  12530. end2_(other.end2_),
  12531. current2_(other.current2_),
  12532. begin3_(other.begin3_),
  12533. end3_(other.end3_),
  12534. current3_(other.current3_),
  12535. begin4_(other.begin4_),
  12536. end4_(other.end4_),
  12537. current4_(other.current4_),
  12538. begin5_(other.begin5_),
  12539. end5_(other.end5_),
  12540. current5_(other.current5_) {
  12541. ComputeCurrentValue();
  12542. }
  12543. void ComputeCurrentValue() {
  12544. if (!AtEnd())
  12545. current_value_ = ParamType(*current1_, *current2_, *current3_,
  12546. *current4_, *current5_);
  12547. }
  12548. bool AtEnd() const {
  12549. // We must report iterator past the end of the range when either of the
  12550. // component iterators has reached the end of its range.
  12551. return
  12552. current1_ == end1_ ||
  12553. current2_ == end2_ ||
  12554. current3_ == end3_ ||
  12555. current4_ == end4_ ||
  12556. current5_ == end5_;
  12557. }
  12558. // No implementation - assignment is unsupported.
  12559. void operator=(const Iterator& other);
  12560. const ParamGeneratorInterface<ParamType>* const base_;
  12561. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12562. // current[i]_ is the actual traversing iterator.
  12563. const typename ParamGenerator<T1>::iterator begin1_;
  12564. const typename ParamGenerator<T1>::iterator end1_;
  12565. typename ParamGenerator<T1>::iterator current1_;
  12566. const typename ParamGenerator<T2>::iterator begin2_;
  12567. const typename ParamGenerator<T2>::iterator end2_;
  12568. typename ParamGenerator<T2>::iterator current2_;
  12569. const typename ParamGenerator<T3>::iterator begin3_;
  12570. const typename ParamGenerator<T3>::iterator end3_;
  12571. typename ParamGenerator<T3>::iterator current3_;
  12572. const typename ParamGenerator<T4>::iterator begin4_;
  12573. const typename ParamGenerator<T4>::iterator end4_;
  12574. typename ParamGenerator<T4>::iterator current4_;
  12575. const typename ParamGenerator<T5>::iterator begin5_;
  12576. const typename ParamGenerator<T5>::iterator end5_;
  12577. typename ParamGenerator<T5>::iterator current5_;
  12578. ParamType current_value_;
  12579. }; // class CartesianProductGenerator5::Iterator
  12580. // No implementation - assignment is unsupported.
  12581. void operator=(const CartesianProductGenerator5& other);
  12582. const ParamGenerator<T1> g1_;
  12583. const ParamGenerator<T2> g2_;
  12584. const ParamGenerator<T3> g3_;
  12585. const ParamGenerator<T4> g4_;
  12586. const ParamGenerator<T5> g5_;
  12587. }; // class CartesianProductGenerator5
  12588. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12589. typename T6>
  12590. class CartesianProductGenerator6
  12591. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,
  12592. T6> > {
  12593. public:
  12594. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;
  12595. CartesianProductGenerator6(const ParamGenerator<T1>& g1,
  12596. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  12597. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  12598. const ParamGenerator<T6>& g6)
  12599. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
  12600. virtual ~CartesianProductGenerator6() {}
  12601. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12602. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12603. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
  12604. }
  12605. virtual ParamIteratorInterface<ParamType>* End() const {
  12606. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  12607. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
  12608. }
  12609. private:
  12610. class Iterator : public ParamIteratorInterface<ParamType> {
  12611. public:
  12612. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12613. const ParamGenerator<T1>& g1,
  12614. const typename ParamGenerator<T1>::iterator& current1,
  12615. const ParamGenerator<T2>& g2,
  12616. const typename ParamGenerator<T2>::iterator& current2,
  12617. const ParamGenerator<T3>& g3,
  12618. const typename ParamGenerator<T3>::iterator& current3,
  12619. const ParamGenerator<T4>& g4,
  12620. const typename ParamGenerator<T4>::iterator& current4,
  12621. const ParamGenerator<T5>& g5,
  12622. const typename ParamGenerator<T5>::iterator& current5,
  12623. const ParamGenerator<T6>& g6,
  12624. const typename ParamGenerator<T6>::iterator& current6)
  12625. : base_(base),
  12626. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12627. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  12628. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  12629. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  12630. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  12631. begin6_(g6.begin()), end6_(g6.end()), current6_(current6) {
  12632. ComputeCurrentValue();
  12633. }
  12634. virtual ~Iterator() {}
  12635. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12636. return base_;
  12637. }
  12638. // Advance should not be called on beyond-of-range iterators
  12639. // so no component iterators must be beyond end of range, either.
  12640. virtual void Advance() {
  12641. assert(!AtEnd());
  12642. ++current6_;
  12643. if (current6_ == end6_) {
  12644. current6_ = begin6_;
  12645. ++current5_;
  12646. }
  12647. if (current5_ == end5_) {
  12648. current5_ = begin5_;
  12649. ++current4_;
  12650. }
  12651. if (current4_ == end4_) {
  12652. current4_ = begin4_;
  12653. ++current3_;
  12654. }
  12655. if (current3_ == end3_) {
  12656. current3_ = begin3_;
  12657. ++current2_;
  12658. }
  12659. if (current2_ == end2_) {
  12660. current2_ = begin2_;
  12661. ++current1_;
  12662. }
  12663. ComputeCurrentValue();
  12664. }
  12665. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12666. return new Iterator(*this);
  12667. }
  12668. virtual const ParamType* Current() const { return &current_value_; }
  12669. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12670. // Having the same base generator guarantees that the other
  12671. // iterator is of the same type and we can downcast.
  12672. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12673. << "The program attempted to compare iterators "
  12674. << "from different generators." << std::endl;
  12675. const Iterator* typed_other =
  12676. CheckedDowncastToActualType<const Iterator>(&other);
  12677. // We must report iterators equal if they both point beyond their
  12678. // respective ranges. That can happen in a variety of fashions,
  12679. // so we have to consult AtEnd().
  12680. return (AtEnd() && typed_other->AtEnd()) ||
  12681. (
  12682. current1_ == typed_other->current1_ &&
  12683. current2_ == typed_other->current2_ &&
  12684. current3_ == typed_other->current3_ &&
  12685. current4_ == typed_other->current4_ &&
  12686. current5_ == typed_other->current5_ &&
  12687. current6_ == typed_other->current6_);
  12688. }
  12689. private:
  12690. Iterator(const Iterator& other)
  12691. : base_(other.base_),
  12692. begin1_(other.begin1_),
  12693. end1_(other.end1_),
  12694. current1_(other.current1_),
  12695. begin2_(other.begin2_),
  12696. end2_(other.end2_),
  12697. current2_(other.current2_),
  12698. begin3_(other.begin3_),
  12699. end3_(other.end3_),
  12700. current3_(other.current3_),
  12701. begin4_(other.begin4_),
  12702. end4_(other.end4_),
  12703. current4_(other.current4_),
  12704. begin5_(other.begin5_),
  12705. end5_(other.end5_),
  12706. current5_(other.current5_),
  12707. begin6_(other.begin6_),
  12708. end6_(other.end6_),
  12709. current6_(other.current6_) {
  12710. ComputeCurrentValue();
  12711. }
  12712. void ComputeCurrentValue() {
  12713. if (!AtEnd())
  12714. current_value_ = ParamType(*current1_, *current2_, *current3_,
  12715. *current4_, *current5_, *current6_);
  12716. }
  12717. bool AtEnd() const {
  12718. // We must report iterator past the end of the range when either of the
  12719. // component iterators has reached the end of its range.
  12720. return
  12721. current1_ == end1_ ||
  12722. current2_ == end2_ ||
  12723. current3_ == end3_ ||
  12724. current4_ == end4_ ||
  12725. current5_ == end5_ ||
  12726. current6_ == end6_;
  12727. }
  12728. // No implementation - assignment is unsupported.
  12729. void operator=(const Iterator& other);
  12730. const ParamGeneratorInterface<ParamType>* const base_;
  12731. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12732. // current[i]_ is the actual traversing iterator.
  12733. const typename ParamGenerator<T1>::iterator begin1_;
  12734. const typename ParamGenerator<T1>::iterator end1_;
  12735. typename ParamGenerator<T1>::iterator current1_;
  12736. const typename ParamGenerator<T2>::iterator begin2_;
  12737. const typename ParamGenerator<T2>::iterator end2_;
  12738. typename ParamGenerator<T2>::iterator current2_;
  12739. const typename ParamGenerator<T3>::iterator begin3_;
  12740. const typename ParamGenerator<T3>::iterator end3_;
  12741. typename ParamGenerator<T3>::iterator current3_;
  12742. const typename ParamGenerator<T4>::iterator begin4_;
  12743. const typename ParamGenerator<T4>::iterator end4_;
  12744. typename ParamGenerator<T4>::iterator current4_;
  12745. const typename ParamGenerator<T5>::iterator begin5_;
  12746. const typename ParamGenerator<T5>::iterator end5_;
  12747. typename ParamGenerator<T5>::iterator current5_;
  12748. const typename ParamGenerator<T6>::iterator begin6_;
  12749. const typename ParamGenerator<T6>::iterator end6_;
  12750. typename ParamGenerator<T6>::iterator current6_;
  12751. ParamType current_value_;
  12752. }; // class CartesianProductGenerator6::Iterator
  12753. // No implementation - assignment is unsupported.
  12754. void operator=(const CartesianProductGenerator6& other);
  12755. const ParamGenerator<T1> g1_;
  12756. const ParamGenerator<T2> g2_;
  12757. const ParamGenerator<T3> g3_;
  12758. const ParamGenerator<T4> g4_;
  12759. const ParamGenerator<T5> g5_;
  12760. const ParamGenerator<T6> g6_;
  12761. }; // class CartesianProductGenerator6
  12762. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12763. typename T6, typename T7>
  12764. class CartesianProductGenerator7
  12765. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
  12766. T7> > {
  12767. public:
  12768. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
  12769. CartesianProductGenerator7(const ParamGenerator<T1>& g1,
  12770. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  12771. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  12772. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
  12773. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
  12774. virtual ~CartesianProductGenerator7() {}
  12775. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12776. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12777. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  12778. g7_.begin());
  12779. }
  12780. virtual ParamIteratorInterface<ParamType>* End() const {
  12781. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  12782. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
  12783. }
  12784. private:
  12785. class Iterator : public ParamIteratorInterface<ParamType> {
  12786. public:
  12787. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12788. const ParamGenerator<T1>& g1,
  12789. const typename ParamGenerator<T1>::iterator& current1,
  12790. const ParamGenerator<T2>& g2,
  12791. const typename ParamGenerator<T2>::iterator& current2,
  12792. const ParamGenerator<T3>& g3,
  12793. const typename ParamGenerator<T3>::iterator& current3,
  12794. const ParamGenerator<T4>& g4,
  12795. const typename ParamGenerator<T4>::iterator& current4,
  12796. const ParamGenerator<T5>& g5,
  12797. const typename ParamGenerator<T5>::iterator& current5,
  12798. const ParamGenerator<T6>& g6,
  12799. const typename ParamGenerator<T6>::iterator& current6,
  12800. const ParamGenerator<T7>& g7,
  12801. const typename ParamGenerator<T7>::iterator& current7)
  12802. : base_(base),
  12803. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12804. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  12805. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  12806. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  12807. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  12808. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  12809. begin7_(g7.begin()), end7_(g7.end()), current7_(current7) {
  12810. ComputeCurrentValue();
  12811. }
  12812. virtual ~Iterator() {}
  12813. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12814. return base_;
  12815. }
  12816. // Advance should not be called on beyond-of-range iterators
  12817. // so no component iterators must be beyond end of range, either.
  12818. virtual void Advance() {
  12819. assert(!AtEnd());
  12820. ++current7_;
  12821. if (current7_ == end7_) {
  12822. current7_ = begin7_;
  12823. ++current6_;
  12824. }
  12825. if (current6_ == end6_) {
  12826. current6_ = begin6_;
  12827. ++current5_;
  12828. }
  12829. if (current5_ == end5_) {
  12830. current5_ = begin5_;
  12831. ++current4_;
  12832. }
  12833. if (current4_ == end4_) {
  12834. current4_ = begin4_;
  12835. ++current3_;
  12836. }
  12837. if (current3_ == end3_) {
  12838. current3_ = begin3_;
  12839. ++current2_;
  12840. }
  12841. if (current2_ == end2_) {
  12842. current2_ = begin2_;
  12843. ++current1_;
  12844. }
  12845. ComputeCurrentValue();
  12846. }
  12847. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12848. return new Iterator(*this);
  12849. }
  12850. virtual const ParamType* Current() const { return &current_value_; }
  12851. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12852. // Having the same base generator guarantees that the other
  12853. // iterator is of the same type and we can downcast.
  12854. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12855. << "The program attempted to compare iterators "
  12856. << "from different generators." << std::endl;
  12857. const Iterator* typed_other =
  12858. CheckedDowncastToActualType<const Iterator>(&other);
  12859. // We must report iterators equal if they both point beyond their
  12860. // respective ranges. That can happen in a variety of fashions,
  12861. // so we have to consult AtEnd().
  12862. return (AtEnd() && typed_other->AtEnd()) ||
  12863. (
  12864. current1_ == typed_other->current1_ &&
  12865. current2_ == typed_other->current2_ &&
  12866. current3_ == typed_other->current3_ &&
  12867. current4_ == typed_other->current4_ &&
  12868. current5_ == typed_other->current5_ &&
  12869. current6_ == typed_other->current6_ &&
  12870. current7_ == typed_other->current7_);
  12871. }
  12872. private:
  12873. Iterator(const Iterator& other)
  12874. : base_(other.base_),
  12875. begin1_(other.begin1_),
  12876. end1_(other.end1_),
  12877. current1_(other.current1_),
  12878. begin2_(other.begin2_),
  12879. end2_(other.end2_),
  12880. current2_(other.current2_),
  12881. begin3_(other.begin3_),
  12882. end3_(other.end3_),
  12883. current3_(other.current3_),
  12884. begin4_(other.begin4_),
  12885. end4_(other.end4_),
  12886. current4_(other.current4_),
  12887. begin5_(other.begin5_),
  12888. end5_(other.end5_),
  12889. current5_(other.current5_),
  12890. begin6_(other.begin6_),
  12891. end6_(other.end6_),
  12892. current6_(other.current6_),
  12893. begin7_(other.begin7_),
  12894. end7_(other.end7_),
  12895. current7_(other.current7_) {
  12896. ComputeCurrentValue();
  12897. }
  12898. void ComputeCurrentValue() {
  12899. if (!AtEnd())
  12900. current_value_ = ParamType(*current1_, *current2_, *current3_,
  12901. *current4_, *current5_, *current6_, *current7_);
  12902. }
  12903. bool AtEnd() const {
  12904. // We must report iterator past the end of the range when either of the
  12905. // component iterators has reached the end of its range.
  12906. return
  12907. current1_ == end1_ ||
  12908. current2_ == end2_ ||
  12909. current3_ == end3_ ||
  12910. current4_ == end4_ ||
  12911. current5_ == end5_ ||
  12912. current6_ == end6_ ||
  12913. current7_ == end7_;
  12914. }
  12915. // No implementation - assignment is unsupported.
  12916. void operator=(const Iterator& other);
  12917. const ParamGeneratorInterface<ParamType>* const base_;
  12918. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12919. // current[i]_ is the actual traversing iterator.
  12920. const typename ParamGenerator<T1>::iterator begin1_;
  12921. const typename ParamGenerator<T1>::iterator end1_;
  12922. typename ParamGenerator<T1>::iterator current1_;
  12923. const typename ParamGenerator<T2>::iterator begin2_;
  12924. const typename ParamGenerator<T2>::iterator end2_;
  12925. typename ParamGenerator<T2>::iterator current2_;
  12926. const typename ParamGenerator<T3>::iterator begin3_;
  12927. const typename ParamGenerator<T3>::iterator end3_;
  12928. typename ParamGenerator<T3>::iterator current3_;
  12929. const typename ParamGenerator<T4>::iterator begin4_;
  12930. const typename ParamGenerator<T4>::iterator end4_;
  12931. typename ParamGenerator<T4>::iterator current4_;
  12932. const typename ParamGenerator<T5>::iterator begin5_;
  12933. const typename ParamGenerator<T5>::iterator end5_;
  12934. typename ParamGenerator<T5>::iterator current5_;
  12935. const typename ParamGenerator<T6>::iterator begin6_;
  12936. const typename ParamGenerator<T6>::iterator end6_;
  12937. typename ParamGenerator<T6>::iterator current6_;
  12938. const typename ParamGenerator<T7>::iterator begin7_;
  12939. const typename ParamGenerator<T7>::iterator end7_;
  12940. typename ParamGenerator<T7>::iterator current7_;
  12941. ParamType current_value_;
  12942. }; // class CartesianProductGenerator7::Iterator
  12943. // No implementation - assignment is unsupported.
  12944. void operator=(const CartesianProductGenerator7& other);
  12945. const ParamGenerator<T1> g1_;
  12946. const ParamGenerator<T2> g2_;
  12947. const ParamGenerator<T3> g3_;
  12948. const ParamGenerator<T4> g4_;
  12949. const ParamGenerator<T5> g5_;
  12950. const ParamGenerator<T6> g6_;
  12951. const ParamGenerator<T7> g7_;
  12952. }; // class CartesianProductGenerator7
  12953. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12954. typename T6, typename T7, typename T8>
  12955. class CartesianProductGenerator8
  12956. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
  12957. T7, T8> > {
  12958. public:
  12959. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
  12960. CartesianProductGenerator8(const ParamGenerator<T1>& g1,
  12961. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  12962. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  12963. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
  12964. const ParamGenerator<T8>& g8)
  12965. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
  12966. g8_(g8) {}
  12967. virtual ~CartesianProductGenerator8() {}
  12968. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12969. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12970. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  12971. g7_.begin(), g8_, g8_.begin());
  12972. }
  12973. virtual ParamIteratorInterface<ParamType>* End() const {
  12974. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  12975. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
  12976. g8_.end());
  12977. }
  12978. private:
  12979. class Iterator : public ParamIteratorInterface<ParamType> {
  12980. public:
  12981. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12982. const ParamGenerator<T1>& g1,
  12983. const typename ParamGenerator<T1>::iterator& current1,
  12984. const ParamGenerator<T2>& g2,
  12985. const typename ParamGenerator<T2>::iterator& current2,
  12986. const ParamGenerator<T3>& g3,
  12987. const typename ParamGenerator<T3>::iterator& current3,
  12988. const ParamGenerator<T4>& g4,
  12989. const typename ParamGenerator<T4>::iterator& current4,
  12990. const ParamGenerator<T5>& g5,
  12991. const typename ParamGenerator<T5>::iterator& current5,
  12992. const ParamGenerator<T6>& g6,
  12993. const typename ParamGenerator<T6>::iterator& current6,
  12994. const ParamGenerator<T7>& g7,
  12995. const typename ParamGenerator<T7>::iterator& current7,
  12996. const ParamGenerator<T8>& g8,
  12997. const typename ParamGenerator<T8>::iterator& current8)
  12998. : base_(base),
  12999. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  13000. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  13001. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  13002. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  13003. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  13004. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  13005. begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
  13006. begin8_(g8.begin()), end8_(g8.end()), current8_(current8) {
  13007. ComputeCurrentValue();
  13008. }
  13009. virtual ~Iterator() {}
  13010. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  13011. return base_;
  13012. }
  13013. // Advance should not be called on beyond-of-range iterators
  13014. // so no component iterators must be beyond end of range, either.
  13015. virtual void Advance() {
  13016. assert(!AtEnd());
  13017. ++current8_;
  13018. if (current8_ == end8_) {
  13019. current8_ = begin8_;
  13020. ++current7_;
  13021. }
  13022. if (current7_ == end7_) {
  13023. current7_ = begin7_;
  13024. ++current6_;
  13025. }
  13026. if (current6_ == end6_) {
  13027. current6_ = begin6_;
  13028. ++current5_;
  13029. }
  13030. if (current5_ == end5_) {
  13031. current5_ = begin5_;
  13032. ++current4_;
  13033. }
  13034. if (current4_ == end4_) {
  13035. current4_ = begin4_;
  13036. ++current3_;
  13037. }
  13038. if (current3_ == end3_) {
  13039. current3_ = begin3_;
  13040. ++current2_;
  13041. }
  13042. if (current2_ == end2_) {
  13043. current2_ = begin2_;
  13044. ++current1_;
  13045. }
  13046. ComputeCurrentValue();
  13047. }
  13048. virtual ParamIteratorInterface<ParamType>* Clone() const {
  13049. return new Iterator(*this);
  13050. }
  13051. virtual const ParamType* Current() const { return &current_value_; }
  13052. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  13053. // Having the same base generator guarantees that the other
  13054. // iterator is of the same type and we can downcast.
  13055. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  13056. << "The program attempted to compare iterators "
  13057. << "from different generators." << std::endl;
  13058. const Iterator* typed_other =
  13059. CheckedDowncastToActualType<const Iterator>(&other);
  13060. // We must report iterators equal if they both point beyond their
  13061. // respective ranges. That can happen in a variety of fashions,
  13062. // so we have to consult AtEnd().
  13063. return (AtEnd() && typed_other->AtEnd()) ||
  13064. (
  13065. current1_ == typed_other->current1_ &&
  13066. current2_ == typed_other->current2_ &&
  13067. current3_ == typed_other->current3_ &&
  13068. current4_ == typed_other->current4_ &&
  13069. current5_ == typed_other->current5_ &&
  13070. current6_ == typed_other->current6_ &&
  13071. current7_ == typed_other->current7_ &&
  13072. current8_ == typed_other->current8_);
  13073. }
  13074. private:
  13075. Iterator(const Iterator& other)
  13076. : base_(other.base_),
  13077. begin1_(other.begin1_),
  13078. end1_(other.end1_),
  13079. current1_(other.current1_),
  13080. begin2_(other.begin2_),
  13081. end2_(other.end2_),
  13082. current2_(other.current2_),
  13083. begin3_(other.begin3_),
  13084. end3_(other.end3_),
  13085. current3_(other.current3_),
  13086. begin4_(other.begin4_),
  13087. end4_(other.end4_),
  13088. current4_(other.current4_),
  13089. begin5_(other.begin5_),
  13090. end5_(other.end5_),
  13091. current5_(other.current5_),
  13092. begin6_(other.begin6_),
  13093. end6_(other.end6_),
  13094. current6_(other.current6_),
  13095. begin7_(other.begin7_),
  13096. end7_(other.end7_),
  13097. current7_(other.current7_),
  13098. begin8_(other.begin8_),
  13099. end8_(other.end8_),
  13100. current8_(other.current8_) {
  13101. ComputeCurrentValue();
  13102. }
  13103. void ComputeCurrentValue() {
  13104. if (!AtEnd())
  13105. current_value_ = ParamType(*current1_, *current2_, *current3_,
  13106. *current4_, *current5_, *current6_, *current7_, *current8_);
  13107. }
  13108. bool AtEnd() const {
  13109. // We must report iterator past the end of the range when either of the
  13110. // component iterators has reached the end of its range.
  13111. return
  13112. current1_ == end1_ ||
  13113. current2_ == end2_ ||
  13114. current3_ == end3_ ||
  13115. current4_ == end4_ ||
  13116. current5_ == end5_ ||
  13117. current6_ == end6_ ||
  13118. current7_ == end7_ ||
  13119. current8_ == end8_;
  13120. }
  13121. // No implementation - assignment is unsupported.
  13122. void operator=(const Iterator& other);
  13123. const ParamGeneratorInterface<ParamType>* const base_;
  13124. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  13125. // current[i]_ is the actual traversing iterator.
  13126. const typename ParamGenerator<T1>::iterator begin1_;
  13127. const typename ParamGenerator<T1>::iterator end1_;
  13128. typename ParamGenerator<T1>::iterator current1_;
  13129. const typename ParamGenerator<T2>::iterator begin2_;
  13130. const typename ParamGenerator<T2>::iterator end2_;
  13131. typename ParamGenerator<T2>::iterator current2_;
  13132. const typename ParamGenerator<T3>::iterator begin3_;
  13133. const typename ParamGenerator<T3>::iterator end3_;
  13134. typename ParamGenerator<T3>::iterator current3_;
  13135. const typename ParamGenerator<T4>::iterator begin4_;
  13136. const typename ParamGenerator<T4>::iterator end4_;
  13137. typename ParamGenerator<T4>::iterator current4_;
  13138. const typename ParamGenerator<T5>::iterator begin5_;
  13139. const typename ParamGenerator<T5>::iterator end5_;
  13140. typename ParamGenerator<T5>::iterator current5_;
  13141. const typename ParamGenerator<T6>::iterator begin6_;
  13142. const typename ParamGenerator<T6>::iterator end6_;
  13143. typename ParamGenerator<T6>::iterator current6_;
  13144. const typename ParamGenerator<T7>::iterator begin7_;
  13145. const typename ParamGenerator<T7>::iterator end7_;
  13146. typename ParamGenerator<T7>::iterator current7_;
  13147. const typename ParamGenerator<T8>::iterator begin8_;
  13148. const typename ParamGenerator<T8>::iterator end8_;
  13149. typename ParamGenerator<T8>::iterator current8_;
  13150. ParamType current_value_;
  13151. }; // class CartesianProductGenerator8::Iterator
  13152. // No implementation - assignment is unsupported.
  13153. void operator=(const CartesianProductGenerator8& other);
  13154. const ParamGenerator<T1> g1_;
  13155. const ParamGenerator<T2> g2_;
  13156. const ParamGenerator<T3> g3_;
  13157. const ParamGenerator<T4> g4_;
  13158. const ParamGenerator<T5> g5_;
  13159. const ParamGenerator<T6> g6_;
  13160. const ParamGenerator<T7> g7_;
  13161. const ParamGenerator<T8> g8_;
  13162. }; // class CartesianProductGenerator8
  13163. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13164. typename T6, typename T7, typename T8, typename T9>
  13165. class CartesianProductGenerator9
  13166. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
  13167. T7, T8, T9> > {
  13168. public:
  13169. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
  13170. CartesianProductGenerator9(const ParamGenerator<T1>& g1,
  13171. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  13172. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  13173. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
  13174. const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
  13175. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  13176. g9_(g9) {}
  13177. virtual ~CartesianProductGenerator9() {}
  13178. virtual ParamIteratorInterface<ParamType>* Begin() const {
  13179. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  13180. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  13181. g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
  13182. }
  13183. virtual ParamIteratorInterface<ParamType>* End() const {
  13184. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  13185. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
  13186. g8_.end(), g9_, g9_.end());
  13187. }
  13188. private:
  13189. class Iterator : public ParamIteratorInterface<ParamType> {
  13190. public:
  13191. Iterator(const ParamGeneratorInterface<ParamType>* base,
  13192. const ParamGenerator<T1>& g1,
  13193. const typename ParamGenerator<T1>::iterator& current1,
  13194. const ParamGenerator<T2>& g2,
  13195. const typename ParamGenerator<T2>::iterator& current2,
  13196. const ParamGenerator<T3>& g3,
  13197. const typename ParamGenerator<T3>::iterator& current3,
  13198. const ParamGenerator<T4>& g4,
  13199. const typename ParamGenerator<T4>::iterator& current4,
  13200. const ParamGenerator<T5>& g5,
  13201. const typename ParamGenerator<T5>::iterator& current5,
  13202. const ParamGenerator<T6>& g6,
  13203. const typename ParamGenerator<T6>::iterator& current6,
  13204. const ParamGenerator<T7>& g7,
  13205. const typename ParamGenerator<T7>::iterator& current7,
  13206. const ParamGenerator<T8>& g8,
  13207. const typename ParamGenerator<T8>::iterator& current8,
  13208. const ParamGenerator<T9>& g9,
  13209. const typename ParamGenerator<T9>::iterator& current9)
  13210. : base_(base),
  13211. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  13212. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  13213. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  13214. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  13215. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  13216. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  13217. begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
  13218. begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
  13219. begin9_(g9.begin()), end9_(g9.end()), current9_(current9) {
  13220. ComputeCurrentValue();
  13221. }
  13222. virtual ~Iterator() {}
  13223. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  13224. return base_;
  13225. }
  13226. // Advance should not be called on beyond-of-range iterators
  13227. // so no component iterators must be beyond end of range, either.
  13228. virtual void Advance() {
  13229. assert(!AtEnd());
  13230. ++current9_;
  13231. if (current9_ == end9_) {
  13232. current9_ = begin9_;
  13233. ++current8_;
  13234. }
  13235. if (current8_ == end8_) {
  13236. current8_ = begin8_;
  13237. ++current7_;
  13238. }
  13239. if (current7_ == end7_) {
  13240. current7_ = begin7_;
  13241. ++current6_;
  13242. }
  13243. if (current6_ == end6_) {
  13244. current6_ = begin6_;
  13245. ++current5_;
  13246. }
  13247. if (current5_ == end5_) {
  13248. current5_ = begin5_;
  13249. ++current4_;
  13250. }
  13251. if (current4_ == end4_) {
  13252. current4_ = begin4_;
  13253. ++current3_;
  13254. }
  13255. if (current3_ == end3_) {
  13256. current3_ = begin3_;
  13257. ++current2_;
  13258. }
  13259. if (current2_ == end2_) {
  13260. current2_ = begin2_;
  13261. ++current1_;
  13262. }
  13263. ComputeCurrentValue();
  13264. }
  13265. virtual ParamIteratorInterface<ParamType>* Clone() const {
  13266. return new Iterator(*this);
  13267. }
  13268. virtual const ParamType* Current() const { return &current_value_; }
  13269. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  13270. // Having the same base generator guarantees that the other
  13271. // iterator is of the same type and we can downcast.
  13272. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  13273. << "The program attempted to compare iterators "
  13274. << "from different generators." << std::endl;
  13275. const Iterator* typed_other =
  13276. CheckedDowncastToActualType<const Iterator>(&other);
  13277. // We must report iterators equal if they both point beyond their
  13278. // respective ranges. That can happen in a variety of fashions,
  13279. // so we have to consult AtEnd().
  13280. return (AtEnd() && typed_other->AtEnd()) ||
  13281. (
  13282. current1_ == typed_other->current1_ &&
  13283. current2_ == typed_other->current2_ &&
  13284. current3_ == typed_other->current3_ &&
  13285. current4_ == typed_other->current4_ &&
  13286. current5_ == typed_other->current5_ &&
  13287. current6_ == typed_other->current6_ &&
  13288. current7_ == typed_other->current7_ &&
  13289. current8_ == typed_other->current8_ &&
  13290. current9_ == typed_other->current9_);
  13291. }
  13292. private:
  13293. Iterator(const Iterator& other)
  13294. : base_(other.base_),
  13295. begin1_(other.begin1_),
  13296. end1_(other.end1_),
  13297. current1_(other.current1_),
  13298. begin2_(other.begin2_),
  13299. end2_(other.end2_),
  13300. current2_(other.current2_),
  13301. begin3_(other.begin3_),
  13302. end3_(other.end3_),
  13303. current3_(other.current3_),
  13304. begin4_(other.begin4_),
  13305. end4_(other.end4_),
  13306. current4_(other.current4_),
  13307. begin5_(other.begin5_),
  13308. end5_(other.end5_),
  13309. current5_(other.current5_),
  13310. begin6_(other.begin6_),
  13311. end6_(other.end6_),
  13312. current6_(other.current6_),
  13313. begin7_(other.begin7_),
  13314. end7_(other.end7_),
  13315. current7_(other.current7_),
  13316. begin8_(other.begin8_),
  13317. end8_(other.end8_),
  13318. current8_(other.current8_),
  13319. begin9_(other.begin9_),
  13320. end9_(other.end9_),
  13321. current9_(other.current9_) {
  13322. ComputeCurrentValue();
  13323. }
  13324. void ComputeCurrentValue() {
  13325. if (!AtEnd())
  13326. current_value_ = ParamType(*current1_, *current2_, *current3_,
  13327. *current4_, *current5_, *current6_, *current7_, *current8_,
  13328. *current9_);
  13329. }
  13330. bool AtEnd() const {
  13331. // We must report iterator past the end of the range when either of the
  13332. // component iterators has reached the end of its range.
  13333. return
  13334. current1_ == end1_ ||
  13335. current2_ == end2_ ||
  13336. current3_ == end3_ ||
  13337. current4_ == end4_ ||
  13338. current5_ == end5_ ||
  13339. current6_ == end6_ ||
  13340. current7_ == end7_ ||
  13341. current8_ == end8_ ||
  13342. current9_ == end9_;
  13343. }
  13344. // No implementation - assignment is unsupported.
  13345. void operator=(const Iterator& other);
  13346. const ParamGeneratorInterface<ParamType>* const base_;
  13347. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  13348. // current[i]_ is the actual traversing iterator.
  13349. const typename ParamGenerator<T1>::iterator begin1_;
  13350. const typename ParamGenerator<T1>::iterator end1_;
  13351. typename ParamGenerator<T1>::iterator current1_;
  13352. const typename ParamGenerator<T2>::iterator begin2_;
  13353. const typename ParamGenerator<T2>::iterator end2_;
  13354. typename ParamGenerator<T2>::iterator current2_;
  13355. const typename ParamGenerator<T3>::iterator begin3_;
  13356. const typename ParamGenerator<T3>::iterator end3_;
  13357. typename ParamGenerator<T3>::iterator current3_;
  13358. const typename ParamGenerator<T4>::iterator begin4_;
  13359. const typename ParamGenerator<T4>::iterator end4_;
  13360. typename ParamGenerator<T4>::iterator current4_;
  13361. const typename ParamGenerator<T5>::iterator begin5_;
  13362. const typename ParamGenerator<T5>::iterator end5_;
  13363. typename ParamGenerator<T5>::iterator current5_;
  13364. const typename ParamGenerator<T6>::iterator begin6_;
  13365. const typename ParamGenerator<T6>::iterator end6_;
  13366. typename ParamGenerator<T6>::iterator current6_;
  13367. const typename ParamGenerator<T7>::iterator begin7_;
  13368. const typename ParamGenerator<T7>::iterator end7_;
  13369. typename ParamGenerator<T7>::iterator current7_;
  13370. const typename ParamGenerator<T8>::iterator begin8_;
  13371. const typename ParamGenerator<T8>::iterator end8_;
  13372. typename ParamGenerator<T8>::iterator current8_;
  13373. const typename ParamGenerator<T9>::iterator begin9_;
  13374. const typename ParamGenerator<T9>::iterator end9_;
  13375. typename ParamGenerator<T9>::iterator current9_;
  13376. ParamType current_value_;
  13377. }; // class CartesianProductGenerator9::Iterator
  13378. // No implementation - assignment is unsupported.
  13379. void operator=(const CartesianProductGenerator9& other);
  13380. const ParamGenerator<T1> g1_;
  13381. const ParamGenerator<T2> g2_;
  13382. const ParamGenerator<T3> g3_;
  13383. const ParamGenerator<T4> g4_;
  13384. const ParamGenerator<T5> g5_;
  13385. const ParamGenerator<T6> g6_;
  13386. const ParamGenerator<T7> g7_;
  13387. const ParamGenerator<T8> g8_;
  13388. const ParamGenerator<T9> g9_;
  13389. }; // class CartesianProductGenerator9
  13390. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13391. typename T6, typename T7, typename T8, typename T9, typename T10>
  13392. class CartesianProductGenerator10
  13393. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
  13394. T7, T8, T9, T10> > {
  13395. public:
  13396. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
  13397. CartesianProductGenerator10(const ParamGenerator<T1>& g1,
  13398. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  13399. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  13400. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
  13401. const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
  13402. const ParamGenerator<T10>& g10)
  13403. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  13404. g9_(g9), g10_(g10) {}
  13405. virtual ~CartesianProductGenerator10() {}
  13406. virtual ParamIteratorInterface<ParamType>* Begin() const {
  13407. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  13408. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  13409. g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
  13410. }
  13411. virtual ParamIteratorInterface<ParamType>* End() const {
  13412. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  13413. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
  13414. g8_.end(), g9_, g9_.end(), g10_, g10_.end());
  13415. }
  13416. private:
  13417. class Iterator : public ParamIteratorInterface<ParamType> {
  13418. public:
  13419. Iterator(const ParamGeneratorInterface<ParamType>* base,
  13420. const ParamGenerator<T1>& g1,
  13421. const typename ParamGenerator<T1>::iterator& current1,
  13422. const ParamGenerator<T2>& g2,
  13423. const typename ParamGenerator<T2>::iterator& current2,
  13424. const ParamGenerator<T3>& g3,
  13425. const typename ParamGenerator<T3>::iterator& current3,
  13426. const ParamGenerator<T4>& g4,
  13427. const typename ParamGenerator<T4>::iterator& current4,
  13428. const ParamGenerator<T5>& g5,
  13429. const typename ParamGenerator<T5>::iterator& current5,
  13430. const ParamGenerator<T6>& g6,
  13431. const typename ParamGenerator<T6>::iterator& current6,
  13432. const ParamGenerator<T7>& g7,
  13433. const typename ParamGenerator<T7>::iterator& current7,
  13434. const ParamGenerator<T8>& g8,
  13435. const typename ParamGenerator<T8>::iterator& current8,
  13436. const ParamGenerator<T9>& g9,
  13437. const typename ParamGenerator<T9>::iterator& current9,
  13438. const ParamGenerator<T10>& g10,
  13439. const typename ParamGenerator<T10>::iterator& current10)
  13440. : base_(base),
  13441. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  13442. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  13443. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  13444. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  13445. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  13446. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  13447. begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
  13448. begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
  13449. begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
  13450. begin10_(g10.begin()), end10_(g10.end()), current10_(current10) {
  13451. ComputeCurrentValue();
  13452. }
  13453. virtual ~Iterator() {}
  13454. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  13455. return base_;
  13456. }
  13457. // Advance should not be called on beyond-of-range iterators
  13458. // so no component iterators must be beyond end of range, either.
  13459. virtual void Advance() {
  13460. assert(!AtEnd());
  13461. ++current10_;
  13462. if (current10_ == end10_) {
  13463. current10_ = begin10_;
  13464. ++current9_;
  13465. }
  13466. if (current9_ == end9_) {
  13467. current9_ = begin9_;
  13468. ++current8_;
  13469. }
  13470. if (current8_ == end8_) {
  13471. current8_ = begin8_;
  13472. ++current7_;
  13473. }
  13474. if (current7_ == end7_) {
  13475. current7_ = begin7_;
  13476. ++current6_;
  13477. }
  13478. if (current6_ == end6_) {
  13479. current6_ = begin6_;
  13480. ++current5_;
  13481. }
  13482. if (current5_ == end5_) {
  13483. current5_ = begin5_;
  13484. ++current4_;
  13485. }
  13486. if (current4_ == end4_) {
  13487. current4_ = begin4_;
  13488. ++current3_;
  13489. }
  13490. if (current3_ == end3_) {
  13491. current3_ = begin3_;
  13492. ++current2_;
  13493. }
  13494. if (current2_ == end2_) {
  13495. current2_ = begin2_;
  13496. ++current1_;
  13497. }
  13498. ComputeCurrentValue();
  13499. }
  13500. virtual ParamIteratorInterface<ParamType>* Clone() const {
  13501. return new Iterator(*this);
  13502. }
  13503. virtual const ParamType* Current() const { return &current_value_; }
  13504. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  13505. // Having the same base generator guarantees that the other
  13506. // iterator is of the same type and we can downcast.
  13507. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  13508. << "The program attempted to compare iterators "
  13509. << "from different generators." << std::endl;
  13510. const Iterator* typed_other =
  13511. CheckedDowncastToActualType<const Iterator>(&other);
  13512. // We must report iterators equal if they both point beyond their
  13513. // respective ranges. That can happen in a variety of fashions,
  13514. // so we have to consult AtEnd().
  13515. return (AtEnd() && typed_other->AtEnd()) ||
  13516. (
  13517. current1_ == typed_other->current1_ &&
  13518. current2_ == typed_other->current2_ &&
  13519. current3_ == typed_other->current3_ &&
  13520. current4_ == typed_other->current4_ &&
  13521. current5_ == typed_other->current5_ &&
  13522. current6_ == typed_other->current6_ &&
  13523. current7_ == typed_other->current7_ &&
  13524. current8_ == typed_other->current8_ &&
  13525. current9_ == typed_other->current9_ &&
  13526. current10_ == typed_other->current10_);
  13527. }
  13528. private:
  13529. Iterator(const Iterator& other)
  13530. : base_(other.base_),
  13531. begin1_(other.begin1_),
  13532. end1_(other.end1_),
  13533. current1_(other.current1_),
  13534. begin2_(other.begin2_),
  13535. end2_(other.end2_),
  13536. current2_(other.current2_),
  13537. begin3_(other.begin3_),
  13538. end3_(other.end3_),
  13539. current3_(other.current3_),
  13540. begin4_(other.begin4_),
  13541. end4_(other.end4_),
  13542. current4_(other.current4_),
  13543. begin5_(other.begin5_),
  13544. end5_(other.end5_),
  13545. current5_(other.current5_),
  13546. begin6_(other.begin6_),
  13547. end6_(other.end6_),
  13548. current6_(other.current6_),
  13549. begin7_(other.begin7_),
  13550. end7_(other.end7_),
  13551. current7_(other.current7_),
  13552. begin8_(other.begin8_),
  13553. end8_(other.end8_),
  13554. current8_(other.current8_),
  13555. begin9_(other.begin9_),
  13556. end9_(other.end9_),
  13557. current9_(other.current9_),
  13558. begin10_(other.begin10_),
  13559. end10_(other.end10_),
  13560. current10_(other.current10_) {
  13561. ComputeCurrentValue();
  13562. }
  13563. void ComputeCurrentValue() {
  13564. if (!AtEnd())
  13565. current_value_ = ParamType(*current1_, *current2_, *current3_,
  13566. *current4_, *current5_, *current6_, *current7_, *current8_,
  13567. *current9_, *current10_);
  13568. }
  13569. bool AtEnd() const {
  13570. // We must report iterator past the end of the range when either of the
  13571. // component iterators has reached the end of its range.
  13572. return
  13573. current1_ == end1_ ||
  13574. current2_ == end2_ ||
  13575. current3_ == end3_ ||
  13576. current4_ == end4_ ||
  13577. current5_ == end5_ ||
  13578. current6_ == end6_ ||
  13579. current7_ == end7_ ||
  13580. current8_ == end8_ ||
  13581. current9_ == end9_ ||
  13582. current10_ == end10_;
  13583. }
  13584. // No implementation - assignment is unsupported.
  13585. void operator=(const Iterator& other);
  13586. const ParamGeneratorInterface<ParamType>* const base_;
  13587. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  13588. // current[i]_ is the actual traversing iterator.
  13589. const typename ParamGenerator<T1>::iterator begin1_;
  13590. const typename ParamGenerator<T1>::iterator end1_;
  13591. typename ParamGenerator<T1>::iterator current1_;
  13592. const typename ParamGenerator<T2>::iterator begin2_;
  13593. const typename ParamGenerator<T2>::iterator end2_;
  13594. typename ParamGenerator<T2>::iterator current2_;
  13595. const typename ParamGenerator<T3>::iterator begin3_;
  13596. const typename ParamGenerator<T3>::iterator end3_;
  13597. typename ParamGenerator<T3>::iterator current3_;
  13598. const typename ParamGenerator<T4>::iterator begin4_;
  13599. const typename ParamGenerator<T4>::iterator end4_;
  13600. typename ParamGenerator<T4>::iterator current4_;
  13601. const typename ParamGenerator<T5>::iterator begin5_;
  13602. const typename ParamGenerator<T5>::iterator end5_;
  13603. typename ParamGenerator<T5>::iterator current5_;
  13604. const typename ParamGenerator<T6>::iterator begin6_;
  13605. const typename ParamGenerator<T6>::iterator end6_;
  13606. typename ParamGenerator<T6>::iterator current6_;
  13607. const typename ParamGenerator<T7>::iterator begin7_;
  13608. const typename ParamGenerator<T7>::iterator end7_;
  13609. typename ParamGenerator<T7>::iterator current7_;
  13610. const typename ParamGenerator<T8>::iterator begin8_;
  13611. const typename ParamGenerator<T8>::iterator end8_;
  13612. typename ParamGenerator<T8>::iterator current8_;
  13613. const typename ParamGenerator<T9>::iterator begin9_;
  13614. const typename ParamGenerator<T9>::iterator end9_;
  13615. typename ParamGenerator<T9>::iterator current9_;
  13616. const typename ParamGenerator<T10>::iterator begin10_;
  13617. const typename ParamGenerator<T10>::iterator end10_;
  13618. typename ParamGenerator<T10>::iterator current10_;
  13619. ParamType current_value_;
  13620. }; // class CartesianProductGenerator10::Iterator
  13621. // No implementation - assignment is unsupported.
  13622. void operator=(const CartesianProductGenerator10& other);
  13623. const ParamGenerator<T1> g1_;
  13624. const ParamGenerator<T2> g2_;
  13625. const ParamGenerator<T3> g3_;
  13626. const ParamGenerator<T4> g4_;
  13627. const ParamGenerator<T5> g5_;
  13628. const ParamGenerator<T6> g6_;
  13629. const ParamGenerator<T7> g7_;
  13630. const ParamGenerator<T8> g8_;
  13631. const ParamGenerator<T9> g9_;
  13632. const ParamGenerator<T10> g10_;
  13633. }; // class CartesianProductGenerator10
  13634. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  13635. //
  13636. // Helper classes providing Combine() with polymorphic features. They allow
  13637. // casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
  13638. // convertible to U.
  13639. //
  13640. template <class Generator1, class Generator2>
  13641. class CartesianProductHolder2 {
  13642. public:
  13643. CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
  13644. : g1_(g1), g2_(g2) {}
  13645. template <typename T1, typename T2>
  13646. operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {
  13647. return ParamGenerator< ::std::tr1::tuple<T1, T2> >(
  13648. new CartesianProductGenerator2<T1, T2>(
  13649. static_cast<ParamGenerator<T1> >(g1_),
  13650. static_cast<ParamGenerator<T2> >(g2_)));
  13651. }
  13652. private:
  13653. // No implementation - assignment is unsupported.
  13654. void operator=(const CartesianProductHolder2& other);
  13655. const Generator1 g1_;
  13656. const Generator2 g2_;
  13657. }; // class CartesianProductHolder2
  13658. template <class Generator1, class Generator2, class Generator3>
  13659. class CartesianProductHolder3 {
  13660. public:
  13661. CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
  13662. const Generator3& g3)
  13663. : g1_(g1), g2_(g2), g3_(g3) {}
  13664. template <typename T1, typename T2, typename T3>
  13665. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {
  13666. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(
  13667. new CartesianProductGenerator3<T1, T2, T3>(
  13668. static_cast<ParamGenerator<T1> >(g1_),
  13669. static_cast<ParamGenerator<T2> >(g2_),
  13670. static_cast<ParamGenerator<T3> >(g3_)));
  13671. }
  13672. private:
  13673. // No implementation - assignment is unsupported.
  13674. void operator=(const CartesianProductHolder3& other);
  13675. const Generator1 g1_;
  13676. const Generator2 g2_;
  13677. const Generator3 g3_;
  13678. }; // class CartesianProductHolder3
  13679. template <class Generator1, class Generator2, class Generator3,
  13680. class Generator4>
  13681. class CartesianProductHolder4 {
  13682. public:
  13683. CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
  13684. const Generator3& g3, const Generator4& g4)
  13685. : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
  13686. template <typename T1, typename T2, typename T3, typename T4>
  13687. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {
  13688. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(
  13689. new CartesianProductGenerator4<T1, T2, T3, T4>(
  13690. static_cast<ParamGenerator<T1> >(g1_),
  13691. static_cast<ParamGenerator<T2> >(g2_),
  13692. static_cast<ParamGenerator<T3> >(g3_),
  13693. static_cast<ParamGenerator<T4> >(g4_)));
  13694. }
  13695. private:
  13696. // No implementation - assignment is unsupported.
  13697. void operator=(const CartesianProductHolder4& other);
  13698. const Generator1 g1_;
  13699. const Generator2 g2_;
  13700. const Generator3 g3_;
  13701. const Generator4 g4_;
  13702. }; // class CartesianProductHolder4
  13703. template <class Generator1, class Generator2, class Generator3,
  13704. class Generator4, class Generator5>
  13705. class CartesianProductHolder5 {
  13706. public:
  13707. CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
  13708. const Generator3& g3, const Generator4& g4, const Generator5& g5)
  13709. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
  13710. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  13711. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {
  13712. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(
  13713. new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
  13714. static_cast<ParamGenerator<T1> >(g1_),
  13715. static_cast<ParamGenerator<T2> >(g2_),
  13716. static_cast<ParamGenerator<T3> >(g3_),
  13717. static_cast<ParamGenerator<T4> >(g4_),
  13718. static_cast<ParamGenerator<T5> >(g5_)));
  13719. }
  13720. private:
  13721. // No implementation - assignment is unsupported.
  13722. void operator=(const CartesianProductHolder5& other);
  13723. const Generator1 g1_;
  13724. const Generator2 g2_;
  13725. const Generator3 g3_;
  13726. const Generator4 g4_;
  13727. const Generator5 g5_;
  13728. }; // class CartesianProductHolder5
  13729. template <class Generator1, class Generator2, class Generator3,
  13730. class Generator4, class Generator5, class Generator6>
  13731. class CartesianProductHolder6 {
  13732. public:
  13733. CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
  13734. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  13735. const Generator6& g6)
  13736. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
  13737. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13738. typename T6>
  13739. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {
  13740. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(
  13741. new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
  13742. static_cast<ParamGenerator<T1> >(g1_),
  13743. static_cast<ParamGenerator<T2> >(g2_),
  13744. static_cast<ParamGenerator<T3> >(g3_),
  13745. static_cast<ParamGenerator<T4> >(g4_),
  13746. static_cast<ParamGenerator<T5> >(g5_),
  13747. static_cast<ParamGenerator<T6> >(g6_)));
  13748. }
  13749. private:
  13750. // No implementation - assignment is unsupported.
  13751. void operator=(const CartesianProductHolder6& other);
  13752. const Generator1 g1_;
  13753. const Generator2 g2_;
  13754. const Generator3 g3_;
  13755. const Generator4 g4_;
  13756. const Generator5 g5_;
  13757. const Generator6 g6_;
  13758. }; // class CartesianProductHolder6
  13759. template <class Generator1, class Generator2, class Generator3,
  13760. class Generator4, class Generator5, class Generator6, class Generator7>
  13761. class CartesianProductHolder7 {
  13762. public:
  13763. CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
  13764. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  13765. const Generator6& g6, const Generator7& g7)
  13766. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
  13767. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13768. typename T6, typename T7>
  13769. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
  13770. T7> >() const {
  13771. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(
  13772. new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
  13773. static_cast<ParamGenerator<T1> >(g1_),
  13774. static_cast<ParamGenerator<T2> >(g2_),
  13775. static_cast<ParamGenerator<T3> >(g3_),
  13776. static_cast<ParamGenerator<T4> >(g4_),
  13777. static_cast<ParamGenerator<T5> >(g5_),
  13778. static_cast<ParamGenerator<T6> >(g6_),
  13779. static_cast<ParamGenerator<T7> >(g7_)));
  13780. }
  13781. private:
  13782. // No implementation - assignment is unsupported.
  13783. void operator=(const CartesianProductHolder7& other);
  13784. const Generator1 g1_;
  13785. const Generator2 g2_;
  13786. const Generator3 g3_;
  13787. const Generator4 g4_;
  13788. const Generator5 g5_;
  13789. const Generator6 g6_;
  13790. const Generator7 g7_;
  13791. }; // class CartesianProductHolder7
  13792. template <class Generator1, class Generator2, class Generator3,
  13793. class Generator4, class Generator5, class Generator6, class Generator7,
  13794. class Generator8>
  13795. class CartesianProductHolder8 {
  13796. public:
  13797. CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
  13798. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  13799. const Generator6& g6, const Generator7& g7, const Generator8& g8)
  13800. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
  13801. g8_(g8) {}
  13802. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13803. typename T6, typename T7, typename T8>
  13804. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,
  13805. T8> >() const {
  13806. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
  13807. new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
  13808. static_cast<ParamGenerator<T1> >(g1_),
  13809. static_cast<ParamGenerator<T2> >(g2_),
  13810. static_cast<ParamGenerator<T3> >(g3_),
  13811. static_cast<ParamGenerator<T4> >(g4_),
  13812. static_cast<ParamGenerator<T5> >(g5_),
  13813. static_cast<ParamGenerator<T6> >(g6_),
  13814. static_cast<ParamGenerator<T7> >(g7_),
  13815. static_cast<ParamGenerator<T8> >(g8_)));
  13816. }
  13817. private:
  13818. // No implementation - assignment is unsupported.
  13819. void operator=(const CartesianProductHolder8& other);
  13820. const Generator1 g1_;
  13821. const Generator2 g2_;
  13822. const Generator3 g3_;
  13823. const Generator4 g4_;
  13824. const Generator5 g5_;
  13825. const Generator6 g6_;
  13826. const Generator7 g7_;
  13827. const Generator8 g8_;
  13828. }; // class CartesianProductHolder8
  13829. template <class Generator1, class Generator2, class Generator3,
  13830. class Generator4, class Generator5, class Generator6, class Generator7,
  13831. class Generator8, class Generator9>
  13832. class CartesianProductHolder9 {
  13833. public:
  13834. CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
  13835. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  13836. const Generator6& g6, const Generator7& g7, const Generator8& g8,
  13837. const Generator9& g9)
  13838. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  13839. g9_(g9) {}
  13840. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13841. typename T6, typename T7, typename T8, typename T9>
  13842. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
  13843. T9> >() const {
  13844. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
  13845. T9> >(
  13846. new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
  13847. static_cast<ParamGenerator<T1> >(g1_),
  13848. static_cast<ParamGenerator<T2> >(g2_),
  13849. static_cast<ParamGenerator<T3> >(g3_),
  13850. static_cast<ParamGenerator<T4> >(g4_),
  13851. static_cast<ParamGenerator<T5> >(g5_),
  13852. static_cast<ParamGenerator<T6> >(g6_),
  13853. static_cast<ParamGenerator<T7> >(g7_),
  13854. static_cast<ParamGenerator<T8> >(g8_),
  13855. static_cast<ParamGenerator<T9> >(g9_)));
  13856. }
  13857. private:
  13858. // No implementation - assignment is unsupported.
  13859. void operator=(const CartesianProductHolder9& other);
  13860. const Generator1 g1_;
  13861. const Generator2 g2_;
  13862. const Generator3 g3_;
  13863. const Generator4 g4_;
  13864. const Generator5 g5_;
  13865. const Generator6 g6_;
  13866. const Generator7 g7_;
  13867. const Generator8 g8_;
  13868. const Generator9 g9_;
  13869. }; // class CartesianProductHolder9
  13870. template <class Generator1, class Generator2, class Generator3,
  13871. class Generator4, class Generator5, class Generator6, class Generator7,
  13872. class Generator8, class Generator9, class Generator10>
  13873. class CartesianProductHolder10 {
  13874. public:
  13875. CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
  13876. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  13877. const Generator6& g6, const Generator7& g7, const Generator8& g8,
  13878. const Generator9& g9, const Generator10& g10)
  13879. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  13880. g9_(g9), g10_(g10) {}
  13881. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13882. typename T6, typename T7, typename T8, typename T9, typename T10>
  13883. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
  13884. T9, T10> >() const {
  13885. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
  13886. T9, T10> >(
  13887. new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
  13888. T10>(
  13889. static_cast<ParamGenerator<T1> >(g1_),
  13890. static_cast<ParamGenerator<T2> >(g2_),
  13891. static_cast<ParamGenerator<T3> >(g3_),
  13892. static_cast<ParamGenerator<T4> >(g4_),
  13893. static_cast<ParamGenerator<T5> >(g5_),
  13894. static_cast<ParamGenerator<T6> >(g6_),
  13895. static_cast<ParamGenerator<T7> >(g7_),
  13896. static_cast<ParamGenerator<T8> >(g8_),
  13897. static_cast<ParamGenerator<T9> >(g9_),
  13898. static_cast<ParamGenerator<T10> >(g10_)));
  13899. }
  13900. private:
  13901. // No implementation - assignment is unsupported.
  13902. void operator=(const CartesianProductHolder10& other);
  13903. const Generator1 g1_;
  13904. const Generator2 g2_;
  13905. const Generator3 g3_;
  13906. const Generator4 g4_;
  13907. const Generator5 g5_;
  13908. const Generator6 g6_;
  13909. const Generator7 g7_;
  13910. const Generator8 g8_;
  13911. const Generator9 g9_;
  13912. const Generator10 g10_;
  13913. }; // class CartesianProductHolder10
  13914. # endif // GTEST_HAS_COMBINE
  13915. } // namespace internal
  13916. } // namespace testing
  13917. #endif // GTEST_HAS_PARAM_TEST
  13918. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
  13919. #if GTEST_HAS_PARAM_TEST
  13920. namespace testing {
  13921. // Functions producing parameter generators.
  13922. //
  13923. // Google Test uses these generators to produce parameters for value-
  13924. // parameterized tests. When a parameterized test case is instantiated
  13925. // with a particular generator, Google Test creates and runs tests
  13926. // for each element in the sequence produced by the generator.
  13927. //
  13928. // In the following sample, tests from test case FooTest are instantiated
  13929. // each three times with parameter values 3, 5, and 8:
  13930. //
  13931. // class FooTest : public TestWithParam<int> { ... };
  13932. //
  13933. // TEST_P(FooTest, TestThis) {
  13934. // }
  13935. // TEST_P(FooTest, TestThat) {
  13936. // }
  13937. // INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
  13938. //
  13939. // Range() returns generators providing sequences of values in a range.
  13940. //
  13941. // Synopsis:
  13942. // Range(start, end)
  13943. // - returns a generator producing a sequence of values {start, start+1,
  13944. // start+2, ..., }.
  13945. // Range(start, end, step)
  13946. // - returns a generator producing a sequence of values {start, start+step,
  13947. // start+step+step, ..., }.
  13948. // Notes:
  13949. // * The generated sequences never include end. For example, Range(1, 5)
  13950. // returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
  13951. // returns a generator producing {1, 3, 5, 7}.
  13952. // * start and end must have the same type. That type may be any integral or
  13953. // floating-point type or a user defined type satisfying these conditions:
  13954. // * It must be assignable (have operator=() defined).
  13955. // * It must have operator+() (operator+(int-compatible type) for
  13956. // two-operand version).
  13957. // * It must have operator<() defined.
  13958. // Elements in the resulting sequences will also have that type.
  13959. // * Condition start < end must be satisfied in order for resulting sequences
  13960. // to contain any elements.
  13961. //
  13962. template <typename T, typename IncrementT>
  13963. internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
  13964. return internal::ParamGenerator<T>(
  13965. new internal::RangeGenerator<T, IncrementT>(start, end, step));
  13966. }
  13967. template <typename T>
  13968. internal::ParamGenerator<T> Range(T start, T end) {
  13969. return Range(start, end, 1);
  13970. }
  13971. // ValuesIn() function allows generation of tests with parameters coming from
  13972. // a container.
  13973. //
  13974. // Synopsis:
  13975. // ValuesIn(const T (&array)[N])
  13976. // - returns a generator producing sequences with elements from
  13977. // a C-style array.
  13978. // ValuesIn(const Container& container)
  13979. // - returns a generator producing sequences with elements from
  13980. // an STL-style container.
  13981. // ValuesIn(Iterator begin, Iterator end)
  13982. // - returns a generator producing sequences with elements from
  13983. // a range [begin, end) defined by a pair of STL-style iterators. These
  13984. // iterators can also be plain C pointers.
  13985. //
  13986. // Please note that ValuesIn copies the values from the containers
  13987. // passed in and keeps them to generate tests in RUN_ALL_TESTS().
  13988. //
  13989. // Examples:
  13990. //
  13991. // This instantiates tests from test case StringTest
  13992. // each with C-string values of "foo", "bar", and "baz":
  13993. //
  13994. // const char* strings[] = {"foo", "bar", "baz"};
  13995. // INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
  13996. //
  13997. // This instantiates tests from test case StlStringTest
  13998. // each with STL strings with values "a" and "b":
  13999. //
  14000. // ::std::vector< ::std::string> GetParameterStrings() {
  14001. // ::std::vector< ::std::string> v;
  14002. // v.push_back("a");
  14003. // v.push_back("b");
  14004. // return v;
  14005. // }
  14006. //
  14007. // INSTANTIATE_TEST_CASE_P(CharSequence,
  14008. // StlStringTest,
  14009. // ValuesIn(GetParameterStrings()));
  14010. //
  14011. //
  14012. // This will also instantiate tests from CharTest
  14013. // each with parameter values 'a' and 'b':
  14014. //
  14015. // ::std::list<char> GetParameterChars() {
  14016. // ::std::list<char> list;
  14017. // list.push_back('a');
  14018. // list.push_back('b');
  14019. // return list;
  14020. // }
  14021. // ::std::list<char> l = GetParameterChars();
  14022. // INSTANTIATE_TEST_CASE_P(CharSequence2,
  14023. // CharTest,
  14024. // ValuesIn(l.begin(), l.end()));
  14025. //
  14026. template <typename ForwardIterator>
  14027. internal::ParamGenerator<
  14028. typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
  14029. ValuesIn(ForwardIterator begin, ForwardIterator end) {
  14030. typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
  14031. ::value_type ParamType;
  14032. return internal::ParamGenerator<ParamType>(
  14033. new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
  14034. }
  14035. template <typename T, size_t N>
  14036. internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
  14037. return ValuesIn(array, array + N);
  14038. }
  14039. template <class Container>
  14040. internal::ParamGenerator<typename Container::value_type> ValuesIn(
  14041. const Container& container) {
  14042. return ValuesIn(container.begin(), container.end());
  14043. }
  14044. // Values() allows generating tests from explicitly specified list of
  14045. // parameters.
  14046. //
  14047. // Synopsis:
  14048. // Values(T v1, T v2, ..., T vN)
  14049. // - returns a generator producing sequences with elements v1, v2, ..., vN.
  14050. //
  14051. // For example, this instantiates tests from test case BarTest each
  14052. // with values "one", "two", and "three":
  14053. //
  14054. // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
  14055. //
  14056. // This instantiates tests from test case BazTest each with values 1, 2, 3.5.
  14057. // The exact type of values will depend on the type of parameter in BazTest.
  14058. //
  14059. // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
  14060. //
  14061. // Currently, Values() supports from 1 to 50 parameters.
  14062. //
  14063. template <typename T1>
  14064. internal::ValueArray1<T1> Values(T1 v1) {
  14065. return internal::ValueArray1<T1>(v1);
  14066. }
  14067. template <typename T1, typename T2>
  14068. internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
  14069. return internal::ValueArray2<T1, T2>(v1, v2);
  14070. }
  14071. template <typename T1, typename T2, typename T3>
  14072. internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
  14073. return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
  14074. }
  14075. template <typename T1, typename T2, typename T3, typename T4>
  14076. internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
  14077. return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
  14078. }
  14079. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  14080. internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14081. T5 v5) {
  14082. return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
  14083. }
  14084. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14085. typename T6>
  14086. internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
  14087. T4 v4, T5 v5, T6 v6) {
  14088. return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
  14089. }
  14090. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14091. typename T6, typename T7>
  14092. internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
  14093. T4 v4, T5 v5, T6 v6, T7 v7) {
  14094. return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
  14095. v6, v7);
  14096. }
  14097. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14098. typename T6, typename T7, typename T8>
  14099. internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
  14100. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
  14101. return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
  14102. v5, v6, v7, v8);
  14103. }
  14104. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14105. typename T6, typename T7, typename T8, typename T9>
  14106. internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
  14107. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
  14108. return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
  14109. v4, v5, v6, v7, v8, v9);
  14110. }
  14111. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14112. typename T6, typename T7, typename T8, typename T9, typename T10>
  14113. internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
  14114. T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
  14115. return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
  14116. v2, v3, v4, v5, v6, v7, v8, v9, v10);
  14117. }
  14118. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14119. typename T6, typename T7, typename T8, typename T9, typename T10,
  14120. typename T11>
  14121. internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
  14122. T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14123. T10 v10, T11 v11) {
  14124. return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
  14125. T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
  14126. }
  14127. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14128. typename T6, typename T7, typename T8, typename T9, typename T10,
  14129. typename T11, typename T12>
  14130. internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14131. T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14132. T10 v10, T11 v11, T12 v12) {
  14133. return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14134. T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
  14135. }
  14136. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14137. typename T6, typename T7, typename T8, typename T9, typename T10,
  14138. typename T11, typename T12, typename T13>
  14139. internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  14140. T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14141. T10 v10, T11 v11, T12 v12, T13 v13) {
  14142. return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14143. T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
  14144. }
  14145. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14146. typename T6, typename T7, typename T8, typename T9, typename T10,
  14147. typename T11, typename T12, typename T13, typename T14>
  14148. internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14149. T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14150. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
  14151. return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14152. T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
  14153. v14);
  14154. }
  14155. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14156. typename T6, typename T7, typename T8, typename T9, typename T10,
  14157. typename T11, typename T12, typename T13, typename T14, typename T15>
  14158. internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14159. T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  14160. T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
  14161. return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14162. T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
  14163. v13, v14, v15);
  14164. }
  14165. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14166. typename T6, typename T7, typename T8, typename T9, typename T10,
  14167. typename T11, typename T12, typename T13, typename T14, typename T15,
  14168. typename T16>
  14169. internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14170. T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14171. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14172. T16 v16) {
  14173. return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14174. T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
  14175. v12, v13, v14, v15, v16);
  14176. }
  14177. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14178. typename T6, typename T7, typename T8, typename T9, typename T10,
  14179. typename T11, typename T12, typename T13, typename T14, typename T15,
  14180. typename T16, typename T17>
  14181. internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14182. T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14183. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14184. T16 v16, T17 v17) {
  14185. return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14186. T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
  14187. v11, v12, v13, v14, v15, v16, v17);
  14188. }
  14189. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14190. typename T6, typename T7, typename T8, typename T9, typename T10,
  14191. typename T11, typename T12, typename T13, typename T14, typename T15,
  14192. typename T16, typename T17, typename T18>
  14193. internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14194. T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
  14195. T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14196. T16 v16, T17 v17, T18 v18) {
  14197. return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14198. T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
  14199. v10, v11, v12, v13, v14, v15, v16, v17, v18);
  14200. }
  14201. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14202. typename T6, typename T7, typename T8, typename T9, typename T10,
  14203. typename T11, typename T12, typename T13, typename T14, typename T15,
  14204. typename T16, typename T17, typename T18, typename T19>
  14205. internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14206. T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
  14207. T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
  14208. T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
  14209. return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14210. T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
  14211. v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
  14212. }
  14213. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14214. typename T6, typename T7, typename T8, typename T9, typename T10,
  14215. typename T11, typename T12, typename T13, typename T14, typename T15,
  14216. typename T16, typename T17, typename T18, typename T19, typename T20>
  14217. internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14218. T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14219. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  14220. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
  14221. return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14222. T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
  14223. v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
  14224. }
  14225. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14226. typename T6, typename T7, typename T8, typename T9, typename T10,
  14227. typename T11, typename T12, typename T13, typename T14, typename T15,
  14228. typename T16, typename T17, typename T18, typename T19, typename T20,
  14229. typename T21>
  14230. internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14231. T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14232. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  14233. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
  14234. return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14235. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
  14236. v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
  14237. }
  14238. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14239. typename T6, typename T7, typename T8, typename T9, typename T10,
  14240. typename T11, typename T12, typename T13, typename T14, typename T15,
  14241. typename T16, typename T17, typename T18, typename T19, typename T20,
  14242. typename T21, typename T22>
  14243. internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14244. T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
  14245. T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14246. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14247. T21 v21, T22 v22) {
  14248. return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14249. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
  14250. v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  14251. v20, v21, v22);
  14252. }
  14253. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14254. typename T6, typename T7, typename T8, typename T9, typename T10,
  14255. typename T11, typename T12, typename T13, typename T14, typename T15,
  14256. typename T16, typename T17, typename T18, typename T19, typename T20,
  14257. typename T21, typename T22, typename T23>
  14258. internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14259. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
  14260. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14261. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14262. T21 v21, T22 v22, T23 v23) {
  14263. return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14264. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
  14265. v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  14266. v20, v21, v22, v23);
  14267. }
  14268. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14269. typename T6, typename T7, typename T8, typename T9, typename T10,
  14270. typename T11, typename T12, typename T13, typename T14, typename T15,
  14271. typename T16, typename T17, typename T18, typename T19, typename T20,
  14272. typename T21, typename T22, typename T23, typename T24>
  14273. internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14274. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
  14275. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14276. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14277. T21 v21, T22 v22, T23 v23, T24 v24) {
  14278. return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14279. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
  14280. v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
  14281. v19, v20, v21, v22, v23, v24);
  14282. }
  14283. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14284. typename T6, typename T7, typename T8, typename T9, typename T10,
  14285. typename T11, typename T12, typename T13, typename T14, typename T15,
  14286. typename T16, typename T17, typename T18, typename T19, typename T20,
  14287. typename T21, typename T22, typename T23, typename T24, typename T25>
  14288. internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14289. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
  14290. T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
  14291. T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
  14292. T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
  14293. return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14294. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
  14295. v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
  14296. v18, v19, v20, v21, v22, v23, v24, v25);
  14297. }
  14298. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14299. typename T6, typename T7, typename T8, typename T9, typename T10,
  14300. typename T11, typename T12, typename T13, typename T14, typename T15,
  14301. typename T16, typename T17, typename T18, typename T19, typename T20,
  14302. typename T21, typename T22, typename T23, typename T24, typename T25,
  14303. typename T26>
  14304. internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14305. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14306. T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14307. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14308. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14309. T26 v26) {
  14310. return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14311. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14312. T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
  14313. v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
  14314. }
  14315. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14316. typename T6, typename T7, typename T8, typename T9, typename T10,
  14317. typename T11, typename T12, typename T13, typename T14, typename T15,
  14318. typename T16, typename T17, typename T18, typename T19, typename T20,
  14319. typename T21, typename T22, typename T23, typename T24, typename T25,
  14320. typename T26, typename T27>
  14321. internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14322. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  14323. T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14324. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14325. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14326. T26 v26, T27 v27) {
  14327. return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14328. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14329. T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
  14330. v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
  14331. }
  14332. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14333. typename T6, typename T7, typename T8, typename T9, typename T10,
  14334. typename T11, typename T12, typename T13, typename T14, typename T15,
  14335. typename T16, typename T17, typename T18, typename T19, typename T20,
  14336. typename T21, typename T22, typename T23, typename T24, typename T25,
  14337. typename T26, typename T27, typename T28>
  14338. internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14339. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  14340. T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14341. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14342. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14343. T26 v26, T27 v27, T28 v28) {
  14344. return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14345. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14346. T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
  14347. v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
  14348. v28);
  14349. }
  14350. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14351. typename T6, typename T7, typename T8, typename T9, typename T10,
  14352. typename T11, typename T12, typename T13, typename T14, typename T15,
  14353. typename T16, typename T17, typename T18, typename T19, typename T20,
  14354. typename T21, typename T22, typename T23, typename T24, typename T25,
  14355. typename T26, typename T27, typename T28, typename T29>
  14356. internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14357. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14358. T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14359. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14360. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14361. T26 v26, T27 v27, T28 v28, T29 v29) {
  14362. return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14363. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14364. T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
  14365. v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
  14366. v27, v28, v29);
  14367. }
  14368. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14369. typename T6, typename T7, typename T8, typename T9, typename T10,
  14370. typename T11, typename T12, typename T13, typename T14, typename T15,
  14371. typename T16, typename T17, typename T18, typename T19, typename T20,
  14372. typename T21, typename T22, typename T23, typename T24, typename T25,
  14373. typename T26, typename T27, typename T28, typename T29, typename T30>
  14374. internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14375. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14376. T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  14377. T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
  14378. T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
  14379. T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
  14380. return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14381. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14382. T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
  14383. v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
  14384. v26, v27, v28, v29, v30);
  14385. }
  14386. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14387. typename T6, typename T7, typename T8, typename T9, typename T10,
  14388. typename T11, typename T12, typename T13, typename T14, typename T15,
  14389. typename T16, typename T17, typename T18, typename T19, typename T20,
  14390. typename T21, typename T22, typename T23, typename T24, typename T25,
  14391. typename T26, typename T27, typename T28, typename T29, typename T30,
  14392. typename T31>
  14393. internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14394. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14395. T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14396. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14397. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  14398. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
  14399. return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14400. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14401. T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
  14402. v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
  14403. v25, v26, v27, v28, v29, v30, v31);
  14404. }
  14405. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14406. typename T6, typename T7, typename T8, typename T9, typename T10,
  14407. typename T11, typename T12, typename T13, typename T14, typename T15,
  14408. typename T16, typename T17, typename T18, typename T19, typename T20,
  14409. typename T21, typename T22, typename T23, typename T24, typename T25,
  14410. typename T26, typename T27, typename T28, typename T29, typename T30,
  14411. typename T31, typename T32>
  14412. internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14413. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14414. T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14415. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14416. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  14417. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  14418. T32 v32) {
  14419. return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14420. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14421. T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
  14422. v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  14423. v24, v25, v26, v27, v28, v29, v30, v31, v32);
  14424. }
  14425. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14426. typename T6, typename T7, typename T8, typename T9, typename T10,
  14427. typename T11, typename T12, typename T13, typename T14, typename T15,
  14428. typename T16, typename T17, typename T18, typename T19, typename T20,
  14429. typename T21, typename T22, typename T23, typename T24, typename T25,
  14430. typename T26, typename T27, typename T28, typename T29, typename T30,
  14431. typename T31, typename T32, typename T33>
  14432. internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14433. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14434. T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
  14435. T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14436. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  14437. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  14438. T32 v32, T33 v33) {
  14439. return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14440. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14441. T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
  14442. v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  14443. v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
  14444. }
  14445. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14446. typename T6, typename T7, typename T8, typename T9, typename T10,
  14447. typename T11, typename T12, typename T13, typename T14, typename T15,
  14448. typename T16, typename T17, typename T18, typename T19, typename T20,
  14449. typename T21, typename T22, typename T23, typename T24, typename T25,
  14450. typename T26, typename T27, typename T28, typename T29, typename T30,
  14451. typename T31, typename T32, typename T33, typename T34>
  14452. internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14453. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14454. T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
  14455. T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
  14456. T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
  14457. T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
  14458. T31 v31, T32 v32, T33 v33, T34 v34) {
  14459. return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14460. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14461. T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
  14462. v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
  14463. v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
  14464. }
  14465. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14466. typename T6, typename T7, typename T8, typename T9, typename T10,
  14467. typename T11, typename T12, typename T13, typename T14, typename T15,
  14468. typename T16, typename T17, typename T18, typename T19, typename T20,
  14469. typename T21, typename T22, typename T23, typename T24, typename T25,
  14470. typename T26, typename T27, typename T28, typename T29, typename T30,
  14471. typename T31, typename T32, typename T33, typename T34, typename T35>
  14472. internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14473. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14474. T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14475. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  14476. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
  14477. T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
  14478. T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
  14479. return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14480. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14481. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
  14482. v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
  14483. v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
  14484. }
  14485. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14486. typename T6, typename T7, typename T8, typename T9, typename T10,
  14487. typename T11, typename T12, typename T13, typename T14, typename T15,
  14488. typename T16, typename T17, typename T18, typename T19, typename T20,
  14489. typename T21, typename T22, typename T23, typename T24, typename T25,
  14490. typename T26, typename T27, typename T28, typename T29, typename T30,
  14491. typename T31, typename T32, typename T33, typename T34, typename T35,
  14492. typename T36>
  14493. internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14494. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14495. T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14496. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  14497. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
  14498. T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
  14499. T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
  14500. return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14501. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14502. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
  14503. v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  14504. v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
  14505. v34, v35, v36);
  14506. }
  14507. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14508. typename T6, typename T7, typename T8, typename T9, typename T10,
  14509. typename T11, typename T12, typename T13, typename T14, typename T15,
  14510. typename T16, typename T17, typename T18, typename T19, typename T20,
  14511. typename T21, typename T22, typename T23, typename T24, typename T25,
  14512. typename T26, typename T27, typename T28, typename T29, typename T30,
  14513. typename T31, typename T32, typename T33, typename T34, typename T35,
  14514. typename T36, typename T37>
  14515. internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14516. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14517. T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
  14518. T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14519. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14520. T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
  14521. T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
  14522. T37 v37) {
  14523. return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14524. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14525. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
  14526. v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  14527. v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
  14528. v34, v35, v36, v37);
  14529. }
  14530. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14531. typename T6, typename T7, typename T8, typename T9, typename T10,
  14532. typename T11, typename T12, typename T13, typename T14, typename T15,
  14533. typename T16, typename T17, typename T18, typename T19, typename T20,
  14534. typename T21, typename T22, typename T23, typename T24, typename T25,
  14535. typename T26, typename T27, typename T28, typename T29, typename T30,
  14536. typename T31, typename T32, typename T33, typename T34, typename T35,
  14537. typename T36, typename T37, typename T38>
  14538. internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14539. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14540. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
  14541. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14542. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14543. T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
  14544. T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
  14545. T37 v37, T38 v38) {
  14546. return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14547. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14548. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
  14549. v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
  14550. v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
  14551. v33, v34, v35, v36, v37, v38);
  14552. }
  14553. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14554. typename T6, typename T7, typename T8, typename T9, typename T10,
  14555. typename T11, typename T12, typename T13, typename T14, typename T15,
  14556. typename T16, typename T17, typename T18, typename T19, typename T20,
  14557. typename T21, typename T22, typename T23, typename T24, typename T25,
  14558. typename T26, typename T27, typename T28, typename T29, typename T30,
  14559. typename T31, typename T32, typename T33, typename T34, typename T35,
  14560. typename T36, typename T37, typename T38, typename T39>
  14561. internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14562. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14563. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
  14564. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14565. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14566. T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
  14567. T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
  14568. T37 v37, T38 v38, T39 v39) {
  14569. return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14570. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14571. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
  14572. v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
  14573. v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
  14574. v32, v33, v34, v35, v36, v37, v38, v39);
  14575. }
  14576. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14577. typename T6, typename T7, typename T8, typename T9, typename T10,
  14578. typename T11, typename T12, typename T13, typename T14, typename T15,
  14579. typename T16, typename T17, typename T18, typename T19, typename T20,
  14580. typename T21, typename T22, typename T23, typename T24, typename T25,
  14581. typename T26, typename T27, typename T28, typename T29, typename T30,
  14582. typename T31, typename T32, typename T33, typename T34, typename T35,
  14583. typename T36, typename T37, typename T38, typename T39, typename T40>
  14584. internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14585. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14586. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
  14587. T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
  14588. T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
  14589. T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
  14590. T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
  14591. T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
  14592. return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14593. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14594. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14595. T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
  14596. v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
  14597. v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
  14598. }
  14599. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14600. typename T6, typename T7, typename T8, typename T9, typename T10,
  14601. typename T11, typename T12, typename T13, typename T14, typename T15,
  14602. typename T16, typename T17, typename T18, typename T19, typename T20,
  14603. typename T21, typename T22, typename T23, typename T24, typename T25,
  14604. typename T26, typename T27, typename T28, typename T29, typename T30,
  14605. typename T31, typename T32, typename T33, typename T34, typename T35,
  14606. typename T36, typename T37, typename T38, typename T39, typename T40,
  14607. typename T41>
  14608. internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14609. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14610. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  14611. T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14612. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14613. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14614. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  14615. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
  14616. return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14617. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14618. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14619. T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
  14620. v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
  14621. v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
  14622. }
  14623. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14624. typename T6, typename T7, typename T8, typename T9, typename T10,
  14625. typename T11, typename T12, typename T13, typename T14, typename T15,
  14626. typename T16, typename T17, typename T18, typename T19, typename T20,
  14627. typename T21, typename T22, typename T23, typename T24, typename T25,
  14628. typename T26, typename T27, typename T28, typename T29, typename T30,
  14629. typename T31, typename T32, typename T33, typename T34, typename T35,
  14630. typename T36, typename T37, typename T38, typename T39, typename T40,
  14631. typename T41, typename T42>
  14632. internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14633. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14634. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  14635. T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14636. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14637. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14638. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  14639. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  14640. T42 v42) {
  14641. return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14642. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14643. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14644. T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
  14645. v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
  14646. v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
  14647. v42);
  14648. }
  14649. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14650. typename T6, typename T7, typename T8, typename T9, typename T10,
  14651. typename T11, typename T12, typename T13, typename T14, typename T15,
  14652. typename T16, typename T17, typename T18, typename T19, typename T20,
  14653. typename T21, typename T22, typename T23, typename T24, typename T25,
  14654. typename T26, typename T27, typename T28, typename T29, typename T30,
  14655. typename T31, typename T32, typename T33, typename T34, typename T35,
  14656. typename T36, typename T37, typename T38, typename T39, typename T40,
  14657. typename T41, typename T42, typename T43>
  14658. internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14659. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14660. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  14661. T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14662. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14663. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14664. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  14665. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  14666. T42 v42, T43 v43) {
  14667. return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14668. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14669. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14670. T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
  14671. v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
  14672. v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
  14673. v41, v42, v43);
  14674. }
  14675. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14676. typename T6, typename T7, typename T8, typename T9, typename T10,
  14677. typename T11, typename T12, typename T13, typename T14, typename T15,
  14678. typename T16, typename T17, typename T18, typename T19, typename T20,
  14679. typename T21, typename T22, typename T23, typename T24, typename T25,
  14680. typename T26, typename T27, typename T28, typename T29, typename T30,
  14681. typename T31, typename T32, typename T33, typename T34, typename T35,
  14682. typename T36, typename T37, typename T38, typename T39, typename T40,
  14683. typename T41, typename T42, typename T43, typename T44>
  14684. internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14685. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14686. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  14687. T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14688. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14689. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14690. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  14691. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  14692. T42 v42, T43 v43, T44 v44) {
  14693. return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14694. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14695. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14696. T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
  14697. v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
  14698. v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
  14699. v40, v41, v42, v43, v44);
  14700. }
  14701. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14702. typename T6, typename T7, typename T8, typename T9, typename T10,
  14703. typename T11, typename T12, typename T13, typename T14, typename T15,
  14704. typename T16, typename T17, typename T18, typename T19, typename T20,
  14705. typename T21, typename T22, typename T23, typename T24, typename T25,
  14706. typename T26, typename T27, typename T28, typename T29, typename T30,
  14707. typename T31, typename T32, typename T33, typename T34, typename T35,
  14708. typename T36, typename T37, typename T38, typename T39, typename T40,
  14709. typename T41, typename T42, typename T43, typename T44, typename T45>
  14710. internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14711. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14712. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  14713. T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  14714. T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
  14715. T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
  14716. T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
  14717. T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
  14718. T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
  14719. return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14720. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14721. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14722. T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
  14723. v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
  14724. v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
  14725. v39, v40, v41, v42, v43, v44, v45);
  14726. }
  14727. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14728. typename T6, typename T7, typename T8, typename T9, typename T10,
  14729. typename T11, typename T12, typename T13, typename T14, typename T15,
  14730. typename T16, typename T17, typename T18, typename T19, typename T20,
  14731. typename T21, typename T22, typename T23, typename T24, typename T25,
  14732. typename T26, typename T27, typename T28, typename T29, typename T30,
  14733. typename T31, typename T32, typename T33, typename T34, typename T35,
  14734. typename T36, typename T37, typename T38, typename T39, typename T40,
  14735. typename T41, typename T42, typename T43, typename T44, typename T45,
  14736. typename T46>
  14737. internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14738. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14739. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  14740. T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14741. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14742. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  14743. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  14744. T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
  14745. T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
  14746. return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14747. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14748. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14749. T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
  14750. v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  14751. v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
  14752. v38, v39, v40, v41, v42, v43, v44, v45, v46);
  14753. }
  14754. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14755. typename T6, typename T7, typename T8, typename T9, typename T10,
  14756. typename T11, typename T12, typename T13, typename T14, typename T15,
  14757. typename T16, typename T17, typename T18, typename T19, typename T20,
  14758. typename T21, typename T22, typename T23, typename T24, typename T25,
  14759. typename T26, typename T27, typename T28, typename T29, typename T30,
  14760. typename T31, typename T32, typename T33, typename T34, typename T35,
  14761. typename T36, typename T37, typename T38, typename T39, typename T40,
  14762. typename T41, typename T42, typename T43, typename T44, typename T45,
  14763. typename T46, typename T47>
  14764. internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14765. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14766. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  14767. T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14768. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14769. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  14770. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  14771. T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
  14772. T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
  14773. return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14774. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14775. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14776. T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
  14777. v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  14778. v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
  14779. v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
  14780. }
  14781. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14782. typename T6, typename T7, typename T8, typename T9, typename T10,
  14783. typename T11, typename T12, typename T13, typename T14, typename T15,
  14784. typename T16, typename T17, typename T18, typename T19, typename T20,
  14785. typename T21, typename T22, typename T23, typename T24, typename T25,
  14786. typename T26, typename T27, typename T28, typename T29, typename T30,
  14787. typename T31, typename T32, typename T33, typename T34, typename T35,
  14788. typename T36, typename T37, typename T38, typename T39, typename T40,
  14789. typename T41, typename T42, typename T43, typename T44, typename T45,
  14790. typename T46, typename T47, typename T48>
  14791. internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14792. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14793. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  14794. T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
  14795. T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14796. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  14797. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  14798. T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
  14799. T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
  14800. T48 v48) {
  14801. return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14802. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14803. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14804. T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
  14805. v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
  14806. v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
  14807. v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
  14808. }
  14809. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14810. typename T6, typename T7, typename T8, typename T9, typename T10,
  14811. typename T11, typename T12, typename T13, typename T14, typename T15,
  14812. typename T16, typename T17, typename T18, typename T19, typename T20,
  14813. typename T21, typename T22, typename T23, typename T24, typename T25,
  14814. typename T26, typename T27, typename T28, typename T29, typename T30,
  14815. typename T31, typename T32, typename T33, typename T34, typename T35,
  14816. typename T36, typename T37, typename T38, typename T39, typename T40,
  14817. typename T41, typename T42, typename T43, typename T44, typename T45,
  14818. typename T46, typename T47, typename T48, typename T49>
  14819. internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14820. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14821. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  14822. T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
  14823. T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
  14824. T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
  14825. T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
  14826. T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
  14827. T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
  14828. T47 v47, T48 v48, T49 v49) {
  14829. return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14830. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14831. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14832. T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
  14833. v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
  14834. v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
  14835. v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
  14836. }
  14837. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14838. typename T6, typename T7, typename T8, typename T9, typename T10,
  14839. typename T11, typename T12, typename T13, typename T14, typename T15,
  14840. typename T16, typename T17, typename T18, typename T19, typename T20,
  14841. typename T21, typename T22, typename T23, typename T24, typename T25,
  14842. typename T26, typename T27, typename T28, typename T29, typename T30,
  14843. typename T31, typename T32, typename T33, typename T34, typename T35,
  14844. typename T36, typename T37, typename T38, typename T39, typename T40,
  14845. typename T41, typename T42, typename T43, typename T44, typename T45,
  14846. typename T46, typename T47, typename T48, typename T49, typename T50>
  14847. internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14848. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14849. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  14850. T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14851. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  14852. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
  14853. T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
  14854. T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
  14855. T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
  14856. T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
  14857. return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14858. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14859. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14860. T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
  14861. v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  14862. v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
  14863. v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
  14864. v48, v49, v50);
  14865. }
  14866. // Bool() allows generating tests with parameters in a set of (false, true).
  14867. //
  14868. // Synopsis:
  14869. // Bool()
  14870. // - returns a generator producing sequences with elements {false, true}.
  14871. //
  14872. // It is useful when testing code that depends on Boolean flags. Combinations
  14873. // of multiple flags can be tested when several Bool()'s are combined using
  14874. // Combine() function.
  14875. //
  14876. // In the following example all tests in the test case FlagDependentTest
  14877. // will be instantiated twice with parameters false and true.
  14878. //
  14879. // class FlagDependentTest : public testing::TestWithParam<bool> {
  14880. // virtual void SetUp() {
  14881. // external_flag = GetParam();
  14882. // }
  14883. // }
  14884. // INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
  14885. //
  14886. inline internal::ParamGenerator<bool> Bool() {
  14887. return Values(false, true);
  14888. }
  14889. # if GTEST_HAS_COMBINE
  14890. // Combine() allows the user to combine two or more sequences to produce
  14891. // values of a Cartesian product of those sequences' elements.
  14892. //
  14893. // Synopsis:
  14894. // Combine(gen1, gen2, ..., genN)
  14895. // - returns a generator producing sequences with elements coming from
  14896. // the Cartesian product of elements from the sequences generated by
  14897. // gen1, gen2, ..., genN. The sequence elements will have a type of
  14898. // tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
  14899. // of elements from sequences produces by gen1, gen2, ..., genN.
  14900. //
  14901. // Combine can have up to 10 arguments. This number is currently limited
  14902. // by the maximum number of elements in the tuple implementation used by Google
  14903. // Test.
  14904. //
  14905. // Example:
  14906. //
  14907. // This will instantiate tests in test case AnimalTest each one with
  14908. // the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
  14909. // tuple("dog", BLACK), and tuple("dog", WHITE):
  14910. //
  14911. // enum Color { BLACK, GRAY, WHITE };
  14912. // class AnimalTest
  14913. // : public testing::TestWithParam<tuple<const char*, Color> > {...};
  14914. //
  14915. // TEST_P(AnimalTest, AnimalLooksNice) {...}
  14916. //
  14917. // INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
  14918. // Combine(Values("cat", "dog"),
  14919. // Values(BLACK, WHITE)));
  14920. //
  14921. // This will instantiate tests in FlagDependentTest with all variations of two
  14922. // Boolean flags:
  14923. //
  14924. // class FlagDependentTest
  14925. // : public testing::TestWithParam<tuple(bool, bool)> > {
  14926. // virtual void SetUp() {
  14927. // // Assigns external_flag_1 and external_flag_2 values from the tuple.
  14928. // tie(external_flag_1, external_flag_2) = GetParam();
  14929. // }
  14930. // };
  14931. //
  14932. // TEST_P(FlagDependentTest, TestFeature1) {
  14933. // // Test your code using external_flag_1 and external_flag_2 here.
  14934. // }
  14935. // INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
  14936. // Combine(Bool(), Bool()));
  14937. //
  14938. template <typename Generator1, typename Generator2>
  14939. internal::CartesianProductHolder2<Generator1, Generator2> Combine(
  14940. const Generator1& g1, const Generator2& g2) {
  14941. return internal::CartesianProductHolder2<Generator1, Generator2>(
  14942. g1, g2);
  14943. }
  14944. template <typename Generator1, typename Generator2, typename Generator3>
  14945. internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
  14946. const Generator1& g1, const Generator2& g2, const Generator3& g3) {
  14947. return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
  14948. g1, g2, g3);
  14949. }
  14950. template <typename Generator1, typename Generator2, typename Generator3,
  14951. typename Generator4>
  14952. internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
  14953. Generator4> Combine(
  14954. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  14955. const Generator4& g4) {
  14956. return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
  14957. Generator4>(
  14958. g1, g2, g3, g4);
  14959. }
  14960. template <typename Generator1, typename Generator2, typename Generator3,
  14961. typename Generator4, typename Generator5>
  14962. internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
  14963. Generator4, Generator5> Combine(
  14964. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  14965. const Generator4& g4, const Generator5& g5) {
  14966. return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
  14967. Generator4, Generator5>(
  14968. g1, g2, g3, g4, g5);
  14969. }
  14970. template <typename Generator1, typename Generator2, typename Generator3,
  14971. typename Generator4, typename Generator5, typename Generator6>
  14972. internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
  14973. Generator4, Generator5, Generator6> Combine(
  14974. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  14975. const Generator4& g4, const Generator5& g5, const Generator6& g6) {
  14976. return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
  14977. Generator4, Generator5, Generator6>(
  14978. g1, g2, g3, g4, g5, g6);
  14979. }
  14980. template <typename Generator1, typename Generator2, typename Generator3,
  14981. typename Generator4, typename Generator5, typename Generator6,
  14982. typename Generator7>
  14983. internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
  14984. Generator4, Generator5, Generator6, Generator7> Combine(
  14985. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  14986. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  14987. const Generator7& g7) {
  14988. return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
  14989. Generator4, Generator5, Generator6, Generator7>(
  14990. g1, g2, g3, g4, g5, g6, g7);
  14991. }
  14992. template <typename Generator1, typename Generator2, typename Generator3,
  14993. typename Generator4, typename Generator5, typename Generator6,
  14994. typename Generator7, typename Generator8>
  14995. internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
  14996. Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
  14997. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  14998. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  14999. const Generator7& g7, const Generator8& g8) {
  15000. return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
  15001. Generator4, Generator5, Generator6, Generator7, Generator8>(
  15002. g1, g2, g3, g4, g5, g6, g7, g8);
  15003. }
  15004. template <typename Generator1, typename Generator2, typename Generator3,
  15005. typename Generator4, typename Generator5, typename Generator6,
  15006. typename Generator7, typename Generator8, typename Generator9>
  15007. internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
  15008. Generator4, Generator5, Generator6, Generator7, Generator8,
  15009. Generator9> Combine(
  15010. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  15011. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  15012. const Generator7& g7, const Generator8& g8, const Generator9& g9) {
  15013. return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
  15014. Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
  15015. g1, g2, g3, g4, g5, g6, g7, g8, g9);
  15016. }
  15017. template <typename Generator1, typename Generator2, typename Generator3,
  15018. typename Generator4, typename Generator5, typename Generator6,
  15019. typename Generator7, typename Generator8, typename Generator9,
  15020. typename Generator10>
  15021. internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
  15022. Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
  15023. Generator10> Combine(
  15024. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  15025. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  15026. const Generator7& g7, const Generator8& g8, const Generator9& g9,
  15027. const Generator10& g10) {
  15028. return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
  15029. Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
  15030. Generator10>(
  15031. g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
  15032. }
  15033. # endif // GTEST_HAS_COMBINE
  15034. # define TEST_P(test_case_name, test_name) \
  15035. class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
  15036. : public test_case_name { \
  15037. public: \
  15038. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
  15039. virtual void TestBody(); \
  15040. private: \
  15041. static int AddToRegistry() { \
  15042. ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
  15043. GetTestCasePatternHolder<test_case_name>(\
  15044. #test_case_name, __FILE__, __LINE__)->AddTestPattern(\
  15045. #test_case_name, \
  15046. #test_name, \
  15047. new ::testing::internal::TestMetaFactory< \
  15048. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \
  15049. return 0; \
  15050. } \
  15051. static int gtest_registering_dummy_; \
  15052. GTEST_DISALLOW_COPY_AND_ASSIGN_(\
  15053. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
  15054. }; \
  15055. int GTEST_TEST_CLASS_NAME_(test_case_name, \
  15056. test_name)::gtest_registering_dummy_ = \
  15057. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
  15058. void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
  15059. # define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
  15060. ::testing::internal::ParamGenerator<test_case_name::ParamType> \
  15061. gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
  15062. int gtest_##prefix##test_case_name##_dummy_ = \
  15063. ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
  15064. GetTestCasePatternHolder<test_case_name>(\
  15065. #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\
  15066. #prefix, \
  15067. &gtest_##prefix##test_case_name##_EvalGenerator_, \
  15068. __FILE__, __LINE__)
  15069. } // namespace testing
  15070. #endif // GTEST_HAS_PARAM_TEST
  15071. #endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
  15072. // Copyright 2006, Google Inc.
  15073. // All rights reserved.
  15074. //
  15075. // Redistribution and use in source and binary forms, with or without
  15076. // modification, are permitted provided that the following conditions are
  15077. // met:
  15078. //
  15079. // * Redistributions of source code must retain the above copyright
  15080. // notice, this list of conditions and the following disclaimer.
  15081. // * Redistributions in binary form must reproduce the above
  15082. // copyright notice, this list of conditions and the following disclaimer
  15083. // in the documentation and/or other materials provided with the
  15084. // distribution.
  15085. // * Neither the name of Google Inc. nor the names of its
  15086. // contributors may be used to endorse or promote products derived from
  15087. // this software without specific prior written permission.
  15088. //
  15089. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  15090. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  15091. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  15092. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  15093. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15094. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  15095. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  15096. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  15097. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  15098. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  15099. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  15100. //
  15101. // Author: [email protected] (Zhanyong Wan)
  15102. //
  15103. // Google C++ Testing Framework definitions useful in production code.
  15104. #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
  15105. #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
  15106. // When you need to test the private or protected members of a class,
  15107. // use the FRIEND_TEST macro to declare your tests as friends of the
  15108. // class. For example:
  15109. //
  15110. // class MyClass {
  15111. // private:
  15112. // void MyMethod();
  15113. // FRIEND_TEST(MyClassTest, MyMethod);
  15114. // };
  15115. //
  15116. // class MyClassTest : public testing::Test {
  15117. // // ...
  15118. // };
  15119. //
  15120. // TEST_F(MyClassTest, MyMethod) {
  15121. // // Can call MyClass::MyMethod() here.
  15122. // }
  15123. #define FRIEND_TEST(test_case_name, test_name)\
  15124. friend class test_case_name##_##test_name##_Test
  15125. #endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
  15126. // Copyright 2008, Google Inc.
  15127. // All rights reserved.
  15128. //
  15129. // Redistribution and use in source and binary forms, with or without
  15130. // modification, are permitted provided that the following conditions are
  15131. // met:
  15132. //
  15133. // * Redistributions of source code must retain the above copyright
  15134. // notice, this list of conditions and the following disclaimer.
  15135. // * Redistributions in binary form must reproduce the above
  15136. // copyright notice, this list of conditions and the following disclaimer
  15137. // in the documentation and/or other materials provided with the
  15138. // distribution.
  15139. // * Neither the name of Google Inc. nor the names of its
  15140. // contributors may be used to endorse or promote products derived from
  15141. // this software without specific prior written permission.
  15142. //
  15143. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  15144. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  15145. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  15146. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  15147. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15148. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  15149. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  15150. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  15151. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  15152. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  15153. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  15154. //
  15155. // Author: [email protected] (Markus Heule)
  15156. //
  15157. #ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
  15158. #define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
  15159. #include <iosfwd>
  15160. #include <vector>
  15161. namespace testing {
  15162. // A copyable object representing the result of a test part (i.e. an
  15163. // assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
  15164. //
  15165. // Don't inherit from TestPartResult as its destructor is not virtual.
  15166. class GTEST_API_ TestPartResult {
  15167. public:
  15168. // The possible outcomes of a test part (i.e. an assertion or an
  15169. // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
  15170. enum Type {
  15171. kSuccess, // Succeeded.
  15172. kNonFatalFailure, // Failed but the test can continue.
  15173. kFatalFailure // Failed and the test should be terminated.
  15174. };
  15175. // C'tor. TestPartResult does NOT have a default constructor.
  15176. // Always use this constructor (with parameters) to create a
  15177. // TestPartResult object.
  15178. TestPartResult(Type a_type,
  15179. const char* a_file_name,
  15180. int a_line_number,
  15181. const char* a_message)
  15182. : type_(a_type),
  15183. file_name_(a_file_name),
  15184. line_number_(a_line_number),
  15185. summary_(ExtractSummary(a_message)),
  15186. message_(a_message) {
  15187. }
  15188. // Gets the outcome of the test part.
  15189. Type type() const { return type_; }
  15190. // Gets the name of the source file where the test part took place, or
  15191. // NULL if it's unknown.
  15192. const char* file_name() const { return file_name_.c_str(); }
  15193. // Gets the line in the source file where the test part took place,
  15194. // or -1 if it's unknown.
  15195. int line_number() const { return line_number_; }
  15196. // Gets the summary of the failure message.
  15197. const char* summary() const { return summary_.c_str(); }
  15198. // Gets the message associated with the test part.
  15199. const char* message() const { return message_.c_str(); }
  15200. // Returns true iff the test part passed.
  15201. bool passed() const { return type_ == kSuccess; }
  15202. // Returns true iff the test part failed.
  15203. bool failed() const { return type_ != kSuccess; }
  15204. // Returns true iff the test part non-fatally failed.
  15205. bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
  15206. // Returns true iff the test part fatally failed.
  15207. bool fatally_failed() const { return type_ == kFatalFailure; }
  15208. private:
  15209. Type type_;
  15210. // Gets the summary of the failure message by omitting the stack
  15211. // trace in it.
  15212. static internal::String ExtractSummary(const char* message);
  15213. // The name of the source file where the test part took place, or
  15214. // NULL if the source file is unknown.
  15215. internal::String file_name_;
  15216. // The line in the source file where the test part took place, or -1
  15217. // if the line number is unknown.
  15218. int line_number_;
  15219. internal::String summary_; // The test failure summary.
  15220. internal::String message_; // The test failure message.
  15221. };
  15222. // Prints a TestPartResult object.
  15223. std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
  15224. // An array of TestPartResult objects.
  15225. //
  15226. // Don't inherit from TestPartResultArray as its destructor is not
  15227. // virtual.
  15228. class GTEST_API_ TestPartResultArray {
  15229. public:
  15230. TestPartResultArray() {}
  15231. // Appends the given TestPartResult to the array.
  15232. void Append(const TestPartResult& result);
  15233. // Returns the TestPartResult at the given index (0-based).
  15234. const TestPartResult& GetTestPartResult(int index) const;
  15235. // Returns the number of TestPartResult objects in the array.
  15236. int size() const;
  15237. private:
  15238. std::vector<TestPartResult> array_;
  15239. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
  15240. };
  15241. // This interface knows how to report a test part result.
  15242. class TestPartResultReporterInterface {
  15243. public:
  15244. virtual ~TestPartResultReporterInterface() {}
  15245. virtual void ReportTestPartResult(const TestPartResult& result) = 0;
  15246. };
  15247. namespace internal {
  15248. // This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
  15249. // statement generates new fatal failures. To do so it registers itself as the
  15250. // current test part result reporter. Besides checking if fatal failures were
  15251. // reported, it only delegates the reporting to the former result reporter.
  15252. // The original result reporter is restored in the destructor.
  15253. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  15254. class GTEST_API_ HasNewFatalFailureHelper
  15255. : public TestPartResultReporterInterface {
  15256. public:
  15257. HasNewFatalFailureHelper();
  15258. virtual ~HasNewFatalFailureHelper();
  15259. virtual void ReportTestPartResult(const TestPartResult& result);
  15260. bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
  15261. private:
  15262. bool has_new_fatal_failure_;
  15263. TestPartResultReporterInterface* original_reporter_;
  15264. GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
  15265. };
  15266. } // namespace internal
  15267. } // namespace testing
  15268. #endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
  15269. // Copyright 2008 Google Inc.
  15270. // All Rights Reserved.
  15271. //
  15272. // Redistribution and use in source and binary forms, with or without
  15273. // modification, are permitted provided that the following conditions are
  15274. // met:
  15275. //
  15276. // * Redistributions of source code must retain the above copyright
  15277. // notice, this list of conditions and the following disclaimer.
  15278. // * Redistributions in binary form must reproduce the above
  15279. // copyright notice, this list of conditions and the following disclaimer
  15280. // in the documentation and/or other materials provided with the
  15281. // distribution.
  15282. // * Neither the name of Google Inc. nor the names of its
  15283. // contributors may be used to endorse or promote products derived from
  15284. // this software without specific prior written permission.
  15285. //
  15286. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  15287. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  15288. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  15289. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  15290. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15291. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  15292. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  15293. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  15294. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  15295. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  15296. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  15297. //
  15298. // Author: [email protected] (Zhanyong Wan)
  15299. #ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
  15300. #define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
  15301. // This header implements typed tests and type-parameterized tests.
  15302. // Typed (aka type-driven) tests repeat the same test for types in a
  15303. // list. You must know which types you want to test with when writing
  15304. // typed tests. Here's how you do it:
  15305. #if 0
  15306. // First, define a fixture class template. It should be parameterized
  15307. // by a type. Remember to derive it from testing::Test.
  15308. template <typename T>
  15309. class FooTest : public testing::Test {
  15310. public:
  15311. ...
  15312. typedef std::list<T> List;
  15313. static T shared_;
  15314. T value_;
  15315. };
  15316. // Next, associate a list of types with the test case, which will be
  15317. // repeated for each type in the list. The typedef is necessary for
  15318. // the macro to parse correctly.
  15319. typedef testing::Types<char, int, unsigned int> MyTypes;
  15320. TYPED_TEST_CASE(FooTest, MyTypes);
  15321. // If the type list contains only one type, you can write that type
  15322. // directly without Types<...>:
  15323. // TYPED_TEST_CASE(FooTest, int);
  15324. // Then, use TYPED_TEST() instead of TEST_F() to define as many typed
  15325. // tests for this test case as you want.
  15326. TYPED_TEST(FooTest, DoesBlah) {
  15327. // Inside a test, refer to TypeParam to get the type parameter.
  15328. // Since we are inside a derived class template, C++ requires use to
  15329. // visit the members of FooTest via 'this'.
  15330. TypeParam n = this->value_;
  15331. // To visit static members of the fixture, add the TestFixture::
  15332. // prefix.
  15333. n += TestFixture::shared_;
  15334. // To refer to typedefs in the fixture, add the "typename
  15335. // TestFixture::" prefix.
  15336. typename TestFixture::List values;
  15337. values.push_back(n);
  15338. ...
  15339. }
  15340. TYPED_TEST(FooTest, HasPropertyA) { ... }
  15341. #endif // 0
  15342. // Type-parameterized tests are abstract test patterns parameterized
  15343. // by a type. Compared with typed tests, type-parameterized tests
  15344. // allow you to define the test pattern without knowing what the type
  15345. // parameters are. The defined pattern can be instantiated with
  15346. // different types any number of times, in any number of translation
  15347. // units.
  15348. //
  15349. // If you are designing an interface or concept, you can define a
  15350. // suite of type-parameterized tests to verify properties that any
  15351. // valid implementation of the interface/concept should have. Then,
  15352. // each implementation can easily instantiate the test suite to verify
  15353. // that it conforms to the requirements, without having to write
  15354. // similar tests repeatedly. Here's an example:
  15355. #if 0
  15356. // First, define a fixture class template. It should be parameterized
  15357. // by a type. Remember to derive it from testing::Test.
  15358. template <typename T>
  15359. class FooTest : public testing::Test {
  15360. ...
  15361. };
  15362. // Next, declare that you will define a type-parameterized test case
  15363. // (the _P suffix is for "parameterized" or "pattern", whichever you
  15364. // prefer):
  15365. TYPED_TEST_CASE_P(FooTest);
  15366. // Then, use TYPED_TEST_P() to define as many type-parameterized tests
  15367. // for this type-parameterized test case as you want.
  15368. TYPED_TEST_P(FooTest, DoesBlah) {
  15369. // Inside a test, refer to TypeParam to get the type parameter.
  15370. TypeParam n = 0;
  15371. ...
  15372. }
  15373. TYPED_TEST_P(FooTest, HasPropertyA) { ... }
  15374. // Now the tricky part: you need to register all test patterns before
  15375. // you can instantiate them. The first argument of the macro is the
  15376. // test case name; the rest are the names of the tests in this test
  15377. // case.
  15378. REGISTER_TYPED_TEST_CASE_P(FooTest,
  15379. DoesBlah, HasPropertyA);
  15380. // Finally, you are free to instantiate the pattern with the types you
  15381. // want. If you put the above code in a header file, you can #include
  15382. // it in multiple C++ source files and instantiate it multiple times.
  15383. //
  15384. // To distinguish different instances of the pattern, the first
  15385. // argument to the INSTANTIATE_* macro is a prefix that will be added
  15386. // to the actual test case name. Remember to pick unique prefixes for
  15387. // different instances.
  15388. typedef testing::Types<char, int, unsigned int> MyTypes;
  15389. INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
  15390. // If the type list contains only one type, you can write that type
  15391. // directly without Types<...>:
  15392. // INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
  15393. #endif // 0
  15394. // Implements typed tests.
  15395. #if GTEST_HAS_TYPED_TEST
  15396. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  15397. //
  15398. // Expands to the name of the typedef for the type parameters of the
  15399. // given test case.
  15400. # define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
  15401. // The 'Types' template argument below must have spaces around it
  15402. // since some compilers may choke on '>>' when passing a template
  15403. // instance (e.g. Types<int>)
  15404. # define TYPED_TEST_CASE(CaseName, Types) \
  15405. typedef ::testing::internal::TypeList< Types >::type \
  15406. GTEST_TYPE_PARAMS_(CaseName)
  15407. # define TYPED_TEST(CaseName, TestName) \
  15408. template <typename gtest_TypeParam_> \
  15409. class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
  15410. : public CaseName<gtest_TypeParam_> { \
  15411. private: \
  15412. typedef CaseName<gtest_TypeParam_> TestFixture; \
  15413. typedef gtest_TypeParam_ TypeParam; \
  15414. virtual void TestBody(); \
  15415. }; \
  15416. bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \
  15417. ::testing::internal::TypeParameterizedTest< \
  15418. CaseName, \
  15419. ::testing::internal::TemplateSel< \
  15420. GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
  15421. GTEST_TYPE_PARAMS_(CaseName)>::Register(\
  15422. "", #CaseName, #TestName, 0); \
  15423. template <typename gtest_TypeParam_> \
  15424. void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
  15425. #endif // GTEST_HAS_TYPED_TEST
  15426. // Implements type-parameterized tests.
  15427. #if GTEST_HAS_TYPED_TEST_P
  15428. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  15429. //
  15430. // Expands to the namespace name that the type-parameterized tests for
  15431. // the given type-parameterized test case are defined in. The exact
  15432. // name of the namespace is subject to change without notice.
  15433. # define GTEST_CASE_NAMESPACE_(TestCaseName) \
  15434. gtest_case_##TestCaseName##_
  15435. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  15436. //
  15437. // Expands to the name of the variable used to remember the names of
  15438. // the defined tests in the given test case.
  15439. # define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
  15440. gtest_typed_test_case_p_state_##TestCaseName##_
  15441. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
  15442. //
  15443. // Expands to the name of the variable used to remember the names of
  15444. // the registered tests in the given test case.
  15445. # define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
  15446. gtest_registered_test_names_##TestCaseName##_
  15447. // The variables defined in the type-parameterized test macros are
  15448. // static as typically these macros are used in a .h file that can be
  15449. // #included in multiple translation units linked together.
  15450. # define TYPED_TEST_CASE_P(CaseName) \
  15451. static ::testing::internal::TypedTestCasePState \
  15452. GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
  15453. # define TYPED_TEST_P(CaseName, TestName) \
  15454. namespace GTEST_CASE_NAMESPACE_(CaseName) { \
  15455. template <typename gtest_TypeParam_> \
  15456. class TestName : public CaseName<gtest_TypeParam_> { \
  15457. private: \
  15458. typedef CaseName<gtest_TypeParam_> TestFixture; \
  15459. typedef gtest_TypeParam_ TypeParam; \
  15460. virtual void TestBody(); \
  15461. }; \
  15462. static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
  15463. GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
  15464. __FILE__, __LINE__, #CaseName, #TestName); \
  15465. } \
  15466. template <typename gtest_TypeParam_> \
  15467. void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
  15468. # define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
  15469. namespace GTEST_CASE_NAMESPACE_(CaseName) { \
  15470. typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
  15471. } \
  15472. static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
  15473. GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
  15474. __FILE__, __LINE__, #__VA_ARGS__)
  15475. // The 'Types' template argument below must have spaces around it
  15476. // since some compilers may choke on '>>' when passing a template
  15477. // instance (e.g. Types<int>)
  15478. # define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \
  15479. bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
  15480. ::testing::internal::TypeParameterizedTestCase<CaseName, \
  15481. GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
  15482. ::testing::internal::TypeList< Types >::type>::Register(\
  15483. #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
  15484. #endif // GTEST_HAS_TYPED_TEST_P
  15485. #endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
  15486. // Depending on the platform, different string classes are available.
  15487. // On Linux, in addition to ::std::string, Google also makes use of
  15488. // class ::string, which has the same interface as ::std::string, but
  15489. // has a different implementation.
  15490. //
  15491. // The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
  15492. // ::string is available AND is a distinct type to ::std::string, or
  15493. // define it to 0 to indicate otherwise.
  15494. //
  15495. // If the user's ::std::string and ::string are the same class due to
  15496. // aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0.
  15497. //
  15498. // If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined
  15499. // heuristically.
  15500. namespace testing {
  15501. // Declares the flags.
  15502. // This flag temporary enables the disabled tests.
  15503. GTEST_DECLARE_bool_(also_run_disabled_tests);
  15504. // This flag brings the debugger on an assertion failure.
  15505. GTEST_DECLARE_bool_(break_on_failure);
  15506. // This flag controls whether Google Test catches all test-thrown exceptions
  15507. // and logs them as failures.
  15508. GTEST_DECLARE_bool_(catch_exceptions);
  15509. // This flag enables using colors in terminal output. Available values are
  15510. // "yes" to enable colors, "no" (disable colors), or "auto" (the default)
  15511. // to let Google Test decide.
  15512. GTEST_DECLARE_string_(color);
  15513. // This flag sets up the filter to select by name using a glob pattern
  15514. // the tests to run. If the filter is not given all tests are executed.
  15515. GTEST_DECLARE_string_(filter);
  15516. // This flag causes the Google Test to list tests. None of the tests listed
  15517. // are actually run if the flag is provided.
  15518. GTEST_DECLARE_bool_(list_tests);
  15519. // This flag controls whether Google Test emits a detailed XML report to a file
  15520. // in addition to its normal textual output.
  15521. GTEST_DECLARE_string_(output);
  15522. // This flags control whether Google Test prints the elapsed time for each
  15523. // test.
  15524. GTEST_DECLARE_bool_(print_time);
  15525. // This flag specifies the random number seed.
  15526. GTEST_DECLARE_int32_(random_seed);
  15527. // This flag sets how many times the tests are repeated. The default value
  15528. // is 1. If the value is -1 the tests are repeating forever.
  15529. GTEST_DECLARE_int32_(repeat);
  15530. // This flag controls whether Google Test includes Google Test internal
  15531. // stack frames in failure stack traces.
  15532. GTEST_DECLARE_bool_(show_internal_stack_frames);
  15533. // When this flag is specified, tests' order is randomized on every iteration.
  15534. GTEST_DECLARE_bool_(shuffle);
  15535. // This flag specifies the maximum number of stack frames to be
  15536. // printed in a failure message.
  15537. GTEST_DECLARE_int32_(stack_trace_depth);
  15538. // When this flag is specified, a failed assertion will throw an
  15539. // exception if exceptions are enabled, or exit the program with a
  15540. // non-zero code otherwise.
  15541. GTEST_DECLARE_bool_(throw_on_failure);
  15542. // When this flag is set with a "host:port" string, on supported
  15543. // platforms test results are streamed to the specified port on
  15544. // the specified host machine.
  15545. GTEST_DECLARE_string_(stream_result_to);
  15546. // The upper limit for valid stack trace depths.
  15547. const int kMaxStackTraceDepth = 100;
  15548. namespace internal {
  15549. class AssertHelper;
  15550. class DefaultGlobalTestPartResultReporter;
  15551. class ExecDeathTest;
  15552. class NoExecDeathTest;
  15553. class FinalSuccessChecker;
  15554. class GTestFlagSaver;
  15555. class TestResultAccessor;
  15556. class TestEventListenersAccessor;
  15557. class TestEventRepeater;
  15558. class WindowsDeathTest;
  15559. class UnitTestImpl* GetUnitTestImpl();
  15560. void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
  15561. const String& message);
  15562. // Converts a streamable value to a String. A NULL pointer is
  15563. // converted to "(null)". When the input value is a ::string,
  15564. // ::std::string, ::wstring, or ::std::wstring object, each NUL
  15565. // character in it is replaced with "\\0".
  15566. // Declared in gtest-internal.h but defined here, so that it has access
  15567. // to the definition of the Message class, required by the ARM
  15568. // compiler.
  15569. template <typename T>
  15570. String StreamableToString(const T& streamable) {
  15571. return (Message() << streamable).GetString();
  15572. }
  15573. } // namespace internal
  15574. // The friend relationship of some of these classes is cyclic.
  15575. // If we don't forward declare them the compiler might confuse the classes
  15576. // in friendship clauses with same named classes on the scope.
  15577. class Test;
  15578. class TestCase;
  15579. class TestInfo;
  15580. class UnitTest;
  15581. // A class for indicating whether an assertion was successful. When
  15582. // the assertion wasn't successful, the AssertionResult object
  15583. // remembers a non-empty message that describes how it failed.
  15584. //
  15585. // To create an instance of this class, use one of the factory functions
  15586. // (AssertionSuccess() and AssertionFailure()).
  15587. //
  15588. // This class is useful for two purposes:
  15589. // 1. Defining predicate functions to be used with Boolean test assertions
  15590. // EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
  15591. // 2. Defining predicate-format functions to be
  15592. // used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
  15593. //
  15594. // For example, if you define IsEven predicate:
  15595. //
  15596. // testing::AssertionResult IsEven(int n) {
  15597. // if ((n % 2) == 0)
  15598. // return testing::AssertionSuccess();
  15599. // else
  15600. // return testing::AssertionFailure() << n << " is odd";
  15601. // }
  15602. //
  15603. // Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
  15604. // will print the message
  15605. //
  15606. // Value of: IsEven(Fib(5))
  15607. // Actual: false (5 is odd)
  15608. // Expected: true
  15609. //
  15610. // instead of a more opaque
  15611. //
  15612. // Value of: IsEven(Fib(5))
  15613. // Actual: false
  15614. // Expected: true
  15615. //
  15616. // in case IsEven is a simple Boolean predicate.
  15617. //
  15618. // If you expect your predicate to be reused and want to support informative
  15619. // messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
  15620. // about half as often as positive ones in our tests), supply messages for
  15621. // both success and failure cases:
  15622. //
  15623. // testing::AssertionResult IsEven(int n) {
  15624. // if ((n % 2) == 0)
  15625. // return testing::AssertionSuccess() << n << " is even";
  15626. // else
  15627. // return testing::AssertionFailure() << n << " is odd";
  15628. // }
  15629. //
  15630. // Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
  15631. //
  15632. // Value of: IsEven(Fib(6))
  15633. // Actual: true (8 is even)
  15634. // Expected: false
  15635. //
  15636. // NB: Predicates that support negative Boolean assertions have reduced
  15637. // performance in positive ones so be careful not to use them in tests
  15638. // that have lots (tens of thousands) of positive Boolean assertions.
  15639. //
  15640. // To use this class with EXPECT_PRED_FORMAT assertions such as:
  15641. //
  15642. // // Verifies that Foo() returns an even number.
  15643. // EXPECT_PRED_FORMAT1(IsEven, Foo());
  15644. //
  15645. // you need to define:
  15646. //
  15647. // testing::AssertionResult IsEven(const char* expr, int n) {
  15648. // if ((n % 2) == 0)
  15649. // return testing::AssertionSuccess();
  15650. // else
  15651. // return testing::AssertionFailure()
  15652. // << "Expected: " << expr << " is even\n Actual: it's " << n;
  15653. // }
  15654. //
  15655. // If Foo() returns 5, you will see the following message:
  15656. //
  15657. // Expected: Foo() is even
  15658. // Actual: it's 5
  15659. //
  15660. class GTEST_API_ AssertionResult {
  15661. public:
  15662. // Copy constructor.
  15663. // Used in EXPECT_TRUE/FALSE(assertion_result).
  15664. AssertionResult(const AssertionResult& other);
  15665. // Used in the EXPECT_TRUE/FALSE(bool_expression).
  15666. explicit AssertionResult(bool success) : success_(success) {}
  15667. // Returns true iff the assertion succeeded.
  15668. operator bool() const { return success_; } // NOLINT
  15669. // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
  15670. AssertionResult operator!() const;
  15671. // Returns the text streamed into this AssertionResult. Test assertions
  15672. // use it when they fail (i.e., the predicate's outcome doesn't match the
  15673. // assertion's expectation). When nothing has been streamed into the
  15674. // object, returns an empty string.
  15675. const char* message() const {
  15676. return message_.get() != NULL ? message_->c_str() : "";
  15677. }
  15678. // TODO([email protected]): Remove this after making sure no clients use it.
  15679. // Deprecated; please use message() instead.
  15680. const char* failure_message() const { return message(); }
  15681. // Streams a custom failure message into this object.
  15682. template <typename T> AssertionResult& operator<<(const T& value) {
  15683. AppendMessage(Message() << value);
  15684. return *this;
  15685. }
  15686. // Allows streaming basic output manipulators such as endl or flush into
  15687. // this object.
  15688. AssertionResult& operator<<(
  15689. ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
  15690. AppendMessage(Message() << basic_manipulator);
  15691. return *this;
  15692. }
  15693. private:
  15694. // Appends the contents of message to message_.
  15695. void AppendMessage(const Message& a_message) {
  15696. if (message_.get() == NULL)
  15697. message_.reset(new ::std::string);
  15698. message_->append(a_message.GetString().c_str());
  15699. }
  15700. // Stores result of the assertion predicate.
  15701. bool success_;
  15702. // Stores the message describing the condition in case the expectation
  15703. // construct is not satisfied with the predicate's outcome.
  15704. // Referenced via a pointer to avoid taking too much stack frame space
  15705. // with test assertions.
  15706. internal::scoped_ptr< ::std::string> message_;
  15707. GTEST_DISALLOW_ASSIGN_(AssertionResult);
  15708. };
  15709. // Makes a successful assertion result.
  15710. GTEST_API_ AssertionResult AssertionSuccess();
  15711. // Makes a failed assertion result.
  15712. GTEST_API_ AssertionResult AssertionFailure();
  15713. // Makes a failed assertion result with the given failure message.
  15714. // Deprecated; use AssertionFailure() << msg.
  15715. GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
  15716. // The abstract class that all tests inherit from.
  15717. //
  15718. // In Google Test, a unit test program contains one or many TestCases, and
  15719. // each TestCase contains one or many Tests.
  15720. //
  15721. // When you define a test using the TEST macro, you don't need to
  15722. // explicitly derive from Test - the TEST macro automatically does
  15723. // this for you.
  15724. //
  15725. // The only time you derive from Test is when defining a test fixture
  15726. // to be used a TEST_F. For example:
  15727. //
  15728. // class FooTest : public testing::Test {
  15729. // protected:
  15730. // virtual void SetUp() { ... }
  15731. // virtual void TearDown() { ... }
  15732. // ...
  15733. // };
  15734. //
  15735. // TEST_F(FooTest, Bar) { ... }
  15736. // TEST_F(FooTest, Baz) { ... }
  15737. //
  15738. // Test is not copyable.
  15739. class GTEST_API_ Test {
  15740. public:
  15741. friend class TestInfo;
  15742. // Defines types for pointers to functions that set up and tear down
  15743. // a test case.
  15744. typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
  15745. typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
  15746. // The d'tor is virtual as we intend to inherit from Test.
  15747. virtual ~Test();
  15748. // Sets up the stuff shared by all tests in this test case.
  15749. //
  15750. // Google Test will call Foo::SetUpTestCase() before running the first
  15751. // test in test case Foo. Hence a sub-class can define its own
  15752. // SetUpTestCase() method to shadow the one defined in the super
  15753. // class.
  15754. static void SetUpTestCase() {}
  15755. // Tears down the stuff shared by all tests in this test case.
  15756. //
  15757. // Google Test will call Foo::TearDownTestCase() after running the last
  15758. // test in test case Foo. Hence a sub-class can define its own
  15759. // TearDownTestCase() method to shadow the one defined in the super
  15760. // class.
  15761. static void TearDownTestCase() {}
  15762. // Returns true iff the current test has a fatal failure.
  15763. static bool HasFatalFailure();
  15764. // Returns true iff the current test has a non-fatal failure.
  15765. static bool HasNonfatalFailure();
  15766. // Returns true iff the current test has a (either fatal or
  15767. // non-fatal) failure.
  15768. static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
  15769. // Logs a property for the current test. Only the last value for a given
  15770. // key is remembered.
  15771. // These are public static so they can be called from utility functions
  15772. // that are not members of the test fixture.
  15773. // The arguments are const char* instead strings, as Google Test is used
  15774. // on platforms where string doesn't compile.
  15775. //
  15776. // Note that a driving consideration for these RecordProperty methods
  15777. // was to produce xml output suited to the Greenspan charting utility,
  15778. // which at present will only chart values that fit in a 32-bit int. It
  15779. // is the user's responsibility to restrict their values to 32-bit ints
  15780. // if they intend them to be used with Greenspan.
  15781. static void RecordProperty(const char* key, const char* value);
  15782. static void RecordProperty(const char* key, int value);
  15783. protected:
  15784. // Creates a Test object.
  15785. Test();
  15786. // Sets up the test fixture.
  15787. virtual void SetUp();
  15788. // Tears down the test fixture.
  15789. virtual void TearDown();
  15790. private:
  15791. // Returns true iff the current test has the same fixture class as
  15792. // the first test in the current test case.
  15793. static bool HasSameFixtureClass();
  15794. // Runs the test after the test fixture has been set up.
  15795. //
  15796. // A sub-class must implement this to define the test logic.
  15797. //
  15798. // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
  15799. // Instead, use the TEST or TEST_F macro.
  15800. virtual void TestBody() = 0;
  15801. // Sets up, executes, and tears down the test.
  15802. void Run();
  15803. // Deletes self. We deliberately pick an unusual name for this
  15804. // internal method to avoid clashing with names used in user TESTs.
  15805. void DeleteSelf_() { delete this; }
  15806. // Uses a GTestFlagSaver to save and restore all Google Test flags.
  15807. const internal::GTestFlagSaver* const gtest_flag_saver_;
  15808. // Often a user mis-spells SetUp() as Setup() and spends a long time
  15809. // wondering why it is never called by Google Test. The declaration of
  15810. // the following method is solely for catching such an error at
  15811. // compile time:
  15812. //
  15813. // - The return type is deliberately chosen to be not void, so it
  15814. // will be a conflict if a user declares void Setup() in his test
  15815. // fixture.
  15816. //
  15817. // - This method is private, so it will be another compiler error
  15818. // if a user calls it from his test fixture.
  15819. //
  15820. // DO NOT OVERRIDE THIS FUNCTION.
  15821. //
  15822. // If you see an error about overriding the following function or
  15823. // about it being private, you have mis-spelled SetUp() as Setup().
  15824. struct Setup_should_be_spelled_SetUp {};
  15825. virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
  15826. // We disallow copying Tests.
  15827. GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
  15828. };
  15829. typedef internal::TimeInMillis TimeInMillis;
  15830. // A copyable object representing a user specified test property which can be
  15831. // output as a key/value string pair.
  15832. //
  15833. // Don't inherit from TestProperty as its destructor is not virtual.
  15834. class TestProperty {
  15835. public:
  15836. // C'tor. TestProperty does NOT have a default constructor.
  15837. // Always use this constructor (with parameters) to create a
  15838. // TestProperty object.
  15839. TestProperty(const char* a_key, const char* a_value) :
  15840. key_(a_key), value_(a_value) {
  15841. }
  15842. // Gets the user supplied key.
  15843. const char* key() const {
  15844. return key_.c_str();
  15845. }
  15846. // Gets the user supplied value.
  15847. const char* value() const {
  15848. return value_.c_str();
  15849. }
  15850. // Sets a new value, overriding the one supplied in the constructor.
  15851. void SetValue(const char* new_value) {
  15852. value_ = new_value;
  15853. }
  15854. private:
  15855. // The key supplied by the user.
  15856. internal::String key_;
  15857. // The value supplied by the user.
  15858. internal::String value_;
  15859. };
  15860. // The result of a single Test. This includes a list of
  15861. // TestPartResults, a list of TestProperties, a count of how many
  15862. // death tests there are in the Test, and how much time it took to run
  15863. // the Test.
  15864. //
  15865. // TestResult is not copyable.
  15866. class GTEST_API_ TestResult {
  15867. public:
  15868. // Creates an empty TestResult.
  15869. TestResult();
  15870. // D'tor. Do not inherit from TestResult.
  15871. ~TestResult();
  15872. // Gets the number of all test parts. This is the sum of the number
  15873. // of successful test parts and the number of failed test parts.
  15874. int total_part_count() const;
  15875. // Returns the number of the test properties.
  15876. int test_property_count() const;
  15877. // Returns true iff the test passed (i.e. no test part failed).
  15878. bool Passed() const { return !Failed(); }
  15879. // Returns true iff the test failed.
  15880. bool Failed() const;
  15881. // Returns true iff the test fatally failed.
  15882. bool HasFatalFailure() const;
  15883. // Returns true iff the test has a non-fatal failure.
  15884. bool HasNonfatalFailure() const;
  15885. // Returns the elapsed time, in milliseconds.
  15886. TimeInMillis elapsed_time() const { return elapsed_time_; }
  15887. // Returns the i-th test part result among all the results. i can range
  15888. // from 0 to test_property_count() - 1. If i is not in that range, aborts
  15889. // the program.
  15890. const TestPartResult& GetTestPartResult(int i) const;
  15891. // Returns the i-th test property. i can range from 0 to
  15892. // test_property_count() - 1. If i is not in that range, aborts the
  15893. // program.
  15894. const TestProperty& GetTestProperty(int i) const;
  15895. private:
  15896. friend class TestInfo;
  15897. friend class UnitTest;
  15898. friend class internal::DefaultGlobalTestPartResultReporter;
  15899. friend class internal::ExecDeathTest;
  15900. friend class internal::TestResultAccessor;
  15901. friend class internal::UnitTestImpl;
  15902. friend class internal::WindowsDeathTest;
  15903. // Gets the vector of TestPartResults.
  15904. const std::vector<TestPartResult>& test_part_results() const {
  15905. return test_part_results_;
  15906. }
  15907. // Gets the vector of TestProperties.
  15908. const std::vector<TestProperty>& test_properties() const {
  15909. return test_properties_;
  15910. }
  15911. // Sets the elapsed time.
  15912. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
  15913. // Adds a test property to the list. The property is validated and may add
  15914. // a non-fatal failure if invalid (e.g., if it conflicts with reserved
  15915. // key names). If a property is already recorded for the same key, the
  15916. // value will be updated, rather than storing multiple values for the same
  15917. // key.
  15918. void RecordProperty(const TestProperty& test_property);
  15919. // Adds a failure if the key is a reserved attribute of Google Test
  15920. // testcase tags. Returns true if the property is valid.
  15921. // TODO(russr): Validate attribute names are legal and human readable.
  15922. static bool ValidateTestProperty(const TestProperty& test_property);
  15923. // Adds a test part result to the list.
  15924. void AddTestPartResult(const TestPartResult& test_part_result);
  15925. // Returns the death test count.
  15926. int death_test_count() const { return death_test_count_; }
  15927. // Increments the death test count, returning the new count.
  15928. int increment_death_test_count() { return ++death_test_count_; }
  15929. // Clears the test part results.
  15930. void ClearTestPartResults();
  15931. // Clears the object.
  15932. void Clear();
  15933. // Protects mutable state of the property vector and of owned
  15934. // properties, whose values may be updated.
  15935. internal::Mutex test_properites_mutex_;
  15936. // The vector of TestPartResults
  15937. std::vector<TestPartResult> test_part_results_;
  15938. // The vector of TestProperties
  15939. std::vector<TestProperty> test_properties_;
  15940. // Running count of death tests.
  15941. int death_test_count_;
  15942. // The elapsed time, in milliseconds.
  15943. TimeInMillis elapsed_time_;
  15944. // We disallow copying TestResult.
  15945. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
  15946. }; // class TestResult
  15947. // A TestInfo object stores the following information about a test:
  15948. //
  15949. // Test case name
  15950. // Test name
  15951. // Whether the test should be run
  15952. // A function pointer that creates the test object when invoked
  15953. // Test result
  15954. //
  15955. // The constructor of TestInfo registers itself with the UnitTest
  15956. // singleton such that the RUN_ALL_TESTS() macro knows which tests to
  15957. // run.
  15958. class GTEST_API_ TestInfo {
  15959. public:
  15960. // Destructs a TestInfo object. This function is not virtual, so
  15961. // don't inherit from TestInfo.
  15962. ~TestInfo();
  15963. // Returns the test case name.
  15964. const char* test_case_name() const { return test_case_name_.c_str(); }
  15965. // Returns the test name.
  15966. const char* name() const { return name_.c_str(); }
  15967. // Returns the name of the parameter type, or NULL if this is not a typed
  15968. // or a type-parameterized test.
  15969. const char* type_param() const {
  15970. if (type_param_.get() != NULL)
  15971. return type_param_->c_str();
  15972. return NULL;
  15973. }
  15974. // Returns the text representation of the value parameter, or NULL if this
  15975. // is not a value-parameterized test.
  15976. const char* value_param() const {
  15977. if (value_param_.get() != NULL)
  15978. return value_param_->c_str();
  15979. return NULL;
  15980. }
  15981. // Returns true if this test should run, that is if the test is not disabled
  15982. // (or it is disabled but the also_run_disabled_tests flag has been specified)
  15983. // and its full name matches the user-specified filter.
  15984. //
  15985. // Google Test allows the user to filter the tests by their full names.
  15986. // The full name of a test Bar in test case Foo is defined as
  15987. // "Foo.Bar". Only the tests that match the filter will run.
  15988. //
  15989. // A filter is a colon-separated list of glob (not regex) patterns,
  15990. // optionally followed by a '-' and a colon-separated list of
  15991. // negative patterns (tests to exclude). A test is run if it
  15992. // matches one of the positive patterns and does not match any of
  15993. // the negative patterns.
  15994. //
  15995. // For example, *A*:Foo.* is a filter that matches any string that
  15996. // contains the character 'A' or starts with "Foo.".
  15997. bool should_run() const { return should_run_; }
  15998. // Returns the result of the test.
  15999. const TestResult* result() const { return &result_; }
  16000. private:
  16001. #if GTEST_HAS_DEATH_TEST
  16002. friend class internal::DefaultDeathTestFactory;
  16003. #endif // GTEST_HAS_DEATH_TEST
  16004. friend class Test;
  16005. friend class TestCase;
  16006. friend class internal::UnitTestImpl;
  16007. friend TestInfo* internal::MakeAndRegisterTestInfo(
  16008. const char* test_case_name, const char* name,
  16009. const char* type_param,
  16010. const char* value_param,
  16011. internal::TypeId fixture_class_id,
  16012. Test::SetUpTestCaseFunc set_up_tc,
  16013. Test::TearDownTestCaseFunc tear_down_tc,
  16014. internal::TestFactoryBase* factory);
  16015. // Constructs a TestInfo object. The newly constructed instance assumes
  16016. // ownership of the factory object.
  16017. TestInfo(const char* test_case_name, const char* name,
  16018. const char* a_type_param,
  16019. const char* a_value_param,
  16020. internal::TypeId fixture_class_id,
  16021. internal::TestFactoryBase* factory);
  16022. // Increments the number of death tests encountered in this test so
  16023. // far.
  16024. int increment_death_test_count() {
  16025. return result_.increment_death_test_count();
  16026. }
  16027. // Creates the test object, runs it, records its result, and then
  16028. // deletes it.
  16029. void Run();
  16030. static void ClearTestResult(TestInfo* test_info) {
  16031. test_info->result_.Clear();
  16032. }
  16033. // These fields are immutable properties of the test.
  16034. const std::string test_case_name_; // Test case name
  16035. const std::string name_; // Test name
  16036. // Name of the parameter type, or NULL if this is not a typed or a
  16037. // type-parameterized test.
  16038. const internal::scoped_ptr<const ::std::string> type_param_;
  16039. // Text representation of the value parameter, or NULL if this is not a
  16040. // value-parameterized test.
  16041. const internal::scoped_ptr<const ::std::string> value_param_;
  16042. const internal::TypeId fixture_class_id_; // ID of the test fixture class
  16043. bool should_run_; // True iff this test should run
  16044. bool is_disabled_; // True iff this test is disabled
  16045. bool matches_filter_; // True if this test matches the
  16046. // user-specified filter.
  16047. internal::TestFactoryBase* const factory_; // The factory that creates
  16048. // the test object
  16049. // This field is mutable and needs to be reset before running the
  16050. // test for the second time.
  16051. TestResult result_;
  16052. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
  16053. };
  16054. // A test case, which consists of a vector of TestInfos.
  16055. //
  16056. // TestCase is not copyable.
  16057. class GTEST_API_ TestCase {
  16058. public:
  16059. // Creates a TestCase with the given name.
  16060. //
  16061. // TestCase does NOT have a default constructor. Always use this
  16062. // constructor to create a TestCase object.
  16063. //
  16064. // Arguments:
  16065. //
  16066. // name: name of the test case
  16067. // a_type_param: the name of the test's type parameter, or NULL if
  16068. // this is not a type-parameterized test.
  16069. // set_up_tc: pointer to the function that sets up the test case
  16070. // tear_down_tc: pointer to the function that tears down the test case
  16071. TestCase(const char* name, const char* a_type_param,
  16072. Test::SetUpTestCaseFunc set_up_tc,
  16073. Test::TearDownTestCaseFunc tear_down_tc);
  16074. // Destructor of TestCase.
  16075. virtual ~TestCase();
  16076. // Gets the name of the TestCase.
  16077. const char* name() const { return name_.c_str(); }
  16078. // Returns the name of the parameter type, or NULL if this is not a
  16079. // type-parameterized test case.
  16080. const char* type_param() const {
  16081. if (type_param_.get() != NULL)
  16082. return type_param_->c_str();
  16083. return NULL;
  16084. }
  16085. // Returns true if any test in this test case should run.
  16086. bool should_run() const { return should_run_; }
  16087. // Gets the number of successful tests in this test case.
  16088. int successful_test_count() const;
  16089. // Gets the number of failed tests in this test case.
  16090. int failed_test_count() const;
  16091. // Gets the number of disabled tests in this test case.
  16092. int disabled_test_count() const;
  16093. // Get the number of tests in this test case that should run.
  16094. int test_to_run_count() const;
  16095. // Gets the number of all tests in this test case.
  16096. int total_test_count() const;
  16097. // Returns true iff the test case passed.
  16098. bool Passed() const { return !Failed(); }
  16099. // Returns true iff the test case failed.
  16100. bool Failed() const { return failed_test_count() > 0; }
  16101. // Returns the elapsed time, in milliseconds.
  16102. TimeInMillis elapsed_time() const { return elapsed_time_; }
  16103. // Returns the i-th test among all the tests. i can range from 0 to
  16104. // total_test_count() - 1. If i is not in that range, returns NULL.
  16105. const TestInfo* GetTestInfo(int i) const;
  16106. private:
  16107. friend class Test;
  16108. friend class internal::UnitTestImpl;
  16109. // Gets the (mutable) vector of TestInfos in this TestCase.
  16110. std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
  16111. // Gets the (immutable) vector of TestInfos in this TestCase.
  16112. const std::vector<TestInfo*>& test_info_list() const {
  16113. return test_info_list_;
  16114. }
  16115. // Returns the i-th test among all the tests. i can range from 0 to
  16116. // total_test_count() - 1. If i is not in that range, returns NULL.
  16117. TestInfo* GetMutableTestInfo(int i);
  16118. // Sets the should_run member.
  16119. void set_should_run(bool should) { should_run_ = should; }
  16120. // Adds a TestInfo to this test case. Will delete the TestInfo upon
  16121. // destruction of the TestCase object.
  16122. void AddTestInfo(TestInfo * test_info);
  16123. // Clears the results of all tests in this test case.
  16124. void ClearResult();
  16125. // Clears the results of all tests in the given test case.
  16126. static void ClearTestCaseResult(TestCase* test_case) {
  16127. test_case->ClearResult();
  16128. }
  16129. // Runs every test in this TestCase.
  16130. void Run();
  16131. // Runs SetUpTestCase() for this TestCase. This wrapper is needed
  16132. // for catching exceptions thrown from SetUpTestCase().
  16133. void RunSetUpTestCase() { (*set_up_tc_)(); }
  16134. // Runs TearDownTestCase() for this TestCase. This wrapper is
  16135. // needed for catching exceptions thrown from TearDownTestCase().
  16136. void RunTearDownTestCase() { (*tear_down_tc_)(); }
  16137. // Returns true iff test passed.
  16138. static bool TestPassed(const TestInfo* test_info) {
  16139. return test_info->should_run() && test_info->result()->Passed();
  16140. }
  16141. // Returns true iff test failed.
  16142. static bool TestFailed(const TestInfo* test_info) {
  16143. return test_info->should_run() && test_info->result()->Failed();
  16144. }
  16145. // Returns true iff test is disabled.
  16146. static bool TestDisabled(const TestInfo* test_info) {
  16147. return test_info->is_disabled_;
  16148. }
  16149. // Returns true if the given test should run.
  16150. static bool ShouldRunTest(const TestInfo* test_info) {
  16151. return test_info->should_run();
  16152. }
  16153. // Shuffles the tests in this test case.
  16154. void ShuffleTests(internal::Random* random);
  16155. // Restores the test order to before the first shuffle.
  16156. void UnshuffleTests();
  16157. // Name of the test case.
  16158. internal::String name_;
  16159. // Name of the parameter type, or NULL if this is not a typed or a
  16160. // type-parameterized test.
  16161. const internal::scoped_ptr<const ::std::string> type_param_;
  16162. // The vector of TestInfos in their original order. It owns the
  16163. // elements in the vector.
  16164. std::vector<TestInfo*> test_info_list_;
  16165. // Provides a level of indirection for the test list to allow easy
  16166. // shuffling and restoring the test order. The i-th element in this
  16167. // vector is the index of the i-th test in the shuffled test list.
  16168. std::vector<int> test_indices_;
  16169. // Pointer to the function that sets up the test case.
  16170. Test::SetUpTestCaseFunc set_up_tc_;
  16171. // Pointer to the function that tears down the test case.
  16172. Test::TearDownTestCaseFunc tear_down_tc_;
  16173. // True iff any test in this test case should run.
  16174. bool should_run_;
  16175. // Elapsed time, in milliseconds.
  16176. TimeInMillis elapsed_time_;
  16177. // We disallow copying TestCases.
  16178. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
  16179. };
  16180. // An Environment object is capable of setting up and tearing down an
  16181. // environment. The user should subclass this to define his own
  16182. // environment(s).
  16183. //
  16184. // An Environment object does the set-up and tear-down in virtual
  16185. // methods SetUp() and TearDown() instead of the constructor and the
  16186. // destructor, as:
  16187. //
  16188. // 1. You cannot safely throw from a destructor. This is a problem
  16189. // as in some cases Google Test is used where exceptions are enabled, and
  16190. // we may want to implement ASSERT_* using exceptions where they are
  16191. // available.
  16192. // 2. You cannot use ASSERT_* directly in a constructor or
  16193. // destructor.
  16194. class Environment {
  16195. public:
  16196. // The d'tor is virtual as we need to subclass Environment.
  16197. virtual ~Environment() {}
  16198. // Override this to define how to set up the environment.
  16199. virtual void SetUp() {}
  16200. // Override this to define how to tear down the environment.
  16201. virtual void TearDown() {}
  16202. private:
  16203. // If you see an error about overriding the following function or
  16204. // about it being private, you have mis-spelled SetUp() as Setup().
  16205. struct Setup_should_be_spelled_SetUp {};
  16206. virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
  16207. };
  16208. // The interface for tracing execution of tests. The methods are organized in
  16209. // the order the corresponding events are fired.
  16210. class TestEventListener {
  16211. public:
  16212. virtual ~TestEventListener() {}
  16213. // Fired before any test activity starts.
  16214. virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
  16215. // Fired before each iteration of tests starts. There may be more than
  16216. // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
  16217. // index, starting from 0.
  16218. virtual void OnTestIterationStart(const UnitTest& unit_test,
  16219. int iteration) = 0;
  16220. // Fired before environment set-up for each iteration of tests starts.
  16221. virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
  16222. // Fired after environment set-up for each iteration of tests ends.
  16223. virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
  16224. // Fired before the test case starts.
  16225. virtual void OnTestCaseStart(const TestCase& test_case) = 0;
  16226. // Fired before the test starts.
  16227. virtual void OnTestStart(const TestInfo& test_info) = 0;
  16228. // Fired after a failed assertion or a SUCCEED() invocation.
  16229. virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
  16230. // Fired after the test ends.
  16231. virtual void OnTestEnd(const TestInfo& test_info) = 0;
  16232. // Fired after the test case ends.
  16233. virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
  16234. // Fired before environment tear-down for each iteration of tests starts.
  16235. virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
  16236. // Fired after environment tear-down for each iteration of tests ends.
  16237. virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
  16238. // Fired after each iteration of tests finishes.
  16239. virtual void OnTestIterationEnd(const UnitTest& unit_test,
  16240. int iteration) = 0;
  16241. // Fired after all test activities have ended.
  16242. virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
  16243. };
  16244. // The convenience class for users who need to override just one or two
  16245. // methods and are not concerned that a possible change to a signature of
  16246. // the methods they override will not be caught during the build. For
  16247. // comments about each method please see the definition of TestEventListener
  16248. // above.
  16249. class EmptyTestEventListener : public TestEventListener {
  16250. public:
  16251. virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
  16252. virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
  16253. int /*iteration*/) {}
  16254. virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
  16255. virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
  16256. virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
  16257. virtual void OnTestStart(const TestInfo& /*test_info*/) {}
  16258. virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
  16259. virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
  16260. virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
  16261. virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
  16262. virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
  16263. virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
  16264. int /*iteration*/) {}
  16265. virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
  16266. };
  16267. // TestEventListeners lets users add listeners to track events in Google Test.
  16268. class GTEST_API_ TestEventListeners {
  16269. public:
  16270. TestEventListeners();
  16271. ~TestEventListeners();
  16272. // Appends an event listener to the end of the list. Google Test assumes
  16273. // the ownership of the listener (i.e. it will delete the listener when
  16274. // the test program finishes).
  16275. void Append(TestEventListener* listener);
  16276. // Removes the given event listener from the list and returns it. It then
  16277. // becomes the caller's responsibility to delete the listener. Returns
  16278. // NULL if the listener is not found in the list.
  16279. TestEventListener* Release(TestEventListener* listener);
  16280. // Returns the standard listener responsible for the default console
  16281. // output. Can be removed from the listeners list to shut down default
  16282. // console output. Note that removing this object from the listener list
  16283. // with Release transfers its ownership to the caller and makes this
  16284. // function return NULL the next time.
  16285. TestEventListener* default_result_printer() const {
  16286. return default_result_printer_;
  16287. }
  16288. // Returns the standard listener responsible for the default XML output
  16289. // controlled by the --gtest_output=xml flag. Can be removed from the
  16290. // listeners list by users who want to shut down the default XML output
  16291. // controlled by this flag and substitute it with custom one. Note that
  16292. // removing this object from the listener list with Release transfers its
  16293. // ownership to the caller and makes this function return NULL the next
  16294. // time.
  16295. TestEventListener* default_xml_generator() const {
  16296. return default_xml_generator_;
  16297. }
  16298. private:
  16299. friend class TestCase;
  16300. friend class TestInfo;
  16301. friend class internal::DefaultGlobalTestPartResultReporter;
  16302. friend class internal::NoExecDeathTest;
  16303. friend class internal::TestEventListenersAccessor;
  16304. friend class internal::UnitTestImpl;
  16305. // Returns repeater that broadcasts the TestEventListener events to all
  16306. // subscribers.
  16307. TestEventListener* repeater();
  16308. // Sets the default_result_printer attribute to the provided listener.
  16309. // The listener is also added to the listener list and previous
  16310. // default_result_printer is removed from it and deleted. The listener can
  16311. // also be NULL in which case it will not be added to the list. Does
  16312. // nothing if the previous and the current listener objects are the same.
  16313. void SetDefaultResultPrinter(TestEventListener* listener);
  16314. // Sets the default_xml_generator attribute to the provided listener. The
  16315. // listener is also added to the listener list and previous
  16316. // default_xml_generator is removed from it and deleted. The listener can
  16317. // also be NULL in which case it will not be added to the list. Does
  16318. // nothing if the previous and the current listener objects are the same.
  16319. void SetDefaultXmlGenerator(TestEventListener* listener);
  16320. // Controls whether events will be forwarded by the repeater to the
  16321. // listeners in the list.
  16322. bool EventForwardingEnabled() const;
  16323. void SuppressEventForwarding();
  16324. // The actual list of listeners.
  16325. internal::TestEventRepeater* repeater_;
  16326. // Listener responsible for the standard result output.
  16327. TestEventListener* default_result_printer_;
  16328. // Listener responsible for the creation of the XML output file.
  16329. TestEventListener* default_xml_generator_;
  16330. // We disallow copying TestEventListeners.
  16331. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
  16332. };
  16333. // A UnitTest consists of a vector of TestCases.
  16334. //
  16335. // This is a singleton class. The only instance of UnitTest is
  16336. // created when UnitTest::GetInstance() is first called. This
  16337. // instance is never deleted.
  16338. //
  16339. // UnitTest is not copyable.
  16340. //
  16341. // This class is thread-safe as long as the methods are called
  16342. // according to their specification.
  16343. class GTEST_API_ UnitTest {
  16344. public:
  16345. // Gets the singleton UnitTest object. The first time this method
  16346. // is called, a UnitTest object is constructed and returned.
  16347. // Consecutive calls will return the same object.
  16348. static UnitTest* GetInstance();
  16349. // Runs all tests in this UnitTest object and prints the result.
  16350. // Returns 0 if successful, or 1 otherwise.
  16351. //
  16352. // This method can only be called from the main thread.
  16353. //
  16354. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16355. int Run() GTEST_MUST_USE_RESULT_;
  16356. // Returns the working directory when the first TEST() or TEST_F()
  16357. // was executed. The UnitTest object owns the string.
  16358. const char* original_working_dir() const;
  16359. // Returns the TestCase object for the test that's currently running,
  16360. // or NULL if no test is running.
  16361. const TestCase* current_test_case() const;
  16362. // Returns the TestInfo object for the test that's currently running,
  16363. // or NULL if no test is running.
  16364. const TestInfo* current_test_info() const;
  16365. // Returns the random seed used at the start of the current test run.
  16366. int random_seed() const;
  16367. #if GTEST_HAS_PARAM_TEST
  16368. // Returns the ParameterizedTestCaseRegistry object used to keep track of
  16369. // value-parameterized tests and instantiate and register them.
  16370. //
  16371. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16372. internal::ParameterizedTestCaseRegistry& parameterized_test_registry();
  16373. #endif // GTEST_HAS_PARAM_TEST
  16374. // Gets the number of successful test cases.
  16375. int successful_test_case_count() const;
  16376. // Gets the number of failed test cases.
  16377. int failed_test_case_count() const;
  16378. // Gets the number of all test cases.
  16379. int total_test_case_count() const;
  16380. // Gets the number of all test cases that contain at least one test
  16381. // that should run.
  16382. int test_case_to_run_count() const;
  16383. // Gets the number of successful tests.
  16384. int successful_test_count() const;
  16385. // Gets the number of failed tests.
  16386. int failed_test_count() const;
  16387. // Gets the number of disabled tests.
  16388. int disabled_test_count() const;
  16389. // Gets the number of all tests.
  16390. int total_test_count() const;
  16391. // Gets the number of tests that should run.
  16392. int test_to_run_count() const;
  16393. // Gets the elapsed time, in milliseconds.
  16394. TimeInMillis elapsed_time() const;
  16395. // Returns true iff the unit test passed (i.e. all test cases passed).
  16396. bool Passed() const;
  16397. // Returns true iff the unit test failed (i.e. some test case failed
  16398. // or something outside of all tests failed).
  16399. bool Failed() const;
  16400. // Gets the i-th test case among all the test cases. i can range from 0 to
  16401. // total_test_case_count() - 1. If i is not in that range, returns NULL.
  16402. const TestCase* GetTestCase(int i) const;
  16403. // Returns the list of event listeners that can be used to track events
  16404. // inside Google Test.
  16405. TestEventListeners& listeners();
  16406. private:
  16407. // Registers and returns a global test environment. When a test
  16408. // program is run, all global test environments will be set-up in
  16409. // the order they were registered. After all tests in the program
  16410. // have finished, all global test environments will be torn-down in
  16411. // the *reverse* order they were registered.
  16412. //
  16413. // The UnitTest object takes ownership of the given environment.
  16414. //
  16415. // This method can only be called from the main thread.
  16416. Environment* AddEnvironment(Environment* env);
  16417. // Adds a TestPartResult to the current TestResult object. All
  16418. // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
  16419. // eventually call this to report their results. The user code
  16420. // should use the assertion macros instead of calling this directly.
  16421. void AddTestPartResult(TestPartResult::Type result_type,
  16422. const char* file_name,
  16423. int line_number,
  16424. const internal::String& message,
  16425. const internal::String& os_stack_trace);
  16426. // Adds a TestProperty to the current TestResult object. If the result already
  16427. // contains a property with the same key, the value will be updated.
  16428. void RecordPropertyForCurrentTest(const char* key, const char* value);
  16429. // Gets the i-th test case among all the test cases. i can range from 0 to
  16430. // total_test_case_count() - 1. If i is not in that range, returns NULL.
  16431. TestCase* GetMutableTestCase(int i);
  16432. // Accessors for the implementation object.
  16433. internal::UnitTestImpl* impl() { return impl_; }
  16434. const internal::UnitTestImpl* impl() const { return impl_; }
  16435. // These classes and funcions are friends as they need to access private
  16436. // members of UnitTest.
  16437. friend class Test;
  16438. friend class internal::AssertHelper;
  16439. friend class internal::ScopedTrace;
  16440. friend Environment* AddGlobalTestEnvironment(Environment* env);
  16441. friend internal::UnitTestImpl* internal::GetUnitTestImpl();
  16442. friend void internal::ReportFailureInUnknownLocation(
  16443. TestPartResult::Type result_type,
  16444. const internal::String& message);
  16445. // Creates an empty UnitTest.
  16446. UnitTest();
  16447. // D'tor
  16448. virtual ~UnitTest();
  16449. // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
  16450. // Google Test trace stack.
  16451. void PushGTestTrace(const internal::TraceInfo& trace);
  16452. // Pops a trace from the per-thread Google Test trace stack.
  16453. void PopGTestTrace();
  16454. // Protects mutable state in *impl_. This is mutable as some const
  16455. // methods need to lock it too.
  16456. mutable internal::Mutex mutex_;
  16457. // Opaque implementation object. This field is never changed once
  16458. // the object is constructed. We don't mark it as const here, as
  16459. // doing so will cause a warning in the constructor of UnitTest.
  16460. // Mutable state in *impl_ is protected by mutex_.
  16461. internal::UnitTestImpl* impl_;
  16462. // We disallow copying UnitTest.
  16463. GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
  16464. };
  16465. // A convenient wrapper for adding an environment for the test
  16466. // program.
  16467. //
  16468. // You should call this before RUN_ALL_TESTS() is called, probably in
  16469. // main(). If you use gtest_main, you need to call this before main()
  16470. // starts for it to take effect. For example, you can define a global
  16471. // variable like this:
  16472. //
  16473. // testing::Environment* const foo_env =
  16474. // testing::AddGlobalTestEnvironment(new FooEnvironment);
  16475. //
  16476. // However, we strongly recommend you to write your own main() and
  16477. // call AddGlobalTestEnvironment() there, as relying on initialization
  16478. // of global variables makes the code harder to read and may cause
  16479. // problems when you register multiple environments from different
  16480. // translation units and the environments have dependencies among them
  16481. // (remember that the compiler doesn't guarantee the order in which
  16482. // global variables from different translation units are initialized).
  16483. inline Environment* AddGlobalTestEnvironment(Environment* env) {
  16484. return UnitTest::GetInstance()->AddEnvironment(env);
  16485. }
  16486. // Initializes Google Test. This must be called before calling
  16487. // RUN_ALL_TESTS(). In particular, it parses a command line for the
  16488. // flags that Google Test recognizes. Whenever a Google Test flag is
  16489. // seen, it is removed from argv, and *argc is decremented.
  16490. //
  16491. // No value is returned. Instead, the Google Test flag variables are
  16492. // updated.
  16493. //
  16494. // Calling the function for the second time has no user-visible effect.
  16495. GTEST_API_ void InitGoogleTest(int* argc, char** argv);
  16496. // This overloaded version can be used in Windows programs compiled in
  16497. // UNICODE mode.
  16498. GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
  16499. namespace internal {
  16500. // Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
  16501. // operand to be used in a failure message. The type (but not value)
  16502. // of the other operand may affect the format. This allows us to
  16503. // print a char* as a raw pointer when it is compared against another
  16504. // char*, and print it as a C string when it is compared against an
  16505. // std::string object, for example.
  16506. //
  16507. // The default implementation ignores the type of the other operand.
  16508. // Some specialized versions are used to handle formatting wide or
  16509. // narrow C strings.
  16510. //
  16511. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16512. template <typename T1, typename T2>
  16513. String FormatForComparisonFailureMessage(const T1& value,
  16514. const T2& /* other_operand */) {
  16515. // C++Builder compiles this incorrectly if the namespace isn't explicitly
  16516. // given.
  16517. return ::testing::PrintToString(value);
  16518. }
  16519. // The helper function for {ASSERT|EXPECT}_EQ.
  16520. template <typename T1, typename T2>
  16521. AssertionResult CmpHelperEQ(const char* expected_expression,
  16522. const char* actual_expression,
  16523. const T1& expected,
  16524. const T2& actual) {
  16525. #ifdef _MSC_VER
  16526. # pragma warning(push) // Saves the current warning state.
  16527. # pragma warning(disable:4389) // Temporarily disables warning on
  16528. // signed/unsigned mismatch.
  16529. #elif __clang__
  16530. #pragma clang diagnostic push
  16531. #pragma clang diagnostic ignored "-Wsign-compare"
  16532. #elif __GNUC__
  16533. #pragma gcc diagnostic push
  16534. #pragma gcc diagnostic ignored "-Wsign-compare"
  16535. #endif
  16536. if (expected == actual) {
  16537. return AssertionSuccess();
  16538. }
  16539. #ifdef _MSC_VER
  16540. # pragma warning(pop) // Restores the warning state.
  16541. #elif __clang__
  16542. #pragma clang diagnostic pop
  16543. #elif __GNUC__
  16544. #pragma gcc diagnostic pop
  16545. #endif
  16546. return EqFailure(expected_expression,
  16547. actual_expression,
  16548. FormatForComparisonFailureMessage(expected, actual),
  16549. FormatForComparisonFailureMessage(actual, expected),
  16550. false);
  16551. }
  16552. // With this overloaded version, we allow anonymous enums to be used
  16553. // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
  16554. // can be implicitly cast to BiggestInt.
  16555. GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression,
  16556. const char* actual_expression,
  16557. BiggestInt expected,
  16558. BiggestInt actual);
  16559. // The helper class for {ASSERT|EXPECT}_EQ. The template argument
  16560. // lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
  16561. // is a null pointer literal. The following default implementation is
  16562. // for lhs_is_null_literal being false.
  16563. template <bool lhs_is_null_literal>
  16564. class EqHelper {
  16565. public:
  16566. // This templatized version is for the general case.
  16567. template <typename T1, typename T2>
  16568. static AssertionResult Compare(const char* expected_expression,
  16569. const char* actual_expression,
  16570. const T1& expected,
  16571. const T2& actual) {
  16572. return CmpHelperEQ(expected_expression, actual_expression, expected,
  16573. actual);
  16574. }
  16575. // With this overloaded version, we allow anonymous enums to be used
  16576. // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
  16577. // enums can be implicitly cast to BiggestInt.
  16578. //
  16579. // Even though its body looks the same as the above version, we
  16580. // cannot merge the two, as it will make anonymous enums unhappy.
  16581. static AssertionResult Compare(const char* expected_expression,
  16582. const char* actual_expression,
  16583. BiggestInt expected,
  16584. BiggestInt actual) {
  16585. return CmpHelperEQ(expected_expression, actual_expression, expected,
  16586. actual);
  16587. }
  16588. };
  16589. // This specialization is used when the first argument to ASSERT_EQ()
  16590. // is a null pointer literal, like NULL, false, or 0.
  16591. template <>
  16592. class EqHelper<true> {
  16593. public:
  16594. // We define two overloaded versions of Compare(). The first
  16595. // version will be picked when the second argument to ASSERT_EQ() is
  16596. // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
  16597. // EXPECT_EQ(false, a_bool).
  16598. template <typename T1, typename T2>
  16599. static AssertionResult Compare(
  16600. const char* expected_expression,
  16601. const char* actual_expression,
  16602. const T1& expected,
  16603. const T2& actual,
  16604. // The following line prevents this overload from being considered if T2
  16605. // is not a pointer type. We need this because ASSERT_EQ(NULL, my_ptr)
  16606. // expands to Compare("", "", NULL, my_ptr), which requires a conversion
  16607. // to match the Secret* in the other overload, which would otherwise make
  16608. // this template match better.
  16609. typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
  16610. return CmpHelperEQ(expected_expression, actual_expression, expected,
  16611. actual);
  16612. }
  16613. // This version will be picked when the second argument to ASSERT_EQ() is a
  16614. // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
  16615. template <typename T>
  16616. static AssertionResult Compare(
  16617. const char* expected_expression,
  16618. const char* actual_expression,
  16619. // We used to have a second template parameter instead of Secret*. That
  16620. // template parameter would deduce to 'long', making this a better match
  16621. // than the first overload even without the first overload's EnableIf.
  16622. // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
  16623. // non-pointer argument" (even a deduced integral argument), so the old
  16624. // implementation caused warnings in user code.
  16625. Secret* /* expected (NULL) */,
  16626. T* actual) {
  16627. // We already know that 'expected' is a null pointer.
  16628. return CmpHelperEQ(expected_expression, actual_expression,
  16629. static_cast<T*>(NULL), actual);
  16630. }
  16631. };
  16632. // A macro for implementing the helper functions needed to implement
  16633. // ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste
  16634. // of similar code.
  16635. //
  16636. // For each templatized helper function, we also define an overloaded
  16637. // version for BiggestInt in order to reduce code bloat and allow
  16638. // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
  16639. // with gcc 4.
  16640. //
  16641. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16642. #define GTEST_IMPL_CMP_HELPER_(op_name, op)\
  16643. template <typename T1, typename T2>\
  16644. AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
  16645. const T1& val1, const T2& val2) {\
  16646. if (val1 op val2) {\
  16647. return AssertionSuccess();\
  16648. } else {\
  16649. return AssertionFailure() \
  16650. << "Expected: (" << expr1 << ") " #op " (" << expr2\
  16651. << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
  16652. << " vs " << FormatForComparisonFailureMessage(val2, val1);\
  16653. }\
  16654. }\
  16655. GTEST_API_ AssertionResult CmpHelper##op_name(\
  16656. const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
  16657. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16658. // Implements the helper function for {ASSERT|EXPECT}_NE
  16659. GTEST_IMPL_CMP_HELPER_(NE, !=);
  16660. // Implements the helper function for {ASSERT|EXPECT}_LE
  16661. GTEST_IMPL_CMP_HELPER_(LE, <=);
  16662. // Implements the helper function for {ASSERT|EXPECT}_LT
  16663. GTEST_IMPL_CMP_HELPER_(LT, < );
  16664. // Implements the helper function for {ASSERT|EXPECT}_GE
  16665. GTEST_IMPL_CMP_HELPER_(GE, >=);
  16666. // Implements the helper function for {ASSERT|EXPECT}_GT
  16667. GTEST_IMPL_CMP_HELPER_(GT, > );
  16668. #undef GTEST_IMPL_CMP_HELPER_
  16669. // The helper function for {ASSERT|EXPECT}_STREQ.
  16670. //
  16671. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16672. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
  16673. const char* actual_expression,
  16674. const char* expected,
  16675. const char* actual);
  16676. // The helper function for {ASSERT|EXPECT}_STRCASEEQ.
  16677. //
  16678. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16679. GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,
  16680. const char* actual_expression,
  16681. const char* expected,
  16682. const char* actual);
  16683. // The helper function for {ASSERT|EXPECT}_STRNE.
  16684. //
  16685. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16686. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
  16687. const char* s2_expression,
  16688. const char* s1,
  16689. const char* s2);
  16690. // The helper function for {ASSERT|EXPECT}_STRCASENE.
  16691. //
  16692. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16693. GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
  16694. const char* s2_expression,
  16695. const char* s1,
  16696. const char* s2);
  16697. // Helper function for *_STREQ on wide strings.
  16698. //
  16699. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16700. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
  16701. const char* actual_expression,
  16702. const wchar_t* expected,
  16703. const wchar_t* actual);
  16704. // Helper function for *_STRNE on wide strings.
  16705. //
  16706. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16707. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
  16708. const char* s2_expression,
  16709. const wchar_t* s1,
  16710. const wchar_t* s2);
  16711. } // namespace internal
  16712. // IsSubstring() and IsNotSubstring() are intended to be used as the
  16713. // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
  16714. // themselves. They check whether needle is a substring of haystack
  16715. // (NULL is considered a substring of itself only), and return an
  16716. // appropriate error message when they fail.
  16717. //
  16718. // The {needle,haystack}_expr arguments are the stringified
  16719. // expressions that generated the two real arguments.
  16720. GTEST_API_ AssertionResult IsSubstring(
  16721. const char* needle_expr, const char* haystack_expr,
  16722. const char* needle, const char* haystack);
  16723. GTEST_API_ AssertionResult IsSubstring(
  16724. const char* needle_expr, const char* haystack_expr,
  16725. const wchar_t* needle, const wchar_t* haystack);
  16726. GTEST_API_ AssertionResult IsNotSubstring(
  16727. const char* needle_expr, const char* haystack_expr,
  16728. const char* needle, const char* haystack);
  16729. GTEST_API_ AssertionResult IsNotSubstring(
  16730. const char* needle_expr, const char* haystack_expr,
  16731. const wchar_t* needle, const wchar_t* haystack);
  16732. GTEST_API_ AssertionResult IsSubstring(
  16733. const char* needle_expr, const char* haystack_expr,
  16734. const ::std::string& needle, const ::std::string& haystack);
  16735. GTEST_API_ AssertionResult IsNotSubstring(
  16736. const char* needle_expr, const char* haystack_expr,
  16737. const ::std::string& needle, const ::std::string& haystack);
  16738. #if GTEST_HAS_STD_WSTRING
  16739. GTEST_API_ AssertionResult IsSubstring(
  16740. const char* needle_expr, const char* haystack_expr,
  16741. const ::std::wstring& needle, const ::std::wstring& haystack);
  16742. GTEST_API_ AssertionResult IsNotSubstring(
  16743. const char* needle_expr, const char* haystack_expr,
  16744. const ::std::wstring& needle, const ::std::wstring& haystack);
  16745. #endif // GTEST_HAS_STD_WSTRING
  16746. namespace internal {
  16747. // Helper template function for comparing floating-points.
  16748. //
  16749. // Template parameter:
  16750. //
  16751. // RawType: the raw floating-point type (either float or double)
  16752. //
  16753. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16754. template <typename RawType>
  16755. AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression,
  16756. const char* actual_expression,
  16757. RawType expected,
  16758. RawType actual) {
  16759. const FloatingPoint<RawType> lhs(expected), rhs(actual);
  16760. if (lhs.AlmostEquals(rhs)) {
  16761. return AssertionSuccess();
  16762. }
  16763. ::std::stringstream expected_ss;
  16764. expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
  16765. << expected;
  16766. ::std::stringstream actual_ss;
  16767. actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
  16768. << actual;
  16769. return EqFailure(expected_expression,
  16770. actual_expression,
  16771. StringStreamToString(&expected_ss),
  16772. StringStreamToString(&actual_ss),
  16773. false);
  16774. }
  16775. // Helper function for implementing ASSERT_NEAR.
  16776. //
  16777. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16778. GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
  16779. const char* expr2,
  16780. const char* abs_error_expr,
  16781. double val1,
  16782. double val2,
  16783. double abs_error);
  16784. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  16785. // A class that enables one to stream messages to assertion macros
  16786. class GTEST_API_ AssertHelper {
  16787. public:
  16788. // Constructor.
  16789. AssertHelper(TestPartResult::Type type,
  16790. const char* file,
  16791. int line,
  16792. const char* message);
  16793. ~AssertHelper();
  16794. // Message assignment is a semantic trick to enable assertion
  16795. // streaming; see the GTEST_MESSAGE_ macro below.
  16796. void operator=(const Message& message) const;
  16797. private:
  16798. // We put our data in a struct so that the size of the AssertHelper class can
  16799. // be as small as possible. This is important because gcc is incapable of
  16800. // re-using stack space even for temporary variables, so every EXPECT_EQ
  16801. // reserves stack space for another AssertHelper.
  16802. struct AssertHelperData {
  16803. AssertHelperData(TestPartResult::Type t,
  16804. const char* srcfile,
  16805. int line_num,
  16806. const char* msg)
  16807. : type(t), file(srcfile), line(line_num), message(msg) { }
  16808. TestPartResult::Type const type;
  16809. const char* const file;
  16810. int const line;
  16811. String const message;
  16812. private:
  16813. GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
  16814. };
  16815. AssertHelperData* const data_;
  16816. GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
  16817. };
  16818. } // namespace internal
  16819. #if GTEST_HAS_PARAM_TEST
  16820. // The pure interface class that all value-parameterized tests inherit from.
  16821. // A value-parameterized class must inherit from both ::testing::Test and
  16822. // ::testing::WithParamInterface. In most cases that just means inheriting
  16823. // from ::testing::TestWithParam, but more complicated test hierarchies
  16824. // may need to inherit from Test and WithParamInterface at different levels.
  16825. //
  16826. // This interface has support for accessing the test parameter value via
  16827. // the GetParam() method.
  16828. //
  16829. // Use it with one of the parameter generator defining functions, like Range(),
  16830. // Values(), ValuesIn(), Bool(), and Combine().
  16831. //
  16832. // class FooTest : public ::testing::TestWithParam<int> {
  16833. // protected:
  16834. // FooTest() {
  16835. // // Can use GetParam() here.
  16836. // }
  16837. // virtual ~FooTest() {
  16838. // // Can use GetParam() here.
  16839. // }
  16840. // virtual void SetUp() {
  16841. // // Can use GetParam() here.
  16842. // }
  16843. // virtual void TearDown {
  16844. // // Can use GetParam() here.
  16845. // }
  16846. // };
  16847. // TEST_P(FooTest, DoesBar) {
  16848. // // Can use GetParam() method here.
  16849. // Foo foo;
  16850. // ASSERT_TRUE(foo.DoesBar(GetParam()));
  16851. // }
  16852. // INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
  16853. template <typename T>
  16854. class WithParamInterface {
  16855. public:
  16856. typedef T ParamType;
  16857. virtual ~WithParamInterface() {}
  16858. // The current parameter value. Is also available in the test fixture's
  16859. // constructor. This member function is non-static, even though it only
  16860. // references static data, to reduce the opportunity for incorrect uses
  16861. // like writing 'WithParamInterface<bool>::GetParam()' for a test that
  16862. // uses a fixture whose parameter type is int.
  16863. const ParamType& GetParam() const { return *parameter_; }
  16864. private:
  16865. // Sets parameter value. The caller is responsible for making sure the value
  16866. // remains alive and unchanged throughout the current test.
  16867. static void SetParam(const ParamType* parameter) {
  16868. parameter_ = parameter;
  16869. }
  16870. // Static value used for accessing parameter during a test lifetime.
  16871. static const ParamType* parameter_;
  16872. // TestClass must be a subclass of WithParamInterface<T> and Test.
  16873. template <class TestClass> friend class internal::ParameterizedTestFactory;
  16874. };
  16875. template <typename T>
  16876. const T* WithParamInterface<T>::parameter_ = NULL;
  16877. // Most value-parameterized classes can ignore the existence of
  16878. // WithParamInterface, and can just inherit from ::testing::TestWithParam.
  16879. template <typename T>
  16880. class TestWithParam : public Test, public WithParamInterface<T> {
  16881. };
  16882. #endif // GTEST_HAS_PARAM_TEST
  16883. // Macros for indicating success/failure in test code.
  16884. // ADD_FAILURE unconditionally adds a failure to the current test.
  16885. // SUCCEED generates a success - it doesn't automatically make the
  16886. // current test successful, as a test is only successful when it has
  16887. // no failure.
  16888. //
  16889. // EXPECT_* verifies that a certain condition is satisfied. If not,
  16890. // it behaves like ADD_FAILURE. In particular:
  16891. //
  16892. // EXPECT_TRUE verifies that a Boolean condition is true.
  16893. // EXPECT_FALSE verifies that a Boolean condition is false.
  16894. //
  16895. // FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
  16896. // that they will also abort the current function on failure. People
  16897. // usually want the fail-fast behavior of FAIL and ASSERT_*, but those
  16898. // writing data-driven tests often find themselves using ADD_FAILURE
  16899. // and EXPECT_* more.
  16900. //
  16901. // Examples:
  16902. //
  16903. // EXPECT_TRUE(server.StatusIsOK());
  16904. // ASSERT_FALSE(server.HasPendingRequest(port))
  16905. // << "There are still pending requests " << "on port " << port;
  16906. // Generates a nonfatal failure with a generic message.
  16907. #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
  16908. // Generates a nonfatal failure at the given source file location with
  16909. // a generic message.
  16910. #define ADD_FAILURE_AT(file, line) \
  16911. GTEST_MESSAGE_AT_(file, line, "Failed", \
  16912. ::testing::TestPartResult::kNonFatalFailure)
  16913. // Generates a fatal failure with a generic message.
  16914. #define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
  16915. // Define this macro to 1 to omit the definition of FAIL(), which is a
  16916. // generic name and clashes with some other libraries.
  16917. #if !GTEST_DONT_DEFINE_FAIL
  16918. # define FAIL() GTEST_FAIL()
  16919. #endif
  16920. // Generates a success with a generic message.
  16921. #define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
  16922. // Define this macro to 1 to omit the definition of SUCCEED(), which
  16923. // is a generic name and clashes with some other libraries.
  16924. #if !GTEST_DONT_DEFINE_SUCCEED
  16925. # define SUCCEED() GTEST_SUCCEED()
  16926. #endif
  16927. // Macros for testing exceptions.
  16928. //
  16929. // * {ASSERT|EXPECT}_THROW(statement, expected_exception):
  16930. // Tests that the statement throws the expected exception.
  16931. // * {ASSERT|EXPECT}_NO_THROW(statement):
  16932. // Tests that the statement doesn't throw any exception.
  16933. // * {ASSERT|EXPECT}_ANY_THROW(statement):
  16934. // Tests that the statement throws an exception.
  16935. #define EXPECT_THROW(statement, expected_exception) \
  16936. GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
  16937. #define EXPECT_NO_THROW(statement) \
  16938. GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
  16939. #define EXPECT_ANY_THROW(statement) \
  16940. GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
  16941. #define ASSERT_THROW(statement, expected_exception) \
  16942. GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
  16943. #define ASSERT_NO_THROW(statement) \
  16944. GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
  16945. #define ASSERT_ANY_THROW(statement) \
  16946. GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
  16947. // Boolean assertions. Condition can be either a Boolean expression or an
  16948. // AssertionResult. For more information on how to use AssertionResult with
  16949. // these macros see comments on that class.
  16950. #define EXPECT_TRUE(condition) \
  16951. GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
  16952. GTEST_NONFATAL_FAILURE_)
  16953. #define EXPECT_FALSE(condition) \
  16954. GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
  16955. GTEST_NONFATAL_FAILURE_)
  16956. #define ASSERT_TRUE(condition) \
  16957. GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
  16958. GTEST_FATAL_FAILURE_)
  16959. #define ASSERT_FALSE(condition) \
  16960. GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
  16961. GTEST_FATAL_FAILURE_)
  16962. // Includes the auto-generated header that implements a family of
  16963. // generic predicate assertion macros.
  16964. // Copyright 2006, Google Inc.
  16965. // All rights reserved.
  16966. //
  16967. // Redistribution and use in source and binary forms, with or without
  16968. // modification, are permitted provided that the following conditions are
  16969. // met:
  16970. //
  16971. // * Redistributions of source code must retain the above copyright
  16972. // notice, this list of conditions and the following disclaimer.
  16973. // * Redistributions in binary form must reproduce the above
  16974. // copyright notice, this list of conditions and the following disclaimer
  16975. // in the documentation and/or other materials provided with the
  16976. // distribution.
  16977. // * Neither the name of Google Inc. nor the names of its
  16978. // contributors may be used to endorse or promote products derived from
  16979. // this software without specific prior written permission.
  16980. //
  16981. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  16982. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  16983. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  16984. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  16985. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16986. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16987. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  16988. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  16989. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  16990. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  16991. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  16992. // This file is AUTOMATICALLY GENERATED on 09/24/2010 by command
  16993. // 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
  16994. //
  16995. // Implements a family of generic predicate assertion macros.
  16996. #ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
  16997. #define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
  16998. // Makes sure this header is not included before gtest.h.
  16999. #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
  17000. # error Do not include gtest_pred_impl.h directly. Include gtest.h instead.
  17001. #endif // GTEST_INCLUDE_GTEST_GTEST_H_
  17002. // This header implements a family of generic predicate assertion
  17003. // macros:
  17004. //
  17005. // ASSERT_PRED_FORMAT1(pred_format, v1)
  17006. // ASSERT_PRED_FORMAT2(pred_format, v1, v2)
  17007. // ...
  17008. //
  17009. // where pred_format is a function or functor that takes n (in the
  17010. // case of ASSERT_PRED_FORMATn) values and their source expression
  17011. // text, and returns a testing::AssertionResult. See the definition
  17012. // of ASSERT_EQ in gtest.h for an example.
  17013. //
  17014. // If you don't care about formatting, you can use the more
  17015. // restrictive version:
  17016. //
  17017. // ASSERT_PRED1(pred, v1)
  17018. // ASSERT_PRED2(pred, v1, v2)
  17019. // ...
  17020. //
  17021. // where pred is an n-ary function or functor that returns bool,
  17022. // and the values v1, v2, ..., must support the << operator for
  17023. // streaming to std::ostream.
  17024. //
  17025. // We also define the EXPECT_* variations.
  17026. //
  17027. // For now we only support predicates whose arity is at most 5.
  17028. // Please email [email protected] if you need
  17029. // support for higher arities.
  17030. // GTEST_ASSERT_ is the basic statement to which all of the assertions
  17031. // in this file reduce. Don't use this in your code.
  17032. #define GTEST_ASSERT_(expression, on_failure) \
  17033. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  17034. if (const ::testing::AssertionResult gtest_ar = (expression)) \
  17035. ; \
  17036. else \
  17037. on_failure(gtest_ar.failure_message())
  17038. // Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use
  17039. // this in your code.
  17040. template <typename Pred,
  17041. typename T1>
  17042. AssertionResult AssertPred1Helper(const char* pred_text,
  17043. const char* e1,
  17044. Pred pred,
  17045. const T1& v1) {
  17046. if (pred(v1)) return AssertionSuccess();
  17047. return AssertionFailure() << pred_text << "("
  17048. << e1 << ") evaluates to false, where"
  17049. << "\n" << e1 << " evaluates to " << v1;
  17050. }
  17051. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
  17052. // Don't use this in your code.
  17053. #define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
  17054. GTEST_ASSERT_(pred_format(#v1, v1),\
  17055. on_failure)
  17056. // Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use
  17057. // this in your code.
  17058. #define GTEST_PRED1_(pred, v1, on_failure)\
  17059. GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
  17060. #v1, \
  17061. pred, \
  17062. v1), on_failure)
  17063. // Unary predicate assertion macros.
  17064. #define EXPECT_PRED_FORMAT1(pred_format, v1) \
  17065. GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
  17066. #define EXPECT_PRED1(pred, v1) \
  17067. GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
  17068. #define ASSERT_PRED_FORMAT1(pred_format, v1) \
  17069. GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
  17070. #define ASSERT_PRED1(pred, v1) \
  17071. GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
  17072. // Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use
  17073. // this in your code.
  17074. template <typename Pred,
  17075. typename T1,
  17076. typename T2>
  17077. AssertionResult AssertPred2Helper(const char* pred_text,
  17078. const char* e1,
  17079. const char* e2,
  17080. Pred pred,
  17081. const T1& v1,
  17082. const T2& v2) {
  17083. if (pred(v1, v2)) return AssertionSuccess();
  17084. return AssertionFailure() << pred_text << "("
  17085. << e1 << ", "
  17086. << e2 << ") evaluates to false, where"
  17087. << "\n" << e1 << " evaluates to " << v1
  17088. << "\n" << e2 << " evaluates to " << v2;
  17089. }
  17090. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
  17091. // Don't use this in your code.
  17092. #define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
  17093. GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2),\
  17094. on_failure)
  17095. // Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use
  17096. // this in your code.
  17097. #define GTEST_PRED2_(pred, v1, v2, on_failure)\
  17098. GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
  17099. #v1, \
  17100. #v2, \
  17101. pred, \
  17102. v1, \
  17103. v2), on_failure)
  17104. // Binary predicate assertion macros.
  17105. #define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
  17106. GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
  17107. #define EXPECT_PRED2(pred, v1, v2) \
  17108. GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
  17109. #define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
  17110. GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
  17111. #define ASSERT_PRED2(pred, v1, v2) \
  17112. GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
  17113. // Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use
  17114. // this in your code.
  17115. template <typename Pred,
  17116. typename T1,
  17117. typename T2,
  17118. typename T3>
  17119. AssertionResult AssertPred3Helper(const char* pred_text,
  17120. const char* e1,
  17121. const char* e2,
  17122. const char* e3,
  17123. Pred pred,
  17124. const T1& v1,
  17125. const T2& v2,
  17126. const T3& v3) {
  17127. if (pred(v1, v2, v3)) return AssertionSuccess();
  17128. return AssertionFailure() << pred_text << "("
  17129. << e1 << ", "
  17130. << e2 << ", "
  17131. << e3 << ") evaluates to false, where"
  17132. << "\n" << e1 << " evaluates to " << v1
  17133. << "\n" << e2 << " evaluates to " << v2
  17134. << "\n" << e3 << " evaluates to " << v3;
  17135. }
  17136. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
  17137. // Don't use this in your code.
  17138. #define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
  17139. GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3),\
  17140. on_failure)
  17141. // Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use
  17142. // this in your code.
  17143. #define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
  17144. GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
  17145. #v1, \
  17146. #v2, \
  17147. #v3, \
  17148. pred, \
  17149. v1, \
  17150. v2, \
  17151. v3), on_failure)
  17152. // Ternary predicate assertion macros.
  17153. #define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
  17154. GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
  17155. #define EXPECT_PRED3(pred, v1, v2, v3) \
  17156. GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
  17157. #define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
  17158. GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
  17159. #define ASSERT_PRED3(pred, v1, v2, v3) \
  17160. GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
  17161. // Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use
  17162. // this in your code.
  17163. template <typename Pred,
  17164. typename T1,
  17165. typename T2,
  17166. typename T3,
  17167. typename T4>
  17168. AssertionResult AssertPred4Helper(const char* pred_text,
  17169. const char* e1,
  17170. const char* e2,
  17171. const char* e3,
  17172. const char* e4,
  17173. Pred pred,
  17174. const T1& v1,
  17175. const T2& v2,
  17176. const T3& v3,
  17177. const T4& v4) {
  17178. if (pred(v1, v2, v3, v4)) return AssertionSuccess();
  17179. return AssertionFailure() << pred_text << "("
  17180. << e1 << ", "
  17181. << e2 << ", "
  17182. << e3 << ", "
  17183. << e4 << ") evaluates to false, where"
  17184. << "\n" << e1 << " evaluates to " << v1
  17185. << "\n" << e2 << " evaluates to " << v2
  17186. << "\n" << e3 << " evaluates to " << v3
  17187. << "\n" << e4 << " evaluates to " << v4;
  17188. }
  17189. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
  17190. // Don't use this in your code.
  17191. #define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
  17192. GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4),\
  17193. on_failure)
  17194. // Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use
  17195. // this in your code.
  17196. #define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
  17197. GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
  17198. #v1, \
  17199. #v2, \
  17200. #v3, \
  17201. #v4, \
  17202. pred, \
  17203. v1, \
  17204. v2, \
  17205. v3, \
  17206. v4), on_failure)
  17207. // 4-ary predicate assertion macros.
  17208. #define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
  17209. GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
  17210. #define EXPECT_PRED4(pred, v1, v2, v3, v4) \
  17211. GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
  17212. #define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
  17213. GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
  17214. #define ASSERT_PRED4(pred, v1, v2, v3, v4) \
  17215. GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
  17216. // Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use
  17217. // this in your code.
  17218. template <typename Pred,
  17219. typename T1,
  17220. typename T2,
  17221. typename T3,
  17222. typename T4,
  17223. typename T5>
  17224. AssertionResult AssertPred5Helper(const char* pred_text,
  17225. const char* e1,
  17226. const char* e2,
  17227. const char* e3,
  17228. const char* e4,
  17229. const char* e5,
  17230. Pred pred,
  17231. const T1& v1,
  17232. const T2& v2,
  17233. const T3& v3,
  17234. const T4& v4,
  17235. const T5& v5) {
  17236. if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
  17237. return AssertionFailure() << pred_text << "("
  17238. << e1 << ", "
  17239. << e2 << ", "
  17240. << e3 << ", "
  17241. << e4 << ", "
  17242. << e5 << ") evaluates to false, where"
  17243. << "\n" << e1 << " evaluates to " << v1
  17244. << "\n" << e2 << " evaluates to " << v2
  17245. << "\n" << e3 << " evaluates to " << v3
  17246. << "\n" << e4 << " evaluates to " << v4
  17247. << "\n" << e5 << " evaluates to " << v5;
  17248. }
  17249. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
  17250. // Don't use this in your code.
  17251. #define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
  17252. GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5),\
  17253. on_failure)
  17254. // Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use
  17255. // this in your code.
  17256. #define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
  17257. GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
  17258. #v1, \
  17259. #v2, \
  17260. #v3, \
  17261. #v4, \
  17262. #v5, \
  17263. pred, \
  17264. v1, \
  17265. v2, \
  17266. v3, \
  17267. v4, \
  17268. v5), on_failure)
  17269. // 5-ary predicate assertion macros.
  17270. #define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
  17271. GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
  17272. #define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
  17273. GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
  17274. #define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
  17275. GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
  17276. #define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
  17277. GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
  17278. #endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
  17279. // Macros for testing equalities and inequalities.
  17280. //
  17281. // * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual
  17282. // * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
  17283. // * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2
  17284. // * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2
  17285. // * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2
  17286. // * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2
  17287. //
  17288. // When they are not, Google Test prints both the tested expressions and
  17289. // their actual values. The values must be compatible built-in types,
  17290. // or you will get a compiler error. By "compatible" we mean that the
  17291. // values can be compared by the respective operator.
  17292. //
  17293. // Note:
  17294. //
  17295. // 1. It is possible to make a user-defined type work with
  17296. // {ASSERT|EXPECT}_??(), but that requires overloading the
  17297. // comparison operators and is thus discouraged by the Google C++
  17298. // Usage Guide. Therefore, you are advised to use the
  17299. // {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
  17300. // equal.
  17301. //
  17302. // 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
  17303. // pointers (in particular, C strings). Therefore, if you use it
  17304. // with two C strings, you are testing how their locations in memory
  17305. // are related, not how their content is related. To compare two C
  17306. // strings by content, use {ASSERT|EXPECT}_STR*().
  17307. //
  17308. // 3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to
  17309. // {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you
  17310. // what the actual value is when it fails, and similarly for the
  17311. // other comparisons.
  17312. //
  17313. // 4. Do not depend on the order in which {ASSERT|EXPECT}_??()
  17314. // evaluate their arguments, which is undefined.
  17315. //
  17316. // 5. These macros evaluate their arguments exactly once.
  17317. //
  17318. // Examples:
  17319. //
  17320. // EXPECT_NE(5, Foo());
  17321. // EXPECT_EQ(NULL, a_pointer);
  17322. // ASSERT_LT(i, array_size);
  17323. // ASSERT_GT(records.size(), 0) << "There is no record left.";
  17324. #define EXPECT_EQ(expected, actual) \
  17325. EXPECT_PRED_FORMAT2(::testing::internal:: \
  17326. EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
  17327. expected, actual)
  17328. #define EXPECT_NE(expected, actual) \
  17329. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual)
  17330. #define EXPECT_LE(val1, val2) \
  17331. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
  17332. #define EXPECT_LT(val1, val2) \
  17333. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
  17334. #define EXPECT_GE(val1, val2) \
  17335. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
  17336. #define EXPECT_GT(val1, val2) \
  17337. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
  17338. #define GTEST_ASSERT_EQ(expected, actual) \
  17339. ASSERT_PRED_FORMAT2(::testing::internal:: \
  17340. EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
  17341. expected, actual)
  17342. #define GTEST_ASSERT_NE(val1, val2) \
  17343. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
  17344. #define GTEST_ASSERT_LE(val1, val2) \
  17345. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
  17346. #define GTEST_ASSERT_LT(val1, val2) \
  17347. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
  17348. #define GTEST_ASSERT_GE(val1, val2) \
  17349. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
  17350. #define GTEST_ASSERT_GT(val1, val2) \
  17351. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
  17352. // Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
  17353. // ASSERT_XY(), which clashes with some users' own code.
  17354. #if !GTEST_DONT_DEFINE_ASSERT_EQ
  17355. # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
  17356. #endif
  17357. #if !GTEST_DONT_DEFINE_ASSERT_NE
  17358. # define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
  17359. #endif
  17360. #if !GTEST_DONT_DEFINE_ASSERT_LE
  17361. # define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
  17362. #endif
  17363. #if !GTEST_DONT_DEFINE_ASSERT_LT
  17364. # define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
  17365. #endif
  17366. #if !GTEST_DONT_DEFINE_ASSERT_GE
  17367. # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
  17368. #endif
  17369. #if !GTEST_DONT_DEFINE_ASSERT_GT
  17370. # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
  17371. #endif
  17372. // C String Comparisons. All tests treat NULL and any non-NULL string
  17373. // as different. Two NULLs are equal.
  17374. //
  17375. // * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2
  17376. // * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2
  17377. // * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
  17378. // * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
  17379. //
  17380. // For wide or narrow string objects, you can use the
  17381. // {ASSERT|EXPECT}_??() macros.
  17382. //
  17383. // Don't depend on the order in which the arguments are evaluated,
  17384. // which is undefined.
  17385. //
  17386. // These macros evaluate their arguments exactly once.
  17387. #define EXPECT_STREQ(expected, actual) \
  17388. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
  17389. #define EXPECT_STRNE(s1, s2) \
  17390. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
  17391. #define EXPECT_STRCASEEQ(expected, actual) \
  17392. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
  17393. #define EXPECT_STRCASENE(s1, s2)\
  17394. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
  17395. #define ASSERT_STREQ(expected, actual) \
  17396. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
  17397. #define ASSERT_STRNE(s1, s2) \
  17398. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
  17399. #define ASSERT_STRCASEEQ(expected, actual) \
  17400. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
  17401. #define ASSERT_STRCASENE(s1, s2)\
  17402. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
  17403. // Macros for comparing floating-point numbers.
  17404. //
  17405. // * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual):
  17406. // Tests that two float values are almost equal.
  17407. // * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual):
  17408. // Tests that two double values are almost equal.
  17409. // * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
  17410. // Tests that v1 and v2 are within the given distance to each other.
  17411. //
  17412. // Google Test uses ULP-based comparison to automatically pick a default
  17413. // error bound that is appropriate for the operands. See the
  17414. // FloatingPoint template class in gtest-internal.h if you are
  17415. // interested in the implementation details.
  17416. #define EXPECT_FLOAT_EQ(expected, actual)\
  17417. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
  17418. expected, actual)
  17419. #define EXPECT_DOUBLE_EQ(expected, actual)\
  17420. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
  17421. expected, actual)
  17422. #define ASSERT_FLOAT_EQ(expected, actual)\
  17423. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
  17424. expected, actual)
  17425. #define ASSERT_DOUBLE_EQ(expected, actual)\
  17426. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
  17427. expected, actual)
  17428. #define EXPECT_NEAR(val1, val2, abs_error)\
  17429. EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
  17430. val1, val2, abs_error)
  17431. #define ASSERT_NEAR(val1, val2, abs_error)\
  17432. ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
  17433. val1, val2, abs_error)
  17434. // These predicate format functions work on floating-point values, and
  17435. // can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
  17436. //
  17437. // EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
  17438. // Asserts that val1 is less than, or almost equal to, val2. Fails
  17439. // otherwise. In particular, it fails if either val1 or val2 is NaN.
  17440. GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
  17441. float val1, float val2);
  17442. GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
  17443. double val1, double val2);
  17444. #if GTEST_OS_WINDOWS
  17445. // Macros that test for HRESULT failure and success, these are only useful
  17446. // on Windows, and rely on Windows SDK macros and APIs to compile.
  17447. //
  17448. // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
  17449. //
  17450. // When expr unexpectedly fails or succeeds, Google Test prints the
  17451. // expected result and the actual result with both a human-readable
  17452. // string representation of the error, if available, as well as the
  17453. // hex result code.
  17454. # define EXPECT_HRESULT_SUCCEEDED(expr) \
  17455. EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
  17456. # define ASSERT_HRESULT_SUCCEEDED(expr) \
  17457. ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
  17458. # define EXPECT_HRESULT_FAILED(expr) \
  17459. EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
  17460. # define ASSERT_HRESULT_FAILED(expr) \
  17461. ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
  17462. #endif // GTEST_OS_WINDOWS
  17463. // Macros that execute statement and check that it doesn't generate new fatal
  17464. // failures in the current thread.
  17465. //
  17466. // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
  17467. //
  17468. // Examples:
  17469. //
  17470. // EXPECT_NO_FATAL_FAILURE(Process());
  17471. // ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
  17472. //
  17473. #define ASSERT_NO_FATAL_FAILURE(statement) \
  17474. GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
  17475. #define EXPECT_NO_FATAL_FAILURE(statement) \
  17476. GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
  17477. // Causes a trace (including the source file path, the current line
  17478. // number, and the given message) to be included in every test failure
  17479. // message generated by code in the current scope. The effect is
  17480. // undone when the control leaves the current scope.
  17481. //
  17482. // The message argument can be anything streamable to std::ostream.
  17483. //
  17484. // In the implementation, we include the current line number as part
  17485. // of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
  17486. // to appear in the same block - as long as they are on different
  17487. // lines.
  17488. #define SCOPED_TRACE(message) \
  17489. ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
  17490. __FILE__, __LINE__, ::testing::Message() << (message))
  17491. // Compile-time assertion for type equality.
  17492. // StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
  17493. // the same type. The value it returns is not interesting.
  17494. //
  17495. // Instead of making StaticAssertTypeEq a class template, we make it a
  17496. // function template that invokes a helper class template. This
  17497. // prevents a user from misusing StaticAssertTypeEq<T1, T2> by
  17498. // defining objects of that type.
  17499. //
  17500. // CAVEAT:
  17501. //
  17502. // When used inside a method of a class template,
  17503. // StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
  17504. // instantiated. For example, given:
  17505. //
  17506. // template <typename T> class Foo {
  17507. // public:
  17508. // void Bar() { testing::StaticAssertTypeEq<int, T>(); }
  17509. // };
  17510. //
  17511. // the code:
  17512. //
  17513. // void Test1() { Foo<bool> foo; }
  17514. //
  17515. // will NOT generate a compiler error, as Foo<bool>::Bar() is never
  17516. // actually instantiated. Instead, you need:
  17517. //
  17518. // void Test2() { Foo<bool> foo; foo.Bar(); }
  17519. //
  17520. // to cause a compiler error.
  17521. template <typename T1, typename T2>
  17522. bool StaticAssertTypeEq() {
  17523. (void)internal::StaticAssertTypeEqHelper<T1, T2>();
  17524. return true;
  17525. }
  17526. // Defines a test.
  17527. //
  17528. // The first parameter is the name of the test case, and the second
  17529. // parameter is the name of the test within the test case.
  17530. //
  17531. // The convention is to end the test case name with "Test". For
  17532. // example, a test case for the Foo class can be named FooTest.
  17533. //
  17534. // The user should put his test code between braces after using this
  17535. // macro. Example:
  17536. //
  17537. // TEST(FooTest, InitializesCorrectly) {
  17538. // Foo foo;
  17539. // EXPECT_TRUE(foo.StatusIsOK());
  17540. // }
  17541. // Note that we call GetTestTypeId() instead of GetTypeId<
  17542. // ::testing::Test>() here to get the type ID of testing::Test. This
  17543. // is to work around a suspected linker bug when using Google Test as
  17544. // a framework on Mac OS X. The bug causes GetTypeId<
  17545. // ::testing::Test>() to return different values depending on whether
  17546. // the call is from the Google Test framework itself or from user test
  17547. // code. GetTestTypeId() is guaranteed to always return the same
  17548. // value, as it always calls GetTypeId<>() from the Google Test
  17549. // framework.
  17550. #define GTEST_TEST(test_case_name, test_name)\
  17551. GTEST_TEST_(test_case_name, test_name, \
  17552. ::testing::Test, ::testing::internal::GetTestTypeId())
  17553. // Define this macro to 1 to omit the definition of TEST(), which
  17554. // is a generic name and clashes with some other libraries.
  17555. #if !GTEST_DONT_DEFINE_TEST
  17556. # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
  17557. #endif
  17558. // Defines a test that uses a test fixture.
  17559. //
  17560. // The first parameter is the name of the test fixture class, which
  17561. // also doubles as the test case name. The second parameter is the
  17562. // name of the test within the test case.
  17563. //
  17564. // A test fixture class must be declared earlier. The user should put
  17565. // his test code between braces after using this macro. Example:
  17566. //
  17567. // class FooTest : public testing::Test {
  17568. // protected:
  17569. // virtual void SetUp() { b_.AddElement(3); }
  17570. //
  17571. // Foo a_;
  17572. // Foo b_;
  17573. // };
  17574. //
  17575. // TEST_F(FooTest, InitializesCorrectly) {
  17576. // EXPECT_TRUE(a_.StatusIsOK());
  17577. // }
  17578. //
  17579. // TEST_F(FooTest, ReturnsElementCountCorrectly) {
  17580. // EXPECT_EQ(0, a_.size());
  17581. // EXPECT_EQ(1, b_.size());
  17582. // }
  17583. #define TEST_F(test_fixture, test_name)\
  17584. GTEST_TEST_(test_fixture, test_name, test_fixture, \
  17585. ::testing::internal::GetTypeId<test_fixture>())
  17586. // Use this macro in main() to run all tests. It returns 0 if all
  17587. // tests are successful, or 1 otherwise.
  17588. //
  17589. // RUN_ALL_TESTS() should be invoked after the command line has been
  17590. // parsed by InitGoogleTest().
  17591. #define RUN_ALL_TESTS()\
  17592. (::testing::UnitTest::GetInstance()->Run())
  17593. } // namespace testing
  17594. #if defined(_MSC_VER)
  17595. #pragma warning( pop )
  17596. #endif
  17597. #endif // GTEST_INCLUDE_GTEST_GTEST_H_