gtest.h 784 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570
  1. // Copyright 2005, Google Inc.
  2. // All rights reserved.
  3. //
  4. // Redistribution and use in source and binary forms, with or without
  5. // modification, are permitted provided that the following conditions are
  6. // met:
  7. //
  8. // * Redistributions of source code must retain the above copyright
  9. // notice, this list of conditions and the following disclaimer.
  10. // * Redistributions in binary form must reproduce the above
  11. // copyright notice, this list of conditions and the following disclaimer
  12. // in the documentation and/or other materials provided with the
  13. // distribution.
  14. // * Neither the name of Google Inc. nor the names of its
  15. // contributors may be used to endorse or promote products derived from
  16. // this software without specific prior written permission.
  17. //
  18. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  22. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  23. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  24. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  25. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  26. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  28. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. //
  30. // Author: wan@google.com (Zhanyong Wan)
  31. //
  32. // The Google C++ Testing Framework (Google Test)
  33. //
  34. // This header file defines the public API for Google Test. It should be
  35. // included by any test program that uses Google Test.
  36. //
  37. // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
  38. // leave some internal implementation details in this header file.
  39. // They are clearly marked by comments like this:
  40. //
  41. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  42. //
  43. // Such code is NOT meant to be used by a user directly, and is subject
  44. // to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
  45. // program!
  46. //
  47. // Acknowledgment: Google Test borrowed the idea of automatic test
  48. // registration from Barthelemy Dagenais' (barthelemy@prologique.com)
  49. // easyUnit framework.
  50. #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
  51. #define GTEST_INCLUDE_GTEST_GTEST_H_
  52. #include <limits>
  53. #include <vector>
  54. #if defined(_MSC_VER)
  55. #pragma warning(push)
  56. #pragma warning(disable : 4996)
  57. #endif
  58. #if __clang__
  59. #pragma clang diagnostic push
  60. #pragma clang diagnostic ignored "-Wsign-compare"
  61. #elif __GNUC__
  62. #pragma gcc diagnostic push
  63. #pragma gcc diagnostic ignored "-Wsign-compare"
  64. #endif
  65. // Copyright 2005, Google Inc.
  66. // All rights reserved.
  67. //
  68. // Redistribution and use in source and binary forms, with or without
  69. // modification, are permitted provided that the following conditions are
  70. // met:
  71. //
  72. // * Redistributions of source code must retain the above copyright
  73. // notice, this list of conditions and the following disclaimer.
  74. // * Redistributions in binary form must reproduce the above
  75. // copyright notice, this list of conditions and the following disclaimer
  76. // in the documentation and/or other materials provided with the
  77. // distribution.
  78. // * Neither the name of Google Inc. nor the names of its
  79. // contributors may be used to endorse or promote products derived from
  80. // this software without specific prior written permission.
  81. //
  82. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  83. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  84. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  85. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  86. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  87. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  88. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  89. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  90. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  91. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  92. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  93. //
  94. // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
  95. //
  96. // The Google C++ Testing Framework (Google Test)
  97. //
  98. // This header file declares functions and macros used internally by
  99. // Google Test. They are subject to change without notice.
  100. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
  101. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
  102. // Copyright 2005, Google Inc.
  103. // All rights reserved.
  104. //
  105. // Redistribution and use in source and binary forms, with or without
  106. // modification, are permitted provided that the following conditions are
  107. // met:
  108. //
  109. // * Redistributions of source code must retain the above copyright
  110. // notice, this list of conditions and the following disclaimer.
  111. // * Redistributions in binary form must reproduce the above
  112. // copyright notice, this list of conditions and the following disclaimer
  113. // in the documentation and/or other materials provided with the
  114. // distribution.
  115. // * Neither the name of Google Inc. nor the names of its
  116. // contributors may be used to endorse or promote products derived from
  117. // this software without specific prior written permission.
  118. //
  119. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  120. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  121. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  122. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  123. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  124. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  125. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  126. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  127. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  128. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  129. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  130. //
  131. // Authors: wan@google.com (Zhanyong Wan)
  132. //
  133. // Low-level types and utilities for porting Google Test to various
  134. // platforms. They are subject to change without notice. DO NOT USE
  135. // THEM IN USER CODE.
  136. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
  137. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
  138. // The user can define the following macros in the build script to
  139. // control Google Test's behavior. If the user doesn't define a macro
  140. // in this list, Google Test will define it.
  141. //
  142. // GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2)
  143. // is/isn't available.
  144. // GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions
  145. // are enabled.
  146. // GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string
  147. // is/isn't available (some systems define
  148. // ::string, which is different to std::string).
  149. // GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
  150. // is/isn't available (some systems define
  151. // ::wstring, which is different to std::wstring).
  152. // GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular
  153. // expressions are/aren't available.
  154. // GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that <pthread.h>
  155. // is/isn't available.
  156. // GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't
  157. // enabled.
  158. // GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that
  159. // std::wstring does/doesn't work (Google Test can
  160. // be used where std::wstring is unavailable).
  161. // GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple
  162. // is/isn't available.
  163. // GTEST_HAS_SEH - Define it to 1/0 to indicate whether the
  164. // compiler supports Microsoft's "Structured
  165. // Exception Handling".
  166. // GTEST_HAS_STREAM_REDIRECTION
  167. // - Define it to 1/0 to indicate whether the
  168. // platform supports I/O stream redirection using
  169. // dup() and dup2().
  170. // GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google
  171. // Test's own tr1 tuple implementation should be
  172. // used. Unused when the user sets
  173. // GTEST_HAS_TR1_TUPLE to 0.
  174. // GTEST_LINKED_AS_SHARED_LIBRARY
  175. // - Define to 1 when compiling tests that use
  176. // Google Test as a shared library (known as
  177. // DLL on Windows).
  178. // GTEST_CREATE_SHARED_LIBRARY
  179. // - Define to 1 when compiling Google Test itself
  180. // as a shared library.
  181. // This header defines the following utilities:
  182. //
  183. // Macros indicating the current platform (defined to 1 if compiled on
  184. // the given platform; otherwise undefined):
  185. // GTEST_OS_AIX - IBM AIX
  186. // GTEST_OS_CYGWIN - Cygwin
  187. // GTEST_OS_HPUX - HP-UX
  188. // GTEST_OS_LINUX - Linux
  189. // GTEST_OS_LINUX_ANDROID - Google Android
  190. // GTEST_OS_MAC - Mac OS X
  191. // GTEST_OS_NACL - Google Native Client (NaCl)
  192. // GTEST_OS_SOLARIS - Sun Solaris
  193. // GTEST_OS_SYMBIAN - Symbian
  194. // GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile)
  195. // GTEST_OS_WINDOWS_DESKTOP - Windows Desktop
  196. // GTEST_OS_WINDOWS_MINGW - MinGW
  197. // GTEST_OS_WINDOWS_MOBILE - Windows Mobile
  198. // GTEST_OS_ZOS - z/OS
  199. //
  200. // Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
  201. // most stable support. Since core members of the Google Test project
  202. // don't have access to other platforms, support for them may be less
  203. // stable. If you notice any problems on your platform, please notify
  204. // googletestframework@googlegroups.com (patches for fixing them are
  205. // even more welcome!).
  206. //
  207. // Note that it is possible that none of the GTEST_OS_* macros are defined.
  208. //
  209. // Macros indicating available Google Test features (defined to 1 if
  210. // the corresponding feature is supported; otherwise undefined):
  211. // GTEST_HAS_COMBINE - the Combine() function (for value-parameterized
  212. // tests)
  213. // GTEST_HAS_DEATH_TEST - death tests
  214. // GTEST_HAS_PARAM_TEST - value-parameterized tests
  215. // GTEST_HAS_TYPED_TEST - typed tests
  216. // GTEST_HAS_TYPED_TEST_P - type-parameterized tests
  217. // GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with
  218. // GTEST_HAS_POSIX_RE (see above) which users can
  219. // define themselves.
  220. // GTEST_USES_SIMPLE_RE - our own simple regex is used;
  221. // the above two are mutually exclusive.
  222. // GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
  223. //
  224. // Macros for basic C++ coding:
  225. // GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
  226. // GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a
  227. // variable don't have to be used.
  228. // GTEST_DISALLOW_ASSIGN_ - disables operator=.
  229. // GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
  230. // GTEST_MUST_USE_RESULT_ - declares that a function's result must be used.
  231. //
  232. // Synchronization:
  233. // Mutex, MutexLock, ThreadLocal, GetThreadCount()
  234. // - synchronization primitives.
  235. // GTEST_IS_THREADSAFE - defined to 1 to indicate that the above
  236. // synchronization primitives have real implementations
  237. // and Google Test is thread-safe; or 0 otherwise.
  238. //
  239. // Template meta programming:
  240. // is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only.
  241. // IteratorTraits - partial implementation of std::iterator_traits, which
  242. // is not available in libCstd when compiled with Sun C++.
  243. //
  244. // Smart pointers:
  245. // scoped_ptr - as in TR2.
  246. //
  247. // Regular expressions:
  248. // RE - a simple regular expression class using the POSIX
  249. // Extended Regular Expression syntax on UNIX-like
  250. // platforms, or a reduced regular exception syntax on
  251. // other platforms, including Windows.
  252. //
  253. // Logging:
  254. // GTEST_LOG_() - logs messages at the specified severity level.
  255. // LogToStderr() - directs all log messages to stderr.
  256. // FlushInfoLog() - flushes informational log messages.
  257. //
  258. // Stdout and stderr capturing:
  259. // CaptureStdout() - starts capturing stdout.
  260. // GetCapturedStdout() - stops capturing stdout and returns the captured
  261. // string.
  262. // CaptureStderr() - starts capturing stderr.
  263. // GetCapturedStderr() - stops capturing stderr and returns the captured
  264. // string.
  265. //
  266. // Integer types:
  267. // TypeWithSize - maps an integer to a int type.
  268. // Int32, UInt32, Int64, UInt64, TimeInMillis
  269. // - integers of known sizes.
  270. // BiggestInt - the biggest signed integer type.
  271. //
  272. // Command-line utilities:
  273. // GTEST_FLAG() - references a flag.
  274. // GTEST_DECLARE_*() - declares a flag.
  275. // GTEST_DEFINE_*() - defines a flag.
  276. // GetArgvs() - returns the command line as a vector of strings.
  277. //
  278. // Environment variable utilities:
  279. // GetEnv() - gets the value of an environment variable.
  280. // BoolFromGTestEnv() - parses a bool environment variable.
  281. // Int32FromGTestEnv() - parses an Int32 environment variable.
  282. // StringFromGTestEnv() - parses a string environment variable.
  283. #include <ctype.h> // for isspace, etc
  284. #include <stddef.h> // for ptrdiff_t
  285. #include <stdlib.h>
  286. #include <stdio.h>
  287. #include <string.h>
  288. #ifndef _WIN32_WCE
  289. # include <sys/types.h>
  290. # include <sys/stat.h>
  291. #endif // !_WIN32_WCE
  292. #include <iostream> // NOLINT
  293. #include <sstream> // NOLINT
  294. #include <string> // NOLINT
  295. #define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
  296. #define GTEST_FLAG_PREFIX_ "gtest_"
  297. #define GTEST_FLAG_PREFIX_DASH_ "gtest-"
  298. #define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
  299. #define GTEST_NAME_ "Google Test"
  300. #define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/"
  301. // Determines the version of gcc that is used to compile this.
  302. #ifdef __GNUC__
  303. // 40302 means version 4.3.2.
  304. # define GTEST_GCC_VER_ \
  305. (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
  306. #endif // __GNUC__
  307. // Determines the platform on which Google Test is compiled.
  308. #ifdef __CYGWIN__
  309. # define GTEST_OS_CYGWIN 1
  310. #elif defined __SYMBIAN32__
  311. # define GTEST_OS_SYMBIAN 1
  312. #elif defined _WIN32
  313. # define GTEST_OS_WINDOWS 1
  314. # ifdef _WIN32_WCE
  315. # define GTEST_OS_WINDOWS_MOBILE 1
  316. # elif defined(__MINGW__) || defined(__MINGW32__)
  317. # define GTEST_OS_WINDOWS_MINGW 1
  318. # else
  319. # define GTEST_OS_WINDOWS_DESKTOP 1
  320. # endif // _WIN32_WCE
  321. #elif defined __APPLE__
  322. # define GTEST_OS_MAC 1
  323. #elif defined __linux__
  324. # define GTEST_OS_LINUX 1
  325. # ifdef ANDROID
  326. # define GTEST_OS_LINUX_ANDROID 1
  327. # endif // ANDROID
  328. #elif defined __MVS__
  329. # define GTEST_OS_ZOS 1
  330. #elif defined(__sun) && defined(__SVR4)
  331. # define GTEST_OS_SOLARIS 1
  332. #elif defined(_AIX)
  333. # define GTEST_OS_AIX 1
  334. #elif defined(__hpux)
  335. # define GTEST_OS_HPUX 1
  336. #elif defined __native_client__
  337. # define GTEST_OS_NACL 1
  338. #endif // __CYGWIN__
  339. // Brings in definitions for functions used in the testing::internal::posix
  340. // namespace (read, write, close, chdir, isatty, stat). We do not currently
  341. // use them on Windows Mobile.
  342. #if !GTEST_OS_WINDOWS
  343. // This assumes that non-Windows OSes provide unistd.h. For OSes where this
  344. // is not the case, we need to include headers that provide the functions
  345. // mentioned above.
  346. # include <unistd.h>
  347. # if !GTEST_OS_NACL
  348. // TODO(vladl@google.com): Remove this condition when Native Client SDK adds
  349. // strings.h (tracked in
  350. // http://code.google.com/p/nativeclient/issues/detail?id=1175).
  351. # include <strings.h> // Native Client doesn't provide strings.h.
  352. # endif
  353. #elif !GTEST_OS_WINDOWS_MOBILE
  354. # include <direct.h>
  355. # include <io.h>
  356. #endif
  357. // Defines this to true iff Google Test can use POSIX regular expressions.
  358. #ifndef GTEST_HAS_POSIX_RE
  359. # define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)
  360. #endif
  361. #if GTEST_HAS_POSIX_RE
  362. // On some platforms, <regex.h> needs someone to define size_t, and
  363. // won't compile otherwise. We can #include it here as we already
  364. // included <stdlib.h>, which is guaranteed to define size_t through
  365. // <stddef.h>.
  366. # include <regex.h> // NOLINT
  367. # define GTEST_USES_POSIX_RE 1
  368. #elif GTEST_OS_WINDOWS
  369. // <regex.h> is not available on Windows. Use our own simple regex
  370. // implementation instead.
  371. # define GTEST_USES_SIMPLE_RE 1
  372. #else
  373. // <regex.h> may not be available on this platform. Use our own
  374. // simple regex implementation instead.
  375. # define GTEST_USES_SIMPLE_RE 1
  376. #endif // GTEST_HAS_POSIX_RE
  377. #ifndef GTEST_HAS_EXCEPTIONS
  378. // The user didn't tell us whether exceptions are enabled, so we need
  379. // to figure it out.
  380. # if defined(_MSC_VER) || defined(__BORLANDC__)
  381. // MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS
  382. // macro to enable exceptions, so we'll do the same.
  383. // Assumes that exceptions are enabled by default.
  384. # ifndef _HAS_EXCEPTIONS
  385. # define _HAS_EXCEPTIONS 1
  386. # endif // _HAS_EXCEPTIONS
  387. # define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
  388. # elif defined(__GNUC__) && __EXCEPTIONS
  389. // gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
  390. # define GTEST_HAS_EXCEPTIONS 1
  391. # elif defined(__SUNPRO_CC)
  392. // Sun Pro CC supports exceptions. However, there is no compile-time way of
  393. // detecting whether they are enabled or not. Therefore, we assume that
  394. // they are enabled unless the user tells us otherwise.
  395. # define GTEST_HAS_EXCEPTIONS 1
  396. # elif defined(__IBMCPP__) && __EXCEPTIONS
  397. // xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
  398. # define GTEST_HAS_EXCEPTIONS 1
  399. # elif defined(__HP_aCC)
  400. // Exception handling is in effect by default in HP aCC compiler. It has to
  401. // be turned of by +noeh compiler option if desired.
  402. # define GTEST_HAS_EXCEPTIONS 1
  403. # else
  404. // For other compilers, we assume exceptions are disabled to be
  405. // conservative.
  406. # define GTEST_HAS_EXCEPTIONS 0
  407. # endif // defined(_MSC_VER) || defined(__BORLANDC__)
  408. #endif // GTEST_HAS_EXCEPTIONS
  409. #if !defined(GTEST_HAS_STD_STRING)
  410. // Even though we don't use this macro any longer, we keep it in case
  411. // some clients still depend on it.
  412. # define GTEST_HAS_STD_STRING 1
  413. #elif !GTEST_HAS_STD_STRING
  414. // The user told us that ::std::string isn't available.
  415. # error "Google Test cannot be used where ::std::string isn't available."
  416. #endif // !defined(GTEST_HAS_STD_STRING)
  417. #ifndef GTEST_HAS_GLOBAL_STRING
  418. // The user didn't tell us whether ::string is available, so we need
  419. // to figure it out.
  420. # define GTEST_HAS_GLOBAL_STRING 0
  421. #endif // GTEST_HAS_GLOBAL_STRING
  422. #ifndef GTEST_HAS_STD_WSTRING
  423. // The user didn't tell us whether ::std::wstring is available, so we need
  424. // to figure it out.
  425. // TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
  426. // is available.
  427. // Cygwin 1.7 and below doesn't support ::std::wstring.
  428. // Solaris' libc++ doesn't support it either. Android has
  429. // no support for it at least as recent as Froyo (2.2).
  430. # define GTEST_HAS_STD_WSTRING \
  431. (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
  432. #endif // GTEST_HAS_STD_WSTRING
  433. #ifndef GTEST_HAS_GLOBAL_WSTRING
  434. // The user didn't tell us whether ::wstring is available, so we need
  435. // to figure it out.
  436. # define GTEST_HAS_GLOBAL_WSTRING \
  437. (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
  438. #endif // GTEST_HAS_GLOBAL_WSTRING
  439. // Determines whether RTTI is available.
  440. #ifndef GTEST_HAS_RTTI
  441. // The user didn't tell us whether RTTI is enabled, so we need to
  442. // figure it out.
  443. # ifdef _MSC_VER
  444. # ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled.
  445. # define GTEST_HAS_RTTI 1
  446. # else
  447. # define GTEST_HAS_RTTI 0
  448. # endif
  449. // Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
  450. # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
  451. # ifdef __GXX_RTTI
  452. # define GTEST_HAS_RTTI 1
  453. # else
  454. # define GTEST_HAS_RTTI 0
  455. # endif // __GXX_RTTI
  456. // Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
  457. // both the typeid and dynamic_cast features are present.
  458. # elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
  459. # ifdef __RTTI_ALL__
  460. # define GTEST_HAS_RTTI 1
  461. # else
  462. # define GTEST_HAS_RTTI 0
  463. # endif
  464. # else
  465. // For all other compilers, we assume RTTI is enabled.
  466. # define GTEST_HAS_RTTI 1
  467. # endif // _MSC_VER
  468. #endif // GTEST_HAS_RTTI
  469. // It's this header's responsibility to #include <typeinfo> when RTTI
  470. // is enabled.
  471. #if GTEST_HAS_RTTI
  472. # include <typeinfo>
  473. #endif
  474. // Determines whether Google Test can use the pthreads library.
  475. #ifndef GTEST_HAS_PTHREAD
  476. // The user didn't tell us explicitly, so we assume pthreads support is
  477. // available on Linux and Mac.
  478. //
  479. // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
  480. // to your compiler flags.
  481. # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX)
  482. #endif // GTEST_HAS_PTHREAD
  483. #if GTEST_HAS_PTHREAD
  484. // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
  485. // true.
  486. # include <pthread.h> // NOLINT
  487. // For timespec and nanosleep, used below.
  488. # include <time.h> // NOLINT
  489. #endif
  490. // Determines whether Google Test can use tr1/tuple. You can define
  491. // this macro to 0 to prevent Google Test from using tuple (any
  492. // feature depending on tuple with be disabled in this mode).
  493. #ifndef GTEST_HAS_TR1_TUPLE
  494. // The user didn't tell us not to do it, so we assume it's OK.
  495. # define GTEST_HAS_TR1_TUPLE 1
  496. #endif // GTEST_HAS_TR1_TUPLE
  497. // Determines whether Google Test's own tr1 tuple implementation
  498. // should be used.
  499. #ifndef GTEST_USE_OWN_TR1_TUPLE
  500. // The user didn't tell us, so we need to figure it out.
  501. // We use our own TR1 tuple if we aren't sure the user has an
  502. // implementation of it already. At this time, GCC 4.0.0+ and MSVC
  503. // 2010 are the only mainstream compilers that come with a TR1 tuple
  504. // implementation. NVIDIA's CUDA NVCC compiler pretends to be GCC by
  505. // defining __GNUC__ and friends, but cannot compile GCC's tuple
  506. // implementation. MSVC 2008 (9.0) provides TR1 tuple in a 323 MB
  507. // Feature Pack download, which we cannot assume the user has.
  508. # if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000)) \
  509. || _MSC_VER >= 1600
  510. # define GTEST_USE_OWN_TR1_TUPLE 0
  511. # else
  512. # define GTEST_USE_OWN_TR1_TUPLE 1
  513. # endif
  514. #endif // GTEST_USE_OWN_TR1_TUPLE
  515. // To avoid conditional compilation everywhere, we make it
  516. // gtest-port.h's responsibility to #include the header implementing
  517. // tr1/tuple.
  518. #if GTEST_HAS_TR1_TUPLE
  519. # if GTEST_USE_OWN_TR1_TUPLE
  520. // This file was GENERATED by a script. DO NOT EDIT BY HAND!!!
  521. // Copyright 2009 Google Inc.
  522. // All Rights Reserved.
  523. //
  524. // Redistribution and use in source and binary forms, with or without
  525. // modification, are permitted provided that the following conditions are
  526. // met:
  527. //
  528. // * Redistributions of source code must retain the above copyright
  529. // notice, this list of conditions and the following disclaimer.
  530. // * Redistributions in binary form must reproduce the above
  531. // copyright notice, this list of conditions and the following disclaimer
  532. // in the documentation and/or other materials provided with the
  533. // distribution.
  534. // * Neither the name of Google Inc. nor the names of its
  535. // contributors may be used to endorse or promote products derived from
  536. // this software without specific prior written permission.
  537. //
  538. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  539. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  540. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  541. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  542. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  543. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  544. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  545. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  546. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  547. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  548. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  549. //
  550. // Author: wan@google.com (Zhanyong Wan)
  551. // Implements a subset of TR1 tuple needed by Google Test and Google Mock.
  552. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
  553. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
  554. #include <utility> // For ::std::pair.
  555. // The compiler used in Symbian has a bug that prevents us from declaring the
  556. // tuple template as a friend (it complains that tuple is redefined). This
  557. // hack bypasses the bug by declaring the members that should otherwise be
  558. // private as public.
  559. // Sun Studio versions < 12 also have the above bug.
  560. #if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
  561. # define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
  562. #else
  563. # define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
  564. template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
  565. private:
  566. #endif
  567. // GTEST_n_TUPLE_(T) is the type of an n-tuple.
  568. #define GTEST_0_TUPLE_(T) tuple<>
  569. #define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
  570. void, void, void>
  571. #define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
  572. void, void, void>
  573. #define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
  574. void, void, void>
  575. #define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
  576. void, void, void>
  577. #define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
  578. void, void, void>
  579. #define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
  580. void, void, void>
  581. #define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  582. void, void, void>
  583. #define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  584. T##7, void, void>
  585. #define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  586. T##7, T##8, void>
  587. #define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
  588. T##7, T##8, T##9>
  589. // GTEST_n_TYPENAMES_(T) declares a list of n typenames.
  590. #define GTEST_0_TYPENAMES_(T)
  591. #define GTEST_1_TYPENAMES_(T) typename T##0
  592. #define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
  593. #define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
  594. #define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  595. typename T##3
  596. #define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  597. typename T##3, typename T##4
  598. #define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  599. typename T##3, typename T##4, typename T##5
  600. #define GTEST_7_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. #define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  603. typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
  604. #define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  605. typename T##3, typename T##4, typename T##5, typename T##6, \
  606. typename T##7, typename T##8
  607. #define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
  608. typename T##3, typename T##4, typename T##5, typename T##6, \
  609. typename T##7, typename T##8, typename T##9
  610. // In theory, defining stuff in the ::std namespace is undefined
  611. // behavior. We can do this as we are playing the role of a standard
  612. // library vendor.
  613. namespace std {
  614. namespace tr1 {
  615. template <typename T0 = void, typename T1 = void, typename T2 = void,
  616. typename T3 = void, typename T4 = void, typename T5 = void,
  617. typename T6 = void, typename T7 = void, typename T8 = void,
  618. typename T9 = void>
  619. class tuple;
  620. // Anything in namespace gtest_internal is Google Test's INTERNAL
  621. // IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
  622. namespace gtest_internal {
  623. // ByRef<T>::type is T if T is a reference; otherwise it's const T&.
  624. template <typename T>
  625. struct ByRef { typedef const T& type; }; // NOLINT
  626. template <typename T>
  627. struct ByRef<T&> { typedef T& type; }; // NOLINT
  628. // A handy wrapper for ByRef.
  629. #define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
  630. // AddRef<T>::type is T if T is a reference; otherwise it's T&. This
  631. // is the same as tr1::add_reference<T>::type.
  632. template <typename T>
  633. struct AddRef { typedef T& type; }; // NOLINT
  634. template <typename T>
  635. struct AddRef<T&> { typedef T& type; }; // NOLINT
  636. // A handy wrapper for AddRef.
  637. #define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
  638. // A helper for implementing get<k>().
  639. template <int k> class Get;
  640. // A helper for implementing tuple_element<k, T>. kIndexValid is true
  641. // iff k < the number of fields in tuple type T.
  642. template <bool kIndexValid, int kIndex, class Tuple>
  643. struct TupleElement;
  644. template <GTEST_10_TYPENAMES_(T)>
  645. struct TupleElement<true, 0, GTEST_10_TUPLE_(T)> { typedef T0 type; };
  646. template <GTEST_10_TYPENAMES_(T)>
  647. struct TupleElement<true, 1, GTEST_10_TUPLE_(T)> { typedef T1 type; };
  648. template <GTEST_10_TYPENAMES_(T)>
  649. struct TupleElement<true, 2, GTEST_10_TUPLE_(T)> { typedef T2 type; };
  650. template <GTEST_10_TYPENAMES_(T)>
  651. struct TupleElement<true, 3, GTEST_10_TUPLE_(T)> { typedef T3 type; };
  652. template <GTEST_10_TYPENAMES_(T)>
  653. struct TupleElement<true, 4, GTEST_10_TUPLE_(T)> { typedef T4 type; };
  654. template <GTEST_10_TYPENAMES_(T)>
  655. struct TupleElement<true, 5, GTEST_10_TUPLE_(T)> { typedef T5 type; };
  656. template <GTEST_10_TYPENAMES_(T)>
  657. struct TupleElement<true, 6, GTEST_10_TUPLE_(T)> { typedef T6 type; };
  658. template <GTEST_10_TYPENAMES_(T)>
  659. struct TupleElement<true, 7, GTEST_10_TUPLE_(T)> { typedef T7 type; };
  660. template <GTEST_10_TYPENAMES_(T)>
  661. struct TupleElement<true, 8, GTEST_10_TUPLE_(T)> { typedef T8 type; };
  662. template <GTEST_10_TYPENAMES_(T)>
  663. struct TupleElement<true, 9, GTEST_10_TUPLE_(T)> { typedef T9 type; };
  664. } // namespace gtest_internal
  665. template <>
  666. class tuple<> {
  667. public:
  668. tuple() {}
  669. tuple(const tuple& /* t */) {}
  670. tuple& operator=(const tuple& /* t */) { return *this; }
  671. };
  672. template <GTEST_1_TYPENAMES_(T)>
  673. class GTEST_1_TUPLE_(T) {
  674. public:
  675. template <int k> friend class gtest_internal::Get;
  676. tuple() : f0_() {}
  677. explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
  678. tuple(const tuple& t) : f0_(t.f0_) {}
  679. template <GTEST_1_TYPENAMES_(U)>
  680. tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
  681. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  682. template <GTEST_1_TYPENAMES_(U)>
  683. tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
  684. return CopyFrom(t);
  685. }
  686. GTEST_DECLARE_TUPLE_AS_FRIEND_
  687. template <GTEST_1_TYPENAMES_(U)>
  688. tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
  689. f0_ = t.f0_;
  690. return *this;
  691. }
  692. T0 f0_;
  693. };
  694. template <GTEST_2_TYPENAMES_(T)>
  695. class GTEST_2_TUPLE_(T) {
  696. public:
  697. template <int k> friend class gtest_internal::Get;
  698. tuple() : f0_(), f1_() {}
  699. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
  700. f1_(f1) {}
  701. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
  702. template <GTEST_2_TYPENAMES_(U)>
  703. tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
  704. template <typename U0, typename U1>
  705. tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
  706. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  707. template <GTEST_2_TYPENAMES_(U)>
  708. tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
  709. return CopyFrom(t);
  710. }
  711. template <typename U0, typename U1>
  712. tuple& operator=(const ::std::pair<U0, U1>& p) {
  713. f0_ = p.first;
  714. f1_ = p.second;
  715. return *this;
  716. }
  717. GTEST_DECLARE_TUPLE_AS_FRIEND_
  718. template <GTEST_2_TYPENAMES_(U)>
  719. tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
  720. f0_ = t.f0_;
  721. f1_ = t.f1_;
  722. return *this;
  723. }
  724. T0 f0_;
  725. T1 f1_;
  726. };
  727. template <GTEST_3_TYPENAMES_(T)>
  728. class GTEST_3_TUPLE_(T) {
  729. public:
  730. template <int k> friend class gtest_internal::Get;
  731. tuple() : f0_(), f1_(), f2_() {}
  732. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  733. GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
  734. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
  735. template <GTEST_3_TYPENAMES_(U)>
  736. tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
  737. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  738. template <GTEST_3_TYPENAMES_(U)>
  739. tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
  740. return CopyFrom(t);
  741. }
  742. GTEST_DECLARE_TUPLE_AS_FRIEND_
  743. template <GTEST_3_TYPENAMES_(U)>
  744. tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
  745. f0_ = t.f0_;
  746. f1_ = t.f1_;
  747. f2_ = t.f2_;
  748. return *this;
  749. }
  750. T0 f0_;
  751. T1 f1_;
  752. T2 f2_;
  753. };
  754. template <GTEST_4_TYPENAMES_(T)>
  755. class GTEST_4_TUPLE_(T) {
  756. public:
  757. template <int k> friend class gtest_internal::Get;
  758. tuple() : f0_(), f1_(), f2_(), f3_() {}
  759. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  760. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
  761. f3_(f3) {}
  762. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
  763. template <GTEST_4_TYPENAMES_(U)>
  764. tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  765. f3_(t.f3_) {}
  766. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  767. template <GTEST_4_TYPENAMES_(U)>
  768. tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
  769. return CopyFrom(t);
  770. }
  771. GTEST_DECLARE_TUPLE_AS_FRIEND_
  772. template <GTEST_4_TYPENAMES_(U)>
  773. tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
  774. f0_ = t.f0_;
  775. f1_ = t.f1_;
  776. f2_ = t.f2_;
  777. f3_ = t.f3_;
  778. return *this;
  779. }
  780. T0 f0_;
  781. T1 f1_;
  782. T2 f2_;
  783. T3 f3_;
  784. };
  785. template <GTEST_5_TYPENAMES_(T)>
  786. class GTEST_5_TUPLE_(T) {
  787. public:
  788. template <int k> friend class gtest_internal::Get;
  789. tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
  790. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  791. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
  792. GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
  793. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  794. f4_(t.f4_) {}
  795. template <GTEST_5_TYPENAMES_(U)>
  796. tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  797. f3_(t.f3_), f4_(t.f4_) {}
  798. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  799. template <GTEST_5_TYPENAMES_(U)>
  800. tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
  801. return CopyFrom(t);
  802. }
  803. GTEST_DECLARE_TUPLE_AS_FRIEND_
  804. template <GTEST_5_TYPENAMES_(U)>
  805. tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
  806. f0_ = t.f0_;
  807. f1_ = t.f1_;
  808. f2_ = t.f2_;
  809. f3_ = t.f3_;
  810. f4_ = t.f4_;
  811. return *this;
  812. }
  813. T0 f0_;
  814. T1 f1_;
  815. T2 f2_;
  816. T3 f3_;
  817. T4 f4_;
  818. };
  819. template <GTEST_6_TYPENAMES_(T)>
  820. class GTEST_6_TUPLE_(T) {
  821. public:
  822. template <int k> friend class gtest_internal::Get;
  823. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
  824. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  825. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  826. GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
  827. f5_(f5) {}
  828. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  829. f4_(t.f4_), f5_(t.f5_) {}
  830. template <GTEST_6_TYPENAMES_(U)>
  831. tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  832. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
  833. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  834. template <GTEST_6_TYPENAMES_(U)>
  835. tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
  836. return CopyFrom(t);
  837. }
  838. GTEST_DECLARE_TUPLE_AS_FRIEND_
  839. template <GTEST_6_TYPENAMES_(U)>
  840. tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
  841. f0_ = t.f0_;
  842. f1_ = t.f1_;
  843. f2_ = t.f2_;
  844. f3_ = t.f3_;
  845. f4_ = t.f4_;
  846. f5_ = t.f5_;
  847. return *this;
  848. }
  849. T0 f0_;
  850. T1 f1_;
  851. T2 f2_;
  852. T3 f3_;
  853. T4 f4_;
  854. T5 f5_;
  855. };
  856. template <GTEST_7_TYPENAMES_(T)>
  857. class GTEST_7_TUPLE_(T) {
  858. public:
  859. template <int k> friend class gtest_internal::Get;
  860. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
  861. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  862. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  863. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
  864. f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
  865. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  866. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
  867. template <GTEST_7_TYPENAMES_(U)>
  868. tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  869. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
  870. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  871. template <GTEST_7_TYPENAMES_(U)>
  872. tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
  873. return CopyFrom(t);
  874. }
  875. GTEST_DECLARE_TUPLE_AS_FRIEND_
  876. template <GTEST_7_TYPENAMES_(U)>
  877. tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
  878. f0_ = t.f0_;
  879. f1_ = t.f1_;
  880. f2_ = t.f2_;
  881. f3_ = t.f3_;
  882. f4_ = t.f4_;
  883. f5_ = t.f5_;
  884. f6_ = t.f6_;
  885. return *this;
  886. }
  887. T0 f0_;
  888. T1 f1_;
  889. T2 f2_;
  890. T3 f3_;
  891. T4 f4_;
  892. T5 f5_;
  893. T6 f6_;
  894. };
  895. template <GTEST_8_TYPENAMES_(T)>
  896. class GTEST_8_TUPLE_(T) {
  897. public:
  898. template <int k> friend class gtest_internal::Get;
  899. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
  900. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  901. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  902. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
  903. GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
  904. f5_(f5), f6_(f6), f7_(f7) {}
  905. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  906. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
  907. template <GTEST_8_TYPENAMES_(U)>
  908. tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  909. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
  910. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  911. template <GTEST_8_TYPENAMES_(U)>
  912. tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
  913. return CopyFrom(t);
  914. }
  915. GTEST_DECLARE_TUPLE_AS_FRIEND_
  916. template <GTEST_8_TYPENAMES_(U)>
  917. tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
  918. f0_ = t.f0_;
  919. f1_ = t.f1_;
  920. f2_ = t.f2_;
  921. f3_ = t.f3_;
  922. f4_ = t.f4_;
  923. f5_ = t.f5_;
  924. f6_ = t.f6_;
  925. f7_ = t.f7_;
  926. return *this;
  927. }
  928. T0 f0_;
  929. T1 f1_;
  930. T2 f2_;
  931. T3 f3_;
  932. T4 f4_;
  933. T5 f5_;
  934. T6 f6_;
  935. T7 f7_;
  936. };
  937. template <GTEST_9_TYPENAMES_(T)>
  938. class GTEST_9_TUPLE_(T) {
  939. public:
  940. template <int k> friend class gtest_internal::Get;
  941. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
  942. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  943. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  944. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
  945. GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
  946. f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
  947. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  948. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
  949. template <GTEST_9_TYPENAMES_(U)>
  950. tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  951. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
  952. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  953. template <GTEST_9_TYPENAMES_(U)>
  954. tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
  955. return CopyFrom(t);
  956. }
  957. GTEST_DECLARE_TUPLE_AS_FRIEND_
  958. template <GTEST_9_TYPENAMES_(U)>
  959. tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
  960. f0_ = t.f0_;
  961. f1_ = t.f1_;
  962. f2_ = t.f2_;
  963. f3_ = t.f3_;
  964. f4_ = t.f4_;
  965. f5_ = t.f5_;
  966. f6_ = t.f6_;
  967. f7_ = t.f7_;
  968. f8_ = t.f8_;
  969. return *this;
  970. }
  971. T0 f0_;
  972. T1 f1_;
  973. T2 f2_;
  974. T3 f3_;
  975. T4 f4_;
  976. T5 f5_;
  977. T6 f6_;
  978. T7 f7_;
  979. T8 f8_;
  980. };
  981. template <GTEST_10_TYPENAMES_(T)>
  982. class tuple {
  983. public:
  984. template <int k> friend class gtest_internal::Get;
  985. tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
  986. f9_() {}
  987. explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
  988. GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
  989. GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
  990. GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
  991. f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
  992. tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
  993. f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
  994. template <GTEST_10_TYPENAMES_(U)>
  995. tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
  996. f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
  997. f9_(t.f9_) {}
  998. tuple& operator=(const tuple& t) { return CopyFrom(t); }
  999. template <GTEST_10_TYPENAMES_(U)>
  1000. tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
  1001. return CopyFrom(t);
  1002. }
  1003. GTEST_DECLARE_TUPLE_AS_FRIEND_
  1004. template <GTEST_10_TYPENAMES_(U)>
  1005. tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
  1006. f0_ = t.f0_;
  1007. f1_ = t.f1_;
  1008. f2_ = t.f2_;
  1009. f3_ = t.f3_;
  1010. f4_ = t.f4_;
  1011. f5_ = t.f5_;
  1012. f6_ = t.f6_;
  1013. f7_ = t.f7_;
  1014. f8_ = t.f8_;
  1015. f9_ = t.f9_;
  1016. return *this;
  1017. }
  1018. T0 f0_;
  1019. T1 f1_;
  1020. T2 f2_;
  1021. T3 f3_;
  1022. T4 f4_;
  1023. T5 f5_;
  1024. T6 f6_;
  1025. T7 f7_;
  1026. T8 f8_;
  1027. T9 f9_;
  1028. };
  1029. // 6.1.3.2 Tuple creation functions.
  1030. // Known limitations: we don't support passing an
  1031. // std::tr1::reference_wrapper<T> to make_tuple(). And we don't
  1032. // implement tie().
  1033. inline tuple<> make_tuple() { return tuple<>(); }
  1034. template <GTEST_1_TYPENAMES_(T)>
  1035. inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
  1036. return GTEST_1_TUPLE_(T)(f0);
  1037. }
  1038. template <GTEST_2_TYPENAMES_(T)>
  1039. inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
  1040. return GTEST_2_TUPLE_(T)(f0, f1);
  1041. }
  1042. template <GTEST_3_TYPENAMES_(T)>
  1043. inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
  1044. return GTEST_3_TUPLE_(T)(f0, f1, f2);
  1045. }
  1046. template <GTEST_4_TYPENAMES_(T)>
  1047. inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1048. const T3& f3) {
  1049. return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
  1050. }
  1051. template <GTEST_5_TYPENAMES_(T)>
  1052. inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1053. const T3& f3, const T4& f4) {
  1054. return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
  1055. }
  1056. template <GTEST_6_TYPENAMES_(T)>
  1057. inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1058. const T3& f3, const T4& f4, const T5& f5) {
  1059. return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
  1060. }
  1061. template <GTEST_7_TYPENAMES_(T)>
  1062. inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1063. const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
  1064. return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
  1065. }
  1066. template <GTEST_8_TYPENAMES_(T)>
  1067. inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1068. const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
  1069. return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
  1070. }
  1071. template <GTEST_9_TYPENAMES_(T)>
  1072. inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1073. const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
  1074. const T8& f8) {
  1075. return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
  1076. }
  1077. template <GTEST_10_TYPENAMES_(T)>
  1078. inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
  1079. const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
  1080. const T8& f8, const T9& f9) {
  1081. return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
  1082. }
  1083. // 6.1.3.3 Tuple helper classes.
  1084. template <typename Tuple> struct tuple_size;
  1085. template <GTEST_0_TYPENAMES_(T)>
  1086. struct tuple_size<GTEST_0_TUPLE_(T)> { static const int value = 0; };
  1087. template <GTEST_1_TYPENAMES_(T)>
  1088. struct tuple_size<GTEST_1_TUPLE_(T)> { static const int value = 1; };
  1089. template <GTEST_2_TYPENAMES_(T)>
  1090. struct tuple_size<GTEST_2_TUPLE_(T)> { static const int value = 2; };
  1091. template <GTEST_3_TYPENAMES_(T)>
  1092. struct tuple_size<GTEST_3_TUPLE_(T)> { static const int value = 3; };
  1093. template <GTEST_4_TYPENAMES_(T)>
  1094. struct tuple_size<GTEST_4_TUPLE_(T)> { static const int value = 4; };
  1095. template <GTEST_5_TYPENAMES_(T)>
  1096. struct tuple_size<GTEST_5_TUPLE_(T)> { static const int value = 5; };
  1097. template <GTEST_6_TYPENAMES_(T)>
  1098. struct tuple_size<GTEST_6_TUPLE_(T)> { static const int value = 6; };
  1099. template <GTEST_7_TYPENAMES_(T)>
  1100. struct tuple_size<GTEST_7_TUPLE_(T)> { static const int value = 7; };
  1101. template <GTEST_8_TYPENAMES_(T)>
  1102. struct tuple_size<GTEST_8_TUPLE_(T)> { static const int value = 8; };
  1103. template <GTEST_9_TYPENAMES_(T)>
  1104. struct tuple_size<GTEST_9_TUPLE_(T)> { static const int value = 9; };
  1105. template <GTEST_10_TYPENAMES_(T)>
  1106. struct tuple_size<GTEST_10_TUPLE_(T)> { static const int value = 10; };
  1107. template <int k, class Tuple>
  1108. struct tuple_element {
  1109. typedef typename gtest_internal::TupleElement<
  1110. k < (tuple_size<Tuple>::value), k, Tuple>::type type;
  1111. };
  1112. #define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
  1113. // 6.1.3.4 Element access.
  1114. namespace gtest_internal {
  1115. template <>
  1116. class Get<0> {
  1117. public:
  1118. template <class Tuple>
  1119. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
  1120. Field(Tuple& t) { return t.f0_; } // NOLINT
  1121. template <class Tuple>
  1122. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
  1123. ConstField(const Tuple& t) { return t.f0_; }
  1124. };
  1125. template <>
  1126. class Get<1> {
  1127. public:
  1128. template <class Tuple>
  1129. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
  1130. Field(Tuple& t) { return t.f1_; } // NOLINT
  1131. template <class Tuple>
  1132. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
  1133. ConstField(const Tuple& t) { return t.f1_; }
  1134. };
  1135. template <>
  1136. class Get<2> {
  1137. public:
  1138. template <class Tuple>
  1139. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
  1140. Field(Tuple& t) { return t.f2_; } // NOLINT
  1141. template <class Tuple>
  1142. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
  1143. ConstField(const Tuple& t) { return t.f2_; }
  1144. };
  1145. template <>
  1146. class Get<3> {
  1147. public:
  1148. template <class Tuple>
  1149. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
  1150. Field(Tuple& t) { return t.f3_; } // NOLINT
  1151. template <class Tuple>
  1152. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
  1153. ConstField(const Tuple& t) { return t.f3_; }
  1154. };
  1155. template <>
  1156. class Get<4> {
  1157. public:
  1158. template <class Tuple>
  1159. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
  1160. Field(Tuple& t) { return t.f4_; } // NOLINT
  1161. template <class Tuple>
  1162. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
  1163. ConstField(const Tuple& t) { return t.f4_; }
  1164. };
  1165. template <>
  1166. class Get<5> {
  1167. public:
  1168. template <class Tuple>
  1169. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
  1170. Field(Tuple& t) { return t.f5_; } // NOLINT
  1171. template <class Tuple>
  1172. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
  1173. ConstField(const Tuple& t) { return t.f5_; }
  1174. };
  1175. template <>
  1176. class Get<6> {
  1177. public:
  1178. template <class Tuple>
  1179. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
  1180. Field(Tuple& t) { return t.f6_; } // NOLINT
  1181. template <class Tuple>
  1182. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
  1183. ConstField(const Tuple& t) { return t.f6_; }
  1184. };
  1185. template <>
  1186. class Get<7> {
  1187. public:
  1188. template <class Tuple>
  1189. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
  1190. Field(Tuple& t) { return t.f7_; } // NOLINT
  1191. template <class Tuple>
  1192. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
  1193. ConstField(const Tuple& t) { return t.f7_; }
  1194. };
  1195. template <>
  1196. class Get<8> {
  1197. public:
  1198. template <class Tuple>
  1199. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
  1200. Field(Tuple& t) { return t.f8_; } // NOLINT
  1201. template <class Tuple>
  1202. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
  1203. ConstField(const Tuple& t) { return t.f8_; }
  1204. };
  1205. template <>
  1206. class Get<9> {
  1207. public:
  1208. template <class Tuple>
  1209. static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
  1210. Field(Tuple& t) { return t.f9_; } // NOLINT
  1211. template <class Tuple>
  1212. static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
  1213. ConstField(const Tuple& t) { return t.f9_; }
  1214. };
  1215. } // namespace gtest_internal
  1216. template <int k, GTEST_10_TYPENAMES_(T)>
  1217. GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
  1218. get(GTEST_10_TUPLE_(T)& t) {
  1219. return gtest_internal::Get<k>::Field(t);
  1220. }
  1221. template <int k, GTEST_10_TYPENAMES_(T)>
  1222. GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
  1223. get(const GTEST_10_TUPLE_(T)& t) {
  1224. return gtest_internal::Get<k>::ConstField(t);
  1225. }
  1226. // 6.1.3.5 Relational operators
  1227. // We only implement == and !=, as we don't have a need for the rest yet.
  1228. namespace gtest_internal {
  1229. // SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
  1230. // first k fields of t1 equals the first k fields of t2.
  1231. // SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
  1232. // k1 != k2.
  1233. template <int kSize1, int kSize2>
  1234. struct SameSizeTuplePrefixComparator;
  1235. template <>
  1236. struct SameSizeTuplePrefixComparator<0, 0> {
  1237. template <class Tuple1, class Tuple2>
  1238. static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
  1239. return true;
  1240. }
  1241. };
  1242. template <int k>
  1243. struct SameSizeTuplePrefixComparator<k, k> {
  1244. template <class Tuple1, class Tuple2>
  1245. static bool Eq(const Tuple1& t1, const Tuple2& t2) {
  1246. return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
  1247. ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
  1248. }
  1249. };
  1250. } // namespace gtest_internal
  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) {
  1254. return gtest_internal::SameSizeTuplePrefixComparator<
  1255. tuple_size<GTEST_10_TUPLE_(T)>::value,
  1256. tuple_size<GTEST_10_TUPLE_(U)>::value>::Eq(t, u);
  1257. }
  1258. template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
  1259. inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
  1260. const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
  1261. // 6.1.4 Pairs.
  1262. // Unimplemented.
  1263. } // namespace tr1
  1264. } // namespace std
  1265. #undef GTEST_0_TUPLE_
  1266. #undef GTEST_1_TUPLE_
  1267. #undef GTEST_2_TUPLE_
  1268. #undef GTEST_3_TUPLE_
  1269. #undef GTEST_4_TUPLE_
  1270. #undef GTEST_5_TUPLE_
  1271. #undef GTEST_6_TUPLE_
  1272. #undef GTEST_7_TUPLE_
  1273. #undef GTEST_8_TUPLE_
  1274. #undef GTEST_9_TUPLE_
  1275. #undef GTEST_10_TUPLE_
  1276. #undef GTEST_0_TYPENAMES_
  1277. #undef GTEST_1_TYPENAMES_
  1278. #undef GTEST_2_TYPENAMES_
  1279. #undef GTEST_3_TYPENAMES_
  1280. #undef GTEST_4_TYPENAMES_
  1281. #undef GTEST_5_TYPENAMES_
  1282. #undef GTEST_6_TYPENAMES_
  1283. #undef GTEST_7_TYPENAMES_
  1284. #undef GTEST_8_TYPENAMES_
  1285. #undef GTEST_9_TYPENAMES_
  1286. #undef GTEST_10_TYPENAMES_
  1287. #undef GTEST_DECLARE_TUPLE_AS_FRIEND_
  1288. #undef GTEST_BY_REF_
  1289. #undef GTEST_ADD_REF_
  1290. #undef GTEST_TUPLE_ELEMENT_
  1291. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
  1292. # elif GTEST_OS_SYMBIAN
  1293. // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
  1294. // use STLport's tuple implementation, which unfortunately doesn't
  1295. // work as the copy of STLport distributed with Symbian is incomplete.
  1296. // By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
  1297. // use its own tuple implementation.
  1298. # ifdef BOOST_HAS_TR1_TUPLE
  1299. # undef BOOST_HAS_TR1_TUPLE
  1300. # endif // BOOST_HAS_TR1_TUPLE
  1301. // This prevents <boost/tr1/detail/config.hpp>, which defines
  1302. // BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
  1303. # define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
  1304. # include <tuple>
  1305. # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
  1306. // GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header. This does
  1307. // not conform to the TR1 spec, which requires the header to be <tuple>.
  1308. # if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
  1309. // Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
  1310. // which is #included by <tr1/tuple>, to not compile when RTTI is
  1311. // disabled. _TR1_FUNCTIONAL is the header guard for
  1312. // <tr1/functional>. Hence the following #define is a hack to prevent
  1313. // <tr1/functional> from being included.
  1314. # define _TR1_FUNCTIONAL 1
  1315. # include <tr1/tuple>
  1316. # undef _TR1_FUNCTIONAL // Allows the user to #include
  1317. // <tr1/functional> if he chooses to.
  1318. # else
  1319. # include <tr1/tuple> // NOLINT
  1320. # endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
  1321. # else
  1322. // If the compiler is not GCC 4.0+, we assume the user is using a
  1323. // spec-conforming TR1 implementation.
  1324. # include <tuple> // NOLINT
  1325. # endif // GTEST_USE_OWN_TR1_TUPLE
  1326. #endif // GTEST_HAS_TR1_TUPLE
  1327. // Determines whether clone(2) is supported.
  1328. // Usually it will only be available on Linux, excluding
  1329. // Linux on the Itanium architecture.
  1330. // Also see http://linux.die.net/man/2/clone.
  1331. #ifndef GTEST_HAS_CLONE
  1332. // The user didn't tell us, so we need to figure it out.
  1333. # if GTEST_OS_LINUX && !defined(__ia64__)
  1334. # define GTEST_HAS_CLONE 1
  1335. # else
  1336. # define GTEST_HAS_CLONE 0
  1337. # endif // GTEST_OS_LINUX && !defined(__ia64__)
  1338. #endif // GTEST_HAS_CLONE
  1339. // Determines whether to support stream redirection. This is used to test
  1340. // output correctness and to implement death tests.
  1341. #ifndef GTEST_HAS_STREAM_REDIRECTION
  1342. // By default, we assume that stream redirection is supported on all
  1343. // platforms except known mobile ones.
  1344. # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN
  1345. # define GTEST_HAS_STREAM_REDIRECTION 0
  1346. # else
  1347. # define GTEST_HAS_STREAM_REDIRECTION 1
  1348. # endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
  1349. #endif // GTEST_HAS_STREAM_REDIRECTION
  1350. // Determines whether to support death tests.
  1351. // Google Test does not support death tests for VC 7.1 and earlier as
  1352. // abort() in a VC 7.1 application compiled as GUI in debug config
  1353. // pops up a dialog window that cannot be suppressed programmatically.
  1354. #if (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
  1355. (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
  1356. GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX)
  1357. # define GTEST_HAS_DEATH_TEST 1
  1358. # include <vector> // NOLINT
  1359. #endif
  1360. // We don't support MSVC 7.1 with exceptions disabled now. Therefore
  1361. // all the compilers we care about are adequate for supporting
  1362. // value-parameterized tests.
  1363. #define GTEST_HAS_PARAM_TEST 1
  1364. // Determines whether to support type-driven tests.
  1365. // Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
  1366. // Sun Pro CC, IBM Visual Age, and HP aCC support.
  1367. #if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
  1368. defined(__IBMCPP__) || defined(__HP_aCC)
  1369. # define GTEST_HAS_TYPED_TEST 1
  1370. # define GTEST_HAS_TYPED_TEST_P 1
  1371. #endif
  1372. // Determines whether to support Combine(). This only makes sense when
  1373. // value-parameterized tests are enabled. The implementation doesn't
  1374. // work on Sun Studio since it doesn't understand templated conversion
  1375. // operators.
  1376. #if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)
  1377. # define GTEST_HAS_COMBINE 1
  1378. #endif
  1379. // Determines whether the system compiler uses UTF-16 for encoding wide strings.
  1380. #define GTEST_WIDE_STRING_USES_UTF16_ \
  1381. (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
  1382. // Determines whether test results can be streamed to a socket.
  1383. #if GTEST_OS_LINUX
  1384. # define GTEST_CAN_STREAM_RESULTS_ 1
  1385. #endif
  1386. // Defines some utility macros.
  1387. // The GNU compiler emits a warning if nested "if" statements are followed by
  1388. // an "else" statement and braces are not used to explicitly disambiguate the
  1389. // "else" binding. This leads to problems with code like:
  1390. //
  1391. // if (gate)
  1392. // ASSERT_*(condition) << "Some message";
  1393. //
  1394. // The "switch (0) case 0:" idiom is used to suppress this.
  1395. #ifdef __INTEL_COMPILER
  1396. # define GTEST_AMBIGUOUS_ELSE_BLOCKER_
  1397. #else
  1398. # define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default: // NOLINT
  1399. #endif
  1400. // Use this annotation at the end of a struct/class definition to
  1401. // prevent the compiler from optimizing away instances that are never
  1402. // used. This is useful when all interesting logic happens inside the
  1403. // c'tor and / or d'tor. Example:
  1404. //
  1405. // struct Foo {
  1406. // Foo() { ... }
  1407. // } GTEST_ATTRIBUTE_UNUSED_;
  1408. //
  1409. // Also use it after a variable or parameter declaration to tell the
  1410. // compiler the variable/parameter does not have to be used.
  1411. #if defined(__GNUC__) && !defined(COMPILER_ICC)
  1412. # define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
  1413. #else
  1414. # define GTEST_ATTRIBUTE_UNUSED_
  1415. #endif
  1416. // A macro to disallow operator=
  1417. // This should be used in the private: declarations for a class.
  1418. #define GTEST_DISALLOW_ASSIGN_(type)\
  1419. void operator=(type const &)
  1420. // A macro to disallow copy constructor and operator=
  1421. // This should be used in the private: declarations for a class.
  1422. #define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
  1423. type(type const &);\
  1424. GTEST_DISALLOW_ASSIGN_(type)
  1425. // Tell the compiler to warn about unused return values for functions declared
  1426. // with this macro. The macro should be used on function declarations
  1427. // following the argument list:
  1428. //
  1429. // Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
  1430. #if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
  1431. # define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
  1432. #else
  1433. # define GTEST_MUST_USE_RESULT_
  1434. #endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
  1435. // Determine whether the compiler supports Microsoft's Structured Exception
  1436. // Handling. This is supported by several Windows compilers but generally
  1437. // does not exist on any other system.
  1438. #ifndef GTEST_HAS_SEH
  1439. // The user didn't tell us, so we need to figure it out.
  1440. # if defined(_MSC_VER) || defined(__BORLANDC__)
  1441. // These two compilers are known to support SEH.
  1442. # define GTEST_HAS_SEH 1
  1443. # else
  1444. // Assume no SEH.
  1445. # define GTEST_HAS_SEH 0
  1446. # endif
  1447. #endif // GTEST_HAS_SEH
  1448. #ifdef _MSC_VER
  1449. # if GTEST_LINKED_AS_SHARED_LIBRARY
  1450. # define GTEST_API_ __declspec(dllimport)
  1451. # elif GTEST_CREATE_SHARED_LIBRARY
  1452. # define GTEST_API_ __declspec(dllexport)
  1453. # endif
  1454. #endif // _MSC_VER
  1455. #ifndef GTEST_API_
  1456. # define GTEST_API_
  1457. #endif
  1458. #ifdef __GNUC__
  1459. // Ask the compiler to never inline a given function.
  1460. # define GTEST_NO_INLINE_ __attribute__((noinline))
  1461. #else
  1462. # define GTEST_NO_INLINE_
  1463. #endif
  1464. namespace testing {
  1465. class Message;
  1466. namespace internal {
  1467. class String;
  1468. // The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
  1469. // expression is true. For example, you could use it to verify the
  1470. // size of a static array:
  1471. //
  1472. // GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,
  1473. // content_type_names_incorrect_size);
  1474. //
  1475. // or to make sure a struct is smaller than a certain size:
  1476. //
  1477. // GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
  1478. //
  1479. // The second argument to the macro is the name of the variable. If
  1480. // the expression is false, most compilers will issue a warning/error
  1481. // containing the name of the variable.
  1482. template <bool>
  1483. struct CompileAssert {
  1484. };
  1485. #define GTEST_COMPILE_ASSERT_(expr, msg) \
  1486. typedef ::testing::internal::CompileAssert<(bool(expr))> \
  1487. msg[bool(expr) ? 1 : -1]
  1488. // Implementation details of GTEST_COMPILE_ASSERT_:
  1489. //
  1490. // - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
  1491. // elements (and thus is invalid) when the expression is false.
  1492. //
  1493. // - The simpler definition
  1494. //
  1495. // #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
  1496. //
  1497. // does not work, as gcc supports variable-length arrays whose sizes
  1498. // are determined at run-time (this is gcc's extension and not part
  1499. // of the C++ standard). As a result, gcc fails to reject the
  1500. // following code with the simple definition:
  1501. //
  1502. // int foo;
  1503. // GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
  1504. // // not a compile-time constant.
  1505. //
  1506. // - By using the type CompileAssert<(bool(expr))>, we ensures that
  1507. // expr is a compile-time constant. (Template arguments must be
  1508. // determined at compile-time.)
  1509. //
  1510. // - The outter parentheses in CompileAssert<(bool(expr))> are necessary
  1511. // to work around a bug in gcc 3.4.4 and 4.0.1. If we had written
  1512. //
  1513. // CompileAssert<bool(expr)>
  1514. //
  1515. // instead, these compilers will refuse to compile
  1516. //
  1517. // GTEST_COMPILE_ASSERT_(5 > 0, some_message);
  1518. //
  1519. // (They seem to think the ">" in "5 > 0" marks the end of the
  1520. // template argument list.)
  1521. //
  1522. // - The array size is (bool(expr) ? 1 : -1), instead of simply
  1523. //
  1524. // ((expr) ? 1 : -1).
  1525. //
  1526. // This is to avoid running into a bug in MS VC 7.1, which
  1527. // causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
  1528. // StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
  1529. //
  1530. // This template is declared, but intentionally undefined.
  1531. template <typename T1, typename T2>
  1532. struct StaticAssertTypeEqHelper;
  1533. template <typename T>
  1534. struct StaticAssertTypeEqHelper<T, T> {};
  1535. #if GTEST_HAS_GLOBAL_STRING
  1536. typedef ::string string;
  1537. #else
  1538. typedef ::std::string string;
  1539. #endif // GTEST_HAS_GLOBAL_STRING
  1540. #if GTEST_HAS_GLOBAL_WSTRING
  1541. typedef ::wstring wstring;
  1542. #elif GTEST_HAS_STD_WSTRING
  1543. typedef ::std::wstring wstring;
  1544. #endif // GTEST_HAS_GLOBAL_WSTRING
  1545. // A helper for suppressing warnings on constant condition. It just
  1546. // returns 'condition'.
  1547. GTEST_API_ bool IsTrue(bool condition);
  1548. // Defines scoped_ptr.
  1549. // This implementation of scoped_ptr is PARTIAL - it only contains
  1550. // enough stuff to satisfy Google Test's need.
  1551. template <typename T>
  1552. class scoped_ptr {
  1553. public:
  1554. typedef T element_type;
  1555. explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
  1556. ~scoped_ptr() { reset(); }
  1557. T& operator*() const { return *ptr_; }
  1558. T* operator->() const { return ptr_; }
  1559. T* get() const { return ptr_; }
  1560. T* release() {
  1561. T* const ptr = ptr_;
  1562. ptr_ = NULL;
  1563. return ptr;
  1564. }
  1565. void reset(T* p = NULL) {
  1566. if (p != ptr_) {
  1567. if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type.
  1568. delete ptr_;
  1569. }
  1570. ptr_ = p;
  1571. }
  1572. }
  1573. private:
  1574. T* ptr_;
  1575. GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
  1576. };
  1577. // Defines RE.
  1578. // A simple C++ wrapper for <regex.h>. It uses the POSIX Extended
  1579. // Regular Expression syntax.
  1580. class GTEST_API_ RE {
  1581. public:
  1582. // A copy constructor is required by the Standard to initialize object
  1583. // references from r-values.
  1584. RE(const RE& other) { Init(other.pattern()); }
  1585. // Constructs an RE from a string.
  1586. RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT
  1587. #if GTEST_HAS_GLOBAL_STRING
  1588. RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT
  1589. #endif // GTEST_HAS_GLOBAL_STRING
  1590. RE(const char* regex) { Init(regex); } // NOLINT
  1591. ~RE();
  1592. // Returns the string representation of the regex.
  1593. const char* pattern() const { return pattern_; }
  1594. // FullMatch(str, re) returns true iff regular expression re matches
  1595. // the entire str.
  1596. // PartialMatch(str, re) returns true iff regular expression re
  1597. // matches a substring of str (including str itself).
  1598. //
  1599. // TODO(wan@google.com): make FullMatch() and PartialMatch() work
  1600. // when str contains NUL characters.
  1601. static bool FullMatch(const ::std::string& str, const RE& re) {
  1602. return FullMatch(str.c_str(), re);
  1603. }
  1604. static bool PartialMatch(const ::std::string& str, const RE& re) {
  1605. return PartialMatch(str.c_str(), re);
  1606. }
  1607. #if GTEST_HAS_GLOBAL_STRING
  1608. static bool FullMatch(const ::string& str, const RE& re) {
  1609. return FullMatch(str.c_str(), re);
  1610. }
  1611. static bool PartialMatch(const ::string& str, const RE& re) {
  1612. return PartialMatch(str.c_str(), re);
  1613. }
  1614. #endif // GTEST_HAS_GLOBAL_STRING
  1615. static bool FullMatch(const char* str, const RE& re);
  1616. static bool PartialMatch(const char* str, const RE& re);
  1617. private:
  1618. void Init(const char* regex);
  1619. // We use a const char* instead of a string, as Google Test may be used
  1620. // where string is not available. We also do not use Google Test's own
  1621. // String type here, in order to simplify dependencies between the
  1622. // files.
  1623. const char* pattern_;
  1624. bool is_valid_;
  1625. #if GTEST_USES_POSIX_RE
  1626. regex_t full_regex_; // For FullMatch().
  1627. regex_t partial_regex_; // For PartialMatch().
  1628. #else // GTEST_USES_SIMPLE_RE
  1629. const char* full_pattern_; // For FullMatch();
  1630. #endif
  1631. GTEST_DISALLOW_ASSIGN_(RE);
  1632. };
  1633. // Formats a source file path and a line number as they would appear
  1634. // in an error message from the compiler used to compile this code.
  1635. GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
  1636. // Formats a file location for compiler-independent XML output.
  1637. // Although this function is not platform dependent, we put it next to
  1638. // FormatFileLocation in order to contrast the two functions.
  1639. GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
  1640. int line);
  1641. // Defines logging utilities:
  1642. // GTEST_LOG_(severity) - logs messages at the specified severity level. The
  1643. // message itself is streamed into the macro.
  1644. // LogToStderr() - directs all log messages to stderr.
  1645. // FlushInfoLog() - flushes informational log messages.
  1646. enum GTestLogSeverity {
  1647. GTEST_INFO,
  1648. GTEST_WARNING,
  1649. GTEST_ERROR,
  1650. GTEST_FATAL
  1651. };
  1652. // Formats log entry severity, provides a stream object for streaming the
  1653. // log message, and terminates the message with a newline when going out of
  1654. // scope.
  1655. class GTEST_API_ GTestLog {
  1656. public:
  1657. GTestLog(GTestLogSeverity severity, const char* file, int line);
  1658. // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
  1659. ~GTestLog();
  1660. ::std::ostream& GetStream() { return ::std::cerr; }
  1661. private:
  1662. const GTestLogSeverity severity_;
  1663. GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
  1664. };
  1665. #define GTEST_LOG_(severity) \
  1666. ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
  1667. __FILE__, __LINE__).GetStream()
  1668. inline void LogToStderr() {}
  1669. inline void FlushInfoLog() { fflush(NULL); }
  1670. // INTERNAL IMPLEMENTATION - DO NOT USE.
  1671. //
  1672. // GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
  1673. // is not satisfied.
  1674. // Synopsys:
  1675. // GTEST_CHECK_(boolean_condition);
  1676. // or
  1677. // GTEST_CHECK_(boolean_condition) << "Additional message";
  1678. //
  1679. // This checks the condition and if the condition is not satisfied
  1680. // it prints message about the condition violation, including the
  1681. // condition itself, plus additional message streamed into it, if any,
  1682. // and then it aborts the program. It aborts the program irrespective of
  1683. // whether it is built in the debug mode or not.
  1684. #define GTEST_CHECK_(condition) \
  1685. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  1686. if (::testing::internal::IsTrue(condition)) \
  1687. ; \
  1688. else \
  1689. GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
  1690. // An all-mode assert to verify that the given POSIX-style function
  1691. // call returns 0 (indicating success). Known limitation: this
  1692. // doesn't expand to a balanced 'if' statement, so enclose the macro
  1693. // in {} if you need to use it as the only statement in an 'if'
  1694. // branch.
  1695. #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
  1696. if (const int gtest_error = (posix_call)) \
  1697. GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
  1698. << gtest_error
  1699. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  1700. //
  1701. // Use ImplicitCast_ as a safe version of static_cast for upcasting in
  1702. // the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
  1703. // const Foo*). When you use ImplicitCast_, the compiler checks that
  1704. // the cast is safe. Such explicit ImplicitCast_s are necessary in
  1705. // surprisingly many situations where C++ demands an exact type match
  1706. // instead of an argument type convertable to a target type.
  1707. //
  1708. // The syntax for using ImplicitCast_ is the same as for static_cast:
  1709. //
  1710. // ImplicitCast_<ToType>(expr)
  1711. //
  1712. // ImplicitCast_ would have been part of the C++ standard library,
  1713. // but the proposal was submitted too late. It will probably make
  1714. // its way into the language in the future.
  1715. //
  1716. // This relatively ugly name is intentional. It prevents clashes with
  1717. // similar functions users may have (e.g., implicit_cast). The internal
  1718. // namespace alone is not enough because the function can be found by ADL.
  1719. template<typename To>
  1720. inline To ImplicitCast_(To x) { return x; }
  1721. // When you upcast (that is, cast a pointer from type Foo to type
  1722. // SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
  1723. // always succeed. When you downcast (that is, cast a pointer from
  1724. // type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
  1725. // how do you know the pointer is really of type SubclassOfFoo? It
  1726. // could be a bare Foo, or of type DifferentSubclassOfFoo. Thus,
  1727. // when you downcast, you should use this macro. In debug mode, we
  1728. // use dynamic_cast<> to double-check the downcast is legal (we die
  1729. // if it's not). In normal mode, we do the efficient static_cast<>
  1730. // instead. Thus, it's important to test in debug mode to make sure
  1731. // the cast is legal!
  1732. // This is the only place in the code we should use dynamic_cast<>.
  1733. // In particular, you SHOULDN'T be using dynamic_cast<> in order to
  1734. // do RTTI (eg code like this:
  1735. // if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
  1736. // if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
  1737. // You should design the code some other way not to need this.
  1738. //
  1739. // This relatively ugly name is intentional. It prevents clashes with
  1740. // similar functions users may have (e.g., down_cast). The internal
  1741. // namespace alone is not enough because the function can be found by ADL.
  1742. template<typename To, typename From> // use like this: DownCast_<T*>(foo);
  1743. inline To DownCast_(From* f) { // so we only accept pointers
  1744. // Ensures that To is a sub-type of From *. This test is here only
  1745. // for compile-time type checking, and has no overhead in an
  1746. // optimized build at run-time, as it will be optimized away
  1747. // completely.
  1748. if (false) {
  1749. const To to = NULL;
  1750. ::testing::internal::ImplicitCast_<From*>(to);
  1751. }
  1752. #if GTEST_HAS_RTTI
  1753. // RTTI: debug mode only!
  1754. GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
  1755. #endif
  1756. return static_cast<To>(f);
  1757. }
  1758. // Downcasts the pointer of type Base to Derived.
  1759. // Derived must be a subclass of Base. The parameter MUST
  1760. // point to a class of type Derived, not any subclass of it.
  1761. // When RTTI is available, the function performs a runtime
  1762. // check to enforce this.
  1763. template <class Derived, class Base>
  1764. Derived* CheckedDowncastToActualType(Base* base) {
  1765. #if GTEST_HAS_RTTI
  1766. GTEST_CHECK_(typeid(*base) == typeid(Derived));
  1767. return dynamic_cast<Derived*>(base); // NOLINT
  1768. #else
  1769. return static_cast<Derived*>(base); // Poor man's downcast.
  1770. #endif
  1771. }
  1772. #if GTEST_HAS_STREAM_REDIRECTION
  1773. // Defines the stderr capturer:
  1774. // CaptureStdout - starts capturing stdout.
  1775. // GetCapturedStdout - stops capturing stdout and returns the captured string.
  1776. // CaptureStderr - starts capturing stderr.
  1777. // GetCapturedStderr - stops capturing stderr and returns the captured string.
  1778. //
  1779. GTEST_API_ void CaptureStdout();
  1780. GTEST_API_ String GetCapturedStdout();
  1781. GTEST_API_ void CaptureStderr();
  1782. GTEST_API_ String GetCapturedStderr();
  1783. #endif // GTEST_HAS_STREAM_REDIRECTION
  1784. #if GTEST_HAS_DEATH_TEST
  1785. // A copy of all command line arguments. Set by InitGoogleTest().
  1786. extern ::std::vector<String> g_argvs;
  1787. // GTEST_HAS_DEATH_TEST implies we have ::std::string.
  1788. const ::std::vector<String>& GetArgvs();
  1789. #endif // GTEST_HAS_DEATH_TEST
  1790. // Defines synchronization primitives.
  1791. #if GTEST_HAS_PTHREAD
  1792. // Sleeps for (roughly) n milli-seconds. This function is only for
  1793. // testing Google Test's own constructs. Don't use it in user tests,
  1794. // either directly or indirectly.
  1795. inline void SleepMilliseconds(int n) {
  1796. const timespec time = {
  1797. 0, // 0 seconds.
  1798. n * 1000L * 1000L, // And n ms.
  1799. };
  1800. nanosleep(&time, NULL);
  1801. }
  1802. // Allows a controller thread to pause execution of newly created
  1803. // threads until notified. Instances of this class must be created
  1804. // and destroyed in the controller thread.
  1805. //
  1806. // This class is only for testing Google Test's own constructs. Do not
  1807. // use it in user tests, either directly or indirectly.
  1808. class Notification {
  1809. public:
  1810. Notification() : notified_(false) {}
  1811. // Notifies all threads created with this notification to start. Must
  1812. // be called from the controller thread.
  1813. void Notify() { notified_ = true; }
  1814. // Blocks until the controller thread notifies. Must be called from a test
  1815. // thread.
  1816. void WaitForNotification() {
  1817. while(!notified_) {
  1818. SleepMilliseconds(10);
  1819. }
  1820. }
  1821. private:
  1822. volatile bool notified_;
  1823. GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
  1824. };
  1825. // As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
  1826. // Consequently, it cannot select a correct instantiation of ThreadWithParam
  1827. // in order to call its Run(). Introducing ThreadWithParamBase as a
  1828. // non-templated base class for ThreadWithParam allows us to bypass this
  1829. // problem.
  1830. class ThreadWithParamBase {
  1831. public:
  1832. virtual ~ThreadWithParamBase() {}
  1833. virtual void Run() = 0;
  1834. };
  1835. // pthread_create() accepts a pointer to a function type with the C linkage.
  1836. // According to the Standard (7.5/1), function types with different linkages
  1837. // are different even if they are otherwise identical. Some compilers (for
  1838. // example, SunStudio) treat them as different types. Since class methods
  1839. // cannot be defined with C-linkage we need to define a free C-function to
  1840. // pass into pthread_create().
  1841. extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
  1842. static_cast<ThreadWithParamBase*>(thread)->Run();
  1843. return NULL;
  1844. }
  1845. // Helper class for testing Google Test's multi-threading constructs.
  1846. // To use it, write:
  1847. //
  1848. // void ThreadFunc(int param) { /* Do things with param */ }
  1849. // Notification thread_can_start;
  1850. // ...
  1851. // // The thread_can_start parameter is optional; you can supply NULL.
  1852. // ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
  1853. // thread_can_start.Notify();
  1854. //
  1855. // These classes are only for testing Google Test's own constructs. Do
  1856. // not use them in user tests, either directly or indirectly.
  1857. template <typename T>
  1858. class ThreadWithParam : public ThreadWithParamBase {
  1859. public:
  1860. typedef void (*UserThreadFunc)(T);
  1861. ThreadWithParam(
  1862. UserThreadFunc func, T param, Notification* thread_can_start)
  1863. : func_(func),
  1864. param_(param),
  1865. thread_can_start_(thread_can_start),
  1866. finished_(false) {
  1867. ThreadWithParamBase* const base = this;
  1868. // The thread can be created only after all fields except thread_
  1869. // have been initialized.
  1870. GTEST_CHECK_POSIX_SUCCESS_(
  1871. pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
  1872. }
  1873. ~ThreadWithParam() { Join(); }
  1874. void Join() {
  1875. if (!finished_) {
  1876. GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
  1877. finished_ = true;
  1878. }
  1879. }
  1880. virtual void Run() {
  1881. if (thread_can_start_ != NULL)
  1882. thread_can_start_->WaitForNotification();
  1883. func_(param_);
  1884. }
  1885. private:
  1886. const UserThreadFunc func_; // User-supplied thread function.
  1887. const T param_; // User-supplied parameter to the thread function.
  1888. // When non-NULL, used to block execution until the controller thread
  1889. // notifies.
  1890. Notification* const thread_can_start_;
  1891. bool finished_; // true iff we know that the thread function has finished.
  1892. pthread_t thread_; // The native thread object.
  1893. GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
  1894. };
  1895. // MutexBase and Mutex implement mutex on pthreads-based platforms. They
  1896. // are used in conjunction with class MutexLock:
  1897. //
  1898. // Mutex mutex;
  1899. // ...
  1900. // MutexLock lock(&mutex); // Acquires the mutex and releases it at the end
  1901. // // of the current scope.
  1902. //
  1903. // MutexBase implements behavior for both statically and dynamically
  1904. // allocated mutexes. Do not use MutexBase directly. Instead, write
  1905. // the following to define a static mutex:
  1906. //
  1907. // GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
  1908. //
  1909. // You can forward declare a static mutex like this:
  1910. //
  1911. // GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
  1912. //
  1913. // To create a dynamic mutex, just define an object of type Mutex.
  1914. class MutexBase {
  1915. public:
  1916. // Acquires this mutex.
  1917. void Lock() {
  1918. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
  1919. owner_ = pthread_self();
  1920. }
  1921. // Releases this mutex.
  1922. void Unlock() {
  1923. // We don't protect writing to owner_ here, as it's the caller's
  1924. // responsibility to ensure that the current thread holds the
  1925. // mutex when this is called.
  1926. owner_ = 0;
  1927. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
  1928. }
  1929. // Does nothing if the current thread holds the mutex. Otherwise, crashes
  1930. // with high probability.
  1931. void AssertHeld() const {
  1932. GTEST_CHECK_(owner_ == pthread_self())
  1933. << "The current thread is not holding the mutex @" << this;
  1934. }
  1935. // A static mutex may be used before main() is entered. It may even
  1936. // be used before the dynamic initialization stage. Therefore we
  1937. // must be able to initialize a static mutex object at link time.
  1938. // This means MutexBase has to be a POD and its member variables
  1939. // have to be public.
  1940. public:
  1941. pthread_mutex_t mutex_; // The underlying pthread mutex.
  1942. pthread_t owner_; // The thread holding the mutex; 0 means no one holds it.
  1943. };
  1944. // Forward-declares a static mutex.
  1945. # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
  1946. extern ::testing::internal::MutexBase mutex
  1947. // Defines and statically (i.e. at link time) initializes a static mutex.
  1948. # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
  1949. ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, 0 }
  1950. // The Mutex class can only be used for mutexes created at runtime. It
  1951. // shares its API with MutexBase otherwise.
  1952. class Mutex : public MutexBase {
  1953. public:
  1954. Mutex() {
  1955. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
  1956. owner_ = 0;
  1957. }
  1958. ~Mutex() {
  1959. GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
  1960. }
  1961. private:
  1962. GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
  1963. };
  1964. // We cannot name this class MutexLock as the ctor declaration would
  1965. // conflict with a macro named MutexLock, which is defined on some
  1966. // platforms. Hence the typedef trick below.
  1967. class GTestMutexLock {
  1968. public:
  1969. explicit GTestMutexLock(MutexBase* mutex)
  1970. : mutex_(mutex) { mutex_->Lock(); }
  1971. ~GTestMutexLock() { mutex_->Unlock(); }
  1972. private:
  1973. MutexBase* const mutex_;
  1974. GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
  1975. };
  1976. typedef GTestMutexLock MutexLock;
  1977. // Helpers for ThreadLocal.
  1978. // pthread_key_create() requires DeleteThreadLocalValue() to have
  1979. // C-linkage. Therefore it cannot be templatized to access
  1980. // ThreadLocal<T>. Hence the need for class
  1981. // ThreadLocalValueHolderBase.
  1982. class ThreadLocalValueHolderBase {
  1983. public:
  1984. virtual ~ThreadLocalValueHolderBase() {}
  1985. };
  1986. // Called by pthread to delete thread-local data stored by
  1987. // pthread_setspecific().
  1988. extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
  1989. delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
  1990. }
  1991. // Implements thread-local storage on pthreads-based systems.
  1992. //
  1993. // // Thread 1
  1994. // ThreadLocal<int> tl(100); // 100 is the default value for each thread.
  1995. //
  1996. // // Thread 2
  1997. // tl.set(150); // Changes the value for thread 2 only.
  1998. // EXPECT_EQ(150, tl.get());
  1999. //
  2000. // // Thread 1
  2001. // EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value.
  2002. // tl.set(200);
  2003. // EXPECT_EQ(200, tl.get());
  2004. //
  2005. // The template type argument T must have a public copy constructor.
  2006. // In addition, the default ThreadLocal constructor requires T to have
  2007. // a public default constructor.
  2008. //
  2009. // An object managed for a thread by a ThreadLocal instance is deleted
  2010. // when the thread exits. Or, if the ThreadLocal instance dies in
  2011. // that thread, when the ThreadLocal dies. It's the user's
  2012. // responsibility to ensure that all other threads using a ThreadLocal
  2013. // have exited when it dies, or the per-thread objects for those
  2014. // threads will not be deleted.
  2015. //
  2016. // Google Test only uses global ThreadLocal objects. That means they
  2017. // will die after main() has returned. Therefore, no per-thread
  2018. // object managed by Google Test will be leaked as long as all threads
  2019. // using Google Test have exited when main() returns.
  2020. template <typename T>
  2021. class ThreadLocal {
  2022. public:
  2023. ThreadLocal() : key_(CreateKey()),
  2024. default_() {}
  2025. explicit ThreadLocal(const T& value) : key_(CreateKey()),
  2026. default_(value) {}
  2027. ~ThreadLocal() {
  2028. // Destroys the managed object for the current thread, if any.
  2029. DeleteThreadLocalValue(pthread_getspecific(key_));
  2030. // Releases resources associated with the key. This will *not*
  2031. // delete managed objects for other threads.
  2032. GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
  2033. }
  2034. T* pointer() { return GetOrCreateValue(); }
  2035. const T* pointer() const { return GetOrCreateValue(); }
  2036. const T& get() const { return *pointer(); }
  2037. void set(const T& value) { *pointer() = value; }
  2038. private:
  2039. // Holds a value of type T.
  2040. class ValueHolder : public ThreadLocalValueHolderBase {
  2041. public:
  2042. explicit ValueHolder(const T& value) : value_(value) {}
  2043. T* pointer() { return &value_; }
  2044. private:
  2045. T value_;
  2046. GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
  2047. };
  2048. static pthread_key_t CreateKey() {
  2049. pthread_key_t key;
  2050. // When a thread exits, DeleteThreadLocalValue() will be called on
  2051. // the object managed for that thread.
  2052. GTEST_CHECK_POSIX_SUCCESS_(
  2053. pthread_key_create(&key, &DeleteThreadLocalValue));
  2054. return key;
  2055. }
  2056. T* GetOrCreateValue() const {
  2057. ThreadLocalValueHolderBase* const holder =
  2058. static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
  2059. if (holder != NULL) {
  2060. return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
  2061. }
  2062. ValueHolder* const new_holder = new ValueHolder(default_);
  2063. ThreadLocalValueHolderBase* const holder_base = new_holder;
  2064. GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
  2065. return new_holder->pointer();
  2066. }
  2067. // A key pthreads uses for looking up per-thread values.
  2068. const pthread_key_t key_;
  2069. const T default_; // The default value for each thread.
  2070. GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
  2071. };
  2072. # define GTEST_IS_THREADSAFE 1
  2073. #else // GTEST_HAS_PTHREAD
  2074. // A dummy implementation of synchronization primitives (mutex, lock,
  2075. // and thread-local variable). Necessary for compiling Google Test where
  2076. // mutex is not supported - using Google Test in multiple threads is not
  2077. // supported on such platforms.
  2078. class Mutex {
  2079. public:
  2080. Mutex() {}
  2081. void AssertHeld() const {}
  2082. };
  2083. # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
  2084. extern ::testing::internal::Mutex mutex
  2085. # define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
  2086. class GTestMutexLock {
  2087. public:
  2088. explicit GTestMutexLock(Mutex*) {} // NOLINT
  2089. };
  2090. typedef GTestMutexLock MutexLock;
  2091. template <typename T>
  2092. class ThreadLocal {
  2093. public:
  2094. ThreadLocal() : value_() {}
  2095. explicit ThreadLocal(const T& value) : value_(value) {}
  2096. T* pointer() { return &value_; }
  2097. const T* pointer() const { return &value_; }
  2098. const T& get() const { return value_; }
  2099. void set(const T& value) { value_ = value; }
  2100. private:
  2101. T value_;
  2102. };
  2103. // The above synchronization primitives have dummy implementations.
  2104. // Therefore Google Test is not thread-safe.
  2105. # define GTEST_IS_THREADSAFE 0
  2106. #endif // GTEST_HAS_PTHREAD
  2107. // Returns the number of threads running in the process, or 0 to indicate that
  2108. // we cannot detect it.
  2109. GTEST_API_ size_t GetThreadCount();
  2110. // Passing non-POD classes through ellipsis (...) crashes the ARM
  2111. // compiler and generates a warning in Sun Studio. The Nokia Symbian
  2112. // and the IBM XL C/C++ compiler try to instantiate a copy constructor
  2113. // for objects passed through ellipsis (...), failing for uncopyable
  2114. // objects. We define this to ensure that only POD is passed through
  2115. // ellipsis on these systems.
  2116. #if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
  2117. // We lose support for NULL detection where the compiler doesn't like
  2118. // passing non-POD classes through ellipsis (...).
  2119. # define GTEST_ELLIPSIS_NEEDS_POD_ 1
  2120. #else
  2121. # define GTEST_CAN_COMPARE_NULL 1
  2122. #endif
  2123. // The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
  2124. // const T& and const T* in a function template. These compilers
  2125. // _can_ decide between class template specializations for T and T*,
  2126. // so a tr1::type_traits-like is_pointer works.
  2127. #if defined(__SYMBIAN32__) || defined(__IBMCPP__)
  2128. # define GTEST_NEEDS_IS_POINTER_ 1
  2129. #endif
  2130. template <bool bool_value>
  2131. struct bool_constant {
  2132. typedef bool_constant<bool_value> type;
  2133. static const bool value = bool_value;
  2134. };
  2135. template <bool bool_value> const bool bool_constant<bool_value>::value;
  2136. typedef bool_constant<false> false_type;
  2137. typedef bool_constant<true> true_type;
  2138. template <typename T>
  2139. struct is_pointer : public false_type {};
  2140. template <typename T>
  2141. struct is_pointer<T*> : public true_type {};
  2142. template <typename Iterator>
  2143. struct IteratorTraits {
  2144. typedef typename Iterator::value_type value_type;
  2145. };
  2146. template <typename T>
  2147. struct IteratorTraits<T*> {
  2148. typedef T value_type;
  2149. };
  2150. template <typename T>
  2151. struct IteratorTraits<const T*> {
  2152. typedef T value_type;
  2153. };
  2154. #if GTEST_OS_WINDOWS
  2155. # define GTEST_PATH_SEP_ "\\"
  2156. # define GTEST_HAS_ALT_PATH_SEP_ 1
  2157. // The biggest signed integer type the compiler supports.
  2158. typedef __int64 BiggestInt;
  2159. #else
  2160. # define GTEST_PATH_SEP_ "/"
  2161. # define GTEST_HAS_ALT_PATH_SEP_ 0
  2162. typedef long long BiggestInt; // NOLINT
  2163. #endif // GTEST_OS_WINDOWS
  2164. // Utilities for char.
  2165. // isspace(int ch) and friends accept an unsigned char or EOF. char
  2166. // may be signed, depending on the compiler (or compiler flags).
  2167. // Therefore we need to cast a char to unsigned char before calling
  2168. // isspace(), etc.
  2169. inline bool IsAlpha(char ch) {
  2170. return isalpha(static_cast<unsigned char>(ch)) != 0;
  2171. }
  2172. inline bool IsAlNum(char ch) {
  2173. return isalnum(static_cast<unsigned char>(ch)) != 0;
  2174. }
  2175. inline bool IsDigit(char ch) {
  2176. return isdigit(static_cast<unsigned char>(ch)) != 0;
  2177. }
  2178. inline bool IsLower(char ch) {
  2179. return islower(static_cast<unsigned char>(ch)) != 0;
  2180. }
  2181. inline bool IsSpace(char ch) {
  2182. return isspace(static_cast<unsigned char>(ch)) != 0;
  2183. }
  2184. inline bool IsUpper(char ch) {
  2185. return isupper(static_cast<unsigned char>(ch)) != 0;
  2186. }
  2187. inline bool IsXDigit(char ch) {
  2188. return isxdigit(static_cast<unsigned char>(ch)) != 0;
  2189. }
  2190. inline char ToLower(char ch) {
  2191. return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
  2192. }
  2193. inline char ToUpper(char ch) {
  2194. return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
  2195. }
  2196. // The testing::internal::posix namespace holds wrappers for common
  2197. // POSIX functions. These wrappers hide the differences between
  2198. // Windows/MSVC and POSIX systems. Since some compilers define these
  2199. // standard functions as macros, the wrapper cannot have the same name
  2200. // as the wrapped function.
  2201. namespace posix {
  2202. // Functions with a different name on Windows.
  2203. #if GTEST_OS_WINDOWS
  2204. typedef struct _stat StatStruct;
  2205. # ifdef __BORLANDC__
  2206. inline int IsATTY(int fd) { return isatty(fd); }
  2207. inline int StrCaseCmp(const char* s1, const char* s2) {
  2208. return stricmp(s1, s2);
  2209. }
  2210. inline char* StrDup(const char* src) { return strdup(src); }
  2211. # else // !__BORLANDC__
  2212. # if GTEST_OS_WINDOWS_MOBILE
  2213. inline int IsATTY(int /* fd */) { return 0; }
  2214. # else
  2215. inline int IsATTY(int fd) { return _isatty(fd); }
  2216. # endif // GTEST_OS_WINDOWS_MOBILE
  2217. inline int StrCaseCmp(const char* s1, const char* s2) {
  2218. return _stricmp(s1, s2);
  2219. }
  2220. inline char* StrDup(const char* src) { return _strdup(src); }
  2221. # endif // __BORLANDC__
  2222. # if GTEST_OS_WINDOWS_MOBILE
  2223. inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
  2224. // Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
  2225. // time and thus not defined there.
  2226. # else
  2227. inline int FileNo(FILE* file) { return _fileno(file); }
  2228. inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
  2229. inline int RmDir(const char* dir) { return _rmdir(dir); }
  2230. inline bool IsDir(const StatStruct& st) {
  2231. return (_S_IFDIR & st.st_mode) != 0;
  2232. }
  2233. # endif // GTEST_OS_WINDOWS_MOBILE
  2234. #else
  2235. typedef struct stat StatStruct;
  2236. inline int FileNo(FILE* file) { return fileno(file); }
  2237. inline int IsATTY(int fd) { return isatty(fd); }
  2238. inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
  2239. inline int StrCaseCmp(const char* s1, const char* s2) {
  2240. return strcasecmp(s1, s2);
  2241. }
  2242. inline char* StrDup(const char* src) { return strdup(src); }
  2243. inline int RmDir(const char* dir) { return rmdir(dir); }
  2244. inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
  2245. #endif // GTEST_OS_WINDOWS
  2246. // Functions deprecated by MSVC 8.0.
  2247. #ifdef _MSC_VER
  2248. // Temporarily disable warning 4996 (deprecated function).
  2249. # pragma warning(push)
  2250. # pragma warning(disable:4996)
  2251. #endif
  2252. inline const char* StrNCpy(char* dest, const char* src, size_t n) {
  2253. return strncpy(dest, src, n);
  2254. }
  2255. // ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
  2256. // StrError() aren't needed on Windows CE at this time and thus not
  2257. // defined there.
  2258. #if !GTEST_OS_WINDOWS_MOBILE
  2259. inline int ChDir(const char* dir) { return chdir(dir); }
  2260. #endif
  2261. inline FILE* FOpen(const char* path, const char* mode) {
  2262. return fopen(path, mode);
  2263. }
  2264. #if !GTEST_OS_WINDOWS_MOBILE
  2265. inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
  2266. return freopen(path, mode, stream);
  2267. }
  2268. inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
  2269. #endif
  2270. inline int FClose(FILE* fp) { return fclose(fp); }
  2271. #if !GTEST_OS_WINDOWS_MOBILE
  2272. inline int Read(int fd, void* buf, unsigned int count) {
  2273. return static_cast<int>(read(fd, buf, count));
  2274. }
  2275. inline int Write(int fd, const void* buf, unsigned int count) {
  2276. return static_cast<int>(write(fd, buf, count));
  2277. }
  2278. inline int Close(int fd) { return close(fd); }
  2279. inline const char* StrError(int errnum) { return strerror(errnum); }
  2280. #endif
  2281. inline const char* GetEnv(const char* name) {
  2282. #if GTEST_OS_WINDOWS_MOBILE
  2283. // We are on Windows CE, which has no environment variables.
  2284. return NULL;
  2285. #elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
  2286. // Environment variables which we programmatically clear will be set to the
  2287. // empty string rather than unset (NULL). Handle that case.
  2288. const char* const env = getenv(name);
  2289. return (env != NULL && env[0] != '\0') ? env : NULL;
  2290. #else
  2291. return getenv(name);
  2292. #endif
  2293. }
  2294. #ifdef _MSC_VER
  2295. # pragma warning(pop) // Restores the warning state.
  2296. #endif
  2297. #if GTEST_OS_WINDOWS_MOBILE
  2298. // Windows CE has no C library. The abort() function is used in
  2299. // several places in Google Test. This implementation provides a reasonable
  2300. // imitation of standard behaviour.
  2301. void Abort();
  2302. #else
  2303. inline void Abort() { abort(); }
  2304. #endif // GTEST_OS_WINDOWS_MOBILE
  2305. } // namespace posix
  2306. // The maximum number a BiggestInt can represent. This definition
  2307. // works no matter BiggestInt is represented in one's complement or
  2308. // two's complement.
  2309. //
  2310. // We cannot rely on numeric_limits in STL, as __int64 and long long
  2311. // are not part of standard C++ and numeric_limits doesn't need to be
  2312. // defined for them.
  2313. const BiggestInt kMaxBiggestInt =
  2314. ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
  2315. // This template class serves as a compile-time function from size to
  2316. // type. It maps a size in bytes to a primitive type with that
  2317. // size. e.g.
  2318. //
  2319. // TypeWithSize<4>::UInt
  2320. //
  2321. // is typedef-ed to be unsigned int (unsigned integer made up of 4
  2322. // bytes).
  2323. //
  2324. // Such functionality should belong to STL, but I cannot find it
  2325. // there.
  2326. //
  2327. // Google Test uses this class in the implementation of floating-point
  2328. // comparison.
  2329. //
  2330. // For now it only handles UInt (unsigned int) as that's all Google Test
  2331. // needs. Other types can be easily added in the future if need
  2332. // arises.
  2333. template <size_t size>
  2334. class TypeWithSize {
  2335. public:
  2336. // This prevents the user from using TypeWithSize<N> with incorrect
  2337. // values of N.
  2338. typedef void UInt;
  2339. };
  2340. // The specialization for size 4.
  2341. template <>
  2342. class TypeWithSize<4> {
  2343. public:
  2344. // unsigned int has size 4 in both gcc and MSVC.
  2345. //
  2346. // As base/basictypes.h doesn't compile on Windows, we cannot use
  2347. // uint32, uint64, and etc here.
  2348. typedef int Int;
  2349. typedef unsigned int UInt;
  2350. };
  2351. // The specialization for size 8.
  2352. template <>
  2353. class TypeWithSize<8> {
  2354. public:
  2355. #if GTEST_OS_WINDOWS
  2356. typedef __int64 Int;
  2357. typedef unsigned __int64 UInt;
  2358. #else
  2359. typedef long long Int; // NOLINT
  2360. typedef unsigned long long UInt; // NOLINT
  2361. #endif // GTEST_OS_WINDOWS
  2362. };
  2363. // Integer types of known sizes.
  2364. typedef TypeWithSize<4>::Int Int32;
  2365. typedef TypeWithSize<4>::UInt UInt32;
  2366. typedef TypeWithSize<8>::Int Int64;
  2367. typedef TypeWithSize<8>::UInt UInt64;
  2368. typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds.
  2369. // Utilities for command line flags and environment variables.
  2370. // Macro for referencing flags.
  2371. #define GTEST_FLAG(name) FLAGS_gtest_##name
  2372. // Macros for declaring flags.
  2373. #define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
  2374. #define GTEST_DECLARE_int32_(name) \
  2375. GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
  2376. #define GTEST_DECLARE_string_(name) \
  2377. GTEST_API_ extern ::testing::internal::String GTEST_FLAG(name)
  2378. // Macros for defining flags.
  2379. #define GTEST_DEFINE_bool_(name, default_val, doc) \
  2380. GTEST_API_ bool GTEST_FLAG(name) = (default_val)
  2381. #define GTEST_DEFINE_int32_(name, default_val, doc) \
  2382. GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
  2383. #define GTEST_DEFINE_string_(name, default_val, doc) \
  2384. GTEST_API_ ::testing::internal::String GTEST_FLAG(name) = (default_val)
  2385. // Parses 'str' for a 32-bit signed integer. If successful, writes the result
  2386. // to *value and returns true; otherwise leaves *value unchanged and returns
  2387. // false.
  2388. // TODO(chandlerc): Find a better way to refactor flag and environment parsing
  2389. // out of both gtest-port.cc and gtest.cc to avoid exporting this utility
  2390. // function.
  2391. bool ParseInt32(const Message& src_text, const char* str, Int32* value);
  2392. // Parses a bool/Int32/string from the environment variable
  2393. // corresponding to the given Google Test flag.
  2394. bool BoolFromGTestEnv(const char* flag, bool default_val);
  2395. GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
  2396. const char* StringFromGTestEnv(const char* flag, const char* default_val);
  2397. } // namespace internal
  2398. } // namespace testing
  2399. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
  2400. #if GTEST_OS_LINUX
  2401. # include <stdlib.h>
  2402. # include <sys/types.h>
  2403. # include <sys/wait.h>
  2404. # include <unistd.h>
  2405. #endif // GTEST_OS_LINUX
  2406. #include <ctype.h>
  2407. #include <string.h>
  2408. #include <iomanip>
  2409. #include <limits>
  2410. #include <set>
  2411. // Copyright 2005, Google Inc.
  2412. // All rights reserved.
  2413. //
  2414. // Redistribution and use in source and binary forms, with or without
  2415. // modification, are permitted provided that the following conditions are
  2416. // met:
  2417. //
  2418. // * Redistributions of source code must retain the above copyright
  2419. // notice, this list of conditions and the following disclaimer.
  2420. // * Redistributions in binary form must reproduce the above
  2421. // copyright notice, this list of conditions and the following disclaimer
  2422. // in the documentation and/or other materials provided with the
  2423. // distribution.
  2424. // * Neither the name of Google Inc. nor the names of its
  2425. // contributors may be used to endorse or promote products derived from
  2426. // this software without specific prior written permission.
  2427. //
  2428. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  2429. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  2430. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  2431. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  2432. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  2433. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  2434. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  2435. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  2436. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  2437. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  2438. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2439. //
  2440. // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
  2441. //
  2442. // The Google C++ Testing Framework (Google Test)
  2443. //
  2444. // This header file declares the String class and functions used internally by
  2445. // Google Test. They are subject to change without notice. They should not used
  2446. // by code external to Google Test.
  2447. //
  2448. // This header file is #included by <gtest/internal/gtest-internal.h>.
  2449. // It should not be #included by other files.
  2450. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
  2451. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
  2452. #ifdef __BORLANDC__
  2453. // string.h is not guaranteed to provide strcpy on C++ Builder.
  2454. # include <mem.h>
  2455. #endif
  2456. #include <string.h>
  2457. #include <string>
  2458. namespace testing {
  2459. namespace internal {
  2460. // String - a UTF-8 string class.
  2461. //
  2462. // For historic reasons, we don't use std::string.
  2463. //
  2464. // TODO(wan@google.com): replace this class with std::string or
  2465. // implement it in terms of the latter.
  2466. //
  2467. // Note that String can represent both NULL and the empty string,
  2468. // while std::string cannot represent NULL.
  2469. //
  2470. // NULL and the empty string are considered different. NULL is less
  2471. // than anything (including the empty string) except itself.
  2472. //
  2473. // This class only provides minimum functionality necessary for
  2474. // implementing Google Test. We do not intend to implement a full-fledged
  2475. // string class here.
  2476. //
  2477. // Since the purpose of this class is to provide a substitute for
  2478. // std::string on platforms where it cannot be used, we define a copy
  2479. // constructor and assignment operators such that we don't need
  2480. // conditional compilation in a lot of places.
  2481. //
  2482. // In order to make the representation efficient, the d'tor of String
  2483. // is not virtual. Therefore DO NOT INHERIT FROM String.
  2484. class GTEST_API_ String {
  2485. public:
  2486. // Static utility methods
  2487. // Returns the input enclosed in double quotes if it's not NULL;
  2488. // otherwise returns "(null)". For example, "\"Hello\"" is returned
  2489. // for input "Hello".
  2490. //
  2491. // This is useful for printing a C string in the syntax of a literal.
  2492. //
  2493. // Known issue: escape sequences are not handled yet.
  2494. static String ShowCStringQuoted(const char* c_str);
  2495. // Clones a 0-terminated C string, allocating memory using new. The
  2496. // caller is responsible for deleting the return value using
  2497. // delete[]. Returns the cloned string, or NULL if the input is
  2498. // NULL.
  2499. //
  2500. // This is different from strdup() in string.h, which allocates
  2501. // memory using malloc().
  2502. static const char* CloneCString(const char* c_str);
  2503. #if GTEST_OS_WINDOWS_MOBILE
  2504. // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
  2505. // able to pass strings to Win32 APIs on CE we need to convert them
  2506. // to 'Unicode', UTF-16.
  2507. // Creates a UTF-16 wide string from the given ANSI string, allocating
  2508. // memory using new. The caller is responsible for deleting the return
  2509. // value using delete[]. Returns the wide string, or NULL if the
  2510. // input is NULL.
  2511. //
  2512. // The wide string is created using the ANSI codepage (CP_ACP) to
  2513. // match the behaviour of the ANSI versions of Win32 calls and the
  2514. // C runtime.
  2515. static LPCWSTR AnsiToUtf16(const char* c_str);
  2516. // Creates an ANSI string from the given wide string, allocating
  2517. // memory using new. The caller is responsible for deleting the return
  2518. // value using delete[]. Returns the ANSI string, or NULL if the
  2519. // input is NULL.
  2520. //
  2521. // The returned string is created using the ANSI codepage (CP_ACP) to
  2522. // match the behaviour of the ANSI versions of Win32 calls and the
  2523. // C runtime.
  2524. static const char* Utf16ToAnsi(LPCWSTR utf16_str);
  2525. #endif
  2526. // Compares two C strings. Returns true iff they have the same content.
  2527. //
  2528. // Unlike strcmp(), this function can handle NULL argument(s). A
  2529. // NULL C string is considered different to any non-NULL C string,
  2530. // including the empty string.
  2531. static bool CStringEquals(const char* lhs, const char* rhs);
  2532. // Converts a wide C string to a String using the UTF-8 encoding.
  2533. // NULL will be converted to "(null)". If an error occurred during
  2534. // the conversion, "(failed to convert from wide string)" is
  2535. // returned.
  2536. static String ShowWideCString(const wchar_t* wide_c_str);
  2537. // Similar to ShowWideCString(), except that this function encloses
  2538. // the converted string in double quotes.
  2539. static String ShowWideCStringQuoted(const wchar_t* wide_c_str);
  2540. // Compares two wide C strings. Returns true iff they have the same
  2541. // content.
  2542. //
  2543. // Unlike wcscmp(), this function can handle NULL argument(s). A
  2544. // NULL C string is considered different to any non-NULL C string,
  2545. // including the empty string.
  2546. static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
  2547. // Compares two C strings, ignoring case. Returns true iff they
  2548. // have the same content.
  2549. //
  2550. // Unlike strcasecmp(), this function can handle NULL argument(s).
  2551. // A NULL C string is considered different to any non-NULL C string,
  2552. // including the empty string.
  2553. static bool CaseInsensitiveCStringEquals(const char* lhs,
  2554. const char* rhs);
  2555. // Compares two wide C strings, ignoring case. Returns true iff they
  2556. // have the same content.
  2557. //
  2558. // Unlike wcscasecmp(), this function can handle NULL argument(s).
  2559. // A NULL C string is considered different to any non-NULL wide C string,
  2560. // including the empty string.
  2561. // NB: The implementations on different platforms slightly differ.
  2562. // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
  2563. // environment variable. On GNU platform this method uses wcscasecmp
  2564. // which compares according to LC_CTYPE category of the current locale.
  2565. // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
  2566. // current locale.
  2567. static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
  2568. const wchar_t* rhs);
  2569. // Formats a list of arguments to a String, using the same format
  2570. // spec string as for printf.
  2571. //
  2572. // We do not use the StringPrintf class as it is not universally
  2573. // available.
  2574. //
  2575. // The result is limited to 4096 characters (including the tailing
  2576. // 0). If 4096 characters are not enough to format the input,
  2577. // "<buffer exceeded>" is returned.
  2578. static String Format(const char* format, ...);
  2579. // C'tors
  2580. // The default c'tor constructs a NULL string.
  2581. String() : c_str_(NULL), length_(0) {}
  2582. // Constructs a String by cloning a 0-terminated C string.
  2583. String(const char* a_c_str) { // NOLINT
  2584. if (a_c_str == NULL) {
  2585. c_str_ = NULL;
  2586. length_ = 0;
  2587. } else {
  2588. ConstructNonNull(a_c_str, strlen(a_c_str));
  2589. }
  2590. }
  2591. // Constructs a String by copying a given number of chars from a
  2592. // buffer. E.g. String("hello", 3) creates the string "hel",
  2593. // String("a\0bcd", 4) creates "a\0bc", String(NULL, 0) creates "",
  2594. // and String(NULL, 1) results in access violation.
  2595. String(const char* buffer, size_t a_length) {
  2596. ConstructNonNull(buffer, a_length);
  2597. }
  2598. // The copy c'tor creates a new copy of the string. The two
  2599. // String objects do not share content.
  2600. String(const String& str) : c_str_(NULL), length_(0) { *this = str; }
  2601. // D'tor. String is intended to be a final class, so the d'tor
  2602. // doesn't need to be virtual.
  2603. ~String() { delete[] c_str_; }
  2604. // Allows a String to be implicitly converted to an ::std::string or
  2605. // ::string, and vice versa. Converting a String containing a NULL
  2606. // pointer to ::std::string or ::string is undefined behavior.
  2607. // Converting a ::std::string or ::string containing an embedded NUL
  2608. // character to a String will result in the prefix up to the first
  2609. // NUL character.
  2610. String(const ::std::string& str) {
  2611. ConstructNonNull(str.c_str(), str.length());
  2612. }
  2613. operator ::std::string() const { return ::std::string(c_str(), length()); }
  2614. #if GTEST_HAS_GLOBAL_STRING
  2615. String(const ::string& str) {
  2616. ConstructNonNull(str.c_str(), str.length());
  2617. }
  2618. operator ::string() const { return ::string(c_str(), length()); }
  2619. #endif // GTEST_HAS_GLOBAL_STRING
  2620. // Returns true iff this is an empty string (i.e. "").
  2621. bool empty() const { return (c_str() != NULL) && (length() == 0); }
  2622. // Compares this with another String.
  2623. // Returns < 0 if this is less than rhs, 0 if this is equal to rhs, or > 0
  2624. // if this is greater than rhs.
  2625. int Compare(const String& rhs) const;
  2626. // Returns true iff this String equals the given C string. A NULL
  2627. // string and a non-NULL string are considered not equal.
  2628. bool operator==(const char* a_c_str) const { return Compare(a_c_str) == 0; }
  2629. // Returns true iff this String is less than the given String. A
  2630. // NULL string is considered less than "".
  2631. bool operator<(const String& rhs) const { return Compare(rhs) < 0; }
  2632. // Returns true iff this String doesn't equal the given C string. A NULL
  2633. // string and a non-NULL string are considered not equal.
  2634. bool operator!=(const char* a_c_str) const { return !(*this == a_c_str); }
  2635. // Returns true iff this String ends with the given suffix. *Any*
  2636. // String is considered to end with a NULL or empty suffix.
  2637. bool EndsWith(const char* suffix) const;
  2638. // Returns true iff this String ends with the given suffix, not considering
  2639. // case. Any String is considered to end with a NULL or empty suffix.
  2640. bool EndsWithCaseInsensitive(const char* suffix) const;
  2641. // Returns the length of the encapsulated string, or 0 if the
  2642. // string is NULL.
  2643. size_t length() const { return length_; }
  2644. // Gets the 0-terminated C string this String object represents.
  2645. // The String object still owns the string. Therefore the caller
  2646. // should NOT delete the return value.
  2647. const char* c_str() const { return c_str_; }
  2648. // Assigns a C string to this object. Self-assignment works.
  2649. const String& operator=(const char* a_c_str) {
  2650. return *this = String(a_c_str);
  2651. }
  2652. // Assigns a String object to this object. Self-assignment works.
  2653. const String& operator=(const String& rhs) {
  2654. if (this != &rhs) {
  2655. delete[] c_str_;
  2656. if (rhs.c_str() == NULL) {
  2657. c_str_ = NULL;
  2658. length_ = 0;
  2659. } else {
  2660. ConstructNonNull(rhs.c_str(), rhs.length());
  2661. }
  2662. }
  2663. return *this;
  2664. }
  2665. private:
  2666. // Constructs a non-NULL String from the given content. This
  2667. // function can only be called when c_str_ has not been allocated.
  2668. // ConstructNonNull(NULL, 0) results in an empty string ("").
  2669. // ConstructNonNull(NULL, non_zero) is undefined behavior.
  2670. void ConstructNonNull(const char* buffer, size_t a_length) {
  2671. char* const str = new char[a_length + 1];
  2672. memcpy(str, buffer, a_length);
  2673. str[a_length] = '\0';
  2674. c_str_ = str;
  2675. length_ = a_length;
  2676. }
  2677. const char* c_str_;
  2678. size_t length_;
  2679. }; // class String
  2680. // Streams a String to an ostream. Each '\0' character in the String
  2681. // is replaced with "\\0".
  2682. inline ::std::ostream& operator<<(::std::ostream& os, const String& str) {
  2683. if (str.c_str() == NULL) {
  2684. os << "(null)";
  2685. } else {
  2686. const char* const c_str = str.c_str();
  2687. for (size_t i = 0; i != str.length(); i++) {
  2688. if (c_str[i] == '\0') {
  2689. os << "\\0";
  2690. } else {
  2691. os << c_str[i];
  2692. }
  2693. }
  2694. }
  2695. return os;
  2696. }
  2697. // Gets the content of the stringstream's buffer as a String. Each '\0'
  2698. // character in the buffer is replaced with "\\0".
  2699. GTEST_API_ String StringStreamToString(::std::stringstream* stream);
  2700. // Converts a streamable value to a String. A NULL pointer is
  2701. // converted to "(null)". When the input value is a ::string,
  2702. // ::std::string, ::wstring, or ::std::wstring object, each NUL
  2703. // character in it is replaced with "\\0".
  2704. // Declared here but defined in gtest.h, so that it has access
  2705. // to the definition of the Message class, required by the ARM
  2706. // compiler.
  2707. template <typename T>
  2708. String StreamableToString(const T& streamable);
  2709. } // namespace internal
  2710. } // namespace testing
  2711. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
  2712. // Copyright 2008, Google Inc.
  2713. // All rights reserved.
  2714. //
  2715. // Redistribution and use in source and binary forms, with or without
  2716. // modification, are permitted provided that the following conditions are
  2717. // met:
  2718. //
  2719. // * Redistributions of source code must retain the above copyright
  2720. // notice, this list of conditions and the following disclaimer.
  2721. // * Redistributions in binary form must reproduce the above
  2722. // copyright notice, this list of conditions and the following disclaimer
  2723. // in the documentation and/or other materials provided with the
  2724. // distribution.
  2725. // * Neither the name of Google Inc. nor the names of its
  2726. // contributors may be used to endorse or promote products derived from
  2727. // this software without specific prior written permission.
  2728. //
  2729. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  2730. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  2731. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  2732. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  2733. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  2734. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  2735. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  2736. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  2737. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  2738. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  2739. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2740. //
  2741. // Author: keith.ray@gmail.com (Keith Ray)
  2742. //
  2743. // Google Test filepath utilities
  2744. //
  2745. // This header file declares classes and functions used internally by
  2746. // Google Test. They are subject to change without notice.
  2747. //
  2748. // This file is #included in <gtest/internal/gtest-internal.h>.
  2749. // Do not include this header file separately!
  2750. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
  2751. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
  2752. namespace testing {
  2753. namespace internal {
  2754. // FilePath - a class for file and directory pathname manipulation which
  2755. // handles platform-specific conventions (like the pathname separator).
  2756. // Used for helper functions for naming files in a directory for xml output.
  2757. // Except for Set methods, all methods are const or static, which provides an
  2758. // "immutable value object" -- useful for peace of mind.
  2759. // A FilePath with a value ending in a path separator ("like/this/") represents
  2760. // a directory, otherwise it is assumed to represent a file. In either case,
  2761. // it may or may not represent an actual file or directory in the file system.
  2762. // Names are NOT checked for syntax correctness -- no checking for illegal
  2763. // characters, malformed paths, etc.
  2764. class GTEST_API_ FilePath {
  2765. public:
  2766. FilePath() : pathname_("") { }
  2767. FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
  2768. explicit FilePath(const char* pathname) : pathname_(pathname) {
  2769. Normalize();
  2770. }
  2771. explicit FilePath(const String& pathname) : pathname_(pathname) {
  2772. Normalize();
  2773. }
  2774. FilePath& operator=(const FilePath& rhs) {
  2775. Set(rhs);
  2776. return *this;
  2777. }
  2778. void Set(const FilePath& rhs) {
  2779. pathname_ = rhs.pathname_;
  2780. }
  2781. String ToString() const { return pathname_; }
  2782. const char* c_str() const { return pathname_.c_str(); }
  2783. // Returns the current working directory, or "" if unsuccessful.
  2784. static FilePath GetCurrentDir();
  2785. // Given directory = "dir", base_name = "test", number = 0,
  2786. // extension = "xml", returns "dir/test.xml". If number is greater
  2787. // than zero (e.g., 12), returns "dir/test_12.xml".
  2788. // On Windows platform, uses \ as the separator rather than /.
  2789. static FilePath MakeFileName(const FilePath& directory,
  2790. const FilePath& base_name,
  2791. int number,
  2792. const char* extension);
  2793. // Given directory = "dir", relative_path = "test.xml",
  2794. // returns "dir/test.xml".
  2795. // On Windows, uses \ as the separator rather than /.
  2796. static FilePath ConcatPaths(const FilePath& directory,
  2797. const FilePath& relative_path);
  2798. // Returns a pathname for a file that does not currently exist. The pathname
  2799. // will be directory/base_name.extension or
  2800. // directory/base_name_<number>.extension if directory/base_name.extension
  2801. // already exists. The number will be incremented until a pathname is found
  2802. // that does not already exist.
  2803. // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
  2804. // There could be a race condition if two or more processes are calling this
  2805. // function at the same time -- they could both pick the same filename.
  2806. static FilePath GenerateUniqueFileName(const FilePath& directory,
  2807. const FilePath& base_name,
  2808. const char* extension);
  2809. // Returns true iff the path is NULL or "".
  2810. bool IsEmpty() const { return c_str() == NULL || *c_str() == '\0'; }
  2811. // If input name has a trailing separator character, removes it and returns
  2812. // the name, otherwise return the name string unmodified.
  2813. // On Windows platform, uses \ as the separator, other platforms use /.
  2814. FilePath RemoveTrailingPathSeparator() const;
  2815. // Returns a copy of the FilePath with the directory part removed.
  2816. // Example: FilePath("path/to/file").RemoveDirectoryName() returns
  2817. // FilePath("file"). If there is no directory part ("just_a_file"), it returns
  2818. // the FilePath unmodified. If there is no file part ("just_a_dir/") it
  2819. // returns an empty FilePath ("").
  2820. // On Windows platform, '\' is the path separator, otherwise it is '/'.
  2821. FilePath RemoveDirectoryName() const;
  2822. // RemoveFileName returns the directory path with the filename removed.
  2823. // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
  2824. // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
  2825. // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
  2826. // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
  2827. // On Windows platform, '\' is the path separator, otherwise it is '/'.
  2828. FilePath RemoveFileName() const;
  2829. // Returns a copy of the FilePath with the case-insensitive extension removed.
  2830. // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
  2831. // FilePath("dir/file"). If a case-insensitive extension is not
  2832. // found, returns a copy of the original FilePath.
  2833. FilePath RemoveExtension(const char* extension) const;
  2834. // Creates directories so that path exists. Returns true if successful or if
  2835. // the directories already exist; returns false if unable to create
  2836. // directories for any reason. Will also return false if the FilePath does
  2837. // not represent a directory (that is, it doesn't end with a path separator).
  2838. bool CreateDirectoriesRecursively() const;
  2839. // Create the directory so that path exists. Returns true if successful or
  2840. // if the directory already exists; returns false if unable to create the
  2841. // directory for any reason, including if the parent directory does not
  2842. // exist. Not named "CreateDirectory" because that's a macro on Windows.
  2843. bool CreateFolder() const;
  2844. // Returns true if FilePath describes something in the file-system,
  2845. // either a file, directory, or whatever, and that something exists.
  2846. bool FileOrDirectoryExists() const;
  2847. // Returns true if pathname describes a directory in the file-system
  2848. // that exists.
  2849. bool DirectoryExists() const;
  2850. // Returns true if FilePath ends with a path separator, which indicates that
  2851. // it is intended to represent a directory. Returns false otherwise.
  2852. // This does NOT check that a directory (or file) actually exists.
  2853. bool IsDirectory() const;
  2854. // Returns true if pathname describes a root directory. (Windows has one
  2855. // root directory per disk drive.)
  2856. bool IsRootDirectory() const;
  2857. // Returns true if pathname describes an absolute path.
  2858. bool IsAbsolutePath() const;
  2859. private:
  2860. // Replaces multiple consecutive separators with a single separator.
  2861. // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
  2862. // redundancies that might be in a pathname involving "." or "..".
  2863. //
  2864. // A pathname with multiple consecutive separators may occur either through
  2865. // user error or as a result of some scripts or APIs that generate a pathname
  2866. // with a trailing separator. On other platforms the same API or script
  2867. // may NOT generate a pathname with a trailing "/". Then elsewhere that
  2868. // pathname may have another "/" and pathname components added to it,
  2869. // without checking for the separator already being there.
  2870. // The script language and operating system may allow paths like "foo//bar"
  2871. // but some of the functions in FilePath will not handle that correctly. In
  2872. // particular, RemoveTrailingPathSeparator() only removes one separator, and
  2873. // it is called in CreateDirectoriesRecursively() assuming that it will change
  2874. // a pathname from directory syntax (trailing separator) to filename syntax.
  2875. //
  2876. // On Windows this method also replaces the alternate path separator '/' with
  2877. // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
  2878. // "bar\\foo".
  2879. void Normalize();
  2880. // Returns a pointer to the last occurence of a valid path separator in
  2881. // the FilePath. On Windows, for example, both '/' and '\' are valid path
  2882. // separators. Returns NULL if no path separator was found.
  2883. const char* FindLastPathSeparator() const;
  2884. String pathname_;
  2885. }; // class FilePath
  2886. } // namespace internal
  2887. } // namespace testing
  2888. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
  2889. // This file was GENERATED by command:
  2890. // pump.py gtest-type-util.h.pump
  2891. // DO NOT EDIT BY HAND!!!
  2892. // Copyright 2008 Google Inc.
  2893. // All Rights Reserved.
  2894. //
  2895. // Redistribution and use in source and binary forms, with or without
  2896. // modification, are permitted provided that the following conditions are
  2897. // met:
  2898. //
  2899. // * Redistributions of source code must retain the above copyright
  2900. // notice, this list of conditions and the following disclaimer.
  2901. // * Redistributions in binary form must reproduce the above
  2902. // copyright notice, this list of conditions and the following disclaimer
  2903. // in the documentation and/or other materials provided with the
  2904. // distribution.
  2905. // * Neither the name of Google Inc. nor the names of its
  2906. // contributors may be used to endorse or promote products derived from
  2907. // this software without specific prior written permission.
  2908. //
  2909. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  2910. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  2911. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  2912. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  2913. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  2914. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  2915. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  2916. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  2917. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  2918. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  2919. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2920. //
  2921. // Author: wan@google.com (Zhanyong Wan)
  2922. // Type utilities needed for implementing typed and type-parameterized
  2923. // tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
  2924. //
  2925. // Currently we support at most 50 types in a list, and at most 50
  2926. // type-parameterized tests in one type-parameterized test case.
  2927. // Please contact googletestframework@googlegroups.com if you need
  2928. // more.
  2929. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
  2930. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
  2931. // #ifdef __GNUC__ is too general here. It is possible to use gcc without using
  2932. // libstdc++ (which is where cxxabi.h comes from).
  2933. # ifdef __GLIBCXX__
  2934. # include <cxxabi.h>
  2935. # elif defined(__HP_aCC)
  2936. # include <acxx_demangle.h>
  2937. # endif // __GLIBCXX__
  2938. namespace testing {
  2939. namespace internal {
  2940. // GetTypeName<T>() returns a human-readable name of type T.
  2941. // NB: This function is also used in Google Mock, so don't move it inside of
  2942. // the typed-test-only section below.
  2943. template <typename T>
  2944. String GetTypeName() {
  2945. # if GTEST_HAS_RTTI
  2946. const char* const name = typeid(T).name();
  2947. # if defined(__GLIBCXX__) || defined(__HP_aCC)
  2948. int status = 0;
  2949. // gcc's implementation of typeid(T).name() mangles the type name,
  2950. // so we have to demangle it.
  2951. # ifdef __GLIBCXX__
  2952. using abi::__cxa_demangle;
  2953. # endif // __GLIBCXX__
  2954. char* const readable_name = __cxa_demangle(name, 0, 0, &status);
  2955. const String name_str(status == 0 ? readable_name : name);
  2956. free(readable_name);
  2957. return name_str;
  2958. # else
  2959. return name;
  2960. # endif // __GLIBCXX__ || __HP_aCC
  2961. # else
  2962. return "<type>";
  2963. # endif // GTEST_HAS_RTTI
  2964. }
  2965. #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  2966. // AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
  2967. // type. This can be used as a compile-time assertion to ensure that
  2968. // two types are equal.
  2969. template <typename T1, typename T2>
  2970. struct AssertTypeEq;
  2971. template <typename T>
  2972. struct AssertTypeEq<T, T> {
  2973. typedef bool type;
  2974. };
  2975. // A unique type used as the default value for the arguments of class
  2976. // template Types. This allows us to simulate variadic templates
  2977. // (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
  2978. // support directly.
  2979. struct None {};
  2980. // The following family of struct and struct templates are used to
  2981. // represent type lists. In particular, TypesN<T1, T2, ..., TN>
  2982. // represents a type list with N types (T1, T2, ..., and TN) in it.
  2983. // Except for Types0, every struct in the family has two member types:
  2984. // Head for the first type in the list, and Tail for the rest of the
  2985. // list.
  2986. // The empty type list.
  2987. struct Types0 {};
  2988. // Type lists of length 1, 2, 3, and so on.
  2989. template <typename T1>
  2990. struct Types1 {
  2991. typedef T1 Head;
  2992. typedef Types0 Tail;
  2993. };
  2994. template <typename T1, typename T2>
  2995. struct Types2 {
  2996. typedef T1 Head;
  2997. typedef Types1<T2> Tail;
  2998. };
  2999. template <typename T1, typename T2, typename T3>
  3000. struct Types3 {
  3001. typedef T1 Head;
  3002. typedef Types2<T2, T3> Tail;
  3003. };
  3004. template <typename T1, typename T2, typename T3, typename T4>
  3005. struct Types4 {
  3006. typedef T1 Head;
  3007. typedef Types3<T2, T3, T4> Tail;
  3008. };
  3009. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  3010. struct Types5 {
  3011. typedef T1 Head;
  3012. typedef Types4<T2, T3, T4, T5> Tail;
  3013. };
  3014. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3015. typename T6>
  3016. struct Types6 {
  3017. typedef T1 Head;
  3018. typedef Types5<T2, T3, T4, T5, T6> Tail;
  3019. };
  3020. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3021. typename T6, typename T7>
  3022. struct Types7 {
  3023. typedef T1 Head;
  3024. typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
  3025. };
  3026. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3027. typename T6, typename T7, typename T8>
  3028. struct Types8 {
  3029. typedef T1 Head;
  3030. typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
  3031. };
  3032. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3033. typename T6, typename T7, typename T8, typename T9>
  3034. struct Types9 {
  3035. typedef T1 Head;
  3036. typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
  3037. };
  3038. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3039. typename T6, typename T7, typename T8, typename T9, typename T10>
  3040. struct Types10 {
  3041. typedef T1 Head;
  3042. typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> 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>
  3047. struct Types11 {
  3048. typedef T1 Head;
  3049. typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> 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>
  3054. struct Types12 {
  3055. typedef T1 Head;
  3056. typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> 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>
  3061. struct Types13 {
  3062. typedef T1 Head;
  3063. typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> 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>
  3068. struct Types14 {
  3069. typedef T1 Head;
  3070. typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
  3071. };
  3072. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3073. typename T6, typename T7, typename T8, typename T9, typename T10,
  3074. typename T11, typename T12, typename T13, typename T14, typename T15>
  3075. struct Types15 {
  3076. typedef T1 Head;
  3077. typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  3078. T15> Tail;
  3079. };
  3080. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3081. typename T6, typename T7, typename T8, typename T9, typename T10,
  3082. typename T11, typename T12, typename T13, typename T14, typename T15,
  3083. typename T16>
  3084. struct Types16 {
  3085. typedef T1 Head;
  3086. typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3087. T16> Tail;
  3088. };
  3089. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3090. typename T6, typename T7, typename T8, typename T9, typename T10,
  3091. typename T11, typename T12, typename T13, typename T14, typename T15,
  3092. typename T16, typename T17>
  3093. struct Types17 {
  3094. typedef T1 Head;
  3095. typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3096. T16, T17> Tail;
  3097. };
  3098. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3099. typename T6, typename T7, typename T8, typename T9, typename T10,
  3100. typename T11, typename T12, typename T13, typename T14, typename T15,
  3101. typename T16, typename T17, typename T18>
  3102. struct Types18 {
  3103. typedef T1 Head;
  3104. typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3105. T16, T17, T18> Tail;
  3106. };
  3107. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3108. typename T6, typename T7, typename T8, typename T9, typename T10,
  3109. typename T11, typename T12, typename T13, typename T14, typename T15,
  3110. typename T16, typename T17, typename T18, typename T19>
  3111. struct Types19 {
  3112. typedef T1 Head;
  3113. typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3114. T16, T17, T18, T19> Tail;
  3115. };
  3116. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3117. typename T6, typename T7, typename T8, typename T9, typename T10,
  3118. typename T11, typename T12, typename T13, typename T14, typename T15,
  3119. typename T16, typename T17, typename T18, typename T19, typename T20>
  3120. struct Types20 {
  3121. typedef T1 Head;
  3122. typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3123. T16, T17, T18, T19, T20> Tail;
  3124. };
  3125. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3126. typename T6, typename T7, typename T8, typename T9, typename T10,
  3127. typename T11, typename T12, typename T13, typename T14, typename T15,
  3128. typename T16, typename T17, typename T18, typename T19, typename T20,
  3129. typename T21>
  3130. struct Types21 {
  3131. typedef T1 Head;
  3132. typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3133. T16, T17, T18, T19, T20, T21> Tail;
  3134. };
  3135. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3136. typename T6, typename T7, typename T8, typename T9, typename T10,
  3137. typename T11, typename T12, typename T13, typename T14, typename T15,
  3138. typename T16, typename T17, typename T18, typename T19, typename T20,
  3139. typename T21, typename T22>
  3140. struct Types22 {
  3141. typedef T1 Head;
  3142. typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3143. T16, T17, T18, T19, T20, T21, T22> Tail;
  3144. };
  3145. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3146. typename T6, typename T7, typename T8, typename T9, typename T10,
  3147. typename T11, typename T12, typename T13, typename T14, typename T15,
  3148. typename T16, typename T17, typename T18, typename T19, typename T20,
  3149. typename T21, typename T22, typename T23>
  3150. struct Types23 {
  3151. typedef T1 Head;
  3152. typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3153. T16, T17, T18, T19, T20, T21, T22, T23> Tail;
  3154. };
  3155. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3156. typename T6, typename T7, typename T8, typename T9, typename T10,
  3157. typename T11, typename T12, typename T13, typename T14, typename T15,
  3158. typename T16, typename T17, typename T18, typename T19, typename T20,
  3159. typename T21, typename T22, typename T23, typename T24>
  3160. struct Types24 {
  3161. typedef T1 Head;
  3162. typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3163. T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
  3164. };
  3165. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3166. typename T6, typename T7, typename T8, typename T9, typename T10,
  3167. typename T11, typename T12, typename T13, typename T14, typename T15,
  3168. typename T16, typename T17, typename T18, typename T19, typename T20,
  3169. typename T21, typename T22, typename T23, typename T24, typename T25>
  3170. struct Types25 {
  3171. typedef T1 Head;
  3172. typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3173. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
  3174. };
  3175. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3176. typename T6, typename T7, typename T8, typename T9, typename T10,
  3177. typename T11, typename T12, typename T13, typename T14, typename T15,
  3178. typename T16, typename T17, typename T18, typename T19, typename T20,
  3179. typename T21, typename T22, typename T23, typename T24, typename T25,
  3180. typename T26>
  3181. struct Types26 {
  3182. typedef T1 Head;
  3183. typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3184. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
  3185. };
  3186. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3187. typename T6, typename T7, typename T8, typename T9, typename T10,
  3188. typename T11, typename T12, typename T13, typename T14, typename T15,
  3189. typename T16, typename T17, typename T18, typename T19, typename T20,
  3190. typename T21, typename T22, typename T23, typename T24, typename T25,
  3191. typename T26, typename T27>
  3192. struct Types27 {
  3193. typedef T1 Head;
  3194. typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3195. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
  3196. };
  3197. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3198. typename T6, typename T7, typename T8, typename T9, typename T10,
  3199. typename T11, typename T12, typename T13, typename T14, typename T15,
  3200. typename T16, typename T17, typename T18, typename T19, typename T20,
  3201. typename T21, typename T22, typename T23, typename T24, typename T25,
  3202. typename T26, typename T27, typename T28>
  3203. struct Types28 {
  3204. typedef T1 Head;
  3205. typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3206. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
  3207. };
  3208. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3209. typename T6, typename T7, typename T8, typename T9, typename T10,
  3210. typename T11, typename T12, typename T13, typename T14, typename T15,
  3211. typename T16, typename T17, typename T18, typename T19, typename T20,
  3212. typename T21, typename T22, typename T23, typename T24, typename T25,
  3213. typename T26, typename T27, typename T28, typename T29>
  3214. struct Types29 {
  3215. typedef T1 Head;
  3216. typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3217. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  3218. T29> Tail;
  3219. };
  3220. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3221. typename T6, typename T7, typename T8, typename T9, typename T10,
  3222. typename T11, typename T12, typename T13, typename T14, typename T15,
  3223. typename T16, typename T17, typename T18, typename T19, typename T20,
  3224. typename T21, typename T22, typename T23, typename T24, typename T25,
  3225. typename T26, typename T27, typename T28, typename T29, typename T30>
  3226. struct Types30 {
  3227. typedef T1 Head;
  3228. typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3229. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3230. T30> Tail;
  3231. };
  3232. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3233. typename T6, typename T7, typename T8, typename T9, typename T10,
  3234. typename T11, typename T12, typename T13, typename T14, typename T15,
  3235. typename T16, typename T17, typename T18, typename T19, typename T20,
  3236. typename T21, typename T22, typename T23, typename T24, typename T25,
  3237. typename T26, typename T27, typename T28, typename T29, typename T30,
  3238. typename T31>
  3239. struct Types31 {
  3240. typedef T1 Head;
  3241. typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3242. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3243. T30, T31> Tail;
  3244. };
  3245. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3246. typename T6, typename T7, typename T8, typename T9, typename T10,
  3247. typename T11, typename T12, typename T13, typename T14, typename T15,
  3248. typename T16, typename T17, typename T18, typename T19, typename T20,
  3249. typename T21, typename T22, typename T23, typename T24, typename T25,
  3250. typename T26, typename T27, typename T28, typename T29, typename T30,
  3251. typename T31, typename T32>
  3252. struct Types32 {
  3253. typedef T1 Head;
  3254. typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3255. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3256. T30, T31, T32> Tail;
  3257. };
  3258. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3259. typename T6, typename T7, typename T8, typename T9, typename T10,
  3260. typename T11, typename T12, typename T13, typename T14, typename T15,
  3261. typename T16, typename T17, typename T18, typename T19, typename T20,
  3262. typename T21, typename T22, typename T23, typename T24, typename T25,
  3263. typename T26, typename T27, typename T28, typename T29, typename T30,
  3264. typename T31, typename T32, typename T33>
  3265. struct Types33 {
  3266. typedef T1 Head;
  3267. typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3268. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3269. T30, T31, T32, T33> Tail;
  3270. };
  3271. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3272. typename T6, typename T7, typename T8, typename T9, typename T10,
  3273. typename T11, typename T12, typename T13, typename T14, typename T15,
  3274. typename T16, typename T17, typename T18, typename T19, typename T20,
  3275. typename T21, typename T22, typename T23, typename T24, typename T25,
  3276. typename T26, typename T27, typename T28, typename T29, typename T30,
  3277. typename T31, typename T32, typename T33, typename T34>
  3278. struct Types34 {
  3279. typedef T1 Head;
  3280. typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3281. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3282. T30, T31, T32, T33, T34> Tail;
  3283. };
  3284. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3285. typename T6, typename T7, typename T8, typename T9, typename T10,
  3286. typename T11, typename T12, typename T13, typename T14, typename T15,
  3287. typename T16, typename T17, typename T18, typename T19, typename T20,
  3288. typename T21, typename T22, typename T23, typename T24, typename T25,
  3289. typename T26, typename T27, typename T28, typename T29, typename T30,
  3290. typename T31, typename T32, typename T33, typename T34, typename T35>
  3291. struct Types35 {
  3292. typedef T1 Head;
  3293. typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3294. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3295. T30, T31, T32, T33, T34, T35> Tail;
  3296. };
  3297. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3298. typename T6, typename T7, typename T8, typename T9, typename T10,
  3299. typename T11, typename T12, typename T13, typename T14, typename T15,
  3300. typename T16, typename T17, typename T18, typename T19, typename T20,
  3301. typename T21, typename T22, typename T23, typename T24, typename T25,
  3302. typename T26, typename T27, typename T28, typename T29, typename T30,
  3303. typename T31, typename T32, typename T33, typename T34, typename T35,
  3304. typename T36>
  3305. struct Types36 {
  3306. typedef T1 Head;
  3307. typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3308. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3309. T30, T31, T32, T33, T34, T35, T36> Tail;
  3310. };
  3311. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3312. typename T6, typename T7, typename T8, typename T9, typename T10,
  3313. typename T11, typename T12, typename T13, typename T14, typename T15,
  3314. typename T16, typename T17, typename T18, typename T19, typename T20,
  3315. typename T21, typename T22, typename T23, typename T24, typename T25,
  3316. typename T26, typename T27, typename T28, typename T29, typename T30,
  3317. typename T31, typename T32, typename T33, typename T34, typename T35,
  3318. typename T36, typename T37>
  3319. struct Types37 {
  3320. typedef T1 Head;
  3321. typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3322. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3323. T30, T31, T32, T33, T34, T35, T36, T37> Tail;
  3324. };
  3325. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3326. typename T6, typename T7, typename T8, typename T9, typename T10,
  3327. typename T11, typename T12, typename T13, typename T14, typename T15,
  3328. typename T16, typename T17, typename T18, typename T19, typename T20,
  3329. typename T21, typename T22, typename T23, typename T24, typename T25,
  3330. typename T26, typename T27, typename T28, typename T29, typename T30,
  3331. typename T31, typename T32, typename T33, typename T34, typename T35,
  3332. typename T36, typename T37, typename T38>
  3333. struct Types38 {
  3334. typedef T1 Head;
  3335. typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3336. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3337. T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
  3338. };
  3339. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3340. typename T6, typename T7, typename T8, typename T9, typename T10,
  3341. typename T11, typename T12, typename T13, typename T14, typename T15,
  3342. typename T16, typename T17, typename T18, typename T19, typename T20,
  3343. typename T21, typename T22, typename T23, typename T24, typename T25,
  3344. typename T26, typename T27, typename T28, typename T29, typename T30,
  3345. typename T31, typename T32, typename T33, typename T34, typename T35,
  3346. typename T36, typename T37, typename T38, typename T39>
  3347. struct Types39 {
  3348. typedef T1 Head;
  3349. typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3350. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3351. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
  3352. };
  3353. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3354. typename T6, typename T7, typename T8, typename T9, typename T10,
  3355. typename T11, typename T12, typename T13, typename T14, typename T15,
  3356. typename T16, typename T17, typename T18, typename T19, typename T20,
  3357. typename T21, typename T22, typename T23, typename T24, typename T25,
  3358. typename T26, typename T27, typename T28, typename T29, typename T30,
  3359. typename T31, typename T32, typename T33, typename T34, typename T35,
  3360. typename T36, typename T37, typename T38, typename T39, typename T40>
  3361. struct Types40 {
  3362. typedef T1 Head;
  3363. typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3364. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3365. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
  3366. };
  3367. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3368. typename T6, typename T7, typename T8, typename T9, typename T10,
  3369. typename T11, typename T12, typename T13, typename T14, typename T15,
  3370. typename T16, typename T17, typename T18, typename T19, typename T20,
  3371. typename T21, typename T22, typename T23, typename T24, typename T25,
  3372. typename T26, typename T27, typename T28, typename T29, typename T30,
  3373. typename T31, typename T32, typename T33, typename T34, typename T35,
  3374. typename T36, typename T37, typename T38, typename T39, typename T40,
  3375. typename T41>
  3376. struct Types41 {
  3377. typedef T1 Head;
  3378. typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3379. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3380. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
  3381. };
  3382. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3383. typename T6, typename T7, typename T8, typename T9, typename T10,
  3384. typename T11, typename T12, typename T13, typename T14, typename T15,
  3385. typename T16, typename T17, typename T18, typename T19, typename T20,
  3386. typename T21, typename T22, typename T23, typename T24, typename T25,
  3387. typename T26, typename T27, typename T28, typename T29, typename T30,
  3388. typename T31, typename T32, typename T33, typename T34, typename T35,
  3389. typename T36, typename T37, typename T38, typename T39, typename T40,
  3390. typename T41, typename T42>
  3391. struct Types42 {
  3392. typedef T1 Head;
  3393. typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3394. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3395. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
  3396. };
  3397. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3398. typename T6, typename T7, typename T8, typename T9, typename T10,
  3399. typename T11, typename T12, typename T13, typename T14, typename T15,
  3400. typename T16, typename T17, typename T18, typename T19, typename T20,
  3401. typename T21, typename T22, typename T23, typename T24, typename T25,
  3402. typename T26, typename T27, typename T28, typename T29, typename T30,
  3403. typename T31, typename T32, typename T33, typename T34, typename T35,
  3404. typename T36, typename T37, typename T38, typename T39, typename T40,
  3405. typename T41, typename T42, typename T43>
  3406. struct Types43 {
  3407. typedef T1 Head;
  3408. typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3409. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3410. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  3411. T43> Tail;
  3412. };
  3413. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3414. typename T6, typename T7, typename T8, typename T9, typename T10,
  3415. typename T11, typename T12, typename T13, typename T14, typename T15,
  3416. typename T16, typename T17, typename T18, typename T19, typename T20,
  3417. typename T21, typename T22, typename T23, typename T24, typename T25,
  3418. typename T26, typename T27, typename T28, typename T29, typename T30,
  3419. typename T31, typename T32, typename T33, typename T34, typename T35,
  3420. typename T36, typename T37, typename T38, typename T39, typename T40,
  3421. typename T41, typename T42, typename T43, typename T44>
  3422. struct Types44 {
  3423. typedef T1 Head;
  3424. typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3425. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3426. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3427. T44> Tail;
  3428. };
  3429. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3430. typename T6, typename T7, typename T8, typename T9, typename T10,
  3431. typename T11, typename T12, typename T13, typename T14, typename T15,
  3432. typename T16, typename T17, typename T18, typename T19, typename T20,
  3433. typename T21, typename T22, typename T23, typename T24, typename T25,
  3434. typename T26, typename T27, typename T28, typename T29, typename T30,
  3435. typename T31, typename T32, typename T33, typename T34, typename T35,
  3436. typename T36, typename T37, typename T38, typename T39, typename T40,
  3437. typename T41, typename T42, typename T43, typename T44, typename T45>
  3438. struct Types45 {
  3439. typedef T1 Head;
  3440. typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3441. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3442. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3443. T44, T45> Tail;
  3444. };
  3445. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3446. typename T6, typename T7, typename T8, typename T9, typename T10,
  3447. typename T11, typename T12, typename T13, typename T14, typename T15,
  3448. typename T16, typename T17, typename T18, typename T19, typename T20,
  3449. typename T21, typename T22, typename T23, typename T24, typename T25,
  3450. typename T26, typename T27, typename T28, typename T29, typename T30,
  3451. typename T31, typename T32, typename T33, typename T34, typename T35,
  3452. typename T36, typename T37, typename T38, typename T39, typename T40,
  3453. typename T41, typename T42, typename T43, typename T44, typename T45,
  3454. typename T46>
  3455. struct Types46 {
  3456. typedef T1 Head;
  3457. typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3458. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3459. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3460. T44, T45, T46> Tail;
  3461. };
  3462. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3463. typename T6, typename T7, typename T8, typename T9, typename T10,
  3464. typename T11, typename T12, typename T13, typename T14, typename T15,
  3465. typename T16, typename T17, typename T18, typename T19, typename T20,
  3466. typename T21, typename T22, typename T23, typename T24, typename T25,
  3467. typename T26, typename T27, typename T28, typename T29, typename T30,
  3468. typename T31, typename T32, typename T33, typename T34, typename T35,
  3469. typename T36, typename T37, typename T38, typename T39, typename T40,
  3470. typename T41, typename T42, typename T43, typename T44, typename T45,
  3471. typename T46, typename T47>
  3472. struct Types47 {
  3473. typedef T1 Head;
  3474. typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3475. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3476. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3477. T44, T45, T46, T47> Tail;
  3478. };
  3479. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3480. typename T6, typename T7, typename T8, typename T9, typename T10,
  3481. typename T11, typename T12, typename T13, typename T14, typename T15,
  3482. typename T16, typename T17, typename T18, typename T19, typename T20,
  3483. typename T21, typename T22, typename T23, typename T24, typename T25,
  3484. typename T26, typename T27, typename T28, typename T29, typename T30,
  3485. typename T31, typename T32, typename T33, typename T34, typename T35,
  3486. typename T36, typename T37, typename T38, typename T39, typename T40,
  3487. typename T41, typename T42, typename T43, typename T44, typename T45,
  3488. typename T46, typename T47, typename T48>
  3489. struct Types48 {
  3490. typedef T1 Head;
  3491. typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3492. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3493. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3494. T44, T45, T46, T47, T48> Tail;
  3495. };
  3496. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3497. typename T6, typename T7, typename T8, typename T9, typename T10,
  3498. typename T11, typename T12, typename T13, typename T14, typename T15,
  3499. typename T16, typename T17, typename T18, typename T19, typename T20,
  3500. typename T21, typename T22, typename T23, typename T24, typename T25,
  3501. typename T26, typename T27, typename T28, typename T29, typename T30,
  3502. typename T31, typename T32, typename T33, typename T34, typename T35,
  3503. typename T36, typename T37, typename T38, typename T39, typename T40,
  3504. typename T41, typename T42, typename T43, typename T44, typename T45,
  3505. typename T46, typename T47, typename T48, typename T49>
  3506. struct Types49 {
  3507. typedef T1 Head;
  3508. typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3509. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3510. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3511. T44, T45, T46, T47, T48, T49> Tail;
  3512. };
  3513. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3514. typename T6, typename T7, typename T8, typename T9, typename T10,
  3515. typename T11, typename T12, typename T13, typename T14, typename T15,
  3516. typename T16, typename T17, typename T18, typename T19, typename T20,
  3517. typename T21, typename T22, typename T23, typename T24, typename T25,
  3518. typename T26, typename T27, typename T28, typename T29, typename T30,
  3519. typename T31, typename T32, typename T33, typename T34, typename T35,
  3520. typename T36, typename T37, typename T38, typename T39, typename T40,
  3521. typename T41, typename T42, typename T43, typename T44, typename T45,
  3522. typename T46, typename T47, typename T48, typename T49, typename T50>
  3523. struct Types50 {
  3524. typedef T1 Head;
  3525. typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3526. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  3527. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  3528. T44, T45, T46, T47, T48, T49, T50> Tail;
  3529. };
  3530. } // namespace internal
  3531. // We don't want to require the users to write TypesN<...> directly,
  3532. // as that would require them to count the length. Types<...> is much
  3533. // easier to write, but generates horrible messages when there is a
  3534. // compiler error, as gcc insists on printing out each template
  3535. // argument, even if it has the default value (this means Types<int>
  3536. // will appear as Types<int, None, None, ..., None> in the compiler
  3537. // errors).
  3538. //
  3539. // Our solution is to combine the best part of the two approaches: a
  3540. // user would write Types<T1, ..., TN>, and Google Test will translate
  3541. // that to TypesN<T1, ..., TN> internally to make error messages
  3542. // readable. The translation is done by the 'type' member of the
  3543. // Types template.
  3544. template <typename T1 = internal::None, typename T2 = internal::None,
  3545. typename T3 = internal::None, typename T4 = internal::None,
  3546. typename T5 = internal::None, typename T6 = internal::None,
  3547. typename T7 = internal::None, typename T8 = internal::None,
  3548. typename T9 = internal::None, typename T10 = internal::None,
  3549. typename T11 = internal::None, typename T12 = internal::None,
  3550. typename T13 = internal::None, typename T14 = internal::None,
  3551. typename T15 = internal::None, typename T16 = internal::None,
  3552. typename T17 = internal::None, typename T18 = internal::None,
  3553. typename T19 = internal::None, typename T20 = internal::None,
  3554. typename T21 = internal::None, typename T22 = internal::None,
  3555. typename T23 = internal::None, typename T24 = internal::None,
  3556. typename T25 = internal::None, typename T26 = internal::None,
  3557. typename T27 = internal::None, typename T28 = internal::None,
  3558. typename T29 = internal::None, typename T30 = internal::None,
  3559. typename T31 = internal::None, typename T32 = internal::None,
  3560. typename T33 = internal::None, typename T34 = internal::None,
  3561. typename T35 = internal::None, typename T36 = internal::None,
  3562. typename T37 = internal::None, typename T38 = internal::None,
  3563. typename T39 = internal::None, typename T40 = internal::None,
  3564. typename T41 = internal::None, typename T42 = internal::None,
  3565. typename T43 = internal::None, typename T44 = internal::None,
  3566. typename T45 = internal::None, typename T46 = internal::None,
  3567. typename T47 = internal::None, typename T48 = internal::None,
  3568. typename T49 = internal::None, typename T50 = internal::None>
  3569. struct Types {
  3570. typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3571. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  3572. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  3573. T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
  3574. };
  3575. template <>
  3576. struct Types<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, internal::None, internal::None,
  3582. internal::None, internal::None, internal::None, internal::None,
  3583. internal::None, internal::None, internal::None, internal::None,
  3584. internal::None, internal::None, internal::None, internal::None,
  3585. internal::None, internal::None, internal::None, internal::None,
  3586. internal::None, internal::None, internal::None, internal::None,
  3587. internal::None, internal::None, internal::None, internal::None,
  3588. internal::None, internal::None> {
  3589. typedef internal::Types0 type;
  3590. };
  3591. template <typename T1>
  3592. struct Types<T1, 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, internal::None, internal::None,
  3598. internal::None, internal::None, internal::None, internal::None,
  3599. internal::None, internal::None, internal::None, internal::None,
  3600. internal::None, internal::None, internal::None, internal::None,
  3601. internal::None, internal::None, internal::None, internal::None,
  3602. internal::None, internal::None, internal::None, internal::None,
  3603. internal::None, internal::None, internal::None, internal::None,
  3604. internal::None, internal::None> {
  3605. typedef internal::Types1<T1> type;
  3606. };
  3607. template <typename T1, typename T2>
  3608. struct Types<T1, T2, 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, internal::None, internal::None, internal::None,
  3614. internal::None, internal::None, internal::None, internal::None,
  3615. internal::None, internal::None, internal::None, internal::None,
  3616. internal::None, internal::None, internal::None, internal::None,
  3617. internal::None, internal::None, internal::None, internal::None,
  3618. internal::None, internal::None, internal::None, internal::None,
  3619. internal::None, internal::None, internal::None, internal::None,
  3620. internal::None> {
  3621. typedef internal::Types2<T1, T2> type;
  3622. };
  3623. template <typename T1, typename T2, typename T3>
  3624. struct Types<T1, T2, T3, 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. internal::None, internal::None, internal::None, internal::None,
  3630. internal::None, internal::None, internal::None, internal::None,
  3631. internal::None, internal::None, internal::None, internal::None,
  3632. internal::None, internal::None, internal::None, internal::None,
  3633. internal::None, internal::None, internal::None, internal::None,
  3634. internal::None, internal::None, internal::None, internal::None,
  3635. internal::None, internal::None, internal::None, internal::None> {
  3636. typedef internal::Types3<T1, T2, T3> type;
  3637. };
  3638. template <typename T1, typename T2, typename T3, typename T4>
  3639. struct Types<T1, T2, T3, T4, 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, internal::None,
  3644. internal::None, internal::None, internal::None, internal::None,
  3645. internal::None, internal::None, internal::None, internal::None,
  3646. internal::None, internal::None, internal::None, internal::None,
  3647. internal::None, internal::None, internal::None, internal::None,
  3648. internal::None, internal::None, internal::None, internal::None,
  3649. internal::None, internal::None, internal::None, internal::None,
  3650. internal::None, internal::None, internal::None> {
  3651. typedef internal::Types4<T1, T2, T3, T4> type;
  3652. };
  3653. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  3654. struct Types<T1, T2, T3, T4, T5, 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, internal::None,
  3659. internal::None, internal::None, internal::None, internal::None,
  3660. internal::None, internal::None, internal::None, internal::None,
  3661. internal::None, internal::None, internal::None, internal::None,
  3662. internal::None, internal::None, internal::None, internal::None,
  3663. internal::None, internal::None, internal::None, internal::None,
  3664. internal::None, internal::None, internal::None, internal::None,
  3665. internal::None, internal::None, internal::None> {
  3666. typedef internal::Types5<T1, T2, T3, T4, T5> type;
  3667. };
  3668. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3669. typename T6>
  3670. struct Types<T1, T2, T3, T4, T5, T6, 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, internal::None, internal::None,
  3675. internal::None, internal::None, internal::None, internal::None,
  3676. internal::None, internal::None, internal::None, internal::None,
  3677. internal::None, internal::None, internal::None, internal::None,
  3678. internal::None, internal::None, internal::None, internal::None,
  3679. internal::None, internal::None, internal::None, internal::None,
  3680. internal::None, internal::None, internal::None, internal::None,
  3681. internal::None, internal::None> {
  3682. typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
  3683. };
  3684. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3685. typename T6, typename T7>
  3686. struct Types<T1, T2, T3, T4, T5, T6, T7, 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, internal::None, internal::None, internal::None,
  3691. internal::None, internal::None, internal::None, internal::None,
  3692. internal::None, internal::None, internal::None, internal::None,
  3693. internal::None, internal::None, internal::None, internal::None,
  3694. internal::None, internal::None, internal::None, internal::None,
  3695. internal::None, internal::None, internal::None, internal::None,
  3696. internal::None, internal::None, internal::None, internal::None,
  3697. internal::None> {
  3698. typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
  3699. };
  3700. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3701. typename T6, typename T7, typename T8>
  3702. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, 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. internal::None, internal::None, internal::None, internal::None,
  3707. internal::None, internal::None, internal::None, internal::None,
  3708. internal::None, internal::None, internal::None, internal::None,
  3709. internal::None, internal::None, internal::None, internal::None,
  3710. internal::None, internal::None, internal::None, internal::None,
  3711. internal::None, internal::None, internal::None, internal::None,
  3712. internal::None, internal::None, internal::None, internal::None> {
  3713. typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
  3714. };
  3715. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3716. typename T6, typename T7, typename T8, typename T9>
  3717. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, 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. internal::None, internal::None, internal::None, internal::None,
  3722. internal::None, internal::None, internal::None, internal::None,
  3723. internal::None, internal::None, internal::None, internal::None,
  3724. internal::None, internal::None, internal::None, internal::None,
  3725. internal::None, internal::None, internal::None, internal::None,
  3726. internal::None, internal::None, internal::None, internal::None,
  3727. internal::None, internal::None, internal::None, internal::None> {
  3728. typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
  3729. };
  3730. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3731. typename T6, typename T7, typename T8, typename T9, typename T10>
  3732. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, 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, internal::None,
  3736. internal::None, internal::None, internal::None, internal::None,
  3737. internal::None, internal::None, internal::None, internal::None,
  3738. internal::None, internal::None, internal::None, internal::None,
  3739. internal::None, internal::None, internal::None, internal::None,
  3740. internal::None, internal::None, internal::None, internal::None,
  3741. internal::None, internal::None, internal::None, internal::None,
  3742. internal::None, internal::None, internal::None> {
  3743. typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
  3744. };
  3745. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3746. typename T6, typename T7, typename T8, typename T9, typename T10,
  3747. typename T11>
  3748. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 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, internal::None, internal::None,
  3752. internal::None, internal::None, internal::None, internal::None,
  3753. internal::None, internal::None, internal::None, internal::None,
  3754. internal::None, internal::None, internal::None, internal::None,
  3755. internal::None, internal::None, internal::None, internal::None,
  3756. internal::None, internal::None, internal::None, internal::None,
  3757. internal::None, internal::None, internal::None, internal::None,
  3758. internal::None, internal::None> {
  3759. typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
  3760. };
  3761. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3762. typename T6, typename T7, typename T8, typename T9, typename T10,
  3763. typename T11, typename T12>
  3764. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,
  3765. internal::None, internal::None, internal::None, internal::None,
  3766. internal::None, internal::None, internal::None, internal::None,
  3767. internal::None, internal::None, internal::None, internal::None,
  3768. internal::None, internal::None, internal::None, internal::None,
  3769. internal::None, internal::None, internal::None, internal::None,
  3770. internal::None, internal::None, internal::None, internal::None,
  3771. internal::None, internal::None, internal::None, internal::None,
  3772. internal::None, internal::None, internal::None, internal::None,
  3773. internal::None, internal::None, internal::None, internal::None,
  3774. internal::None> {
  3775. typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  3776. T12> type;
  3777. };
  3778. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3779. typename T6, typename T7, typename T8, typename T9, typename T10,
  3780. typename T11, typename T12, typename T13>
  3781. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  3782. internal::None, internal::None, internal::None, internal::None,
  3783. internal::None, internal::None, internal::None, internal::None,
  3784. internal::None, internal::None, internal::None, internal::None,
  3785. internal::None, internal::None, internal::None, internal::None,
  3786. internal::None, internal::None, internal::None, internal::None,
  3787. internal::None, internal::None, internal::None, internal::None,
  3788. internal::None, internal::None, internal::None, internal::None,
  3789. internal::None, internal::None, internal::None, internal::None,
  3790. internal::None, internal::None, internal::None, internal::None,
  3791. internal::None> {
  3792. typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3793. T13> type;
  3794. };
  3795. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3796. typename T6, typename T7, typename T8, typename T9, typename T10,
  3797. typename T11, typename T12, typename T13, typename T14>
  3798. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  3799. internal::None, internal::None, internal::None, internal::None,
  3800. internal::None, internal::None, internal::None, internal::None,
  3801. internal::None, internal::None, internal::None, internal::None,
  3802. internal::None, internal::None, internal::None, internal::None,
  3803. internal::None, internal::None, internal::None, internal::None,
  3804. internal::None, internal::None, internal::None, internal::None,
  3805. internal::None, internal::None, internal::None, internal::None,
  3806. internal::None, internal::None, internal::None, internal::None,
  3807. internal::None, internal::None, internal::None, internal::None> {
  3808. typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3809. T13, T14> type;
  3810. };
  3811. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3812. typename T6, typename T7, typename T8, typename T9, typename T10,
  3813. typename T11, typename T12, typename T13, typename T14, typename T15>
  3814. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3815. internal::None, internal::None, internal::None, internal::None,
  3816. internal::None, internal::None, internal::None, internal::None,
  3817. internal::None, internal::None, internal::None, internal::None,
  3818. internal::None, internal::None, internal::None, internal::None,
  3819. internal::None, internal::None, internal::None, internal::None,
  3820. internal::None, internal::None, internal::None, internal::None,
  3821. internal::None, internal::None, internal::None, internal::None,
  3822. internal::None, internal::None, internal::None, internal::None,
  3823. internal::None, internal::None, internal::None> {
  3824. typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3825. T13, T14, T15> type;
  3826. };
  3827. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3828. typename T6, typename T7, typename T8, typename T9, typename T10,
  3829. typename T11, typename T12, typename T13, typename T14, typename T15,
  3830. typename T16>
  3831. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3832. T16, internal::None, internal::None, internal::None, internal::None,
  3833. internal::None, internal::None, internal::None, internal::None,
  3834. internal::None, internal::None, internal::None, internal::None,
  3835. internal::None, internal::None, internal::None, internal::None,
  3836. internal::None, internal::None, internal::None, internal::None,
  3837. internal::None, internal::None, internal::None, internal::None,
  3838. internal::None, internal::None, internal::None, internal::None,
  3839. internal::None, internal::None, internal::None, internal::None,
  3840. internal::None, internal::None> {
  3841. typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3842. T13, T14, T15, T16> type;
  3843. };
  3844. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3845. typename T6, typename T7, typename T8, typename T9, typename T10,
  3846. typename T11, typename T12, typename T13, typename T14, typename T15,
  3847. typename T16, typename T17>
  3848. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3849. T16, T17, internal::None, internal::None, internal::None, internal::None,
  3850. internal::None, internal::None, internal::None, internal::None,
  3851. internal::None, internal::None, internal::None, internal::None,
  3852. internal::None, internal::None, internal::None, internal::None,
  3853. internal::None, internal::None, internal::None, internal::None,
  3854. internal::None, internal::None, internal::None, internal::None,
  3855. internal::None, internal::None, internal::None, internal::None,
  3856. internal::None, internal::None, internal::None, internal::None,
  3857. internal::None> {
  3858. typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3859. T13, T14, T15, T16, T17> type;
  3860. };
  3861. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3862. typename T6, typename T7, typename T8, typename T9, typename T10,
  3863. typename T11, typename T12, typename T13, typename T14, typename T15,
  3864. typename T16, typename T17, typename T18>
  3865. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3866. T16, T17, T18, internal::None, internal::None, internal::None,
  3867. internal::None, internal::None, internal::None, internal::None,
  3868. internal::None, internal::None, internal::None, internal::None,
  3869. internal::None, internal::None, internal::None, internal::None,
  3870. internal::None, internal::None, internal::None, internal::None,
  3871. internal::None, internal::None, internal::None, internal::None,
  3872. internal::None, internal::None, internal::None, internal::None,
  3873. internal::None, internal::None, internal::None, internal::None,
  3874. internal::None> {
  3875. typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3876. T13, T14, T15, T16, T17, T18> type;
  3877. };
  3878. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3879. typename T6, typename T7, typename T8, typename T9, typename T10,
  3880. typename T11, typename T12, typename T13, typename T14, typename T15,
  3881. typename T16, typename T17, typename T18, typename T19>
  3882. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3883. T16, T17, T18, T19, internal::None, internal::None, internal::None,
  3884. internal::None, internal::None, internal::None, internal::None,
  3885. internal::None, internal::None, internal::None, internal::None,
  3886. internal::None, internal::None, internal::None, internal::None,
  3887. internal::None, internal::None, internal::None, internal::None,
  3888. internal::None, internal::None, internal::None, internal::None,
  3889. internal::None, internal::None, internal::None, internal::None,
  3890. internal::None, internal::None, internal::None, internal::None> {
  3891. typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3892. T13, T14, T15, T16, T17, T18, T19> type;
  3893. };
  3894. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3895. typename T6, typename T7, typename T8, typename T9, typename T10,
  3896. typename T11, typename T12, typename T13, typename T14, typename T15,
  3897. typename T16, typename T17, typename T18, typename T19, typename T20>
  3898. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3899. T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,
  3900. internal::None, internal::None, internal::None, internal::None,
  3901. internal::None, internal::None, internal::None, internal::None,
  3902. internal::None, internal::None, internal::None, internal::None,
  3903. internal::None, internal::None, internal::None, internal::None,
  3904. internal::None, internal::None, internal::None, internal::None,
  3905. internal::None, internal::None, internal::None, internal::None,
  3906. internal::None, internal::None, internal::None> {
  3907. typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3908. T13, T14, T15, T16, T17, T18, T19, T20> type;
  3909. };
  3910. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3911. typename T6, typename T7, typename T8, typename T9, typename T10,
  3912. typename T11, typename T12, typename T13, typename T14, typename T15,
  3913. typename T16, typename T17, typename T18, typename T19, typename T20,
  3914. typename T21>
  3915. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3916. T16, T17, T18, T19, T20, T21, internal::None, internal::None,
  3917. internal::None, internal::None, internal::None, internal::None,
  3918. internal::None, internal::None, internal::None, internal::None,
  3919. internal::None, internal::None, internal::None, internal::None,
  3920. internal::None, internal::None, internal::None, internal::None,
  3921. internal::None, internal::None, internal::None, internal::None,
  3922. internal::None, internal::None, internal::None, internal::None,
  3923. internal::None, internal::None, internal::None> {
  3924. typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3925. T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
  3926. };
  3927. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3928. typename T6, typename T7, typename T8, typename T9, typename T10,
  3929. typename T11, typename T12, typename T13, typename T14, typename T15,
  3930. typename T16, typename T17, typename T18, typename T19, typename T20,
  3931. typename T21, typename T22>
  3932. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3933. T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None,
  3934. internal::None, internal::None, internal::None, internal::None,
  3935. internal::None, internal::None, internal::None, internal::None,
  3936. internal::None, internal::None, internal::None, internal::None,
  3937. internal::None, internal::None, internal::None, internal::None,
  3938. internal::None, internal::None, internal::None, internal::None,
  3939. internal::None, internal::None, internal::None, internal::None,
  3940. internal::None, internal::None> {
  3941. typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3942. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
  3943. };
  3944. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3945. typename T6, typename T7, typename T8, typename T9, typename T10,
  3946. typename T11, typename T12, typename T13, typename T14, typename T15,
  3947. typename T16, typename T17, typename T18, typename T19, typename T20,
  3948. typename T21, typename T22, typename T23>
  3949. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3950. T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None,
  3951. internal::None, internal::None, internal::None, internal::None,
  3952. internal::None, internal::None, internal::None, internal::None,
  3953. internal::None, internal::None, internal::None, internal::None,
  3954. internal::None, internal::None, internal::None, internal::None,
  3955. internal::None, internal::None, internal::None, internal::None,
  3956. internal::None, internal::None, internal::None, internal::None,
  3957. internal::None> {
  3958. typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3959. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
  3960. };
  3961. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3962. typename T6, typename T7, typename T8, typename T9, typename T10,
  3963. typename T11, typename T12, typename T13, typename T14, typename T15,
  3964. typename T16, typename T17, typename T18, typename T19, typename T20,
  3965. typename T21, typename T22, typename T23, typename T24>
  3966. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3967. T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,
  3968. internal::None, internal::None, internal::None, internal::None,
  3969. internal::None, internal::None, internal::None, internal::None,
  3970. internal::None, internal::None, internal::None, internal::None,
  3971. internal::None, internal::None, internal::None, internal::None,
  3972. internal::None, internal::None, internal::None, internal::None,
  3973. internal::None, internal::None, internal::None, internal::None,
  3974. internal::None> {
  3975. typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3976. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
  3977. };
  3978. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3979. typename T6, typename T7, typename T8, typename T9, typename T10,
  3980. typename T11, typename T12, typename T13, typename T14, typename T15,
  3981. typename T16, typename T17, typename T18, typename T19, typename T20,
  3982. typename T21, typename T22, typename T23, typename T24, typename T25>
  3983. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  3984. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,
  3985. internal::None, internal::None, internal::None, internal::None,
  3986. internal::None, internal::None, internal::None, internal::None,
  3987. internal::None, internal::None, internal::None, internal::None,
  3988. internal::None, internal::None, internal::None, internal::None,
  3989. internal::None, internal::None, internal::None, internal::None,
  3990. internal::None, internal::None, internal::None, internal::None> {
  3991. typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  3992. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
  3993. };
  3994. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  3995. typename T6, typename T7, typename T8, typename T9, typename T10,
  3996. typename T11, typename T12, typename T13, typename T14, typename T15,
  3997. typename T16, typename T17, typename T18, typename T19, typename T20,
  3998. typename T21, typename T22, typename T23, typename T24, typename T25,
  3999. typename T26>
  4000. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4001. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,
  4002. internal::None, internal::None, internal::None, internal::None,
  4003. internal::None, internal::None, internal::None, internal::None,
  4004. internal::None, internal::None, internal::None, internal::None,
  4005. internal::None, internal::None, internal::None, internal::None,
  4006. internal::None, internal::None, internal::None, internal::None,
  4007. internal::None, internal::None, internal::None> {
  4008. typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4009. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  4010. T26> type;
  4011. };
  4012. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4013. typename T6, typename T7, typename T8, typename T9, typename T10,
  4014. typename T11, typename T12, typename T13, typename T14, typename T15,
  4015. typename T16, typename T17, typename T18, typename T19, typename T20,
  4016. typename T21, typename T22, typename T23, typename T24, typename T25,
  4017. typename T26, typename T27>
  4018. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4019. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,
  4020. internal::None, internal::None, internal::None, internal::None,
  4021. internal::None, internal::None, internal::None, internal::None,
  4022. internal::None, internal::None, internal::None, internal::None,
  4023. internal::None, internal::None, internal::None, internal::None,
  4024. internal::None, internal::None, internal::None, internal::None,
  4025. internal::None, internal::None> {
  4026. typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4027. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4028. T27> type;
  4029. };
  4030. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4031. typename T6, typename T7, typename T8, typename T9, typename T10,
  4032. typename T11, typename T12, typename T13, typename T14, typename T15,
  4033. typename T16, typename T17, typename T18, typename T19, typename T20,
  4034. typename T21, typename T22, typename T23, typename T24, typename T25,
  4035. typename T26, typename T27, typename T28>
  4036. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4037. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4038. internal::None, internal::None, internal::None, internal::None,
  4039. internal::None, internal::None, internal::None, internal::None,
  4040. internal::None, internal::None, internal::None, internal::None,
  4041. internal::None, internal::None, internal::None, internal::None,
  4042. internal::None, internal::None, internal::None, internal::None,
  4043. internal::None, internal::None> {
  4044. typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4045. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4046. T27, T28> type;
  4047. };
  4048. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4049. typename T6, typename T7, typename T8, typename T9, typename T10,
  4050. typename T11, typename T12, typename T13, typename T14, typename T15,
  4051. typename T16, typename T17, typename T18, typename T19, typename T20,
  4052. typename T21, typename T22, typename T23, typename T24, typename T25,
  4053. typename T26, typename T27, typename T28, typename T29>
  4054. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4055. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  4056. internal::None, internal::None, internal::None, internal::None,
  4057. internal::None, internal::None, internal::None, internal::None,
  4058. internal::None, internal::None, internal::None, internal::None,
  4059. internal::None, internal::None, internal::None, internal::None,
  4060. internal::None, internal::None, internal::None, internal::None,
  4061. internal::None> {
  4062. typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4063. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4064. T27, T28, T29> type;
  4065. };
  4066. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4067. typename T6, typename T7, typename T8, typename T9, typename T10,
  4068. typename T11, typename T12, typename T13, typename T14, typename T15,
  4069. typename T16, typename T17, typename T18, typename T19, typename T20,
  4070. typename T21, typename T22, typename T23, typename T24, typename T25,
  4071. typename T26, typename T27, typename T28, typename T29, typename T30>
  4072. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4073. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4074. internal::None, internal::None, internal::None, internal::None,
  4075. internal::None, internal::None, internal::None, internal::None,
  4076. internal::None, internal::None, internal::None, internal::None,
  4077. internal::None, internal::None, internal::None, internal::None,
  4078. internal::None, internal::None, internal::None, internal::None> {
  4079. typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4080. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4081. T27, T28, T29, T30> type;
  4082. };
  4083. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4084. typename T6, typename T7, typename T8, typename T9, typename T10,
  4085. typename T11, typename T12, typename T13, typename T14, typename T15,
  4086. typename T16, typename T17, typename T18, typename T19, typename T20,
  4087. typename T21, typename T22, typename T23, typename T24, typename T25,
  4088. typename T26, typename T27, typename T28, typename T29, typename T30,
  4089. typename T31>
  4090. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4091. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4092. T31, internal::None, internal::None, internal::None, internal::None,
  4093. internal::None, internal::None, internal::None, internal::None,
  4094. internal::None, internal::None, internal::None, internal::None,
  4095. internal::None, internal::None, internal::None, internal::None,
  4096. internal::None, internal::None, internal::None> {
  4097. typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4098. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4099. T27, T28, T29, T30, T31> type;
  4100. };
  4101. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4102. typename T6, typename T7, typename T8, typename T9, typename T10,
  4103. typename T11, typename T12, typename T13, typename T14, typename T15,
  4104. typename T16, typename T17, typename T18, typename T19, typename T20,
  4105. typename T21, typename T22, typename T23, typename T24, typename T25,
  4106. typename T26, typename T27, typename T28, typename T29, typename T30,
  4107. typename T31, typename T32>
  4108. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4109. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4110. T31, T32, internal::None, internal::None, internal::None, internal::None,
  4111. internal::None, internal::None, internal::None, internal::None,
  4112. internal::None, internal::None, internal::None, internal::None,
  4113. internal::None, internal::None, internal::None, internal::None,
  4114. internal::None, internal::None> {
  4115. typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4116. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4117. T27, T28, T29, T30, T31, T32> type;
  4118. };
  4119. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4120. typename T6, typename T7, typename T8, typename T9, typename T10,
  4121. typename T11, typename T12, typename T13, typename T14, typename T15,
  4122. typename T16, typename T17, typename T18, typename T19, typename T20,
  4123. typename T21, typename T22, typename T23, typename T24, typename T25,
  4124. typename T26, typename T27, typename T28, typename T29, typename T30,
  4125. typename T31, typename T32, typename T33>
  4126. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4127. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4128. T31, T32, T33, internal::None, internal::None, internal::None,
  4129. internal::None, internal::None, internal::None, internal::None,
  4130. internal::None, internal::None, internal::None, internal::None,
  4131. internal::None, internal::None, internal::None, internal::None,
  4132. internal::None, internal::None> {
  4133. typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4134. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4135. T27, T28, T29, T30, T31, T32, T33> type;
  4136. };
  4137. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4138. typename T6, typename T7, typename T8, typename T9, typename T10,
  4139. typename T11, typename T12, typename T13, typename T14, typename T15,
  4140. typename T16, typename T17, typename T18, typename T19, typename T20,
  4141. typename T21, typename T22, typename T23, typename T24, typename T25,
  4142. typename T26, typename T27, typename T28, typename T29, typename T30,
  4143. typename T31, typename T32, typename T33, typename T34>
  4144. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4145. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4146. T31, T32, T33, T34, internal::None, internal::None, internal::None,
  4147. internal::None, internal::None, internal::None, internal::None,
  4148. internal::None, internal::None, internal::None, internal::None,
  4149. internal::None, internal::None, internal::None, internal::None,
  4150. internal::None> {
  4151. typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4152. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4153. T27, T28, T29, T30, T31, T32, T33, T34> type;
  4154. };
  4155. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4156. typename T6, typename T7, typename T8, typename T9, typename T10,
  4157. typename T11, typename T12, typename T13, typename T14, typename T15,
  4158. typename T16, typename T17, typename T18, typename T19, typename T20,
  4159. typename T21, typename T22, typename T23, typename T24, typename T25,
  4160. typename T26, typename T27, typename T28, typename T29, typename T30,
  4161. typename T31, typename T32, typename T33, typename T34, typename T35>
  4162. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4163. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4164. T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
  4165. internal::None, internal::None, internal::None, internal::None,
  4166. internal::None, internal::None, internal::None, internal::None,
  4167. internal::None, internal::None, internal::None, internal::None> {
  4168. typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4169. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4170. T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
  4171. };
  4172. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4173. typename T6, typename T7, typename T8, typename T9, typename T10,
  4174. typename T11, typename T12, typename T13, typename T14, typename T15,
  4175. typename T16, typename T17, typename T18, typename T19, typename T20,
  4176. typename T21, typename T22, typename T23, typename T24, typename T25,
  4177. typename T26, typename T27, typename T28, typename T29, typename T30,
  4178. typename T31, typename T32, typename T33, typename T34, typename T35,
  4179. typename T36>
  4180. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4181. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4182. T31, T32, T33, T34, T35, T36, internal::None, internal::None,
  4183. internal::None, internal::None, internal::None, internal::None,
  4184. internal::None, internal::None, internal::None, internal::None,
  4185. internal::None, internal::None, internal::None, internal::None> {
  4186. typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4187. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4188. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
  4189. };
  4190. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4191. typename T6, typename T7, typename T8, typename T9, typename T10,
  4192. typename T11, typename T12, typename T13, typename T14, typename T15,
  4193. typename T16, typename T17, typename T18, typename T19, typename T20,
  4194. typename T21, typename T22, typename T23, typename T24, typename T25,
  4195. typename T26, typename T27, typename T28, typename T29, typename T30,
  4196. typename T31, typename T32, typename T33, typename T34, typename T35,
  4197. typename T36, typename T37>
  4198. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4199. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4200. T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
  4201. internal::None, internal::None, internal::None, internal::None,
  4202. internal::None, internal::None, internal::None, internal::None,
  4203. internal::None, internal::None, internal::None> {
  4204. typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4205. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4206. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
  4207. };
  4208. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4209. typename T6, typename T7, typename T8, typename T9, typename T10,
  4210. typename T11, typename T12, typename T13, typename T14, typename T15,
  4211. typename T16, typename T17, typename T18, typename T19, typename T20,
  4212. typename T21, typename T22, typename T23, typename T24, typename T25,
  4213. typename T26, typename T27, typename T28, typename T29, typename T30,
  4214. typename T31, typename T32, typename T33, typename T34, typename T35,
  4215. typename T36, typename T37, typename T38>
  4216. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4217. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4218. T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
  4219. internal::None, internal::None, internal::None, internal::None,
  4220. internal::None, internal::None, internal::None, internal::None,
  4221. internal::None, internal::None> {
  4222. typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4223. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4224. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
  4225. };
  4226. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4227. typename T6, typename T7, typename T8, typename T9, typename T10,
  4228. typename T11, typename T12, typename T13, typename T14, typename T15,
  4229. typename T16, typename T17, typename T18, typename T19, typename T20,
  4230. typename T21, typename T22, typename T23, typename T24, typename T25,
  4231. typename T26, typename T27, typename T28, typename T29, typename T30,
  4232. typename T31, typename T32, typename T33, typename T34, typename T35,
  4233. typename T36, typename T37, typename T38, typename T39>
  4234. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4235. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4236. T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
  4237. internal::None, internal::None, internal::None, internal::None,
  4238. internal::None, internal::None, internal::None, internal::None,
  4239. internal::None, internal::None> {
  4240. typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4241. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4242. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
  4243. };
  4244. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4245. typename T6, typename T7, typename T8, typename T9, typename T10,
  4246. typename T11, typename T12, typename T13, typename T14, typename T15,
  4247. typename T16, typename T17, typename T18, typename T19, typename T20,
  4248. typename T21, typename T22, typename T23, typename T24, typename T25,
  4249. typename T26, typename T27, typename T28, typename T29, typename T30,
  4250. typename T31, typename T32, typename T33, typename T34, typename T35,
  4251. typename T36, typename T37, typename T38, typename T39, typename T40>
  4252. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4253. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4254. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
  4255. internal::None, internal::None, internal::None, internal::None,
  4256. internal::None, internal::None, internal::None, internal::None,
  4257. internal::None> {
  4258. typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4259. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4260. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  4261. T40> type;
  4262. };
  4263. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4264. typename T6, typename T7, typename T8, typename T9, typename T10,
  4265. typename T11, typename T12, typename T13, typename T14, typename T15,
  4266. typename T16, typename T17, typename T18, typename T19, typename T20,
  4267. typename T21, typename T22, typename T23, typename T24, typename T25,
  4268. typename T26, typename T27, typename T28, typename T29, typename T30,
  4269. typename T31, typename T32, typename T33, typename T34, typename T35,
  4270. typename T36, typename T37, typename T38, typename T39, typename T40,
  4271. typename T41>
  4272. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4273. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4274. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
  4275. internal::None, internal::None, internal::None, internal::None,
  4276. internal::None, internal::None, internal::None, internal::None> {
  4277. typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4278. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4279. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4280. T41> type;
  4281. };
  4282. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4283. typename T6, typename T7, typename T8, typename T9, typename T10,
  4284. typename T11, typename T12, typename T13, typename T14, typename T15,
  4285. typename T16, typename T17, typename T18, typename T19, typename T20,
  4286. typename T21, typename T22, typename T23, typename T24, typename T25,
  4287. typename T26, typename T27, typename T28, typename T29, typename T30,
  4288. typename T31, typename T32, typename T33, typename T34, typename T35,
  4289. typename T36, typename T37, typename T38, typename T39, typename T40,
  4290. typename T41, typename T42>
  4291. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4292. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4293. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
  4294. internal::None, internal::None, internal::None, internal::None,
  4295. internal::None, internal::None, internal::None> {
  4296. typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4297. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4298. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4299. T41, T42> type;
  4300. };
  4301. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4302. typename T6, typename T7, typename T8, typename T9, typename T10,
  4303. typename T11, typename T12, typename T13, typename T14, typename T15,
  4304. typename T16, typename T17, typename T18, typename T19, typename T20,
  4305. typename T21, typename T22, typename T23, typename T24, typename T25,
  4306. typename T26, typename T27, typename T28, typename T29, typename T30,
  4307. typename T31, typename T32, typename T33, typename T34, typename T35,
  4308. typename T36, typename T37, typename T38, typename T39, typename T40,
  4309. typename T41, typename T42, typename T43>
  4310. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4311. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4312. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  4313. internal::None, internal::None, internal::None, internal::None,
  4314. internal::None, internal::None, internal::None> {
  4315. typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4316. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4317. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4318. T41, T42, T43> type;
  4319. };
  4320. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4321. typename T6, typename T7, typename T8, typename T9, typename T10,
  4322. typename T11, typename T12, typename T13, typename T14, typename T15,
  4323. typename T16, typename T17, typename T18, typename T19, typename T20,
  4324. typename T21, typename T22, typename T23, typename T24, typename T25,
  4325. typename T26, typename T27, typename T28, typename T29, typename T30,
  4326. typename T31, typename T32, typename T33, typename T34, typename T35,
  4327. typename T36, typename T37, typename T38, typename T39, typename T40,
  4328. typename T41, typename T42, typename T43, typename T44>
  4329. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4330. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4331. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  4332. internal::None, internal::None, internal::None, internal::None,
  4333. internal::None, internal::None> {
  4334. typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4335. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4336. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4337. T41, T42, T43, T44> type;
  4338. };
  4339. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4340. typename T6, typename T7, typename T8, typename T9, typename T10,
  4341. typename T11, typename T12, typename T13, typename T14, typename T15,
  4342. typename T16, typename T17, typename T18, typename T19, typename T20,
  4343. typename T21, typename T22, typename T23, typename T24, typename T25,
  4344. typename T26, typename T27, typename T28, typename T29, typename T30,
  4345. typename T31, typename T32, typename T33, typename T34, typename T35,
  4346. typename T36, typename T37, typename T38, typename T39, typename T40,
  4347. typename T41, typename T42, typename T43, typename T44, typename T45>
  4348. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4349. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4350. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  4351. internal::None, internal::None, internal::None, internal::None,
  4352. internal::None> {
  4353. typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4354. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4355. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4356. T41, T42, T43, T44, T45> type;
  4357. };
  4358. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4359. typename T6, typename T7, typename T8, typename T9, typename T10,
  4360. typename T11, typename T12, typename T13, typename T14, typename T15,
  4361. typename T16, typename T17, typename T18, typename T19, typename T20,
  4362. typename T21, typename T22, typename T23, typename T24, typename T25,
  4363. typename T26, typename T27, typename T28, typename T29, typename T30,
  4364. typename T31, typename T32, typename T33, typename T34, typename T35,
  4365. typename T36, typename T37, typename T38, typename T39, typename T40,
  4366. typename T41, typename T42, typename T43, typename T44, typename T45,
  4367. typename T46>
  4368. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4369. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4370. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  4371. T46, internal::None, internal::None, internal::None, internal::None> {
  4372. typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4373. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4374. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4375. T41, T42, T43, T44, T45, T46> type;
  4376. };
  4377. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4378. typename T6, typename T7, typename T8, typename T9, typename T10,
  4379. typename T11, typename T12, typename T13, typename T14, typename T15,
  4380. typename T16, typename T17, typename T18, typename T19, typename T20,
  4381. typename T21, typename T22, typename T23, typename T24, typename T25,
  4382. typename T26, typename T27, typename T28, typename T29, typename T30,
  4383. typename T31, typename T32, typename T33, typename T34, typename T35,
  4384. typename T36, typename T37, typename T38, typename T39, typename T40,
  4385. typename T41, typename T42, typename T43, typename T44, typename T45,
  4386. typename T46, typename T47>
  4387. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4388. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4389. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  4390. T46, T47, internal::None, internal::None, internal::None> {
  4391. typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4392. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4393. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4394. T41, T42, T43, T44, T45, T46, T47> type;
  4395. };
  4396. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4397. typename T6, typename T7, typename T8, typename T9, typename T10,
  4398. typename T11, typename T12, typename T13, typename T14, typename T15,
  4399. typename T16, typename T17, typename T18, typename T19, typename T20,
  4400. typename T21, typename T22, typename T23, typename T24, typename T25,
  4401. typename T26, typename T27, typename T28, typename T29, typename T30,
  4402. typename T31, typename T32, typename T33, typename T34, typename T35,
  4403. typename T36, typename T37, typename T38, typename T39, typename T40,
  4404. typename T41, typename T42, typename T43, typename T44, typename T45,
  4405. typename T46, typename T47, typename T48>
  4406. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4407. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4408. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  4409. T46, T47, T48, internal::None, internal::None> {
  4410. typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4411. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4412. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4413. T41, T42, T43, T44, T45, T46, T47, T48> type;
  4414. };
  4415. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  4416. typename T6, typename T7, typename T8, typename T9, typename T10,
  4417. typename T11, typename T12, typename T13, typename T14, typename T15,
  4418. typename T16, typename T17, typename T18, typename T19, typename T20,
  4419. typename T21, typename T22, typename T23, typename T24, typename T25,
  4420. typename T26, typename T27, typename T28, typename T29, typename T30,
  4421. typename T31, typename T32, typename T33, typename T34, typename T35,
  4422. typename T36, typename T37, typename T38, typename T39, typename T40,
  4423. typename T41, typename T42, typename T43, typename T44, typename T45,
  4424. typename T46, typename T47, typename T48, typename T49>
  4425. struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
  4426. T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
  4427. T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
  4428. T46, T47, T48, T49, internal::None> {
  4429. typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  4430. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  4431. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  4432. T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
  4433. };
  4434. namespace internal {
  4435. # define GTEST_TEMPLATE_ template <typename T> class
  4436. // The template "selector" struct TemplateSel<Tmpl> is used to
  4437. // represent Tmpl, which must be a class template with one type
  4438. // parameter, as a type. TemplateSel<Tmpl>::Bind<T>::type is defined
  4439. // as the type Tmpl<T>. This allows us to actually instantiate the
  4440. // template "selected" by TemplateSel<Tmpl>.
  4441. //
  4442. // This trick is necessary for simulating typedef for class templates,
  4443. // which C++ doesn't support directly.
  4444. template <GTEST_TEMPLATE_ Tmpl>
  4445. struct TemplateSel {
  4446. template <typename T>
  4447. struct Bind {
  4448. typedef Tmpl<T> type;
  4449. };
  4450. };
  4451. # define GTEST_BIND_(TmplSel, T) \
  4452. TmplSel::template Bind<T>::type
  4453. // A unique struct template used as the default value for the
  4454. // arguments of class template Templates. This allows us to simulate
  4455. // variadic templates (e.g. Templates<int>, Templates<int, double>,
  4456. // and etc), which C++ doesn't support directly.
  4457. template <typename T>
  4458. struct NoneT {};
  4459. // The following family of struct and struct templates are used to
  4460. // represent template lists. In particular, TemplatesN<T1, T2, ...,
  4461. // TN> represents a list of N templates (T1, T2, ..., and TN). Except
  4462. // for Templates0, every struct in the family has two member types:
  4463. // Head for the selector of the first template in the list, and Tail
  4464. // for the rest of the list.
  4465. // The empty template list.
  4466. struct Templates0 {};
  4467. // Template lists of length 1, 2, 3, and so on.
  4468. template <GTEST_TEMPLATE_ T1>
  4469. struct Templates1 {
  4470. typedef TemplateSel<T1> Head;
  4471. typedef Templates0 Tail;
  4472. };
  4473. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
  4474. struct Templates2 {
  4475. typedef TemplateSel<T1> Head;
  4476. typedef Templates1<T2> Tail;
  4477. };
  4478. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
  4479. struct Templates3 {
  4480. typedef TemplateSel<T1> Head;
  4481. typedef Templates2<T2, T3> Tail;
  4482. };
  4483. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4484. GTEST_TEMPLATE_ T4>
  4485. struct Templates4 {
  4486. typedef TemplateSel<T1> Head;
  4487. typedef Templates3<T2, T3, T4> Tail;
  4488. };
  4489. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4490. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
  4491. struct Templates5 {
  4492. typedef TemplateSel<T1> Head;
  4493. typedef Templates4<T2, T3, T4, T5> Tail;
  4494. };
  4495. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4496. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
  4497. struct Templates6 {
  4498. typedef TemplateSel<T1> Head;
  4499. typedef Templates5<T2, T3, T4, T5, T6> 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>
  4504. struct Templates7 {
  4505. typedef TemplateSel<T1> Head;
  4506. typedef Templates6<T2, T3, T4, T5, T6, T7> 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>
  4511. struct Templates8 {
  4512. typedef TemplateSel<T1> Head;
  4513. typedef Templates7<T2, T3, T4, T5, T6, T7, T8> 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. struct Templates9 {
  4519. typedef TemplateSel<T1> Head;
  4520. typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
  4521. };
  4522. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4523. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4524. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4525. GTEST_TEMPLATE_ T10>
  4526. struct Templates10 {
  4527. typedef TemplateSel<T1> Head;
  4528. typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
  4529. };
  4530. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4531. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4532. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4533. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
  4534. struct Templates11 {
  4535. typedef TemplateSel<T1> Head;
  4536. typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
  4537. };
  4538. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4539. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4540. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4541. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
  4542. struct Templates12 {
  4543. typedef TemplateSel<T1> Head;
  4544. typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
  4545. };
  4546. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4547. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4548. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4549. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4550. GTEST_TEMPLATE_ T13>
  4551. struct Templates13 {
  4552. typedef TemplateSel<T1> Head;
  4553. typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
  4554. };
  4555. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4556. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4557. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4558. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4559. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
  4560. struct Templates14 {
  4561. typedef TemplateSel<T1> Head;
  4562. typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  4563. T14> Tail;
  4564. };
  4565. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4566. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4567. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4568. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4569. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
  4570. struct Templates15 {
  4571. typedef TemplateSel<T1> Head;
  4572. typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4573. T15> Tail;
  4574. };
  4575. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4576. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4577. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4578. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4579. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4580. GTEST_TEMPLATE_ T16>
  4581. struct Templates16 {
  4582. typedef TemplateSel<T1> Head;
  4583. typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4584. T15, T16> Tail;
  4585. };
  4586. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4587. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4588. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4589. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4590. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4591. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
  4592. struct Templates17 {
  4593. typedef TemplateSel<T1> Head;
  4594. typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4595. T15, T16, T17> Tail;
  4596. };
  4597. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4598. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4599. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4600. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4601. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4602. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
  4603. struct Templates18 {
  4604. typedef TemplateSel<T1> Head;
  4605. typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4606. T15, T16, T17, T18> Tail;
  4607. };
  4608. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4609. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4610. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4611. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4612. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4613. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4614. GTEST_TEMPLATE_ T19>
  4615. struct Templates19 {
  4616. typedef TemplateSel<T1> Head;
  4617. typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4618. T15, T16, T17, T18, T19> Tail;
  4619. };
  4620. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4621. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4622. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4623. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4624. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4625. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4626. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
  4627. struct Templates20 {
  4628. typedef TemplateSel<T1> Head;
  4629. typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4630. T15, T16, T17, T18, T19, T20> Tail;
  4631. };
  4632. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4633. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4634. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4635. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4636. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4637. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4638. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
  4639. struct Templates21 {
  4640. typedef TemplateSel<T1> Head;
  4641. typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4642. T15, T16, T17, T18, T19, T20, T21> Tail;
  4643. };
  4644. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4645. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4646. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4647. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4648. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4649. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4650. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4651. GTEST_TEMPLATE_ T22>
  4652. struct Templates22 {
  4653. typedef TemplateSel<T1> Head;
  4654. typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4655. T15, T16, T17, T18, T19, T20, T21, T22> Tail;
  4656. };
  4657. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4658. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4659. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4660. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4661. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4662. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4663. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4664. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
  4665. struct Templates23 {
  4666. typedef TemplateSel<T1> Head;
  4667. typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4668. T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
  4669. };
  4670. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4671. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4672. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4673. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4674. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4675. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4676. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4677. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
  4678. struct Templates24 {
  4679. typedef TemplateSel<T1> Head;
  4680. typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4681. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
  4682. };
  4683. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4684. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4685. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4686. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4687. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4688. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4689. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4690. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4691. GTEST_TEMPLATE_ T25>
  4692. struct Templates25 {
  4693. typedef TemplateSel<T1> Head;
  4694. typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4695. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
  4696. };
  4697. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4698. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4699. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4700. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4701. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4702. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4703. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4704. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4705. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
  4706. struct Templates26 {
  4707. typedef TemplateSel<T1> Head;
  4708. typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4709. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
  4710. };
  4711. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4712. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4713. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4714. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4715. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4716. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4717. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4718. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4719. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
  4720. struct Templates27 {
  4721. typedef TemplateSel<T1> Head;
  4722. typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4723. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
  4724. };
  4725. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4726. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4727. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4728. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4729. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4730. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4731. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4732. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4733. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4734. GTEST_TEMPLATE_ T28>
  4735. struct Templates28 {
  4736. typedef TemplateSel<T1> Head;
  4737. typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4738. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  4739. T28> Tail;
  4740. };
  4741. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4742. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4743. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4744. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4745. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4746. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4747. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4748. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4749. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4750. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
  4751. struct Templates29 {
  4752. typedef TemplateSel<T1> Head;
  4753. typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4754. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4755. T29> Tail;
  4756. };
  4757. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4758. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4759. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4760. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4761. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4762. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4763. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4764. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4765. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4766. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
  4767. struct Templates30 {
  4768. typedef TemplateSel<T1> Head;
  4769. typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4770. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4771. T29, T30> Tail;
  4772. };
  4773. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4774. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4775. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4776. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4777. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4778. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4779. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4780. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4781. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4782. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4783. GTEST_TEMPLATE_ T31>
  4784. struct Templates31 {
  4785. typedef TemplateSel<T1> Head;
  4786. typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4787. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4788. T29, T30, T31> Tail;
  4789. };
  4790. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4791. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4792. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4793. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4794. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4795. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4796. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4797. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4798. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4799. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4800. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
  4801. struct Templates32 {
  4802. typedef TemplateSel<T1> Head;
  4803. typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4804. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4805. T29, T30, T31, T32> Tail;
  4806. };
  4807. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4808. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4809. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4810. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4811. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4812. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4813. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4814. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4815. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4816. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4817. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
  4818. struct Templates33 {
  4819. typedef TemplateSel<T1> Head;
  4820. typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4821. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4822. T29, T30, T31, T32, T33> Tail;
  4823. };
  4824. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4825. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4826. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4827. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4828. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4829. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4830. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4831. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4832. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4833. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4834. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4835. GTEST_TEMPLATE_ T34>
  4836. struct Templates34 {
  4837. typedef TemplateSel<T1> Head;
  4838. typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4839. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4840. T29, T30, T31, T32, T33, T34> Tail;
  4841. };
  4842. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4843. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4844. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4845. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4846. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4847. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4848. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4849. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4850. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4851. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4852. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4853. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
  4854. struct Templates35 {
  4855. typedef TemplateSel<T1> Head;
  4856. typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4857. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4858. T29, T30, T31, T32, T33, T34, T35> Tail;
  4859. };
  4860. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4861. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4862. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4863. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4864. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4865. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4866. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4867. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4868. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4869. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4870. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4871. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
  4872. struct Templates36 {
  4873. typedef TemplateSel<T1> Head;
  4874. typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4875. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4876. T29, T30, T31, T32, T33, T34, T35, T36> Tail;
  4877. };
  4878. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4879. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4880. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4881. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4882. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4883. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4884. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4885. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4886. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4887. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4888. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4889. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  4890. GTEST_TEMPLATE_ T37>
  4891. struct Templates37 {
  4892. typedef TemplateSel<T1> Head;
  4893. typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4894. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4895. T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
  4896. };
  4897. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4898. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4899. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4900. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4901. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4902. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4903. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4904. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4905. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4906. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4907. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4908. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  4909. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
  4910. struct Templates38 {
  4911. typedef TemplateSel<T1> Head;
  4912. typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4913. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4914. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
  4915. };
  4916. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4917. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4918. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4919. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4920. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4921. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4922. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4923. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4924. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4925. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4926. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4927. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  4928. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
  4929. struct Templates39 {
  4930. typedef TemplateSel<T1> Head;
  4931. typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4932. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4933. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
  4934. };
  4935. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4936. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4937. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4938. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4939. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4940. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4941. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4942. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4943. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4944. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4945. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4946. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  4947. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  4948. GTEST_TEMPLATE_ T40>
  4949. struct Templates40 {
  4950. typedef TemplateSel<T1> Head;
  4951. typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4952. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4953. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
  4954. };
  4955. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4956. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4957. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4958. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4959. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4960. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4961. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4962. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4963. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4964. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4965. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4966. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  4967. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  4968. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
  4969. struct Templates41 {
  4970. typedef TemplateSel<T1> Head;
  4971. typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4972. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4973. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
  4974. };
  4975. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4976. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4977. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4978. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  4979. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  4980. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  4981. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  4982. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  4983. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  4984. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  4985. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  4986. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  4987. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  4988. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
  4989. struct Templates42 {
  4990. typedef TemplateSel<T1> Head;
  4991. typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  4992. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  4993. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  4994. T42> Tail;
  4995. };
  4996. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  4997. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  4998. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  4999. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5000. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5001. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5002. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5003. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5004. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5005. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5006. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5007. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5008. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5009. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5010. GTEST_TEMPLATE_ T43>
  5011. struct Templates43 {
  5012. typedef TemplateSel<T1> Head;
  5013. typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5014. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5015. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5016. T43> Tail;
  5017. };
  5018. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5019. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5020. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5021. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5022. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5023. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5024. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5025. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5026. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5027. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5028. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5029. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5030. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5031. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5032. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
  5033. struct Templates44 {
  5034. typedef TemplateSel<T1> Head;
  5035. typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5036. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5037. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5038. T43, T44> Tail;
  5039. };
  5040. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5041. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5042. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5043. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5044. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5045. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5046. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5047. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5048. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5049. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5050. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5051. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5052. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5053. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5054. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
  5055. struct Templates45 {
  5056. typedef TemplateSel<T1> Head;
  5057. typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5058. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5059. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5060. T43, T44, T45> Tail;
  5061. };
  5062. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5063. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5064. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5065. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5066. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5067. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5068. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5069. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5070. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5071. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5072. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5073. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5074. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5075. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5076. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5077. GTEST_TEMPLATE_ T46>
  5078. struct Templates46 {
  5079. typedef TemplateSel<T1> Head;
  5080. typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5081. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5082. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5083. T43, T44, T45, T46> Tail;
  5084. };
  5085. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5086. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5087. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5088. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5089. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5090. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5091. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5092. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5093. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5094. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5095. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5096. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5097. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5098. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5099. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5100. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
  5101. struct Templates47 {
  5102. typedef TemplateSel<T1> Head;
  5103. typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5104. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5105. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5106. T43, T44, T45, T46, T47> Tail;
  5107. };
  5108. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5109. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5110. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5111. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5112. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5113. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5114. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5115. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5116. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5117. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5118. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5119. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5120. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5121. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5122. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5123. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
  5124. struct Templates48 {
  5125. typedef TemplateSel<T1> Head;
  5126. typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5127. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5128. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5129. T43, T44, T45, T46, T47, T48> Tail;
  5130. };
  5131. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5132. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5133. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5134. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5135. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5136. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5137. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5138. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5139. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5140. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5141. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5142. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5143. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5144. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5145. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5146. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
  5147. GTEST_TEMPLATE_ T49>
  5148. struct Templates49 {
  5149. typedef TemplateSel<T1> Head;
  5150. typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5151. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5152. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5153. T43, T44, T45, T46, T47, T48, T49> Tail;
  5154. };
  5155. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5156. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5157. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5158. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5159. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5160. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5161. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5162. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5163. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5164. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5165. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5166. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5167. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5168. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5169. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5170. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
  5171. GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
  5172. struct Templates50 {
  5173. typedef TemplateSel<T1> Head;
  5174. typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5175. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5176. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  5177. T43, T44, T45, T46, T47, T48, T49, T50> Tail;
  5178. };
  5179. // We don't want to require the users to write TemplatesN<...> directly,
  5180. // as that would require them to count the length. Templates<...> is much
  5181. // easier to write, but generates horrible messages when there is a
  5182. // compiler error, as gcc insists on printing out each template
  5183. // argument, even if it has the default value (this means Templates<list>
  5184. // will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
  5185. // errors).
  5186. //
  5187. // Our solution is to combine the best part of the two approaches: a
  5188. // user would write Templates<T1, ..., TN>, and Google Test will translate
  5189. // that to TemplatesN<T1, ..., TN> internally to make error messages
  5190. // readable. The translation is done by the 'type' member of the
  5191. // Templates template.
  5192. template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
  5193. GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
  5194. GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
  5195. GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
  5196. GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
  5197. GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
  5198. GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
  5199. GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
  5200. GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
  5201. GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
  5202. GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
  5203. GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
  5204. GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
  5205. GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
  5206. GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
  5207. GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
  5208. GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
  5209. GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
  5210. GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
  5211. GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
  5212. GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
  5213. GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
  5214. GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
  5215. GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
  5216. GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
  5217. struct Templates {
  5218. typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5219. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5220. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5221. T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
  5222. };
  5223. template <>
  5224. struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5225. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5226. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5227. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5228. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5229. NoneT> {
  5230. typedef Templates0 type;
  5231. };
  5232. template <GTEST_TEMPLATE_ T1>
  5233. struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5234. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5235. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5236. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5237. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5238. NoneT> {
  5239. typedef Templates1<T1> type;
  5240. };
  5241. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
  5242. struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5243. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5244. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5245. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5246. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5247. NoneT> {
  5248. typedef Templates2<T1, T2> type;
  5249. };
  5250. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
  5251. struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5252. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5253. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5254. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5255. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5256. typedef Templates3<T1, T2, T3> type;
  5257. };
  5258. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5259. GTEST_TEMPLATE_ T4>
  5260. struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5261. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5262. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5263. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5264. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5265. typedef Templates4<T1, T2, T3, T4> type;
  5266. };
  5267. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5268. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
  5269. struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5270. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5271. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5272. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5273. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5274. typedef Templates5<T1, T2, T3, T4, T5> type;
  5275. };
  5276. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5277. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
  5278. struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
  5279. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5280. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5281. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5282. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5283. typedef Templates6<T1, T2, T3, T4, T5, T6> type;
  5284. };
  5285. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5286. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5287. GTEST_TEMPLATE_ T7>
  5288. struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
  5289. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5290. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5291. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5292. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5293. typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
  5294. };
  5295. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5296. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5297. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
  5298. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
  5299. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5300. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5301. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5302. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5303. typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
  5304. };
  5305. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5306. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5307. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
  5308. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
  5309. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5310. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5311. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5312. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5313. typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
  5314. };
  5315. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5316. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5317. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5318. GTEST_TEMPLATE_ T10>
  5319. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
  5320. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5321. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5322. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5323. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5324. typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
  5325. };
  5326. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5327. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5328. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5329. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
  5330. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
  5331. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5332. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5333. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5334. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5335. typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
  5336. };
  5337. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5338. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5339. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5340. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
  5341. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
  5342. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5343. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5344. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5345. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5346. typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
  5347. };
  5348. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5349. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5350. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5351. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5352. GTEST_TEMPLATE_ T13>
  5353. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
  5354. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5355. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5356. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5357. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5358. typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  5359. T13> type;
  5360. };
  5361. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5362. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5363. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5364. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5365. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
  5366. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5367. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5368. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5369. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5370. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5371. typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5372. T14> type;
  5373. };
  5374. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5375. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5376. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5377. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5378. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
  5379. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5380. T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5381. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5382. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5383. NoneT, NoneT, NoneT, NoneT, NoneT> {
  5384. typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5385. T14, T15> type;
  5386. };
  5387. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5388. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5389. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5390. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5391. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5392. GTEST_TEMPLATE_ T16>
  5393. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5394. T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5395. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5396. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5397. NoneT, NoneT, NoneT, NoneT, NoneT> {
  5398. typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5399. T14, T15, T16> type;
  5400. };
  5401. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5402. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5403. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5404. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5405. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5406. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
  5407. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5408. T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5409. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5410. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5411. NoneT, NoneT, NoneT, NoneT, NoneT> {
  5412. typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5413. T14, T15, T16, T17> type;
  5414. };
  5415. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5416. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5417. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5418. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5419. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5420. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
  5421. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5422. T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5423. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5424. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5425. NoneT, NoneT, NoneT, NoneT> {
  5426. typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5427. T14, T15, T16, T17, T18> type;
  5428. };
  5429. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5430. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5431. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5432. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5433. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5434. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5435. GTEST_TEMPLATE_ T19>
  5436. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5437. T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5438. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5439. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5440. NoneT, NoneT, NoneT, NoneT> {
  5441. typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5442. T14, T15, T16, T17, T18, T19> type;
  5443. };
  5444. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5445. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5446. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5447. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5448. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5449. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5450. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
  5451. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5452. T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5453. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5454. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5455. NoneT, NoneT, NoneT, NoneT> {
  5456. typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5457. T14, T15, T16, T17, T18, T19, T20> type;
  5458. };
  5459. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5460. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5461. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5462. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5463. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5464. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5465. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
  5466. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5467. T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
  5468. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5469. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5470. NoneT, NoneT, NoneT, NoneT> {
  5471. typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5472. T14, T15, T16, T17, T18, T19, T20, T21> type;
  5473. };
  5474. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5475. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5476. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5477. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5478. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5479. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5480. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5481. GTEST_TEMPLATE_ T22>
  5482. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5483. T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
  5484. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5485. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5486. NoneT, NoneT, NoneT> {
  5487. typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5488. T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
  5489. };
  5490. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5491. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5492. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5493. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5494. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5495. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5496. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5497. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
  5498. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5499. T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
  5500. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5501. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5502. NoneT, NoneT, NoneT> {
  5503. typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5504. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
  5505. };
  5506. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5507. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5508. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5509. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5510. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5511. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5512. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5513. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
  5514. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5515. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
  5516. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5517. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5518. NoneT, NoneT, NoneT> {
  5519. typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5520. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
  5521. };
  5522. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5523. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5524. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5525. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5526. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5527. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5528. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5529. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5530. GTEST_TEMPLATE_ T25>
  5531. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5532. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
  5533. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5534. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5535. NoneT, NoneT> {
  5536. typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5537. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
  5538. };
  5539. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5540. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5541. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5542. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5543. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5544. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5545. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5546. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5547. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
  5548. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5549. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
  5550. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5551. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5552. NoneT, NoneT> {
  5553. typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5554. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
  5555. };
  5556. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5557. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5558. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5559. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5560. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5561. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5562. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5563. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5564. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
  5565. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5566. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
  5567. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5568. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5569. NoneT, NoneT> {
  5570. typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5571. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  5572. T27> type;
  5573. };
  5574. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5575. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5576. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5577. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5578. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5579. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5580. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5581. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5582. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5583. GTEST_TEMPLATE_ T28>
  5584. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5585. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  5586. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5587. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5588. NoneT, NoneT> {
  5589. typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5590. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5591. T28> type;
  5592. };
  5593. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5594. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5595. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5596. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5597. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5598. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5599. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5600. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5601. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5602. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
  5603. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5604. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5605. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5606. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5607. NoneT> {
  5608. typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5609. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5610. T28, T29> type;
  5611. };
  5612. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5613. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5614. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5615. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5616. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5617. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5618. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5619. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5620. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5621. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
  5622. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5623. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5624. T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5625. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5626. typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5627. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5628. T28, T29, T30> type;
  5629. };
  5630. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5631. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5632. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5633. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5634. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5635. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5636. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5637. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5638. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5639. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5640. GTEST_TEMPLATE_ T31>
  5641. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5642. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5643. T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5644. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5645. typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5646. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5647. T28, T29, T30, T31> type;
  5648. };
  5649. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5650. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5651. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5652. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5653. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5654. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5655. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5656. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5657. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5658. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5659. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
  5660. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5661. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5662. T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5663. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5664. typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5665. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5666. T28, T29, T30, T31, T32> type;
  5667. };
  5668. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5669. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5670. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5671. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5672. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5673. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5674. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5675. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5676. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5677. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5678. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
  5679. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5680. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5681. T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5682. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5683. typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5684. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5685. T28, T29, T30, T31, T32, T33> type;
  5686. };
  5687. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5688. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5689. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5690. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5691. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5692. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5693. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5694. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5695. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5696. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5697. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5698. GTEST_TEMPLATE_ T34>
  5699. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5700. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5701. T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5702. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5703. typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5704. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5705. T28, T29, T30, T31, T32, T33, T34> type;
  5706. };
  5707. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5708. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5709. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5710. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5711. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5712. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5713. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5714. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5715. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5716. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5717. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5718. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
  5719. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5720. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5721. T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
  5722. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5723. typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5724. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5725. T28, T29, T30, T31, T32, T33, T34, T35> type;
  5726. };
  5727. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5728. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5729. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5730. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5731. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5732. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5733. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5734. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5735. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5736. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5737. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5738. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
  5739. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5740. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5741. T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
  5742. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5743. typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5744. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5745. T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
  5746. };
  5747. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5748. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5749. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5750. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5751. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5752. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5753. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5754. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5755. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5756. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5757. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5758. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5759. GTEST_TEMPLATE_ T37>
  5760. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5761. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5762. T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
  5763. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5764. typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5765. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5766. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
  5767. };
  5768. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5769. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5770. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5771. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5772. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5773. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5774. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5775. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5776. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5777. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5778. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5779. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5780. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
  5781. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5782. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5783. T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
  5784. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5785. typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5786. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5787. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
  5788. };
  5789. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5790. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5791. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5792. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5793. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5794. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5795. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5796. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5797. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5798. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5799. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5800. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5801. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
  5802. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5803. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5804. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
  5805. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5806. typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5807. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5808. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
  5809. };
  5810. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5811. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5812. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5813. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5814. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5815. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5816. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5817. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5818. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5819. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5820. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5821. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5822. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5823. GTEST_TEMPLATE_ T40>
  5824. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5825. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5826. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
  5827. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5828. typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5829. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5830. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
  5831. };
  5832. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5833. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5834. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5835. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5836. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5837. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5838. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5839. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5840. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5841. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5842. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5843. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5844. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5845. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
  5846. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5847. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5848. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
  5849. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5850. typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5851. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5852. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  5853. T41> type;
  5854. };
  5855. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5856. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5857. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5858. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5859. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5860. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5861. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5862. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5863. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5864. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5865. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5866. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5867. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5868. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
  5869. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5870. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5871. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
  5872. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5873. typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5874. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5875. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5876. T42> type;
  5877. };
  5878. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5879. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5880. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5881. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5882. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5883. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5884. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5885. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5886. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5887. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5888. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5889. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5890. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5891. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5892. GTEST_TEMPLATE_ T43>
  5893. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5894. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5895. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  5896. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5897. typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5898. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5899. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5900. T42, T43> type;
  5901. };
  5902. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5903. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5904. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5905. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5906. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5907. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5908. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5909. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5910. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5911. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5912. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5913. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5914. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5915. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5916. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
  5917. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5918. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5919. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  5920. NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5921. typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5922. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5923. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5924. T42, T43, T44> type;
  5925. };
  5926. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5927. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5928. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5929. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5930. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5931. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5932. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5933. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5934. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5935. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5936. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5937. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5938. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5939. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5940. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
  5941. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5942. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5943. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  5944. T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
  5945. typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5946. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5947. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5948. T42, T43, T44, T45> type;
  5949. };
  5950. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5951. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5952. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5953. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5954. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5955. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5956. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5957. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5958. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5959. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5960. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5961. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5962. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5963. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5964. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5965. GTEST_TEMPLATE_ T46>
  5966. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5967. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5968. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  5969. T45, T46, NoneT, NoneT, NoneT, NoneT> {
  5970. typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5971. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5972. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5973. T42, T43, T44, T45, T46> type;
  5974. };
  5975. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  5976. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  5977. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  5978. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  5979. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  5980. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  5981. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  5982. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  5983. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  5984. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  5985. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  5986. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  5987. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  5988. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  5989. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  5990. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
  5991. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  5992. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  5993. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  5994. T45, T46, T47, NoneT, NoneT, NoneT> {
  5995. typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  5996. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  5997. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  5998. T42, T43, T44, T45, T46, T47> type;
  5999. };
  6000. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6001. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6002. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6003. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6004. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6005. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6006. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6007. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6008. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6009. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6010. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6011. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6012. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6013. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6014. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6015. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
  6016. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6017. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6018. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  6019. T45, T46, T47, T48, NoneT, NoneT> {
  6020. typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6021. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6022. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6023. T42, T43, T44, T45, T46, T47, T48> type;
  6024. };
  6025. template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
  6026. GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
  6027. GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
  6028. GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
  6029. GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
  6030. GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
  6031. GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
  6032. GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
  6033. GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
  6034. GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
  6035. GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
  6036. GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
  6037. GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
  6038. GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
  6039. GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
  6040. GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
  6041. GTEST_TEMPLATE_ T49>
  6042. struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
  6043. T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
  6044. T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
  6045. T45, T46, T47, T48, T49, NoneT> {
  6046. typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6047. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  6048. T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  6049. T42, T43, T44, T45, T46, T47, T48, T49> type;
  6050. };
  6051. // The TypeList template makes it possible to use either a single type
  6052. // or a Types<...> list in TYPED_TEST_CASE() and
  6053. // INSTANTIATE_TYPED_TEST_CASE_P().
  6054. template <typename T>
  6055. struct TypeList { typedef Types1<T> type; };
  6056. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  6057. typename T6, typename T7, typename T8, typename T9, typename T10,
  6058. typename T11, typename T12, typename T13, typename T14, typename T15,
  6059. typename T16, typename T17, typename T18, typename T19, typename T20,
  6060. typename T21, typename T22, typename T23, typename T24, typename T25,
  6061. typename T26, typename T27, typename T28, typename T29, typename T30,
  6062. typename T31, typename T32, typename T33, typename T34, typename T35,
  6063. typename T36, typename T37, typename T38, typename T39, typename T40,
  6064. typename T41, typename T42, typename T43, typename T44, typename T45,
  6065. typename T46, typename T47, typename T48, typename T49, typename T50>
  6066. struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  6067. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  6068. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  6069. T44, T45, T46, T47, T48, T49, T50> > {
  6070. typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  6071. T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  6072. T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  6073. T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
  6074. };
  6075. #endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  6076. } // namespace internal
  6077. } // namespace testing
  6078. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
  6079. // Due to C++ preprocessor weirdness, we need double indirection to
  6080. // concatenate two tokens when one of them is __LINE__. Writing
  6081. //
  6082. // foo ## __LINE__
  6083. //
  6084. // will result in the token foo__LINE__, instead of foo followed by
  6085. // the current line number. For more details, see
  6086. // http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
  6087. #define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
  6088. #define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
  6089. // Google Test defines the testing::Message class to allow construction of
  6090. // test messages via the << operator. The idea is that anything
  6091. // streamable to std::ostream can be streamed to a testing::Message.
  6092. // This allows a user to use his own types in Google Test assertions by
  6093. // overloading the << operator.
  6094. //
  6095. // util/gtl/stl_logging-inl.h overloads << for STL containers. These
  6096. // overloads cannot be defined in the std namespace, as that will be
  6097. // undefined behavior. Therefore, they are defined in the global
  6098. // namespace instead.
  6099. //
  6100. // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
  6101. // overloads are visible in either the std namespace or the global
  6102. // namespace, but not other namespaces, including the testing
  6103. // namespace which Google Test's Message class is in.
  6104. //
  6105. // To allow STL containers (and other types that has a << operator
  6106. // defined in the global namespace) to be used in Google Test assertions,
  6107. // testing::Message must access the custom << operator from the global
  6108. // namespace. Hence this helper function.
  6109. //
  6110. // Note: Jeffrey Yasskin suggested an alternative fix by "using
  6111. // ::operator<<;" in the definition of Message's operator<<. That fix
  6112. // doesn't require a helper function, but unfortunately doesn't
  6113. // compile with MSVC.
  6114. template <typename T>
  6115. inline void GTestStreamToHelper(std::ostream* os, const T& val) {
  6116. *os << val;
  6117. }
  6118. class ProtocolMessage;
  6119. namespace proto2 { class Message; }
  6120. namespace testing {
  6121. // Forward declarations.
  6122. class AssertionResult; // Result of an assertion.
  6123. class Message; // Represents a failure message.
  6124. class Test; // Represents a test.
  6125. class TestInfo; // Information about a test.
  6126. class TestPartResult; // Result of a test part.
  6127. class UnitTest; // A collection of test cases.
  6128. template <typename T>
  6129. ::std::string PrintToString(const T& value);
  6130. namespace internal {
  6131. struct TraceInfo; // Information about a trace point.
  6132. class ScopedTrace; // Implements scoped trace.
  6133. class TestInfoImpl; // Opaque implementation of TestInfo
  6134. class UnitTestImpl; // Opaque implementation of UnitTest
  6135. // How many times InitGoogleTest() has been called.
  6136. extern int g_init_gtest_count;
  6137. // The text used in failure messages to indicate the start of the
  6138. // stack trace.
  6139. GTEST_API_ extern const char kStackTraceMarker[];
  6140. // A secret type that Google Test users don't know about. It has no
  6141. // definition on purpose. Therefore it's impossible to create a
  6142. // Secret object, which is what we want.
  6143. class Secret;
  6144. // Two overloaded helpers for checking at compile time whether an
  6145. // expression is a null pointer literal (i.e. NULL or any 0-valued
  6146. // compile-time integral constant). Their return values have
  6147. // different sizes, so we can use sizeof() to test which version is
  6148. // picked by the compiler. These helpers have no implementations, as
  6149. // we only need their signatures.
  6150. //
  6151. // Given IsNullLiteralHelper(x), the compiler will pick the first
  6152. // version if x can be implicitly converted to Secret*, and pick the
  6153. // second version otherwise. Since Secret is a secret and incomplete
  6154. // type, the only expression a user can write that has type Secret* is
  6155. // a null pointer literal. Therefore, we know that x is a null
  6156. // pointer literal if and only if the first version is picked by the
  6157. // compiler.
  6158. char IsNullLiteralHelper(Secret* p);
  6159. char (&IsNullLiteralHelper(...))[2]; // NOLINT
  6160. // A compile-time bool constant that is true if and only if x is a
  6161. // null pointer literal (i.e. NULL or any 0-valued compile-time
  6162. // integral constant).
  6163. #ifdef GTEST_ELLIPSIS_NEEDS_POD_
  6164. // We lose support for NULL detection where the compiler doesn't like
  6165. // passing non-POD classes through ellipsis (...).
  6166. # define GTEST_IS_NULL_LITERAL_(x) false
  6167. #else
  6168. # define GTEST_IS_NULL_LITERAL_(x) \
  6169. (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
  6170. #endif // GTEST_ELLIPSIS_NEEDS_POD_
  6171. // Appends the user-supplied message to the Google-Test-generated message.
  6172. GTEST_API_ String AppendUserMessage(const String& gtest_msg,
  6173. const Message& user_msg);
  6174. // A helper class for creating scoped traces in user programs.
  6175. class GTEST_API_ ScopedTrace {
  6176. public:
  6177. // The c'tor pushes the given source file location and message onto
  6178. // a trace stack maintained by Google Test.
  6179. ScopedTrace(const char* file, int line, const Message& message);
  6180. // The d'tor pops the info pushed by the c'tor.
  6181. //
  6182. // Note that the d'tor is not virtual in order to be efficient.
  6183. // Don't inherit from ScopedTrace!
  6184. ~ScopedTrace();
  6185. private:
  6186. GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
  6187. } GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its
  6188. // c'tor and d'tor. Therefore it doesn't
  6189. // need to be used otherwise.
  6190. // Converts a streamable value to a String. A NULL pointer is
  6191. // converted to "(null)". When the input value is a ::string,
  6192. // ::std::string, ::wstring, or ::std::wstring object, each NUL
  6193. // character in it is replaced with "\\0".
  6194. // Declared here but defined in gtest.h, so that it has access
  6195. // to the definition of the Message class, required by the ARM
  6196. // compiler.
  6197. template <typename T>
  6198. String StreamableToString(const T& streamable);
  6199. // The Symbian compiler has a bug that prevents it from selecting the
  6200. // correct overload of FormatForComparisonFailureMessage (see below)
  6201. // unless we pass the first argument by reference. If we do that,
  6202. // however, Visual Age C++ 10.1 generates a compiler error. Therefore
  6203. // we only apply the work-around for Symbian.
  6204. #if defined(__SYMBIAN32__)
  6205. # define GTEST_CREF_WORKAROUND_ const&
  6206. #else
  6207. # define GTEST_CREF_WORKAROUND_
  6208. #endif
  6209. // When this operand is a const char* or char*, if the other operand
  6210. // is a ::std::string or ::string, we print this operand as a C string
  6211. // rather than a pointer (we do the same for wide strings); otherwise
  6212. // we print it as a pointer to be safe.
  6213. // This internal macro is used to avoid duplicated code.
  6214. #define GTEST_FORMAT_IMPL_(operand2_type, operand1_printer)\
  6215. inline String FormatForComparisonFailureMessage(\
  6216. operand2_type::value_type* GTEST_CREF_WORKAROUND_ str, \
  6217. const operand2_type& /*operand2*/) {\
  6218. return operand1_printer(str);\
  6219. }\
  6220. inline String FormatForComparisonFailureMessage(\
  6221. const operand2_type::value_type* GTEST_CREF_WORKAROUND_ str, \
  6222. const operand2_type& /*operand2*/) {\
  6223. return operand1_printer(str);\
  6224. }
  6225. GTEST_FORMAT_IMPL_(::std::string, String::ShowCStringQuoted)
  6226. #if GTEST_HAS_STD_WSTRING
  6227. GTEST_FORMAT_IMPL_(::std::wstring, String::ShowWideCStringQuoted)
  6228. #endif // GTEST_HAS_STD_WSTRING
  6229. #if GTEST_HAS_GLOBAL_STRING
  6230. GTEST_FORMAT_IMPL_(::string, String::ShowCStringQuoted)
  6231. #endif // GTEST_HAS_GLOBAL_STRING
  6232. #if GTEST_HAS_GLOBAL_WSTRING
  6233. GTEST_FORMAT_IMPL_(::wstring, String::ShowWideCStringQuoted)
  6234. #endif // GTEST_HAS_GLOBAL_WSTRING
  6235. #undef GTEST_FORMAT_IMPL_
  6236. // The next four overloads handle the case where the operand being
  6237. // printed is a char/wchar_t pointer and the other operand is not a
  6238. // string/wstring object. In such cases, we just print the operand as
  6239. // a pointer to be safe.
  6240. #define GTEST_FORMAT_CHAR_PTR_IMPL_(CharType) \
  6241. template <typename T> \
  6242. String FormatForComparisonFailureMessage(CharType* GTEST_CREF_WORKAROUND_ p, \
  6243. const T&) { \
  6244. return PrintToString(static_cast<const void*>(p)); \
  6245. }
  6246. GTEST_FORMAT_CHAR_PTR_IMPL_(char)
  6247. GTEST_FORMAT_CHAR_PTR_IMPL_(const char)
  6248. GTEST_FORMAT_CHAR_PTR_IMPL_(wchar_t)
  6249. GTEST_FORMAT_CHAR_PTR_IMPL_(const wchar_t)
  6250. #undef GTEST_FORMAT_CHAR_PTR_IMPL_
  6251. // Constructs and returns the message for an equality assertion
  6252. // (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
  6253. //
  6254. // The first four parameters are the expressions used in the assertion
  6255. // and their values, as strings. For example, for ASSERT_EQ(foo, bar)
  6256. // where foo is 5 and bar is 6, we have:
  6257. //
  6258. // expected_expression: "foo"
  6259. // actual_expression: "bar"
  6260. // expected_value: "5"
  6261. // actual_value: "6"
  6262. //
  6263. // The ignoring_case parameter is true iff the assertion is a
  6264. // *_STRCASEEQ*. When it's true, the string " (ignoring case)" will
  6265. // be inserted into the message.
  6266. GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
  6267. const char* actual_expression,
  6268. const String& expected_value,
  6269. const String& actual_value,
  6270. bool ignoring_case);
  6271. // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
  6272. GTEST_API_ String GetBoolAssertionFailureMessage(
  6273. const AssertionResult& assertion_result,
  6274. const char* expression_text,
  6275. const char* actual_predicate_value,
  6276. const char* expected_predicate_value);
  6277. // This template class represents an IEEE floating-point number
  6278. // (either single-precision or double-precision, depending on the
  6279. // template parameters).
  6280. //
  6281. // The purpose of this class is to do more sophisticated number
  6282. // comparison. (Due to round-off error, etc, it's very unlikely that
  6283. // two floating-points will be equal exactly. Hence a naive
  6284. // comparison by the == operation often doesn't work.)
  6285. //
  6286. // Format of IEEE floating-point:
  6287. //
  6288. // The most-significant bit being the leftmost, an IEEE
  6289. // floating-point looks like
  6290. //
  6291. // sign_bit exponent_bits fraction_bits
  6292. //
  6293. // Here, sign_bit is a single bit that designates the sign of the
  6294. // number.
  6295. //
  6296. // For float, there are 8 exponent bits and 23 fraction bits.
  6297. //
  6298. // For double, there are 11 exponent bits and 52 fraction bits.
  6299. //
  6300. // More details can be found at
  6301. // http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
  6302. //
  6303. // Template parameter:
  6304. //
  6305. // RawType: the raw floating-point type (either float or double)
  6306. template <typename RawType>
  6307. class FloatingPoint {
  6308. public:
  6309. // Defines the unsigned integer type that has the same size as the
  6310. // floating point number.
  6311. typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
  6312. // Constants.
  6313. // # of bits in a number.
  6314. static const size_t kBitCount = 8*sizeof(RawType);
  6315. // # of fraction bits in a number.
  6316. static const size_t kFractionBitCount =
  6317. std::numeric_limits<RawType>::digits - 1;
  6318. // # of exponent bits in a number.
  6319. static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
  6320. // The mask for the sign bit.
  6321. static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
  6322. // The mask for the fraction bits.
  6323. static const Bits kFractionBitMask =
  6324. ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
  6325. // The mask for the exponent bits.
  6326. static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
  6327. // How many ULP's (Units in the Last Place) we want to tolerate when
  6328. // comparing two numbers. The larger the value, the more error we
  6329. // allow. A 0 value means that two numbers must be exactly the same
  6330. // to be considered equal.
  6331. //
  6332. // The maximum error of a single floating-point operation is 0.5
  6333. // units in the last place. On Intel CPU's, all floating-point
  6334. // calculations are done with 80-bit precision, while double has 64
  6335. // bits. Therefore, 4 should be enough for ordinary use.
  6336. //
  6337. // See the following article for more details on ULP:
  6338. // http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm.
  6339. static const size_t kMaxUlps = 4;
  6340. // Constructs a FloatingPoint from a raw floating-point number.
  6341. //
  6342. // On an Intel CPU, passing a non-normalized NAN (Not a Number)
  6343. // around may change its bits, although the new value is guaranteed
  6344. // to be also a NAN. Therefore, don't expect this constructor to
  6345. // preserve the bits in x when x is a NAN.
  6346. explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
  6347. // Static methods
  6348. // Reinterprets a bit pattern as a floating-point number.
  6349. //
  6350. // This function is needed to test the AlmostEquals() method.
  6351. static RawType ReinterpretBits(const Bits bits) {
  6352. FloatingPoint fp(0);
  6353. fp.u_.bits_ = bits;
  6354. return fp.u_.value_;
  6355. }
  6356. // Returns the floating-point number that represent positive infinity.
  6357. static RawType Infinity() {
  6358. return ReinterpretBits(kExponentBitMask);
  6359. }
  6360. // Non-static methods
  6361. // Returns the bits that represents this number.
  6362. const Bits &bits() const { return u_.bits_; }
  6363. // Returns the exponent bits of this number.
  6364. Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
  6365. // Returns the fraction bits of this number.
  6366. Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
  6367. // Returns the sign bit of this number.
  6368. Bits sign_bit() const { return kSignBitMask & u_.bits_; }
  6369. // Returns true iff this is NAN (not a number).
  6370. bool is_nan() const {
  6371. // It's a NAN if the exponent bits are all ones and the fraction
  6372. // bits are not entirely zeros.
  6373. return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
  6374. }
  6375. // Returns true iff this number is at most kMaxUlps ULP's away from
  6376. // rhs. In particular, this function:
  6377. //
  6378. // - returns false if either number is (or both are) NAN.
  6379. // - treats really large numbers as almost equal to infinity.
  6380. // - thinks +0.0 and -0.0 are 0 DLP's apart.
  6381. bool AlmostEquals(const FloatingPoint& rhs) const {
  6382. // The IEEE standard says that any comparison operation involving
  6383. // a NAN must return false.
  6384. if (is_nan() || rhs.is_nan()) return false;
  6385. return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
  6386. <= kMaxUlps;
  6387. }
  6388. private:
  6389. // The data type used to store the actual floating-point number.
  6390. union FloatingPointUnion {
  6391. RawType value_; // The raw floating-point number.
  6392. Bits bits_; // The bits that represent the number.
  6393. };
  6394. // Converts an integer from the sign-and-magnitude representation to
  6395. // the biased representation. More precisely, let N be 2 to the
  6396. // power of (kBitCount - 1), an integer x is represented by the
  6397. // unsigned number x + N.
  6398. //
  6399. // For instance,
  6400. //
  6401. // -N + 1 (the most negative number representable using
  6402. // sign-and-magnitude) is represented by 1;
  6403. // 0 is represented by N; and
  6404. // N - 1 (the biggest number representable using
  6405. // sign-and-magnitude) is represented by 2N - 1.
  6406. //
  6407. // Read http://en.wikipedia.org/wiki/Signed_number_representations
  6408. // for more details on signed number representations.
  6409. static Bits SignAndMagnitudeToBiased(const Bits &sam) {
  6410. if (kSignBitMask & sam) {
  6411. // sam represents a negative number.
  6412. return ~sam + 1;
  6413. } else {
  6414. // sam represents a positive number.
  6415. return kSignBitMask | sam;
  6416. }
  6417. }
  6418. // Given two numbers in the sign-and-magnitude representation,
  6419. // returns the distance between them as an unsigned number.
  6420. static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
  6421. const Bits &sam2) {
  6422. const Bits biased1 = SignAndMagnitudeToBiased(sam1);
  6423. const Bits biased2 = SignAndMagnitudeToBiased(sam2);
  6424. return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
  6425. }
  6426. FloatingPointUnion u_;
  6427. };
  6428. // Typedefs the instances of the FloatingPoint template class that we
  6429. // care to use.
  6430. typedef FloatingPoint<float> Float;
  6431. typedef FloatingPoint<double> Double;
  6432. // In order to catch the mistake of putting tests that use different
  6433. // test fixture classes in the same test case, we need to assign
  6434. // unique IDs to fixture classes and compare them. The TypeId type is
  6435. // used to hold such IDs. The user should treat TypeId as an opaque
  6436. // type: the only operation allowed on TypeId values is to compare
  6437. // them for equality using the == operator.
  6438. typedef const void* TypeId;
  6439. template <typename T>
  6440. class TypeIdHelper {
  6441. public:
  6442. // dummy_ must not have a const type. Otherwise an overly eager
  6443. // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
  6444. // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
  6445. static bool dummy_;
  6446. };
  6447. template <typename T>
  6448. bool TypeIdHelper<T>::dummy_ = false;
  6449. // GetTypeId<T>() returns the ID of type T. Different values will be
  6450. // returned for different types. Calling the function twice with the
  6451. // same type argument is guaranteed to return the same ID.
  6452. template <typename T>
  6453. TypeId GetTypeId() {
  6454. // The compiler is required to allocate a different
  6455. // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
  6456. // the template. Therefore, the address of dummy_ is guaranteed to
  6457. // be unique.
  6458. return &(TypeIdHelper<T>::dummy_);
  6459. }
  6460. // Returns the type ID of ::testing::Test. Always call this instead
  6461. // of GetTypeId< ::testing::Test>() to get the type ID of
  6462. // ::testing::Test, as the latter may give the wrong result due to a
  6463. // suspected linker bug when compiling Google Test as a Mac OS X
  6464. // framework.
  6465. GTEST_API_ TypeId GetTestTypeId();
  6466. // Defines the abstract factory interface that creates instances
  6467. // of a Test object.
  6468. class TestFactoryBase {
  6469. public:
  6470. virtual ~TestFactoryBase() {}
  6471. // Creates a test instance to run. The instance is both created and destroyed
  6472. // within TestInfoImpl::Run()
  6473. virtual Test* CreateTest() = 0;
  6474. protected:
  6475. TestFactoryBase() {}
  6476. private:
  6477. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
  6478. };
  6479. // This class provides implementation of TeastFactoryBase interface.
  6480. // It is used in TEST and TEST_F macros.
  6481. template <class TestClass>
  6482. class TestFactoryImpl : public TestFactoryBase {
  6483. public:
  6484. virtual Test* CreateTest() { return new TestClass; }
  6485. };
  6486. #if GTEST_OS_WINDOWS
  6487. // Predicate-formatters for implementing the HRESULT checking macros
  6488. // {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
  6489. // We pass a long instead of HRESULT to avoid causing an
  6490. // include dependency for the HRESULT type.
  6491. GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
  6492. long hr); // NOLINT
  6493. GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
  6494. long hr); // NOLINT
  6495. #endif // GTEST_OS_WINDOWS
  6496. // Types of SetUpTestCase() and TearDownTestCase() functions.
  6497. typedef void (*SetUpTestCaseFunc)();
  6498. typedef void (*TearDownTestCaseFunc)();
  6499. // Creates a new TestInfo object and registers it with Google Test;
  6500. // returns the created object.
  6501. //
  6502. // Arguments:
  6503. //
  6504. // test_case_name: name of the test case
  6505. // name: name of the test
  6506. // type_param the name of the test's type parameter, or NULL if
  6507. // this is not a typed or a type-parameterized test.
  6508. // value_param text representation of the test's value parameter,
  6509. // or NULL if this is not a type-parameterized test.
  6510. // fixture_class_id: ID of the test fixture class
  6511. // set_up_tc: pointer to the function that sets up the test case
  6512. // tear_down_tc: pointer to the function that tears down the test case
  6513. // factory: pointer to the factory that creates a test object.
  6514. // The newly created TestInfo instance will assume
  6515. // ownership of the factory object.
  6516. GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
  6517. const char* test_case_name, const char* name,
  6518. const char* type_param,
  6519. const char* value_param,
  6520. TypeId fixture_class_id,
  6521. SetUpTestCaseFunc set_up_tc,
  6522. TearDownTestCaseFunc tear_down_tc,
  6523. TestFactoryBase* factory);
  6524. // If *pstr starts with the given prefix, modifies *pstr to be right
  6525. // past the prefix and returns true; otherwise leaves *pstr unchanged
  6526. // and returns false. None of pstr, *pstr, and prefix can be NULL.
  6527. GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
  6528. #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  6529. // State of the definition of a type-parameterized test case.
  6530. class GTEST_API_ TypedTestCasePState {
  6531. public:
  6532. TypedTestCasePState() : registered_(false) {}
  6533. // Adds the given test name to defined_test_names_ and return true
  6534. // if the test case hasn't been registered; otherwise aborts the
  6535. // program.
  6536. bool AddTestName(const char* file, int line, const char* case_name,
  6537. const char* test_name) {
  6538. if (registered_) {
  6539. fprintf(stderr, "%s Test %s must be defined before "
  6540. "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
  6541. FormatFileLocation(file, line).c_str(), test_name, case_name);
  6542. fflush(stderr);
  6543. posix::Abort();
  6544. }
  6545. defined_test_names_.insert(test_name);
  6546. return true;
  6547. }
  6548. // Verifies that registered_tests match the test names in
  6549. // defined_test_names_; returns registered_tests if successful, or
  6550. // aborts the program otherwise.
  6551. const char* VerifyRegisteredTestNames(
  6552. const char* file, int line, const char* registered_tests);
  6553. private:
  6554. bool registered_;
  6555. ::std::set<const char*> defined_test_names_;
  6556. };
  6557. // Skips to the first non-space char after the first comma in 'str';
  6558. // returns NULL if no comma is found in 'str'.
  6559. inline const char* SkipComma(const char* str) {
  6560. const char* comma = strchr(str, ',');
  6561. if (comma == NULL) {
  6562. return NULL;
  6563. }
  6564. while (IsSpace(*(++comma))) {}
  6565. return comma;
  6566. }
  6567. // Returns the prefix of 'str' before the first comma in it; returns
  6568. // the entire string if it contains no comma.
  6569. inline String GetPrefixUntilComma(const char* str) {
  6570. const char* comma = strchr(str, ',');
  6571. return comma == NULL ? String(str) : String(str, static_cast<size_t>(comma - str));
  6572. }
  6573. // TypeParameterizedTest<Fixture, TestSel, Types>::Register()
  6574. // registers a list of type-parameterized tests with Google Test. The
  6575. // return value is insignificant - we just need to return something
  6576. // such that we can call this function in a namespace scope.
  6577. //
  6578. // Implementation note: The GTEST_TEMPLATE_ macro declares a template
  6579. // template parameter. It's defined in gtest-type-util.h.
  6580. template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
  6581. class TypeParameterizedTest {
  6582. public:
  6583. // 'index' is the index of the test in the type list 'Types'
  6584. // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
  6585. // Types). Valid values for 'index' are [0, N - 1] where N is the
  6586. // length of Types.
  6587. static bool Register(const char* prefix, const char* case_name,
  6588. const char* test_names, int index) {
  6589. typedef typename Types::Head Type;
  6590. typedef Fixture<Type> FixtureClass;
  6591. typedef typename GTEST_BIND_(TestSel, Type) TestClass;
  6592. // First, registers the first type-parameterized test in the type
  6593. // list.
  6594. MakeAndRegisterTestInfo(
  6595. String::Format("%s%s%s/%d", prefix, prefix[0] == '\0' ? "" : "/",
  6596. case_name, index).c_str(),
  6597. GetPrefixUntilComma(test_names).c_str(),
  6598. GetTypeName<Type>().c_str(),
  6599. NULL, // No value parameter.
  6600. GetTypeId<FixtureClass>(),
  6601. TestClass::SetUpTestCase,
  6602. TestClass::TearDownTestCase,
  6603. new TestFactoryImpl<TestClass>);
  6604. // Next, recurses (at compile time) with the tail of the type list.
  6605. return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
  6606. ::Register(prefix, case_name, test_names, index + 1);
  6607. }
  6608. };
  6609. // The base case for the compile time recursion.
  6610. template <GTEST_TEMPLATE_ Fixture, class TestSel>
  6611. class TypeParameterizedTest<Fixture, TestSel, Types0> {
  6612. public:
  6613. static bool Register(const char* /*prefix*/, const char* /*case_name*/,
  6614. const char* /*test_names*/, int /*index*/) {
  6615. return true;
  6616. }
  6617. };
  6618. // TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
  6619. // registers *all combinations* of 'Tests' and 'Types' with Google
  6620. // Test. The return value is insignificant - we just need to return
  6621. // something such that we can call this function in a namespace scope.
  6622. template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
  6623. class TypeParameterizedTestCase {
  6624. public:
  6625. static bool Register(const char* prefix, const char* case_name,
  6626. const char* test_names) {
  6627. typedef typename Tests::Head Head;
  6628. // First, register the first test in 'Test' for each type in 'Types'.
  6629. TypeParameterizedTest<Fixture, Head, Types>::Register(
  6630. prefix, case_name, test_names, 0);
  6631. // Next, recurses (at compile time) with the tail of the test list.
  6632. return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
  6633. ::Register(prefix, case_name, SkipComma(test_names));
  6634. }
  6635. };
  6636. // The base case for the compile time recursion.
  6637. template <GTEST_TEMPLATE_ Fixture, typename Types>
  6638. class TypeParameterizedTestCase<Fixture, Templates0, Types> {
  6639. public:
  6640. static bool Register(const char* /*prefix*/, const char* /*case_name*/,
  6641. const char* /*test_names*/) {
  6642. return true;
  6643. }
  6644. };
  6645. #endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
  6646. // Returns the current OS stack trace as a String.
  6647. //
  6648. // The maximum number of stack frames to be included is specified by
  6649. // the gtest_stack_trace_depth flag. The skip_count parameter
  6650. // specifies the number of top frames to be skipped, which doesn't
  6651. // count against the number of frames to be included.
  6652. //
  6653. // For example, if Foo() calls Bar(), which in turn calls
  6654. // GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
  6655. // the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
  6656. GTEST_API_ String GetCurrentOsStackTraceExceptTop(UnitTest* unit_test,
  6657. int skip_count);
  6658. // Helpers for suppressing warnings on unreachable code or constant
  6659. // condition.
  6660. // Always returns true.
  6661. GTEST_API_ bool AlwaysTrue();
  6662. // Always returns false.
  6663. inline bool AlwaysFalse() { return !AlwaysTrue(); }
  6664. // Helper for suppressing false warning from Clang on a const char*
  6665. // variable declared in a conditional expression always being NULL in
  6666. // the else branch.
  6667. struct GTEST_API_ ConstCharPtr {
  6668. ConstCharPtr(const char* str) : value(str) {}
  6669. operator bool() const { return true; }
  6670. const char* value;
  6671. };
  6672. // A simple Linear Congruential Generator for generating random
  6673. // numbers with a uniform distribution. Unlike rand() and srand(), it
  6674. // doesn't use global state (and therefore can't interfere with user
  6675. // code). Unlike rand_r(), it's portable. An LCG isn't very random,
  6676. // but it's good enough for our purposes.
  6677. class GTEST_API_ Random {
  6678. public:
  6679. static const UInt32 kMaxRange = 1u << 31;
  6680. explicit Random(UInt32 seed) : state_(seed) {}
  6681. void Reseed(UInt32 seed) { state_ = seed; }
  6682. // Generates a random number from [0, range). Crashes if 'range' is
  6683. // 0 or greater than kMaxRange.
  6684. UInt32 Generate(UInt32 range);
  6685. private:
  6686. UInt32 state_;
  6687. GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
  6688. };
  6689. // Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
  6690. // compiler error iff T1 and T2 are different types.
  6691. template <typename T1, typename T2>
  6692. struct CompileAssertTypesEqual;
  6693. template <typename T>
  6694. struct CompileAssertTypesEqual<T, T> {
  6695. };
  6696. // Removes the reference from a type if it is a reference type,
  6697. // otherwise leaves it unchanged. This is the same as
  6698. // tr1::remove_reference, which is not widely available yet.
  6699. template <typename T>
  6700. struct RemoveReference { typedef T type; }; // NOLINT
  6701. template <typename T>
  6702. struct RemoveReference<T&> { typedef T type; }; // NOLINT
  6703. // A handy wrapper around RemoveReference that works when the argument
  6704. // T depends on template parameters.
  6705. #define GTEST_REMOVE_REFERENCE_(T) \
  6706. typename ::testing::internal::RemoveReference<T>::type
  6707. // Removes const from a type if it is a const type, otherwise leaves
  6708. // it unchanged. This is the same as tr1::remove_const, which is not
  6709. // widely available yet.
  6710. template <typename T>
  6711. struct RemoveConst { typedef T type; }; // NOLINT
  6712. template <typename T>
  6713. struct RemoveConst<const T> { typedef T type; }; // NOLINT
  6714. // MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
  6715. // definition to fail to remove the const in 'const int[3]' and 'const
  6716. // char[3][4]'. The following specialization works around the bug.
  6717. // However, it causes trouble with GCC and thus needs to be
  6718. // conditionally compiled.
  6719. #if defined(_MSC_VER) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
  6720. template <typename T, size_t N>
  6721. struct RemoveConst<const T[N]> {
  6722. typedef typename RemoveConst<T>::type type[N];
  6723. };
  6724. #endif
  6725. // A handy wrapper around RemoveConst that works when the argument
  6726. // T depends on template parameters.
  6727. #define GTEST_REMOVE_CONST_(T) \
  6728. typename ::testing::internal::RemoveConst<T>::type
  6729. // Turns const U&, U&, const U, and U all into U.
  6730. #define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
  6731. GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
  6732. // Adds reference to a type if it is not a reference type,
  6733. // otherwise leaves it unchanged. This is the same as
  6734. // tr1::add_reference, which is not widely available yet.
  6735. template <typename T>
  6736. struct AddReference { typedef T& type; }; // NOLINT
  6737. template <typename T>
  6738. struct AddReference<T&> { typedef T& type; }; // NOLINT
  6739. // A handy wrapper around AddReference that works when the argument T
  6740. // depends on template parameters.
  6741. #define GTEST_ADD_REFERENCE_(T) \
  6742. typename ::testing::internal::AddReference<T>::type
  6743. // Adds a reference to const on top of T as necessary. For example,
  6744. // it transforms
  6745. //
  6746. // char ==> const char&
  6747. // const char ==> const char&
  6748. // char& ==> const char&
  6749. // const char& ==> const char&
  6750. //
  6751. // The argument T must depend on some template parameters.
  6752. #define GTEST_REFERENCE_TO_CONST_(T) \
  6753. GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T))
  6754. // ImplicitlyConvertible<From, To>::value is a compile-time bool
  6755. // constant that's true iff type From can be implicitly converted to
  6756. // type To.
  6757. template <typename From, typename To>
  6758. class ImplicitlyConvertible {
  6759. private:
  6760. // We need the following helper functions only for their types.
  6761. // They have no implementations.
  6762. // MakeFrom() is an expression whose type is From. We cannot simply
  6763. // use From(), as the type From may not have a public default
  6764. // constructor.
  6765. static From MakeFrom();
  6766. // These two functions are overloaded. Given an expression
  6767. // Helper(x), the compiler will pick the first version if x can be
  6768. // implicitly converted to type To; otherwise it will pick the
  6769. // second version.
  6770. //
  6771. // The first version returns a value of size 1, and the second
  6772. // version returns a value of size 2. Therefore, by checking the
  6773. // size of Helper(x), which can be done at compile time, we can tell
  6774. // which version of Helper() is used, and hence whether x can be
  6775. // implicitly converted to type To.
  6776. static char Helper(To);
  6777. static char (&Helper(...))[2]; // NOLINT
  6778. // We have to put the 'public' section after the 'private' section,
  6779. // or MSVC refuses to compile the code.
  6780. public:
  6781. // MSVC warns about implicitly converting from double to int for
  6782. // possible loss of data, so we need to temporarily disable the
  6783. // warning.
  6784. #ifdef _MSC_VER
  6785. # pragma warning(push) // Saves the current warning state.
  6786. # pragma warning(disable:4244) // Temporarily disables warning 4244.
  6787. static const bool value =
  6788. sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
  6789. # pragma warning(pop) // Restores the warning state.
  6790. #elif defined(__BORLANDC__)
  6791. // C++Builder cannot use member overload resolution during template
  6792. // instantiation. The simplest workaround is to use its C++0x type traits
  6793. // functions (C++Builder 2009 and above only).
  6794. static const bool value = __is_convertible(From, To);
  6795. #else
  6796. static const bool value =
  6797. sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
  6798. #endif // _MSV_VER
  6799. };
  6800. template <typename From, typename To>
  6801. const bool ImplicitlyConvertible<From, To>::value;
  6802. // IsAProtocolMessage<T>::value is a compile-time bool constant that's
  6803. // true iff T is type ProtocolMessage, proto2::Message, or a subclass
  6804. // of those.
  6805. template <typename T>
  6806. struct IsAProtocolMessage
  6807. : public bool_constant<
  6808. ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
  6809. ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
  6810. };
  6811. // When the compiler sees expression IsContainerTest<C>(0), if C is an
  6812. // STL-style container class, the first overload of IsContainerTest
  6813. // will be viable (since both C::iterator* and C::const_iterator* are
  6814. // valid types and NULL can be implicitly converted to them). It will
  6815. // be picked over the second overload as 'int' is a perfect match for
  6816. // the type of argument 0. If C::iterator or C::const_iterator is not
  6817. // a valid type, the first overload is not viable, and the second
  6818. // overload will be picked. Therefore, we can determine whether C is
  6819. // a container class by checking the type of IsContainerTest<C>(0).
  6820. // The value of the expression is insignificant.
  6821. //
  6822. // Note that we look for both C::iterator and C::const_iterator. The
  6823. // reason is that C++ injects the name of a class as a member of the
  6824. // class itself (e.g. you can refer to class iterator as either
  6825. // 'iterator' or 'iterator::iterator'). If we look for C::iterator
  6826. // only, for example, we would mistakenly think that a class named
  6827. // iterator is an STL container.
  6828. //
  6829. // Also note that the simpler approach of overloading
  6830. // IsContainerTest(typename C::const_iterator*) and
  6831. // IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
  6832. typedef int IsContainer;
  6833. template <class C>
  6834. IsContainer IsContainerTest(int /* dummy */,
  6835. typename C::iterator* /* it */ = NULL,
  6836. typename C::const_iterator* /* const_it */ = NULL) {
  6837. return 0;
  6838. }
  6839. typedef char IsNotContainer;
  6840. template <class C>
  6841. IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
  6842. // EnableIf<condition>::type is void when 'Cond' is true, and
  6843. // undefined when 'Cond' is false. To use SFINAE to make a function
  6844. // overload only apply when a particular expression is true, add
  6845. // "typename EnableIf<expression>::type* = 0" as the last parameter.
  6846. template<bool> struct EnableIf;
  6847. template<> struct EnableIf<true> { typedef void type; }; // NOLINT
  6848. // Utilities for native arrays.
  6849. // ArrayEq() compares two k-dimensional native arrays using the
  6850. // elements' operator==, where k can be any integer >= 0. When k is
  6851. // 0, ArrayEq() degenerates into comparing a single pair of values.
  6852. template <typename T, typename U>
  6853. bool ArrayEq(const T* lhs, size_t size, const U* rhs);
  6854. // This generic version is used when k is 0.
  6855. template <typename T, typename U>
  6856. inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
  6857. // This overload is used when k >= 1.
  6858. template <typename T, typename U, size_t N>
  6859. inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
  6860. return internal::ArrayEq(lhs, N, rhs);
  6861. }
  6862. // This helper reduces code bloat. If we instead put its logic inside
  6863. // the previous ArrayEq() function, arrays with different sizes would
  6864. // lead to different copies of the template code.
  6865. template <typename T, typename U>
  6866. bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
  6867. for (size_t i = 0; i != size; i++) {
  6868. if (!internal::ArrayEq(lhs[i], rhs[i]))
  6869. return false;
  6870. }
  6871. return true;
  6872. }
  6873. // Finds the first element in the iterator range [begin, end) that
  6874. // equals elem. Element may be a native array type itself.
  6875. template <typename Iter, typename Element>
  6876. Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
  6877. for (Iter it = begin; it != end; ++it) {
  6878. if (internal::ArrayEq(*it, elem))
  6879. return it;
  6880. }
  6881. return end;
  6882. }
  6883. // CopyArray() copies a k-dimensional native array using the elements'
  6884. // operator=, where k can be any integer >= 0. When k is 0,
  6885. // CopyArray() degenerates into copying a single value.
  6886. template <typename T, typename U>
  6887. void CopyArray(const T* from, size_t size, U* to);
  6888. // This generic version is used when k is 0.
  6889. template <typename T, typename U>
  6890. inline void CopyArray(const T& from, U* to) { *to = from; }
  6891. // This overload is used when k >= 1.
  6892. template <typename T, typename U, size_t N>
  6893. inline void CopyArray(const T(&from)[N], U(*to)[N]) {
  6894. internal::CopyArray(from, N, *to);
  6895. }
  6896. // This helper reduces code bloat. If we instead put its logic inside
  6897. // the previous CopyArray() function, arrays with different sizes
  6898. // would lead to different copies of the template code.
  6899. template <typename T, typename U>
  6900. void CopyArray(const T* from, size_t size, U* to) {
  6901. for (size_t i = 0; i != size; i++) {
  6902. internal::CopyArray(from[i], to + i);
  6903. }
  6904. }
  6905. // The relation between an NativeArray object (see below) and the
  6906. // native array it represents.
  6907. enum RelationToSource {
  6908. kReference, // The NativeArray references the native array.
  6909. kCopy // The NativeArray makes a copy of the native array and
  6910. // owns the copy.
  6911. };
  6912. // Adapts a native array to a read-only STL-style container. Instead
  6913. // of the complete STL container concept, this adaptor only implements
  6914. // members useful for Google Mock's container matchers. New members
  6915. // should be added as needed. To simplify the implementation, we only
  6916. // support Element being a raw type (i.e. having no top-level const or
  6917. // reference modifier). It's the client's responsibility to satisfy
  6918. // this requirement. Element can be an array type itself (hence
  6919. // multi-dimensional arrays are supported).
  6920. template <typename Element>
  6921. class NativeArray {
  6922. public:
  6923. // STL-style container typedefs.
  6924. typedef Element value_type;
  6925. typedef Element* iterator;
  6926. typedef const Element* const_iterator;
  6927. // Constructs from a native array.
  6928. NativeArray(const Element* array, size_t count, RelationToSource relation) {
  6929. Init(array, count, relation);
  6930. }
  6931. // Copy constructor.
  6932. NativeArray(const NativeArray& rhs) {
  6933. Init(rhs.array_, rhs.size_, rhs.relation_to_source_);
  6934. }
  6935. ~NativeArray() {
  6936. // Ensures that the user doesn't instantiate NativeArray with a
  6937. // const or reference type.
  6938. static_cast<void>(StaticAssertTypeEqHelper<Element,
  6939. GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>());
  6940. if (relation_to_source_ == kCopy)
  6941. delete[] array_;
  6942. }
  6943. // STL-style container methods.
  6944. size_t size() const { return size_; }
  6945. const_iterator begin() const { return array_; }
  6946. const_iterator end() const { return array_ + size_; }
  6947. bool operator==(const NativeArray& rhs) const {
  6948. return size() == rhs.size() &&
  6949. ArrayEq(begin(), size(), rhs.begin());
  6950. }
  6951. private:
  6952. // Initializes this object; makes a copy of the input array if
  6953. // 'relation' is kCopy.
  6954. void Init(const Element* array, size_t a_size, RelationToSource relation) {
  6955. if (relation == kReference) {
  6956. array_ = array;
  6957. } else {
  6958. Element* const copy = new Element[a_size];
  6959. CopyArray(array, a_size, copy);
  6960. array_ = copy;
  6961. }
  6962. size_ = a_size;
  6963. relation_to_source_ = relation;
  6964. }
  6965. const Element* array_;
  6966. size_t size_;
  6967. RelationToSource relation_to_source_;
  6968. GTEST_DISALLOW_ASSIGN_(NativeArray);
  6969. };
  6970. } // namespace internal
  6971. } // namespace testing
  6972. #define GTEST_MESSAGE_AT_(file, line, message, result_type) \
  6973. ::testing::internal::AssertHelper(result_type, file, line, message) \
  6974. = ::testing::Message()
  6975. #define GTEST_MESSAGE_(message, result_type) \
  6976. GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
  6977. #define GTEST_FATAL_FAILURE_(message) \
  6978. return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
  6979. #define GTEST_NONFATAL_FAILURE_(message) \
  6980. GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
  6981. #define GTEST_SUCCESS_(message) \
  6982. GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
  6983. // Suppresses MSVC warnings 4072 (unreachable code) for the code following
  6984. // statement if it returns or throws (or doesn't return or throw in some
  6985. // situations).
  6986. #define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
  6987. if (::testing::internal::AlwaysTrue()) { statement; }
  6988. #define GTEST_TEST_THROW_(statement, expected_exception, fail) \
  6989. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  6990. if (::testing::internal::ConstCharPtr gtest_msg = "") { \
  6991. bool gtest_caught_expected = false; \
  6992. try { \
  6993. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  6994. } \
  6995. catch (expected_exception const&) { \
  6996. gtest_caught_expected = true; \
  6997. } \
  6998. catch (...) { \
  6999. gtest_msg.value = \
  7000. "Expected: " #statement " throws an exception of type " \
  7001. #expected_exception ".\n Actual: it throws a different type."; \
  7002. goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
  7003. } \
  7004. if (!gtest_caught_expected) { \
  7005. gtest_msg.value = \
  7006. "Expected: " #statement " throws an exception of type " \
  7007. #expected_exception ".\n Actual: it throws nothing."; \
  7008. goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
  7009. } \
  7010. } else \
  7011. GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
  7012. fail(gtest_msg.value)
  7013. #define GTEST_TEST_NO_THROW_(statement, fail) \
  7014. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7015. if (::testing::internal::AlwaysTrue()) { \
  7016. try { \
  7017. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7018. } \
  7019. catch (...) { \
  7020. goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
  7021. } \
  7022. } else \
  7023. GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
  7024. fail("Expected: " #statement " doesn't throw an exception.\n" \
  7025. " Actual: it throws.")
  7026. #define GTEST_TEST_ANY_THROW_(statement, fail) \
  7027. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7028. if (::testing::internal::AlwaysTrue()) { \
  7029. bool gtest_caught_any = false; \
  7030. try { \
  7031. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7032. } \
  7033. catch (...) { \
  7034. gtest_caught_any = true; \
  7035. } \
  7036. if (!gtest_caught_any) { \
  7037. goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
  7038. } \
  7039. } else \
  7040. GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
  7041. fail("Expected: " #statement " throws an exception.\n" \
  7042. " Actual: it doesn't.")
  7043. // Implements Boolean test assertions such as EXPECT_TRUE. expression can be
  7044. // either a boolean expression or an AssertionResult. text is a textual
  7045. // represenation of expression as it was passed into the EXPECT_TRUE.
  7046. #define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
  7047. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7048. if (const ::testing::AssertionResult gtest_ar_ = \
  7049. ::testing::AssertionResult(expression)) \
  7050. ; \
  7051. else \
  7052. fail(::testing::internal::GetBoolAssertionFailureMessage(\
  7053. gtest_ar_, text, #actual, #expected).c_str())
  7054. #define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
  7055. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7056. if (::testing::internal::AlwaysTrue()) { \
  7057. ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
  7058. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7059. if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
  7060. goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
  7061. } \
  7062. } else \
  7063. GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
  7064. fail("Expected: " #statement " doesn't generate new fatal " \
  7065. "failures in the current thread.\n" \
  7066. " Actual: it does.")
  7067. // Expands to the name of the class that implements the given test.
  7068. #define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
  7069. test_case_name##_##test_name##_Test
  7070. // Helper macro for defining tests.
  7071. #define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
  7072. class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
  7073. public:\
  7074. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
  7075. private:\
  7076. virtual void TestBody();\
  7077. static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
  7078. GTEST_DISALLOW_COPY_AND_ASSIGN_(\
  7079. GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
  7080. };\
  7081. \
  7082. ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
  7083. ::test_info_ =\
  7084. ::testing::internal::MakeAndRegisterTestInfo(\
  7085. #test_case_name, #test_name, NULL, NULL, \
  7086. (parent_id), \
  7087. parent_class::SetUpTestCase, \
  7088. parent_class::TearDownTestCase, \
  7089. new ::testing::internal::TestFactoryImpl<\
  7090. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
  7091. void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
  7092. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
  7093. // Copyright 2005, Google Inc.
  7094. // All rights reserved.
  7095. //
  7096. // Redistribution and use in source and binary forms, with or without
  7097. // modification, are permitted provided that the following conditions are
  7098. // met:
  7099. //
  7100. // * Redistributions of source code must retain the above copyright
  7101. // notice, this list of conditions and the following disclaimer.
  7102. // * Redistributions in binary form must reproduce the above
  7103. // copyright notice, this list of conditions and the following disclaimer
  7104. // in the documentation and/or other materials provided with the
  7105. // distribution.
  7106. // * Neither the name of Google Inc. nor the names of its
  7107. // contributors may be used to endorse or promote products derived from
  7108. // this software without specific prior written permission.
  7109. //
  7110. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  7111. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  7112. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  7113. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7114. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  7115. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  7116. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  7117. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  7118. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  7119. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  7120. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  7121. //
  7122. // Author: wan@google.com (Zhanyong Wan)
  7123. //
  7124. // The Google C++ Testing Framework (Google Test)
  7125. //
  7126. // This header file defines the public API for death tests. It is
  7127. // #included by gtest.h so a user doesn't need to include this
  7128. // directly.
  7129. #ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
  7130. #define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
  7131. // Copyright 2005, Google Inc.
  7132. // All rights reserved.
  7133. //
  7134. // Redistribution and use in source and binary forms, with or without
  7135. // modification, are permitted provided that the following conditions are
  7136. // met:
  7137. //
  7138. // * Redistributions of source code must retain the above copyright
  7139. // notice, this list of conditions and the following disclaimer.
  7140. // * Redistributions in binary form must reproduce the above
  7141. // copyright notice, this list of conditions and the following disclaimer
  7142. // in the documentation and/or other materials provided with the
  7143. // distribution.
  7144. // * Neither the name of Google Inc. nor the names of its
  7145. // contributors may be used to endorse or promote products derived from
  7146. // this software without specific prior written permission.
  7147. //
  7148. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  7149. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  7150. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  7151. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7152. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  7153. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  7154. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  7155. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  7156. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  7157. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  7158. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  7159. //
  7160. // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
  7161. //
  7162. // The Google C++ Testing Framework (Google Test)
  7163. //
  7164. // This header file defines internal utilities needed for implementing
  7165. // death tests. They are subject to change without notice.
  7166. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
  7167. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
  7168. #include <stdio.h>
  7169. namespace testing {
  7170. namespace internal {
  7171. GTEST_DECLARE_string_(internal_run_death_test);
  7172. // Names of the flags (needed for parsing Google Test flags).
  7173. const char kDeathTestStyleFlag[] = "death_test_style";
  7174. const char kDeathTestUseFork[] = "death_test_use_fork";
  7175. const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
  7176. #if GTEST_HAS_DEATH_TEST
  7177. // DeathTest is a class that hides much of the complexity of the
  7178. // GTEST_DEATH_TEST_ macro. It is abstract; its static Create method
  7179. // returns a concrete class that depends on the prevailing death test
  7180. // style, as defined by the --gtest_death_test_style and/or
  7181. // --gtest_internal_run_death_test flags.
  7182. // In describing the results of death tests, these terms are used with
  7183. // the corresponding definitions:
  7184. //
  7185. // exit status: The integer exit information in the format specified
  7186. // by wait(2)
  7187. // exit code: The integer code passed to exit(3), _exit(2), or
  7188. // returned from main()
  7189. class GTEST_API_ DeathTest {
  7190. public:
  7191. // Create returns false if there was an error determining the
  7192. // appropriate action to take for the current death test; for example,
  7193. // if the gtest_death_test_style flag is set to an invalid value.
  7194. // The LastMessage method will return a more detailed message in that
  7195. // case. Otherwise, the DeathTest pointer pointed to by the "test"
  7196. // argument is set. If the death test should be skipped, the pointer
  7197. // is set to NULL; otherwise, it is set to the address of a new concrete
  7198. // DeathTest object that controls the execution of the current test.
  7199. static bool Create(const char* statement, const RE* regex,
  7200. const char* file, int line, DeathTest** test);
  7201. DeathTest();
  7202. virtual ~DeathTest() { }
  7203. // A helper class that aborts a death test when it's deleted.
  7204. class ReturnSentinel {
  7205. public:
  7206. explicit ReturnSentinel(DeathTest* test) : test_(test) { }
  7207. ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
  7208. private:
  7209. DeathTest* const test_;
  7210. GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
  7211. } GTEST_ATTRIBUTE_UNUSED_;
  7212. // An enumeration of possible roles that may be taken when a death
  7213. // test is encountered. EXECUTE means that the death test logic should
  7214. // be executed immediately. OVERSEE means that the program should prepare
  7215. // the appropriate environment for a child process to execute the death
  7216. // test, then wait for it to complete.
  7217. enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
  7218. // An enumeration of the three reasons that a test might be aborted.
  7219. enum AbortReason {
  7220. TEST_ENCOUNTERED_RETURN_STATEMENT,
  7221. TEST_THREW_EXCEPTION,
  7222. TEST_DID_NOT_DIE
  7223. };
  7224. // Assumes one of the above roles.
  7225. virtual TestRole AssumeRole() = 0;
  7226. // Waits for the death test to finish and returns its status.
  7227. virtual int Wait() = 0;
  7228. // Returns true if the death test passed; that is, the test process
  7229. // exited during the test, its exit status matches a user-supplied
  7230. // predicate, and its stderr output matches a user-supplied regular
  7231. // expression.
  7232. // The user-supplied predicate may be a macro expression rather
  7233. // than a function pointer or functor, or else Wait and Passed could
  7234. // be combined.
  7235. virtual bool Passed(bool exit_status_ok) = 0;
  7236. // Signals that the death test did not die as expected.
  7237. virtual void Abort(AbortReason reason) = 0;
  7238. // Returns a human-readable outcome message regarding the outcome of
  7239. // the last death test.
  7240. static const char* LastMessage();
  7241. static void set_last_death_test_message(const String& message);
  7242. private:
  7243. // A string containing a description of the outcome of the last death test.
  7244. static String last_death_test_message_;
  7245. GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
  7246. };
  7247. // Factory interface for death tests. May be mocked out for testing.
  7248. class DeathTestFactory {
  7249. public:
  7250. virtual ~DeathTestFactory() { }
  7251. virtual bool Create(const char* statement, const RE* regex,
  7252. const char* file, int line, DeathTest** test) = 0;
  7253. };
  7254. // A concrete DeathTestFactory implementation for normal use.
  7255. class DefaultDeathTestFactory : public DeathTestFactory {
  7256. public:
  7257. virtual bool Create(const char* statement, const RE* regex,
  7258. const char* file, int line, DeathTest** test);
  7259. };
  7260. // Returns true if exit_status describes a process that was terminated
  7261. // by a signal, or exited normally with a nonzero exit code.
  7262. GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
  7263. // Traps C++ exceptions escaping statement and reports them as test
  7264. // failures. Note that trapping SEH exceptions is not implemented here.
  7265. # if GTEST_HAS_EXCEPTIONS
  7266. # define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
  7267. try { \
  7268. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7269. } catch (const ::std::exception& gtest_exception) { \
  7270. fprintf(\
  7271. stderr, \
  7272. "\n%s: Caught std::exception-derived exception escaping the " \
  7273. "death test statement. Exception message: %s\n", \
  7274. ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
  7275. gtest_exception.what()); \
  7276. fflush(stderr); \
  7277. death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
  7278. } catch (...) { \
  7279. death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
  7280. }
  7281. # else
  7282. # define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
  7283. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
  7284. # endif
  7285. // This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
  7286. // ASSERT_EXIT*, and EXPECT_EXIT*.
  7287. # define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
  7288. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7289. if (::testing::internal::AlwaysTrue()) { \
  7290. const ::testing::internal::RE& gtest_regex = (regex); \
  7291. ::testing::internal::DeathTest* gtest_dt; \
  7292. if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \
  7293. __FILE__, __LINE__, &gtest_dt)) { \
  7294. goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
  7295. } \
  7296. if (gtest_dt != NULL) { \
  7297. ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
  7298. gtest_dt_ptr(gtest_dt); \
  7299. switch (gtest_dt->AssumeRole()) { \
  7300. case ::testing::internal::DeathTest::OVERSEE_TEST: \
  7301. if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
  7302. goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
  7303. } \
  7304. break; \
  7305. case ::testing::internal::DeathTest::EXECUTE_TEST: { \
  7306. ::testing::internal::DeathTest::ReturnSentinel \
  7307. gtest_sentinel(gtest_dt); \
  7308. GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
  7309. gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
  7310. break; \
  7311. } \
  7312. default: \
  7313. break; \
  7314. } \
  7315. } \
  7316. } else \
  7317. GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
  7318. fail(::testing::internal::DeathTest::LastMessage())
  7319. // The symbol "fail" here expands to something into which a message
  7320. // can be streamed.
  7321. // A class representing the parsed contents of the
  7322. // --gtest_internal_run_death_test flag, as it existed when
  7323. // RUN_ALL_TESTS was called.
  7324. class InternalRunDeathTestFlag {
  7325. public:
  7326. InternalRunDeathTestFlag(const String& a_file,
  7327. int a_line,
  7328. int an_index,
  7329. int a_write_fd)
  7330. : file_(a_file), line_(a_line), index_(an_index),
  7331. write_fd_(a_write_fd) {}
  7332. ~InternalRunDeathTestFlag() {
  7333. if (write_fd_ >= 0)
  7334. posix::Close(write_fd_);
  7335. }
  7336. String file() const { return file_; }
  7337. int line() const { return line_; }
  7338. int index() const { return index_; }
  7339. int write_fd() const { return write_fd_; }
  7340. private:
  7341. String file_;
  7342. int line_;
  7343. int index_;
  7344. int write_fd_;
  7345. GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
  7346. };
  7347. // Returns a newly created InternalRunDeathTestFlag object with fields
  7348. // initialized from the GTEST_FLAG(internal_run_death_test) flag if
  7349. // the flag is specified; otherwise returns NULL.
  7350. InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
  7351. #else // GTEST_HAS_DEATH_TEST
  7352. // This macro is used for implementing macros such as
  7353. // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
  7354. // death tests are not supported. Those macros must compile on such systems
  7355. // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
  7356. // systems that support death tests. This allows one to write such a macro
  7357. // on a system that does not support death tests and be sure that it will
  7358. // compile on a death-test supporting system.
  7359. //
  7360. // Parameters:
  7361. // statement - A statement that a macro such as EXPECT_DEATH would test
  7362. // for program termination. This macro has to make sure this
  7363. // statement is compiled but not executed, to ensure that
  7364. // EXPECT_DEATH_IF_SUPPORTED compiles with a certain
  7365. // parameter iff EXPECT_DEATH compiles with it.
  7366. // regex - A regex that a macro such as EXPECT_DEATH would use to test
  7367. // the output of statement. This parameter has to be
  7368. // compiled but not evaluated by this macro, to ensure that
  7369. // this macro only accepts expressions that a macro such as
  7370. // EXPECT_DEATH would accept.
  7371. // terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
  7372. // and a return statement for ASSERT_DEATH_IF_SUPPORTED.
  7373. // This ensures that ASSERT_DEATH_IF_SUPPORTED will not
  7374. // compile inside functions where ASSERT_DEATH doesn't
  7375. // compile.
  7376. //
  7377. // The branch that has an always false condition is used to ensure that
  7378. // statement and regex are compiled (and thus syntactically correct) but
  7379. // never executed. The unreachable code macro protects the terminator
  7380. // statement from generating an 'unreachable code' warning in case
  7381. // statement unconditionally returns or throws. The Message constructor at
  7382. // the end allows the syntax of streaming additional messages into the
  7383. // macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
  7384. # define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \
  7385. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  7386. if (::testing::internal::AlwaysTrue()) { \
  7387. GTEST_LOG_(WARNING) \
  7388. << "Death tests are not supported on this platform.\n" \
  7389. << "Statement '" #statement "' cannot be verified."; \
  7390. } else if (::testing::internal::AlwaysFalse()) { \
  7391. ::testing::internal::RE::PartialMatch(".*", (regex)); \
  7392. GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
  7393. terminator; \
  7394. } else \
  7395. ::testing::Message()
  7396. #endif // GTEST_HAS_DEATH_TEST
  7397. } // namespace internal
  7398. } // namespace testing
  7399. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
  7400. namespace testing {
  7401. // This flag controls the style of death tests. Valid values are "threadsafe",
  7402. // meaning that the death test child process will re-execute the test binary
  7403. // from the start, running only a single death test, or "fast",
  7404. // meaning that the child process will execute the test logic immediately
  7405. // after forking.
  7406. GTEST_DECLARE_string_(death_test_style);
  7407. #if GTEST_HAS_DEATH_TEST
  7408. // The following macros are useful for writing death tests.
  7409. // Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
  7410. // executed:
  7411. //
  7412. // 1. It generates a warning if there is more than one active
  7413. // thread. This is because it's safe to fork() or clone() only
  7414. // when there is a single thread.
  7415. //
  7416. // 2. The parent process clone()s a sub-process and runs the death
  7417. // test in it; the sub-process exits with code 0 at the end of the
  7418. // death test, if it hasn't exited already.
  7419. //
  7420. // 3. The parent process waits for the sub-process to terminate.
  7421. //
  7422. // 4. The parent process checks the exit code and error message of
  7423. // the sub-process.
  7424. //
  7425. // Examples:
  7426. //
  7427. // ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
  7428. // for (int i = 0; i < 5; i++) {
  7429. // EXPECT_DEATH(server.ProcessRequest(i),
  7430. // "Invalid request .* in ProcessRequest()")
  7431. // << "Failed to die on request " << i);
  7432. // }
  7433. //
  7434. // ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
  7435. //
  7436. // bool KilledBySIGHUP(int exit_code) {
  7437. // return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
  7438. // }
  7439. //
  7440. // ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
  7441. //
  7442. // On the regular expressions used in death tests:
  7443. //
  7444. // On POSIX-compliant systems (*nix), we use the <regex.h> library,
  7445. // which uses the POSIX extended regex syntax.
  7446. //
  7447. // On other platforms (e.g. Windows), we only support a simple regex
  7448. // syntax implemented as part of Google Test. This limited
  7449. // implementation should be enough most of the time when writing
  7450. // death tests; though it lacks many features you can find in PCRE
  7451. // or POSIX extended regex syntax. For example, we don't support
  7452. // union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
  7453. // repetition count ("x{5,7}"), among others.
  7454. //
  7455. // Below is the syntax that we do support. We chose it to be a
  7456. // subset of both PCRE and POSIX extended regex, so it's easy to
  7457. // learn wherever you come from. In the following: 'A' denotes a
  7458. // literal character, period (.), or a single \\ escape sequence;
  7459. // 'x' and 'y' denote regular expressions; 'm' and 'n' are for
  7460. // natural numbers.
  7461. //
  7462. // c matches any literal character c
  7463. // \\d matches any decimal digit
  7464. // \\D matches any character that's not a decimal digit
  7465. // \\f matches \f
  7466. // \\n matches \n
  7467. // \\r matches \r
  7468. // \\s matches any ASCII whitespace, including \n
  7469. // \\S matches any character that's not a whitespace
  7470. // \\t matches \t
  7471. // \\v matches \v
  7472. // \\w matches any letter, _, or decimal digit
  7473. // \\W matches any character that \\w doesn't match
  7474. // \\c matches any literal character c, which must be a punctuation
  7475. // . matches any single character except \n
  7476. // A? matches 0 or 1 occurrences of A
  7477. // A* matches 0 or many occurrences of A
  7478. // A+ matches 1 or many occurrences of A
  7479. // ^ matches the beginning of a string (not that of each line)
  7480. // $ matches the end of a string (not that of each line)
  7481. // xy matches x followed by y
  7482. //
  7483. // If you accidentally use PCRE or POSIX extended regex features
  7484. // not implemented by us, you will get a run-time failure. In that
  7485. // case, please try to rewrite your regular expression within the
  7486. // above syntax.
  7487. //
  7488. // This implementation is *not* meant to be as highly tuned or robust
  7489. // as a compiled regex library, but should perform well enough for a
  7490. // death test, which already incurs significant overhead by launching
  7491. // a child process.
  7492. //
  7493. // Known caveats:
  7494. //
  7495. // A "threadsafe" style death test obtains the path to the test
  7496. // program from argv[0] and re-executes it in the sub-process. For
  7497. // simplicity, the current implementation doesn't search the PATH
  7498. // when launching the sub-process. This means that the user must
  7499. // invoke the test program via a path that contains at least one
  7500. // path separator (e.g. path/to/foo_test and
  7501. // /absolute/path/to/bar_test are fine, but foo_test is not). This
  7502. // is rarely a problem as people usually don't put the test binary
  7503. // directory in PATH.
  7504. //
  7505. // TODO(wan@google.com): make thread-safe death tests search the PATH.
  7506. // Asserts that a given statement causes the program to exit, with an
  7507. // integer exit status that satisfies predicate, and emitting error output
  7508. // that matches regex.
  7509. # define ASSERT_EXIT(statement, predicate, regex) \
  7510. GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
  7511. // Like ASSERT_EXIT, but continues on to successive tests in the
  7512. // test case, if any:
  7513. # define EXPECT_EXIT(statement, predicate, regex) \
  7514. GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
  7515. // Asserts that a given statement causes the program to exit, either by
  7516. // explicitly exiting with a nonzero exit code or being killed by a
  7517. // signal, and emitting error output that matches regex.
  7518. # define ASSERT_DEATH(statement, regex) \
  7519. ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
  7520. // Like ASSERT_DEATH, but continues on to successive tests in the
  7521. // test case, if any:
  7522. # define EXPECT_DEATH(statement, regex) \
  7523. EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
  7524. // Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
  7525. // Tests that an exit code describes a normal exit with a given exit code.
  7526. class GTEST_API_ ExitedWithCode {
  7527. public:
  7528. explicit ExitedWithCode(int exit_code);
  7529. bool operator()(int exit_status) const;
  7530. private:
  7531. // No implementation - assignment is unsupported.
  7532. void operator=(const ExitedWithCode& other);
  7533. const int exit_code_;
  7534. };
  7535. # if !GTEST_OS_WINDOWS
  7536. // Tests that an exit code describes an exit due to termination by a
  7537. // given signal.
  7538. class GTEST_API_ KilledBySignal {
  7539. public:
  7540. explicit KilledBySignal(int signum);
  7541. bool operator()(int exit_status) const;
  7542. private:
  7543. const int signum_;
  7544. };
  7545. # endif // !GTEST_OS_WINDOWS
  7546. // EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
  7547. // The death testing framework causes this to have interesting semantics,
  7548. // since the sideeffects of the call are only visible in opt mode, and not
  7549. // in debug mode.
  7550. //
  7551. // In practice, this can be used to test functions that utilize the
  7552. // LOG(DFATAL) macro using the following style:
  7553. //
  7554. // int DieInDebugOr12(int* sideeffect) {
  7555. // if (sideeffect) {
  7556. // *sideeffect = 12;
  7557. // }
  7558. // LOG(DFATAL) << "death";
  7559. // return 12;
  7560. // }
  7561. //
  7562. // TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
  7563. // int sideeffect = 0;
  7564. // // Only asserts in dbg.
  7565. // EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
  7566. //
  7567. // #ifdef NDEBUG
  7568. // // opt-mode has sideeffect visible.
  7569. // EXPECT_EQ(12, sideeffect);
  7570. // #else
  7571. // // dbg-mode no visible sideeffect.
  7572. // EXPECT_EQ(0, sideeffect);
  7573. // #endif
  7574. // }
  7575. //
  7576. // This will assert that DieInDebugReturn12InOpt() crashes in debug
  7577. // mode, usually due to a DCHECK or LOG(DFATAL), but returns the
  7578. // appropriate fallback value (12 in this case) in opt mode. If you
  7579. // need to test that a function has appropriate side-effects in opt
  7580. // mode, include assertions against the side-effects. A general
  7581. // pattern for this is:
  7582. //
  7583. // EXPECT_DEBUG_DEATH({
  7584. // // Side-effects here will have an effect after this statement in
  7585. // // opt mode, but none in debug mode.
  7586. // EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
  7587. // }, "death");
  7588. //
  7589. # ifdef NDEBUG
  7590. # define EXPECT_DEBUG_DEATH(statement, regex) \
  7591. do { statement; } while (::testing::internal::AlwaysFalse())
  7592. # define ASSERT_DEBUG_DEATH(statement, regex) \
  7593. do { statement; } while (::testing::internal::AlwaysFalse())
  7594. # else
  7595. # define EXPECT_DEBUG_DEATH(statement, regex) \
  7596. EXPECT_DEATH(statement, regex)
  7597. # define ASSERT_DEBUG_DEATH(statement, regex) \
  7598. ASSERT_DEATH(statement, regex)
  7599. # endif // NDEBUG for EXPECT_DEBUG_DEATH
  7600. #endif // GTEST_HAS_DEATH_TEST
  7601. // EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
  7602. // ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
  7603. // death tests are supported; otherwise they just issue a warning. This is
  7604. // useful when you are combining death test assertions with normal test
  7605. // assertions in one test.
  7606. #if GTEST_HAS_DEATH_TEST
  7607. # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
  7608. EXPECT_DEATH(statement, regex)
  7609. # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
  7610. ASSERT_DEATH(statement, regex)
  7611. #else
  7612. # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
  7613. GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
  7614. # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
  7615. GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)
  7616. #endif
  7617. } // namespace testing
  7618. #endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
  7619. // Copyright 2005, Google Inc.
  7620. // All rights reserved.
  7621. //
  7622. // Redistribution and use in source and binary forms, with or without
  7623. // modification, are permitted provided that the following conditions are
  7624. // met:
  7625. //
  7626. // * Redistributions of source code must retain the above copyright
  7627. // notice, this list of conditions and the following disclaimer.
  7628. // * Redistributions in binary form must reproduce the above
  7629. // copyright notice, this list of conditions and the following disclaimer
  7630. // in the documentation and/or other materials provided with the
  7631. // distribution.
  7632. // * Neither the name of Google Inc. nor the names of its
  7633. // contributors may be used to endorse or promote products derived from
  7634. // this software without specific prior written permission.
  7635. //
  7636. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  7637. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  7638. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  7639. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7640. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  7641. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  7642. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  7643. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  7644. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  7645. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  7646. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  7647. //
  7648. // Author: wan@google.com (Zhanyong Wan)
  7649. //
  7650. // The Google C++ Testing Framework (Google Test)
  7651. //
  7652. // This header file defines the Message class.
  7653. //
  7654. // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
  7655. // leave some internal implementation details in this header file.
  7656. // They are clearly marked by comments like this:
  7657. //
  7658. // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  7659. //
  7660. // Such code is NOT meant to be used by a user directly, and is subject
  7661. // to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
  7662. // program!
  7663. #ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
  7664. #define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
  7665. #include <limits>
  7666. namespace testing {
  7667. // The Message class works like an ostream repeater.
  7668. //
  7669. // Typical usage:
  7670. //
  7671. // 1. You stream a bunch of values to a Message object.
  7672. // It will remember the text in a stringstream.
  7673. // 2. Then you stream the Message object to an ostream.
  7674. // This causes the text in the Message to be streamed
  7675. // to the ostream.
  7676. //
  7677. // For example;
  7678. //
  7679. // testing::Message foo;
  7680. // foo << 1 << " != " << 2;
  7681. // std::cout << foo;
  7682. //
  7683. // will print "1 != 2".
  7684. //
  7685. // Message is not intended to be inherited from. In particular, its
  7686. // destructor is not virtual.
  7687. //
  7688. // Note that stringstream behaves differently in gcc and in MSVC. You
  7689. // can stream a NULL char pointer to it in the former, but not in the
  7690. // latter (it causes an access violation if you do). The Message
  7691. // class hides this difference by treating a NULL char pointer as
  7692. // "(null)".
  7693. class GTEST_API_ Message {
  7694. private:
  7695. // The type of basic IO manipulators (endl, ends, and flush) for
  7696. // narrow streams.
  7697. typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
  7698. public:
  7699. // Constructs an empty Message.
  7700. // We allocate the stringstream separately because otherwise each use of
  7701. // ASSERT/EXPECT in a procedure adds over 200 bytes to the procedure's
  7702. // stack frame leading to huge stack frames in some cases; gcc does not reuse
  7703. // the stack space.
  7704. Message() : ss_(new ::std::stringstream) {
  7705. // By default, we want there to be enough precision when printing
  7706. // a double to a Message.
  7707. *ss_ << std::setprecision(std::numeric_limits<double>::digits10 + 2);
  7708. }
  7709. // Copy constructor.
  7710. Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT
  7711. *ss_ << msg.GetString();
  7712. }
  7713. // Constructs a Message from a C-string.
  7714. explicit Message(const char* str) : ss_(new ::std::stringstream) {
  7715. *ss_ << str;
  7716. }
  7717. #if GTEST_OS_SYMBIAN
  7718. // Streams a value (either a pointer or not) to this object.
  7719. template <typename T>
  7720. inline Message& operator <<(const T& value) {
  7721. StreamHelper(typename internal::is_pointer<T>::type(), value);
  7722. return *this;
  7723. }
  7724. #else
  7725. // Streams a non-pointer value to this object.
  7726. template <typename T>
  7727. inline Message& operator <<(const T& val) {
  7728. ::GTestStreamToHelper(ss_.get(), val);
  7729. return *this;
  7730. }
  7731. // Streams a pointer value to this object.
  7732. //
  7733. // This function is an overload of the previous one. When you
  7734. // stream a pointer to a Message, this definition will be used as it
  7735. // is more specialized. (The C++ Standard, section
  7736. // [temp.func.order].) If you stream a non-pointer, then the
  7737. // previous definition will be used.
  7738. //
  7739. // The reason for this overload is that streaming a NULL pointer to
  7740. // ostream is undefined behavior. Depending on the compiler, you
  7741. // may get "0", "(nil)", "(null)", or an access violation. To
  7742. // ensure consistent result across compilers, we always treat NULL
  7743. // as "(null)".
  7744. template <typename T>
  7745. inline Message& operator <<(T* const& pointer) { // NOLINT
  7746. if (pointer == NULL) {
  7747. *ss_ << "(null)";
  7748. } else {
  7749. ::GTestStreamToHelper(ss_.get(), pointer);
  7750. }
  7751. return *this;
  7752. }
  7753. #endif // GTEST_OS_SYMBIAN
  7754. // Since the basic IO manipulators are overloaded for both narrow
  7755. // and wide streams, we have to provide this specialized definition
  7756. // of operator <<, even though its body is the same as the
  7757. // templatized version above. Without this definition, streaming
  7758. // endl or other basic IO manipulators to Message will confuse the
  7759. // compiler.
  7760. Message& operator <<(BasicNarrowIoManip val) {
  7761. *ss_ << val;
  7762. return *this;
  7763. }
  7764. // Instead of 1/0, we want to see true/false for bool values.
  7765. Message& operator <<(bool b) {
  7766. return *this << (b ? "true" : "false");
  7767. }
  7768. // These two overloads allow streaming a wide C string to a Message
  7769. // using the UTF-8 encoding.
  7770. Message& operator <<(const wchar_t* wide_c_str) {
  7771. return *this << internal::String::ShowWideCString(wide_c_str);
  7772. }
  7773. Message& operator <<(wchar_t* wide_c_str) {
  7774. return *this << internal::String::ShowWideCString(wide_c_str);
  7775. }
  7776. #if GTEST_HAS_STD_WSTRING
  7777. // Converts the given wide string to a narrow string using the UTF-8
  7778. // encoding, and streams the result to this Message object.
  7779. Message& operator <<(const ::std::wstring& wstr);
  7780. #endif // GTEST_HAS_STD_WSTRING
  7781. #if GTEST_HAS_GLOBAL_WSTRING
  7782. // Converts the given wide string to a narrow string using the UTF-8
  7783. // encoding, and streams the result to this Message object.
  7784. Message& operator <<(const ::wstring& wstr);
  7785. #endif // GTEST_HAS_GLOBAL_WSTRING
  7786. // Gets the text streamed to this object so far as a String.
  7787. // Each '\0' character in the buffer is replaced with "\\0".
  7788. //
  7789. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  7790. internal::String GetString() const {
  7791. return internal::StringStreamToString(ss_.get());
  7792. }
  7793. private:
  7794. #if GTEST_OS_SYMBIAN
  7795. // These are needed as the Nokia Symbian Compiler cannot decide between
  7796. // const T& and const T* in a function template. The Nokia compiler _can_
  7797. // decide between class template specializations for T and T*, so a
  7798. // tr1::type_traits-like is_pointer works, and we can overload on that.
  7799. template <typename T>
  7800. inline void StreamHelper(internal::true_type /*dummy*/, T* pointer) {
  7801. if (pointer == NULL) {
  7802. *ss_ << "(null)";
  7803. } else {
  7804. ::GTestStreamToHelper(ss_.get(), pointer);
  7805. }
  7806. }
  7807. template <typename T>
  7808. inline void StreamHelper(internal::false_type /*dummy*/, const T& value) {
  7809. ::GTestStreamToHelper(ss_.get(), value);
  7810. }
  7811. #endif // GTEST_OS_SYMBIAN
  7812. // We'll hold the text streamed to this object here.
  7813. const internal::scoped_ptr< ::std::stringstream> ss_;
  7814. // We declare (but don't implement) this to prevent the compiler
  7815. // from implementing the assignment operator.
  7816. void operator=(const Message&);
  7817. };
  7818. // Streams a Message to an ostream.
  7819. inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
  7820. return os << sb.GetString();
  7821. }
  7822. } // namespace testing
  7823. #endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
  7824. // This file was GENERATED by command:
  7825. // pump.py gtest-param-test.h.pump
  7826. // DO NOT EDIT BY HAND!!!
  7827. // Copyright 2008, Google Inc.
  7828. // All rights reserved.
  7829. //
  7830. // Redistribution and use in source and binary forms, with or without
  7831. // modification, are permitted provided that the following conditions are
  7832. // met:
  7833. //
  7834. // * Redistributions of source code must retain the above copyright
  7835. // notice, this list of conditions and the following disclaimer.
  7836. // * Redistributions in binary form must reproduce the above
  7837. // copyright notice, this list of conditions and the following disclaimer
  7838. // in the documentation and/or other materials provided with the
  7839. // distribution.
  7840. // * Neither the name of Google Inc. nor the names of its
  7841. // contributors may be used to endorse or promote products derived from
  7842. // this software without specific prior written permission.
  7843. //
  7844. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  7845. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  7846. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  7847. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7848. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  7849. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  7850. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  7851. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  7852. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  7853. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  7854. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  7855. //
  7856. // Authors: vladl@google.com (Vlad Losev)
  7857. //
  7858. // Macros and functions for implementing parameterized tests
  7859. // in Google C++ Testing Framework (Google Test)
  7860. //
  7861. // This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
  7862. //
  7863. #ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
  7864. #define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
  7865. // Value-parameterized tests allow you to test your code with different
  7866. // parameters without writing multiple copies of the same test.
  7867. //
  7868. // Here is how you use value-parameterized tests:
  7869. #if 0
  7870. // To write value-parameterized tests, first you should define a fixture
  7871. // class. It is usually derived from testing::TestWithParam<T> (see below for
  7872. // another inheritance scheme that's sometimes useful in more complicated
  7873. // class hierarchies), where the type of your parameter values.
  7874. // TestWithParam<T> is itself derived from testing::Test. T can be any
  7875. // copyable type. If it's a raw pointer, you are responsible for managing the
  7876. // lifespan of the pointed values.
  7877. class FooTest : public ::testing::TestWithParam<const char*> {
  7878. // You can implement all the usual class fixture members here.
  7879. };
  7880. // Then, use the TEST_P macro to define as many parameterized tests
  7881. // for this fixture as you want. The _P suffix is for "parameterized"
  7882. // or "pattern", whichever you prefer to think.
  7883. TEST_P(FooTest, DoesBlah) {
  7884. // Inside a test, access the test parameter with the GetParam() method
  7885. // of the TestWithParam<T> class:
  7886. EXPECT_TRUE(foo.Blah(GetParam()));
  7887. ...
  7888. }
  7889. TEST_P(FooTest, HasBlahBlah) {
  7890. ...
  7891. }
  7892. // Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
  7893. // case with any set of parameters you want. Google Test defines a number
  7894. // of functions for generating test parameters. They return what we call
  7895. // (surprise!) parameter generators. Here is a summary of them, which
  7896. // are all in the testing namespace:
  7897. //
  7898. //
  7899. // Range(begin, end [, step]) - Yields values {begin, begin+step,
  7900. // begin+step+step, ...}. The values do not
  7901. // include end. step defaults to 1.
  7902. // Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}.
  7903. // ValuesIn(container) - Yields values from a C-style array, an STL
  7904. // ValuesIn(begin,end) container, or an iterator range [begin, end).
  7905. // Bool() - Yields sequence {false, true}.
  7906. // Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product
  7907. // for the math savvy) of the values generated
  7908. // by the N generators.
  7909. //
  7910. // For more details, see comments at the definitions of these functions below
  7911. // in this file.
  7912. //
  7913. // The following statement will instantiate tests from the FooTest test case
  7914. // each with parameter values "meeny", "miny", and "moe".
  7915. INSTANTIATE_TEST_CASE_P(InstantiationName,
  7916. FooTest,
  7917. Values("meeny", "miny", "moe"));
  7918. // To distinguish different instances of the pattern, (yes, you
  7919. // can instantiate it more then once) the first argument to the
  7920. // INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
  7921. // actual test case name. Remember to pick unique prefixes for different
  7922. // instantiations. The tests from the instantiation above will have
  7923. // these names:
  7924. //
  7925. // * InstantiationName/FooTest.DoesBlah/0 for "meeny"
  7926. // * InstantiationName/FooTest.DoesBlah/1 for "miny"
  7927. // * InstantiationName/FooTest.DoesBlah/2 for "moe"
  7928. // * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
  7929. // * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
  7930. // * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
  7931. //
  7932. // You can use these names in --gtest_filter.
  7933. //
  7934. // This statement will instantiate all tests from FooTest again, each
  7935. // with parameter values "cat" and "dog":
  7936. const char* pets[] = {"cat", "dog"};
  7937. INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
  7938. // The tests from the instantiation above will have these names:
  7939. //
  7940. // * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
  7941. // * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
  7942. // * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
  7943. // * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
  7944. //
  7945. // Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
  7946. // in the given test case, whether their definitions come before or
  7947. // AFTER the INSTANTIATE_TEST_CASE_P statement.
  7948. //
  7949. // Please also note that generator expressions (including parameters to the
  7950. // generators) are evaluated in InitGoogleTest(), after main() has started.
  7951. // This allows the user on one hand, to adjust generator parameters in order
  7952. // to dynamically determine a set of tests to run and on the other hand,
  7953. // give the user a chance to inspect the generated tests with Google Test
  7954. // reflection API before RUN_ALL_TESTS() is executed.
  7955. //
  7956. // You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
  7957. // for more examples.
  7958. //
  7959. // In the future, we plan to publish the API for defining new parameter
  7960. // generators. But for now this interface remains part of the internal
  7961. // implementation and is subject to change.
  7962. //
  7963. //
  7964. // A parameterized test fixture must be derived from testing::Test and from
  7965. // testing::WithParamInterface<T>, where T is the type of the parameter
  7966. // values. Inheriting from TestWithParam<T> satisfies that requirement because
  7967. // TestWithParam<T> inherits from both Test and WithParamInterface. In more
  7968. // complicated hierarchies, however, it is occasionally useful to inherit
  7969. // separately from Test and WithParamInterface. For example:
  7970. class BaseTest : public ::testing::Test {
  7971. // You can inherit all the usual members for a non-parameterized test
  7972. // fixture here.
  7973. };
  7974. class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
  7975. // The usual test fixture members go here too.
  7976. };
  7977. TEST_F(BaseTest, HasFoo) {
  7978. // This is an ordinary non-parameterized test.
  7979. }
  7980. TEST_P(DerivedTest, DoesBlah) {
  7981. // GetParam works just the same here as if you inherit from TestWithParam.
  7982. EXPECT_TRUE(foo.Blah(GetParam()));
  7983. }
  7984. #endif // 0
  7985. #if !GTEST_OS_SYMBIAN
  7986. # include <utility>
  7987. #endif
  7988. // scripts/fuse_gtest.py depends on gtest's own header being #included
  7989. // *unconditionally*. Therefore these #includes cannot be moved
  7990. // inside #if GTEST_HAS_PARAM_TEST.
  7991. // Copyright 2008 Google Inc.
  7992. // All Rights Reserved.
  7993. //
  7994. // Redistribution and use in source and binary forms, with or without
  7995. // modification, are permitted provided that the following conditions are
  7996. // met:
  7997. //
  7998. // * Redistributions of source code must retain the above copyright
  7999. // notice, this list of conditions and the following disclaimer.
  8000. // * Redistributions in binary form must reproduce the above
  8001. // copyright notice, this list of conditions and the following disclaimer
  8002. // in the documentation and/or other materials provided with the
  8003. // distribution.
  8004. // * Neither the name of Google Inc. nor the names of its
  8005. // contributors may be used to endorse or promote products derived from
  8006. // this software without specific prior written permission.
  8007. //
  8008. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8009. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  8010. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8011. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  8012. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8013. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  8014. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  8015. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  8016. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  8017. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  8018. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8019. //
  8020. // Author: vladl@google.com (Vlad Losev)
  8021. // Type and function utilities for implementing parameterized tests.
  8022. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
  8023. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
  8024. #include <iterator>
  8025. #include <utility>
  8026. #include <vector>
  8027. // scripts/fuse_gtest.py depends on gtest's own header being #included
  8028. // *unconditionally*. Therefore these #includes cannot be moved
  8029. // inside #if GTEST_HAS_PARAM_TEST.
  8030. // Copyright 2003 Google Inc.
  8031. // All rights reserved.
  8032. //
  8033. // Redistribution and use in source and binary forms, with or without
  8034. // modification, are permitted provided that the following conditions are
  8035. // met:
  8036. //
  8037. // * Redistributions of source code must retain the above copyright
  8038. // notice, this list of conditions and the following disclaimer.
  8039. // * Redistributions in binary form must reproduce the above
  8040. // copyright notice, this list of conditions and the following disclaimer
  8041. // in the documentation and/or other materials provided with the
  8042. // distribution.
  8043. // * Neither the name of Google Inc. nor the names of its
  8044. // contributors may be used to endorse or promote products derived from
  8045. // this software without specific prior written permission.
  8046. //
  8047. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8048. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  8049. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8050. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  8051. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8052. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  8053. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  8054. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  8055. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  8056. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  8057. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8058. //
  8059. // Authors: Dan Egnor (egnor@google.com)
  8060. //
  8061. // A "smart" pointer type with reference tracking. Every pointer to a
  8062. // particular object is kept on a circular linked list. When the last pointer
  8063. // to an object is destroyed or reassigned, the object is deleted.
  8064. //
  8065. // Used properly, this deletes the object when the last reference goes away.
  8066. // There are several caveats:
  8067. // - Like all reference counting schemes, cycles lead to leaks.
  8068. // - Each smart pointer is actually two pointers (8 bytes instead of 4).
  8069. // - Every time a pointer is assigned, the entire list of pointers to that
  8070. // object is traversed. This class is therefore NOT SUITABLE when there
  8071. // will often be more than two or three pointers to a particular object.
  8072. // - References are only tracked as long as linked_ptr<> objects are copied.
  8073. // If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
  8074. // will happen (double deletion).
  8075. //
  8076. // A good use of this class is storing object references in STL containers.
  8077. // You can safely put linked_ptr<> in a vector<>.
  8078. // Other uses may not be as good.
  8079. //
  8080. // Note: If you use an incomplete type with linked_ptr<>, the class
  8081. // *containing* linked_ptr<> must have a constructor and destructor (even
  8082. // if they do nothing!).
  8083. //
  8084. // Bill Gibbons suggested we use something like this.
  8085. //
  8086. // Thread Safety:
  8087. // Unlike other linked_ptr implementations, in this implementation
  8088. // a linked_ptr object is thread-safe in the sense that:
  8089. // - it's safe to copy linked_ptr objects concurrently,
  8090. // - it's safe to copy *from* a linked_ptr and read its underlying
  8091. // raw pointer (e.g. via get()) concurrently, and
  8092. // - it's safe to write to two linked_ptrs that point to the same
  8093. // shared object concurrently.
  8094. // TODO(wan@google.com): rename this to safe_linked_ptr to avoid
  8095. // confusion with normal linked_ptr.
  8096. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
  8097. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
  8098. #include <stdlib.h>
  8099. #include <assert.h>
  8100. namespace testing {
  8101. namespace internal {
  8102. // Protects copying of all linked_ptr objects.
  8103. GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
  8104. // This is used internally by all instances of linked_ptr<>. It needs to be
  8105. // a non-template class because different types of linked_ptr<> can refer to
  8106. // the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
  8107. // So, it needs to be possible for different types of linked_ptr to participate
  8108. // in the same circular linked list, so we need a single class type here.
  8109. //
  8110. // DO NOT USE THIS CLASS DIRECTLY YOURSELF. Use linked_ptr<T>.
  8111. class linked_ptr_internal {
  8112. public:
  8113. // Create a new circle that includes only this instance.
  8114. void join_new() {
  8115. next_ = this;
  8116. }
  8117. // Many linked_ptr operations may change p.link_ for some linked_ptr
  8118. // variable p in the same circle as this object. Therefore we need
  8119. // to prevent two such operations from occurring concurrently.
  8120. //
  8121. // Note that different types of linked_ptr objects can coexist in a
  8122. // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
  8123. // linked_ptr<Derived2>). Therefore we must use a single mutex to
  8124. // protect all linked_ptr objects. This can create serious
  8125. // contention in production code, but is acceptable in a testing
  8126. // framework.
  8127. // Join an existing circle.
  8128. // L < g_linked_ptr_mutex
  8129. void join(linked_ptr_internal const* ptr) {
  8130. MutexLock lock(&g_linked_ptr_mutex);
  8131. linked_ptr_internal const* p = ptr;
  8132. while (p->next_ != ptr) p = p->next_;
  8133. p->next_ = this;
  8134. next_ = ptr;
  8135. }
  8136. // Leave whatever circle we're part of. Returns true if we were the
  8137. // last member of the circle. Once this is done, you can join() another.
  8138. // L < g_linked_ptr_mutex
  8139. bool depart() {
  8140. MutexLock lock(&g_linked_ptr_mutex);
  8141. if (next_ == this) return true;
  8142. linked_ptr_internal const* p = next_;
  8143. while (p->next_ != this) p = p->next_;
  8144. p->next_ = next_;
  8145. return false;
  8146. }
  8147. private:
  8148. mutable linked_ptr_internal const* next_;
  8149. };
  8150. template <typename T>
  8151. class linked_ptr {
  8152. public:
  8153. typedef T element_type;
  8154. // Take over ownership of a raw pointer. This should happen as soon as
  8155. // possible after the object is created.
  8156. explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
  8157. ~linked_ptr() { depart(); }
  8158. // Copy an existing linked_ptr<>, adding ourselves to the list of references.
  8159. template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
  8160. linked_ptr(linked_ptr const& ptr) { // NOLINT
  8161. assert(&ptr != this);
  8162. copy(&ptr);
  8163. }
  8164. // Assignment releases the old value and acquires the new.
  8165. template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
  8166. depart();
  8167. copy(&ptr);
  8168. return *this;
  8169. }
  8170. linked_ptr& operator=(linked_ptr const& ptr) {
  8171. if (&ptr != this) {
  8172. depart();
  8173. copy(&ptr);
  8174. }
  8175. return *this;
  8176. }
  8177. // Smart pointer members.
  8178. void reset(T* ptr = NULL) {
  8179. depart();
  8180. capture(ptr);
  8181. }
  8182. T* get() const { return value_; }
  8183. T* operator->() const { return value_; }
  8184. T& operator*() const { return *value_; }
  8185. bool operator==(T* p) const { return value_ == p; }
  8186. bool operator!=(T* p) const { return value_ != p; }
  8187. template <typename U>
  8188. bool operator==(linked_ptr<U> const& ptr) const {
  8189. return value_ == ptr.get();
  8190. }
  8191. template <typename U>
  8192. bool operator!=(linked_ptr<U> const& ptr) const {
  8193. return value_ != ptr.get();
  8194. }
  8195. private:
  8196. template <typename U>
  8197. friend class linked_ptr;
  8198. T* value_;
  8199. linked_ptr_internal link_;
  8200. void depart() {
  8201. if (link_.depart()) delete value_;
  8202. }
  8203. void capture(T* ptr) {
  8204. value_ = ptr;
  8205. link_.join_new();
  8206. }
  8207. template <typename U> void copy(linked_ptr<U> const* ptr) {
  8208. value_ = ptr->get();
  8209. if (value_)
  8210. link_.join(&ptr->link_);
  8211. else
  8212. link_.join_new();
  8213. }
  8214. };
  8215. template<typename T> inline
  8216. bool operator==(T* ptr, const linked_ptr<T>& x) {
  8217. return ptr == x.get();
  8218. }
  8219. template<typename T> inline
  8220. bool operator!=(T* ptr, const linked_ptr<T>& x) {
  8221. return ptr != x.get();
  8222. }
  8223. // A function to convert T* into linked_ptr<T>
  8224. // Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
  8225. // for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
  8226. template <typename T>
  8227. linked_ptr<T> make_linked_ptr(T* ptr) {
  8228. return linked_ptr<T>(ptr);
  8229. }
  8230. } // namespace internal
  8231. } // namespace testing
  8232. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
  8233. // Copyright 2007, Google Inc.
  8234. // All rights reserved.
  8235. //
  8236. // Redistribution and use in source and binary forms, with or without
  8237. // modification, are permitted provided that the following conditions are
  8238. // met:
  8239. //
  8240. // * Redistributions of source code must retain the above copyright
  8241. // notice, this list of conditions and the following disclaimer.
  8242. // * Redistributions in binary form must reproduce the above
  8243. // copyright notice, this list of conditions and the following disclaimer
  8244. // in the documentation and/or other materials provided with the
  8245. // distribution.
  8246. // * Neither the name of Google Inc. nor the names of its
  8247. // contributors may be used to endorse or promote products derived from
  8248. // this software without specific prior written permission.
  8249. //
  8250. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8251. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  8252. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8253. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  8254. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8255. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  8256. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  8257. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  8258. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  8259. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  8260. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8261. //
  8262. // Author: wan@google.com (Zhanyong Wan)
  8263. // Google Test - The Google C++ Testing Framework
  8264. //
  8265. // This file implements a universal value printer that can print a
  8266. // value of any type T:
  8267. //
  8268. // void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
  8269. //
  8270. // A user can teach this function how to print a class type T by
  8271. // defining either operator<<() or PrintTo() in the namespace that
  8272. // defines T. More specifically, the FIRST defined function in the
  8273. // following list will be used (assuming T is defined in namespace
  8274. // foo):
  8275. //
  8276. // 1. foo::PrintTo(const T&, ostream*)
  8277. // 2. operator<<(ostream&, const T&) defined in either foo or the
  8278. // global namespace.
  8279. //
  8280. // If none of the above is defined, it will print the debug string of
  8281. // the value if it is a protocol buffer, or print the raw bytes in the
  8282. // value otherwise.
  8283. //
  8284. // To aid debugging: when T is a reference type, the address of the
  8285. // value is also printed; when T is a (const) char pointer, both the
  8286. // pointer value and the NUL-terminated string it points to are
  8287. // printed.
  8288. //
  8289. // We also provide some convenient wrappers:
  8290. //
  8291. // // Prints a value to a string. For a (const or not) char
  8292. // // pointer, the NUL-terminated string (but not the pointer) is
  8293. // // printed.
  8294. // std::string ::testing::PrintToString(const T& value);
  8295. //
  8296. // // Prints a value tersely: for a reference type, the referenced
  8297. // // value (but not the address) is printed; for a (const or not) char
  8298. // // pointer, the NUL-terminated string (but not the pointer) is
  8299. // // printed.
  8300. // void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
  8301. //
  8302. // // Prints value using the type inferred by the compiler. The difference
  8303. // // from UniversalTersePrint() is that this function prints both the
  8304. // // pointer and the NUL-terminated string for a (const or not) char pointer.
  8305. // void ::testing::internal::UniversalPrint(const T& value, ostream*);
  8306. //
  8307. // // Prints the fields of a tuple tersely to a string vector, one
  8308. // // element for each field. Tuple support must be enabled in
  8309. // // gtest-port.h.
  8310. // std::vector<string> UniversalTersePrintTupleFieldsToStrings(
  8311. // const Tuple& value);
  8312. //
  8313. // Known limitation:
  8314. //
  8315. // The print primitives print the elements of an STL-style container
  8316. // using the compiler-inferred type of *iter where iter is a
  8317. // const_iterator of the container. When const_iterator is an input
  8318. // iterator but not a forward iterator, this inferred type may not
  8319. // match value_type, and the print output may be incorrect. In
  8320. // practice, this is rarely a problem as for most containers
  8321. // const_iterator is a forward iterator. We'll fix this if there's an
  8322. // actual need for it. Note that this fix cannot rely on value_type
  8323. // being defined as many user-defined container types don't have
  8324. // value_type.
  8325. #ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
  8326. #define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
  8327. #include <ostream> // NOLINT
  8328. #include <sstream>
  8329. #include <string>
  8330. #include <utility>
  8331. #include <vector>
  8332. namespace testing {
  8333. // Definitions in the 'internal' and 'internal2' name spaces are
  8334. // subject to change without notice. DO NOT USE THEM IN USER CODE!
  8335. namespace internal2 {
  8336. // Prints the given number of bytes in the given object to the given
  8337. // ostream.
  8338. GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
  8339. size_t count,
  8340. ::std::ostream* os);
  8341. // For selecting which printer to use when a given type has neither <<
  8342. // nor PrintTo().
  8343. enum TypeKind {
  8344. kProtobuf, // a protobuf type
  8345. kConvertibleToInteger, // a type implicitly convertible to BiggestInt
  8346. // (e.g. a named or unnamed enum type)
  8347. kOtherType // anything else
  8348. };
  8349. // TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
  8350. // by the universal printer to print a value of type T when neither
  8351. // operator<< nor PrintTo() is defined for T, where kTypeKind is the
  8352. // "kind" of T as defined by enum TypeKind.
  8353. template <typename T, TypeKind kTypeKind>
  8354. class TypeWithoutFormatter {
  8355. public:
  8356. // This default version is called when kTypeKind is kOtherType.
  8357. static void PrintValue(const T& value, ::std::ostream* os) {
  8358. PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value),
  8359. sizeof(value), os);
  8360. }
  8361. };
  8362. // We print a protobuf using its ShortDebugString() when the string
  8363. // doesn't exceed this many characters; otherwise we print it using
  8364. // DebugString() for better readability.
  8365. const size_t kProtobufOneLinerMaxLength = 50;
  8366. template <typename T>
  8367. class TypeWithoutFormatter<T, kProtobuf> {
  8368. public:
  8369. static void PrintValue(const T& value, ::std::ostream* os) {
  8370. const ::testing::internal::string short_str = value.ShortDebugString();
  8371. const ::testing::internal::string pretty_str =
  8372. short_str.length() <= kProtobufOneLinerMaxLength ?
  8373. short_str : ("\n" + value.DebugString());
  8374. *os << ("<" + pretty_str + ">");
  8375. }
  8376. };
  8377. template <typename T>
  8378. class TypeWithoutFormatter<T, kConvertibleToInteger> {
  8379. public:
  8380. // Since T has no << operator or PrintTo() but can be implicitly
  8381. // converted to BiggestInt, we print it as a BiggestInt.
  8382. //
  8383. // Most likely T is an enum type (either named or unnamed), in which
  8384. // case printing it as an integer is the desired behavior. In case
  8385. // T is not an enum, printing it as an integer is the best we can do
  8386. // given that it has no user-defined printer.
  8387. static void PrintValue(const T& value, ::std::ostream* os) {
  8388. const internal::BiggestInt kBigInt = value;
  8389. *os << kBigInt;
  8390. }
  8391. };
  8392. // Prints the given value to the given ostream. If the value is a
  8393. // protocol message, its debug string is printed; if it's an enum or
  8394. // of a type implicitly convertible to BiggestInt, it's printed as an
  8395. // integer; otherwise the bytes in the value are printed. This is
  8396. // what UniversalPrinter<T>::Print() does when it knows nothing about
  8397. // type T and T has neither << operator nor PrintTo().
  8398. //
  8399. // A user can override this behavior for a class type Foo by defining
  8400. // a << operator in the namespace where Foo is defined.
  8401. //
  8402. // We put this operator in namespace 'internal2' instead of 'internal'
  8403. // to simplify the implementation, as much code in 'internal' needs to
  8404. // use << in STL, which would conflict with our own << were it defined
  8405. // in 'internal'.
  8406. //
  8407. // Note that this operator<< takes a generic std::basic_ostream<Char,
  8408. // CharTraits> type instead of the more restricted std::ostream. If
  8409. // we define it to take an std::ostream instead, we'll get an
  8410. // "ambiguous overloads" compiler error when trying to print a type
  8411. // Foo that supports streaming to std::basic_ostream<Char,
  8412. // CharTraits>, as the compiler cannot tell whether
  8413. // operator<<(std::ostream&, const T&) or
  8414. // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
  8415. // specific.
  8416. template <typename Char, typename CharTraits, typename T>
  8417. ::std::basic_ostream<Char, CharTraits>& operator<<(
  8418. ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
  8419. TypeWithoutFormatter<T,
  8420. (internal::IsAProtocolMessage<T>::value ? kProtobuf :
  8421. internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ?
  8422. kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
  8423. return os;
  8424. }
  8425. } // namespace internal2
  8426. } // namespace testing
  8427. // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
  8428. // magic needed for implementing UniversalPrinter won't work.
  8429. namespace testing_internal {
  8430. // Used to print a value that is not an STL-style container when the
  8431. // user doesn't define PrintTo() for it.
  8432. template <typename T>
  8433. void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
  8434. // With the following statement, during unqualified name lookup,
  8435. // testing::internal2::operator<< appears as if it was declared in
  8436. // the nearest enclosing namespace that contains both
  8437. // ::testing_internal and ::testing::internal2, i.e. the global
  8438. // namespace. For more details, refer to the C++ Standard section
  8439. // 7.3.4-1 [namespace.udir]. This allows us to fall back onto
  8440. // testing::internal2::operator<< in case T doesn't come with a <<
  8441. // operator.
  8442. //
  8443. // We cannot write 'using ::testing::internal2::operator<<;', which
  8444. // gcc 3.3 fails to compile due to a compiler bug.
  8445. using namespace ::testing::internal2; // NOLINT
  8446. // Assuming T is defined in namespace foo, in the next statement,
  8447. // the compiler will consider all of:
  8448. //
  8449. // 1. foo::operator<< (thanks to Koenig look-up),
  8450. // 2. ::operator<< (as the current namespace is enclosed in ::),
  8451. // 3. testing::internal2::operator<< (thanks to the using statement above).
  8452. //
  8453. // The operator<< whose type matches T best will be picked.
  8454. //
  8455. // We deliberately allow #2 to be a candidate, as sometimes it's
  8456. // impossible to define #1 (e.g. when foo is ::std, defining
  8457. // anything in it is undefined behavior unless you are a compiler
  8458. // vendor.).
  8459. *os << value;
  8460. }
  8461. } // namespace testing_internal
  8462. namespace testing {
  8463. namespace internal {
  8464. // UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
  8465. // value to the given ostream. The caller must ensure that
  8466. // 'ostream_ptr' is not NULL, or the behavior is undefined.
  8467. //
  8468. // We define UniversalPrinter as a class template (as opposed to a
  8469. // function template), as we need to partially specialize it for
  8470. // reference types, which cannot be done with function templates.
  8471. template <typename T>
  8472. class UniversalPrinter;
  8473. template <typename T>
  8474. void UniversalPrint(const T& value, ::std::ostream* os);
  8475. // Used to print an STL-style container when the user doesn't define
  8476. // a PrintTo() for it.
  8477. template <typename C>
  8478. void DefaultPrintTo(IsContainer /* dummy */,
  8479. false_type /* is not a pointer */,
  8480. const C& container, ::std::ostream* os) {
  8481. const size_t kMaxCount = 32; // The maximum number of elements to print.
  8482. *os << '{';
  8483. size_t count = 0;
  8484. for (typename C::const_iterator it = container.begin();
  8485. it != container.end(); ++it, ++count) {
  8486. if (count > 0) {
  8487. *os << ',';
  8488. if (count == kMaxCount) { // Enough has been printed.
  8489. *os << " ...";
  8490. break;
  8491. }
  8492. }
  8493. *os << ' ';
  8494. // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
  8495. // handle *it being a native array.
  8496. internal::UniversalPrint(*it, os);
  8497. }
  8498. if (count > 0) {
  8499. *os << ' ';
  8500. }
  8501. *os << '}';
  8502. }
  8503. // Used to print a pointer that is neither a char pointer nor a member
  8504. // pointer, when the user doesn't define PrintTo() for it. (A member
  8505. // variable pointer or member function pointer doesn't really point to
  8506. // a location in the address space. Their representation is
  8507. // implementation-defined. Therefore they will be printed as raw
  8508. // bytes.)
  8509. template <typename T>
  8510. void DefaultPrintTo(IsNotContainer /* dummy */,
  8511. true_type /* is a pointer */,
  8512. T* p, ::std::ostream* os) {
  8513. if (p == NULL) {
  8514. *os << "NULL";
  8515. } else {
  8516. // C++ doesn't allow casting from a function pointer to any object
  8517. // pointer.
  8518. //
  8519. // IsTrue() silences warnings: "Condition is always true",
  8520. // "unreachable code".
  8521. if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {
  8522. // T is not a function type. We just call << to print p,
  8523. // relying on ADL to pick up user-defined << for their pointer
  8524. // types, if any.
  8525. *os << p;
  8526. } else {
  8527. // T is a function type, so '*os << p' doesn't do what we want
  8528. // (it just prints p as bool). We want to print p as a const
  8529. // void*. However, we cannot cast it to const void* directly,
  8530. // even using reinterpret_cast, as earlier versions of gcc
  8531. // (e.g. 3.4.5) cannot compile the cast when p is a function
  8532. // pointer. Casting to UInt64 first solves the problem.
  8533. *os << reinterpret_cast<const void*>(
  8534. reinterpret_cast<internal::UInt64>(p));
  8535. }
  8536. }
  8537. }
  8538. // Used to print a non-container, non-pointer value when the user
  8539. // doesn't define PrintTo() for it.
  8540. template <typename T>
  8541. void DefaultPrintTo(IsNotContainer /* dummy */,
  8542. false_type /* is not a pointer */,
  8543. const T& value, ::std::ostream* os) {
  8544. ::testing_internal::DefaultPrintNonContainerTo(value, os);
  8545. }
  8546. // Prints the given value using the << operator if it has one;
  8547. // otherwise prints the bytes in it. This is what
  8548. // UniversalPrinter<T>::Print() does when PrintTo() is not specialized
  8549. // or overloaded for type T.
  8550. //
  8551. // A user can override this behavior for a class type Foo by defining
  8552. // an overload of PrintTo() in the namespace where Foo is defined. We
  8553. // give the user this option as sometimes defining a << operator for
  8554. // Foo is not desirable (e.g. the coding style may prevent doing it,
  8555. // or there is already a << operator but it doesn't do what the user
  8556. // wants).
  8557. template <typename T>
  8558. void PrintTo(const T& value, ::std::ostream* os) {
  8559. // DefaultPrintTo() is overloaded. The type of its first two
  8560. // arguments determine which version will be picked. If T is an
  8561. // STL-style container, the version for container will be called; if
  8562. // T is a pointer, the pointer version will be called; otherwise the
  8563. // generic version will be called.
  8564. //
  8565. // Note that we check for container types here, prior to we check
  8566. // for protocol message types in our operator<<. The rationale is:
  8567. //
  8568. // For protocol messages, we want to give people a chance to
  8569. // override Google Mock's format by defining a PrintTo() or
  8570. // operator<<. For STL containers, other formats can be
  8571. // incompatible with Google Mock's format for the container
  8572. // elements; therefore we check for container types here to ensure
  8573. // that our format is used.
  8574. //
  8575. // The second argument of DefaultPrintTo() is needed to bypass a bug
  8576. // in Symbian's C++ compiler that prevents it from picking the right
  8577. // overload between:
  8578. //
  8579. // PrintTo(const T& x, ...);
  8580. // PrintTo(T* x, ...);
  8581. DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);
  8582. }
  8583. // The following list of PrintTo() overloads tells
  8584. // UniversalPrinter<T>::Print() how to print standard types (built-in
  8585. // types, strings, plain arrays, and pointers).
  8586. // Overloads for various char types.
  8587. GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
  8588. GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
  8589. inline void PrintTo(char c, ::std::ostream* os) {
  8590. // When printing a plain char, we always treat it as unsigned. This
  8591. // way, the output won't be affected by whether the compiler thinks
  8592. // char is signed or not.
  8593. PrintTo(static_cast<unsigned char>(c), os);
  8594. }
  8595. // Overloads for other simple built-in types.
  8596. inline void PrintTo(bool x, ::std::ostream* os) {
  8597. *os << (x ? "true" : "false");
  8598. }
  8599. // Overload for wchar_t type.
  8600. // Prints a wchar_t as a symbol if it is printable or as its internal
  8601. // code otherwise and also as its decimal code (except for L'\0').
  8602. // The L'\0' char is printed as "L'\\0'". The decimal code is printed
  8603. // as signed integer when wchar_t is implemented by the compiler
  8604. // as a signed type and is printed as an unsigned integer when wchar_t
  8605. // is implemented as an unsigned type.
  8606. GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
  8607. // Overloads for C strings.
  8608. GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
  8609. inline void PrintTo(char* s, ::std::ostream* os) {
  8610. PrintTo(ImplicitCast_<const char*>(s), os);
  8611. }
  8612. // signed/unsigned char is often used for representing binary data, so
  8613. // we print pointers to it as void* to be safe.
  8614. inline void PrintTo(const signed char* s, ::std::ostream* os) {
  8615. PrintTo(ImplicitCast_<const void*>(s), os);
  8616. }
  8617. inline void PrintTo(signed char* s, ::std::ostream* os) {
  8618. PrintTo(ImplicitCast_<const void*>(s), os);
  8619. }
  8620. inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
  8621. PrintTo(ImplicitCast_<const void*>(s), os);
  8622. }
  8623. inline void PrintTo(unsigned char* s, ::std::ostream* os) {
  8624. PrintTo(ImplicitCast_<const void*>(s), os);
  8625. }
  8626. // MSVC can be configured to define wchar_t as a typedef of unsigned
  8627. // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
  8628. // type. When wchar_t is a typedef, defining an overload for const
  8629. // wchar_t* would cause unsigned short* be printed as a wide string,
  8630. // possibly causing invalid memory accesses.
  8631. #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
  8632. // Overloads for wide C strings
  8633. GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
  8634. inline void PrintTo(wchar_t* s, ::std::ostream* os) {
  8635. PrintTo(ImplicitCast_<const wchar_t*>(s), os);
  8636. }
  8637. #endif
  8638. // Overload for C arrays. Multi-dimensional arrays are printed
  8639. // properly.
  8640. // Prints the given number of elements in an array, without printing
  8641. // the curly braces.
  8642. template <typename T>
  8643. void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
  8644. UniversalPrint(a[0], os);
  8645. for (size_t i = 1; i != count; i++) {
  8646. *os << ", ";
  8647. UniversalPrint(a[i], os);
  8648. }
  8649. }
  8650. // Overloads for ::string and ::std::string.
  8651. #if GTEST_HAS_GLOBAL_STRING
  8652. GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
  8653. inline void PrintTo(const ::string& s, ::std::ostream* os) {
  8654. PrintStringTo(s, os);
  8655. }
  8656. #endif // GTEST_HAS_GLOBAL_STRING
  8657. GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
  8658. inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
  8659. PrintStringTo(s, os);
  8660. }
  8661. // Overloads for ::wstring and ::std::wstring.
  8662. #if GTEST_HAS_GLOBAL_WSTRING
  8663. GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
  8664. inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
  8665. PrintWideStringTo(s, os);
  8666. }
  8667. #endif // GTEST_HAS_GLOBAL_WSTRING
  8668. #if GTEST_HAS_STD_WSTRING
  8669. GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
  8670. inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
  8671. PrintWideStringTo(s, os);
  8672. }
  8673. #endif // GTEST_HAS_STD_WSTRING
  8674. #if GTEST_HAS_TR1_TUPLE
  8675. // Overload for ::std::tr1::tuple. Needed for printing function arguments,
  8676. // which are packed as tuples.
  8677. // Helper function for printing a tuple. T must be instantiated with
  8678. // a tuple type.
  8679. template <typename T>
  8680. void PrintTupleTo(const T& t, ::std::ostream* os);
  8681. // Overloaded PrintTo() for tuples of various arities. We support
  8682. // tuples of up-to 10 fields. The following implementation works
  8683. // regardless of whether tr1::tuple is implemented using the
  8684. // non-standard variadic template feature or not.
  8685. inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
  8686. PrintTupleTo(t, os);
  8687. }
  8688. template <typename T1>
  8689. void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
  8690. PrintTupleTo(t, os);
  8691. }
  8692. template <typename T1, typename T2>
  8693. void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
  8694. PrintTupleTo(t, os);
  8695. }
  8696. template <typename T1, typename T2, typename T3>
  8697. void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
  8698. PrintTupleTo(t, os);
  8699. }
  8700. template <typename T1, typename T2, typename T3, typename T4>
  8701. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
  8702. PrintTupleTo(t, os);
  8703. }
  8704. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  8705. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
  8706. ::std::ostream* os) {
  8707. PrintTupleTo(t, os);
  8708. }
  8709. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  8710. typename T6>
  8711. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
  8712. ::std::ostream* os) {
  8713. PrintTupleTo(t, os);
  8714. }
  8715. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  8716. typename T6, typename T7>
  8717. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
  8718. ::std::ostream* os) {
  8719. PrintTupleTo(t, os);
  8720. }
  8721. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  8722. typename T6, typename T7, typename T8>
  8723. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
  8724. ::std::ostream* os) {
  8725. PrintTupleTo(t, os);
  8726. }
  8727. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  8728. typename T6, typename T7, typename T8, typename T9>
  8729. void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
  8730. ::std::ostream* os) {
  8731. PrintTupleTo(t, os);
  8732. }
  8733. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  8734. typename T6, typename T7, typename T8, typename T9, typename T10>
  8735. void PrintTo(
  8736. const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
  8737. ::std::ostream* os) {
  8738. PrintTupleTo(t, os);
  8739. }
  8740. #endif // GTEST_HAS_TR1_TUPLE
  8741. // Overload for std::pair.
  8742. template <typename T1, typename T2>
  8743. void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
  8744. *os << '(';
  8745. // We cannot use UniversalPrint(value.first, os) here, as T1 may be
  8746. // a reference type. The same for printing value.second.
  8747. UniversalPrinter<T1>::Print(value.first, os);
  8748. *os << ", ";
  8749. UniversalPrinter<T2>::Print(value.second, os);
  8750. *os << ')';
  8751. }
  8752. // Implements printing a non-reference type T by letting the compiler
  8753. // pick the right overload of PrintTo() for T.
  8754. template <typename T>
  8755. class UniversalPrinter {
  8756. public:
  8757. // MSVC warns about adding const to a function type, so we want to
  8758. // disable the warning.
  8759. #ifdef _MSC_VER
  8760. # pragma warning(push) // Saves the current warning state.
  8761. # pragma warning(disable:4180) // Temporarily disables warning 4180.
  8762. #endif // _MSC_VER
  8763. // Note: we deliberately don't call this PrintTo(), as that name
  8764. // conflicts with ::testing::internal::PrintTo in the body of the
  8765. // function.
  8766. static void Print(const T& value, ::std::ostream* os) {
  8767. // By default, ::testing::internal::PrintTo() is used for printing
  8768. // the value.
  8769. //
  8770. // Thanks to Koenig look-up, if T is a class and has its own
  8771. // PrintTo() function defined in its namespace, that function will
  8772. // be visible here. Since it is more specific than the generic ones
  8773. // in ::testing::internal, it will be picked by the compiler in the
  8774. // following statement - exactly what we want.
  8775. PrintTo(value, os);
  8776. }
  8777. #ifdef _MSC_VER
  8778. # pragma warning(pop) // Restores the warning state.
  8779. #endif // _MSC_VER
  8780. };
  8781. // UniversalPrintArray(begin, len, os) prints an array of 'len'
  8782. // elements, starting at address 'begin'.
  8783. template <typename T>
  8784. void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
  8785. if (len == 0) {
  8786. *os << "{}";
  8787. } else {
  8788. *os << "{ ";
  8789. const size_t kThreshold = 18;
  8790. const size_t kChunkSize = 8;
  8791. // If the array has more than kThreshold elements, we'll have to
  8792. // omit some details by printing only the first and the last
  8793. // kChunkSize elements.
  8794. // TODO(wan@google.com): let the user control the threshold using a flag.
  8795. if (len <= kThreshold) {
  8796. PrintRawArrayTo(begin, len, os);
  8797. } else {
  8798. PrintRawArrayTo(begin, kChunkSize, os);
  8799. *os << ", ..., ";
  8800. PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
  8801. }
  8802. *os << " }";
  8803. }
  8804. }
  8805. // This overload prints a (const) char array compactly.
  8806. GTEST_API_ void UniversalPrintArray(const char* begin,
  8807. size_t len,
  8808. ::std::ostream* os);
  8809. // Implements printing an array type T[N].
  8810. template <typename T, size_t N>
  8811. class UniversalPrinter<T[N]> {
  8812. public:
  8813. // Prints the given array, omitting some elements when there are too
  8814. // many.
  8815. static void Print(const T (&a)[N], ::std::ostream* os) {
  8816. UniversalPrintArray(a, N, os);
  8817. }
  8818. };
  8819. // Implements printing a reference type T&.
  8820. template <typename T>
  8821. class UniversalPrinter<T&> {
  8822. public:
  8823. // MSVC warns about adding const to a function type, so we want to
  8824. // disable the warning.
  8825. #ifdef _MSC_VER
  8826. # pragma warning(push) // Saves the current warning state.
  8827. # pragma warning(disable:4180) // Temporarily disables warning 4180.
  8828. #endif // _MSC_VER
  8829. static void Print(const T& value, ::std::ostream* os) {
  8830. // Prints the address of the value. We use reinterpret_cast here
  8831. // as static_cast doesn't compile when T is a function type.
  8832. *os << "@" << reinterpret_cast<const void*>(&value) << " ";
  8833. // Then prints the value itself.
  8834. UniversalPrint(value, os);
  8835. }
  8836. #ifdef _MSC_VER
  8837. # pragma warning(pop) // Restores the warning state.
  8838. #endif // _MSC_VER
  8839. };
  8840. // Prints a value tersely: for a reference type, the referenced value
  8841. // (but not the address) is printed; for a (const) char pointer, the
  8842. // NUL-terminated string (but not the pointer) is printed.
  8843. template <typename T>
  8844. void UniversalTersePrint(const T& value, ::std::ostream* os) {
  8845. UniversalPrint(value, os);
  8846. }
  8847. inline void UniversalTersePrint(const char* str, ::std::ostream* os) {
  8848. if (str == NULL) {
  8849. *os << "NULL";
  8850. } else {
  8851. UniversalPrint(string(str), os);
  8852. }
  8853. }
  8854. inline void UniversalTersePrint(char* str, ::std::ostream* os) {
  8855. UniversalTersePrint(static_cast<const char*>(str), os);
  8856. }
  8857. // Prints a value using the type inferred by the compiler. The
  8858. // difference between this and UniversalTersePrint() is that for a
  8859. // (const) char pointer, this prints both the pointer and the
  8860. // NUL-terminated string.
  8861. template <typename T>
  8862. void UniversalPrint(const T& value, ::std::ostream* os) {
  8863. UniversalPrinter<T>::Print(value, os);
  8864. }
  8865. #if GTEST_HAS_TR1_TUPLE
  8866. typedef ::std::vector<string> Strings;
  8867. // This helper template allows PrintTo() for tuples and
  8868. // UniversalTersePrintTupleFieldsToStrings() to be defined by
  8869. // induction on the number of tuple fields. The idea is that
  8870. // TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
  8871. // fields in tuple t, and can be defined in terms of
  8872. // TuplePrefixPrinter<N - 1>.
  8873. // The inductive case.
  8874. template <size_t N>
  8875. struct TuplePrefixPrinter {
  8876. // Prints the first N fields of a tuple.
  8877. template <typename Tuple>
  8878. static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
  8879. TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
  8880. *os << ", ";
  8881. UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>
  8882. ::Print(::std::tr1::get<N - 1>(t), os);
  8883. }
  8884. // Tersely prints the first N fields of a tuple to a string vector,
  8885. // one element for each field.
  8886. template <typename Tuple>
  8887. static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
  8888. TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
  8889. ::std::stringstream ss;
  8890. UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);
  8891. strings->push_back(ss.str());
  8892. }
  8893. };
  8894. // Base cases.
  8895. template <>
  8896. struct TuplePrefixPrinter<0> {
  8897. template <typename Tuple>
  8898. static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
  8899. template <typename Tuple>
  8900. static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
  8901. };
  8902. // We have to specialize the entire TuplePrefixPrinter<> class
  8903. // template here, even though the definition of
  8904. // TersePrintPrefixToStrings() is the same as the generic version, as
  8905. // Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't
  8906. // support specializing a method template of a class template.
  8907. template <>
  8908. struct TuplePrefixPrinter<1> {
  8909. template <typename Tuple>
  8910. static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
  8911. UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::
  8912. Print(::std::tr1::get<0>(t), os);
  8913. }
  8914. template <typename Tuple>
  8915. static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
  8916. ::std::stringstream ss;
  8917. UniversalTersePrint(::std::tr1::get<0>(t), &ss);
  8918. strings->push_back(ss.str());
  8919. }
  8920. };
  8921. // Helper function for printing a tuple. T must be instantiated with
  8922. // a tuple type.
  8923. template <typename T>
  8924. void PrintTupleTo(const T& t, ::std::ostream* os) {
  8925. *os << "(";
  8926. TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::
  8927. PrintPrefixTo(t, os);
  8928. *os << ")";
  8929. }
  8930. // Prints the fields of a tuple tersely to a string vector, one
  8931. // element for each field. See the comment before
  8932. // UniversalTersePrint() for how we define "tersely".
  8933. template <typename Tuple>
  8934. Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
  8935. Strings result;
  8936. TuplePrefixPrinter< ::std::tr1::tuple_size<Tuple>::value>::
  8937. TersePrintPrefixToStrings(value, &result);
  8938. return result;
  8939. }
  8940. #endif // GTEST_HAS_TR1_TUPLE
  8941. } // namespace internal
  8942. template <typename T>
  8943. ::std::string PrintToString(const T& value) {
  8944. ::std::stringstream ss;
  8945. internal::UniversalTersePrint(value, &ss);
  8946. return ss.str();
  8947. }
  8948. } // namespace testing
  8949. #endif // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
  8950. #if GTEST_HAS_PARAM_TEST
  8951. namespace testing {
  8952. namespace internal {
  8953. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  8954. //
  8955. // Outputs a message explaining invalid registration of different
  8956. // fixture class for the same test case. This may happen when
  8957. // TEST_P macro is used to define two tests with the same name
  8958. // but in different namespaces.
  8959. GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
  8960. const char* file, int line);
  8961. template <typename> class ParamGeneratorInterface;
  8962. template <typename> class ParamGenerator;
  8963. // Interface for iterating over elements provided by an implementation
  8964. // of ParamGeneratorInterface<T>.
  8965. template <typename T>
  8966. class ParamIteratorInterface {
  8967. public:
  8968. virtual ~ParamIteratorInterface() {}
  8969. // A pointer to the base generator instance.
  8970. // Used only for the purposes of iterator comparison
  8971. // to make sure that two iterators belong to the same generator.
  8972. virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
  8973. // Advances iterator to point to the next element
  8974. // provided by the generator. The caller is responsible
  8975. // for not calling Advance() on an iterator equal to
  8976. // BaseGenerator()->End().
  8977. virtual void Advance() = 0;
  8978. // Clones the iterator object. Used for implementing copy semantics
  8979. // of ParamIterator<T>.
  8980. virtual ParamIteratorInterface* Clone() const = 0;
  8981. // Dereferences the current iterator and provides (read-only) access
  8982. // to the pointed value. It is the caller's responsibility not to call
  8983. // Current() on an iterator equal to BaseGenerator()->End().
  8984. // Used for implementing ParamGenerator<T>::operator*().
  8985. virtual const T* Current() const = 0;
  8986. // Determines whether the given iterator and other point to the same
  8987. // element in the sequence generated by the generator.
  8988. // Used for implementing ParamGenerator<T>::operator==().
  8989. virtual bool Equals(const ParamIteratorInterface& other) const = 0;
  8990. };
  8991. // Class iterating over elements provided by an implementation of
  8992. // ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
  8993. // and implements the const forward iterator concept.
  8994. template <typename T>
  8995. class ParamIterator {
  8996. public:
  8997. typedef T value_type;
  8998. typedef const T& reference;
  8999. typedef ptrdiff_t difference_type;
  9000. // ParamIterator assumes ownership of the impl_ pointer.
  9001. ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
  9002. ParamIterator& operator=(const ParamIterator& other) {
  9003. if (this != &other)
  9004. impl_.reset(other.impl_->Clone());
  9005. return *this;
  9006. }
  9007. const T& operator*() const { return *impl_->Current(); }
  9008. const T* operator->() const { return impl_->Current(); }
  9009. // Prefix version of operator++.
  9010. ParamIterator& operator++() {
  9011. impl_->Advance();
  9012. return *this;
  9013. }
  9014. // Postfix version of operator++.
  9015. ParamIterator operator++(int /*unused*/) {
  9016. ParamIteratorInterface<T>* clone = impl_->Clone();
  9017. impl_->Advance();
  9018. return ParamIterator(clone);
  9019. }
  9020. bool operator==(const ParamIterator& other) const {
  9021. return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
  9022. }
  9023. bool operator!=(const ParamIterator& other) const {
  9024. return !(*this == other);
  9025. }
  9026. private:
  9027. friend class ParamGenerator<T>;
  9028. explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
  9029. scoped_ptr<ParamIteratorInterface<T> > impl_;
  9030. };
  9031. // ParamGeneratorInterface<T> is the binary interface to access generators
  9032. // defined in other translation units.
  9033. template <typename T>
  9034. class ParamGeneratorInterface {
  9035. public:
  9036. typedef T ParamType;
  9037. virtual ~ParamGeneratorInterface() {}
  9038. // Generator interface definition
  9039. virtual ParamIteratorInterface<T>* Begin() const = 0;
  9040. virtual ParamIteratorInterface<T>* End() const = 0;
  9041. };
  9042. // Wraps ParamGeneratorInterface<T> and provides general generator syntax
  9043. // compatible with the STL Container concept.
  9044. // This class implements copy initialization semantics and the contained
  9045. // ParamGeneratorInterface<T> instance is shared among all copies
  9046. // of the original object. This is possible because that instance is immutable.
  9047. template<typename T>
  9048. class ParamGenerator {
  9049. public:
  9050. typedef ParamIterator<T> iterator;
  9051. explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
  9052. ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
  9053. ParamGenerator& operator=(const ParamGenerator& other) {
  9054. impl_ = other.impl_;
  9055. return *this;
  9056. }
  9057. iterator begin() const { return iterator(impl_->Begin()); }
  9058. iterator end() const { return iterator(impl_->End()); }
  9059. private:
  9060. linked_ptr<const ParamGeneratorInterface<T> > impl_;
  9061. };
  9062. // Generates values from a range of two comparable values. Can be used to
  9063. // generate sequences of user-defined types that implement operator+() and
  9064. // operator<().
  9065. // This class is used in the Range() function.
  9066. template <typename T, typename IncrementT>
  9067. class RangeGenerator : public ParamGeneratorInterface<T> {
  9068. public:
  9069. RangeGenerator(T begin, T end, IncrementT step)
  9070. : begin_(begin), end_(end),
  9071. step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
  9072. virtual ~RangeGenerator() {}
  9073. virtual ParamIteratorInterface<T>* Begin() const {
  9074. return new Iterator(this, begin_, 0, step_);
  9075. }
  9076. virtual ParamIteratorInterface<T>* End() const {
  9077. return new Iterator(this, end_, end_index_, step_);
  9078. }
  9079. private:
  9080. class Iterator : public ParamIteratorInterface<T> {
  9081. public:
  9082. Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
  9083. IncrementT step)
  9084. : base_(base), value_(value), index_(index), step_(step) {}
  9085. virtual ~Iterator() {}
  9086. virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
  9087. return base_;
  9088. }
  9089. virtual void Advance() {
  9090. value_ = value_ + step_;
  9091. index_++;
  9092. }
  9093. virtual ParamIteratorInterface<T>* Clone() const {
  9094. return new Iterator(*this);
  9095. }
  9096. virtual const T* Current() const { return &value_; }
  9097. virtual bool Equals(const ParamIteratorInterface<T>& other) const {
  9098. // Having the same base generator guarantees that the other
  9099. // iterator is of the same type and we can downcast.
  9100. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  9101. << "The program attempted to compare iterators "
  9102. << "from different generators." << std::endl;
  9103. const int other_index =
  9104. CheckedDowncastToActualType<const Iterator>(&other)->index_;
  9105. return index_ == other_index;
  9106. }
  9107. private:
  9108. Iterator(const Iterator& other)
  9109. : ParamIteratorInterface<T>(),
  9110. base_(other.base_), value_(other.value_), index_(other.index_),
  9111. step_(other.step_) {}
  9112. // No implementation - assignment is unsupported.
  9113. void operator=(const Iterator& other);
  9114. const ParamGeneratorInterface<T>* const base_;
  9115. T value_;
  9116. int index_;
  9117. const IncrementT step_;
  9118. }; // class RangeGenerator::Iterator
  9119. static int CalculateEndIndex(const T& begin,
  9120. const T& end,
  9121. const IncrementT& step) {
  9122. int end_index = 0;
  9123. for (T i = begin; i < end; i = i + step)
  9124. end_index++;
  9125. return end_index;
  9126. }
  9127. // No implementation - assignment is unsupported.
  9128. void operator=(const RangeGenerator& other);
  9129. const T begin_;
  9130. const T end_;
  9131. const IncrementT step_;
  9132. // The index for the end() iterator. All the elements in the generated
  9133. // sequence are indexed (0-based) to aid iterator comparison.
  9134. const int end_index_;
  9135. }; // class RangeGenerator
  9136. // Generates values from a pair of STL-style iterators. Used in the
  9137. // ValuesIn() function. The elements are copied from the source range
  9138. // since the source can be located on the stack, and the generator
  9139. // is likely to persist beyond that stack frame.
  9140. template <typename T>
  9141. class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
  9142. public:
  9143. template <typename ForwardIterator>
  9144. ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
  9145. : container_(begin, end) {}
  9146. virtual ~ValuesInIteratorRangeGenerator() {}
  9147. virtual ParamIteratorInterface<T>* Begin() const {
  9148. return new Iterator(this, container_.begin());
  9149. }
  9150. virtual ParamIteratorInterface<T>* End() const {
  9151. return new Iterator(this, container_.end());
  9152. }
  9153. private:
  9154. typedef typename ::std::vector<T> ContainerType;
  9155. class Iterator : public ParamIteratorInterface<T> {
  9156. public:
  9157. Iterator(const ParamGeneratorInterface<T>* base,
  9158. typename ContainerType::const_iterator iterator)
  9159. : base_(base), iterator_(iterator) {}
  9160. virtual ~Iterator() {}
  9161. virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
  9162. return base_;
  9163. }
  9164. virtual void Advance() {
  9165. ++iterator_;
  9166. value_.reset();
  9167. }
  9168. virtual ParamIteratorInterface<T>* Clone() const {
  9169. return new Iterator(*this);
  9170. }
  9171. // We need to use cached value referenced by iterator_ because *iterator_
  9172. // can return a temporary object (and of type other then T), so just
  9173. // having "return &*iterator_;" doesn't work.
  9174. // value_ is updated here and not in Advance() because Advance()
  9175. // can advance iterator_ beyond the end of the range, and we cannot
  9176. // detect that fact. The client code, on the other hand, is
  9177. // responsible for not calling Current() on an out-of-range iterator.
  9178. virtual const T* Current() const {
  9179. if (value_.get() == NULL)
  9180. value_.reset(new T(*iterator_));
  9181. return value_.get();
  9182. }
  9183. virtual bool Equals(const ParamIteratorInterface<T>& other) const {
  9184. // Having the same base generator guarantees that the other
  9185. // iterator is of the same type and we can downcast.
  9186. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  9187. << "The program attempted to compare iterators "
  9188. << "from different generators." << std::endl;
  9189. return iterator_ ==
  9190. CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
  9191. }
  9192. private:
  9193. Iterator(const Iterator& other)
  9194. // The explicit constructor call suppresses a false warning
  9195. // emitted by gcc when supplied with the -Wextra option.
  9196. : ParamIteratorInterface<T>(),
  9197. base_(other.base_),
  9198. iterator_(other.iterator_) {}
  9199. const ParamGeneratorInterface<T>* const base_;
  9200. typename ContainerType::const_iterator iterator_;
  9201. // A cached value of *iterator_. We keep it here to allow access by
  9202. // pointer in the wrapping iterator's operator->().
  9203. // value_ needs to be mutable to be accessed in Current().
  9204. // Use of scoped_ptr helps manage cached value's lifetime,
  9205. // which is bound by the lifespan of the iterator itself.
  9206. mutable scoped_ptr<const T> value_;
  9207. }; // class ValuesInIteratorRangeGenerator::Iterator
  9208. // No implementation - assignment is unsupported.
  9209. void operator=(const ValuesInIteratorRangeGenerator& other);
  9210. const ContainerType container_;
  9211. }; // class ValuesInIteratorRangeGenerator
  9212. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9213. //
  9214. // Stores a parameter value and later creates tests parameterized with that
  9215. // value.
  9216. template <class TestClass>
  9217. class ParameterizedTestFactory : public TestFactoryBase {
  9218. public:
  9219. typedef typename TestClass::ParamType ParamType;
  9220. explicit ParameterizedTestFactory(ParamType parameter) :
  9221. parameter_(parameter) {}
  9222. virtual Test* CreateTest() {
  9223. TestClass::SetParam(&parameter_);
  9224. return new TestClass();
  9225. }
  9226. private:
  9227. const ParamType parameter_;
  9228. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
  9229. };
  9230. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9231. //
  9232. // TestMetaFactoryBase is a base class for meta-factories that create
  9233. // test factories for passing into MakeAndRegisterTestInfo function.
  9234. template <class ParamType>
  9235. class TestMetaFactoryBase {
  9236. public:
  9237. virtual ~TestMetaFactoryBase() {}
  9238. virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
  9239. };
  9240. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9241. //
  9242. // TestMetaFactory creates test factories for passing into
  9243. // MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
  9244. // ownership of test factory pointer, same factory object cannot be passed
  9245. // into that method twice. But ParameterizedTestCaseInfo is going to call
  9246. // it for each Test/Parameter value combination. Thus it needs meta factory
  9247. // creator class.
  9248. template <class TestCase>
  9249. class TestMetaFactory
  9250. : public TestMetaFactoryBase<typename TestCase::ParamType> {
  9251. public:
  9252. typedef typename TestCase::ParamType ParamType;
  9253. TestMetaFactory() {}
  9254. virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
  9255. return new ParameterizedTestFactory<TestCase>(parameter);
  9256. }
  9257. private:
  9258. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
  9259. };
  9260. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9261. //
  9262. // ParameterizedTestCaseInfoBase is a generic interface
  9263. // to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
  9264. // accumulates test information provided by TEST_P macro invocations
  9265. // and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
  9266. // and uses that information to register all resulting test instances
  9267. // in RegisterTests method. The ParameterizeTestCaseRegistry class holds
  9268. // a collection of pointers to the ParameterizedTestCaseInfo objects
  9269. // and calls RegisterTests() on each of them when asked.
  9270. class ParameterizedTestCaseInfoBase {
  9271. public:
  9272. virtual ~ParameterizedTestCaseInfoBase() {}
  9273. // Base part of test case name for display purposes.
  9274. virtual const string& GetTestCaseName() const = 0;
  9275. // Test case id to verify identity.
  9276. virtual TypeId GetTestCaseTypeId() const = 0;
  9277. // UnitTest class invokes this method to register tests in this
  9278. // test case right before running them in RUN_ALL_TESTS macro.
  9279. // This method should not be called more then once on any single
  9280. // instance of a ParameterizedTestCaseInfoBase derived class.
  9281. virtual void RegisterTests() = 0;
  9282. protected:
  9283. ParameterizedTestCaseInfoBase() {}
  9284. private:
  9285. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
  9286. };
  9287. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9288. //
  9289. // ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
  9290. // macro invocations for a particular test case and generators
  9291. // obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
  9292. // test case. It registers tests with all values generated by all
  9293. // generators when asked.
  9294. template <class TestCase>
  9295. class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
  9296. public:
  9297. // ParamType and GeneratorCreationFunc are private types but are required
  9298. // for declarations of public methods AddTestPattern() and
  9299. // AddTestCaseInstantiation().
  9300. typedef typename TestCase::ParamType ParamType;
  9301. // A function that returns an instance of appropriate generator type.
  9302. typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
  9303. explicit ParameterizedTestCaseInfo(const char* name)
  9304. : test_case_name_(name) {}
  9305. // Test case base name for display purposes.
  9306. virtual const string& GetTestCaseName() const { return test_case_name_; }
  9307. // Test case id to verify identity.
  9308. virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
  9309. // TEST_P macro uses AddTestPattern() to record information
  9310. // about a single test in a LocalTestInfo structure.
  9311. // test_case_name is the base name of the test case (without invocation
  9312. // prefix). test_base_name is the name of an individual test without
  9313. // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
  9314. // test case base name and DoBar is test base name.
  9315. void AddTestPattern(const char* test_case_name,
  9316. const char* test_base_name,
  9317. TestMetaFactoryBase<ParamType>* meta_factory) {
  9318. tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
  9319. test_base_name,
  9320. meta_factory)));
  9321. }
  9322. // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
  9323. // about a generator.
  9324. int AddTestCaseInstantiation(const string& instantiation_name,
  9325. GeneratorCreationFunc* func,
  9326. const char* /* file */,
  9327. int /* line */) {
  9328. instantiations_.push_back(::std::make_pair(instantiation_name, func));
  9329. return 0; // Return value used only to run this method in namespace scope.
  9330. }
  9331. // UnitTest class invokes this method to register tests in this test case
  9332. // test cases right before running tests in RUN_ALL_TESTS macro.
  9333. // This method should not be called more then once on any single
  9334. // instance of a ParameterizedTestCaseInfoBase derived class.
  9335. // UnitTest has a guard to prevent from calling this method more then once.
  9336. virtual void RegisterTests() {
  9337. for (typename TestInfoContainer::iterator test_it = tests_.begin();
  9338. test_it != tests_.end(); ++test_it) {
  9339. linked_ptr<TestInfo> test_info = *test_it;
  9340. for (typename InstantiationContainer::iterator gen_it =
  9341. instantiations_.begin(); gen_it != instantiations_.end();
  9342. ++gen_it) {
  9343. const string& instantiation_name = gen_it->first;
  9344. ParamGenerator<ParamType> generator((*gen_it->second)());
  9345. Message test_case_name_stream;
  9346. if ( !instantiation_name.empty() )
  9347. test_case_name_stream << instantiation_name << "/";
  9348. test_case_name_stream << test_info->test_case_base_name;
  9349. int i = 0;
  9350. for (typename ParamGenerator<ParamType>::iterator param_it =
  9351. generator.begin();
  9352. param_it != generator.end(); ++param_it, ++i) {
  9353. Message test_name_stream;
  9354. test_name_stream << test_info->test_base_name << "/" << i;
  9355. MakeAndRegisterTestInfo(
  9356. test_case_name_stream.GetString().c_str(),
  9357. test_name_stream.GetString().c_str(),
  9358. NULL, // No type parameter.
  9359. PrintToString(*param_it).c_str(),
  9360. GetTestCaseTypeId(),
  9361. TestCase::SetUpTestCase,
  9362. TestCase::TearDownTestCase,
  9363. test_info->test_meta_factory->CreateTestFactory(*param_it));
  9364. } // for param_it
  9365. } // for gen_it
  9366. } // for test_it
  9367. } // RegisterTests
  9368. private:
  9369. // LocalTestInfo structure keeps information about a single test registered
  9370. // with TEST_P macro.
  9371. struct TestInfo {
  9372. TestInfo(const char* a_test_case_base_name,
  9373. const char* a_test_base_name,
  9374. TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
  9375. test_case_base_name(a_test_case_base_name),
  9376. test_base_name(a_test_base_name),
  9377. test_meta_factory(a_test_meta_factory) {}
  9378. const string test_case_base_name;
  9379. const string test_base_name;
  9380. const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
  9381. };
  9382. typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
  9383. // Keeps pairs of <Instantiation name, Sequence generator creation function>
  9384. // received from INSTANTIATE_TEST_CASE_P macros.
  9385. typedef ::std::vector<std::pair<string, GeneratorCreationFunc*> >
  9386. InstantiationContainer;
  9387. const string test_case_name_;
  9388. TestInfoContainer tests_;
  9389. InstantiationContainer instantiations_;
  9390. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
  9391. }; // class ParameterizedTestCaseInfo
  9392. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  9393. //
  9394. // ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
  9395. // classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
  9396. // macros use it to locate their corresponding ParameterizedTestCaseInfo
  9397. // descriptors.
  9398. class ParameterizedTestCaseRegistry {
  9399. public:
  9400. ParameterizedTestCaseRegistry() {}
  9401. ~ParameterizedTestCaseRegistry() {
  9402. for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
  9403. it != test_case_infos_.end(); ++it) {
  9404. delete *it;
  9405. }
  9406. }
  9407. // Looks up or creates and returns a structure containing information about
  9408. // tests and instantiations of a particular test case.
  9409. template <class TestCase>
  9410. ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
  9411. const char* test_case_name,
  9412. const char* file,
  9413. int line) {
  9414. ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
  9415. for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
  9416. it != test_case_infos_.end(); ++it) {
  9417. if ((*it)->GetTestCaseName() == test_case_name) {
  9418. if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
  9419. // Complain about incorrect usage of Google Test facilities
  9420. // and terminate the program since we cannot guaranty correct
  9421. // test case setup and tear-down in this case.
  9422. ReportInvalidTestCaseType(test_case_name, file, line);
  9423. posix::Abort();
  9424. } else {
  9425. // At this point we are sure that the object we found is of the same
  9426. // type we are looking for, so we downcast it to that type
  9427. // without further checks.
  9428. typed_test_info = CheckedDowncastToActualType<
  9429. ParameterizedTestCaseInfo<TestCase> >(*it);
  9430. }
  9431. break;
  9432. }
  9433. }
  9434. if (typed_test_info == NULL) {
  9435. typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name);
  9436. test_case_infos_.push_back(typed_test_info);
  9437. }
  9438. return typed_test_info;
  9439. }
  9440. void RegisterTests() {
  9441. for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
  9442. it != test_case_infos_.end(); ++it) {
  9443. (*it)->RegisterTests();
  9444. }
  9445. }
  9446. private:
  9447. typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
  9448. TestCaseInfoContainer test_case_infos_;
  9449. GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
  9450. };
  9451. } // namespace internal
  9452. } // namespace testing
  9453. #endif // GTEST_HAS_PARAM_TEST
  9454. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
  9455. // This file was GENERATED by command:
  9456. // pump.py gtest-param-util-generated.h.pump
  9457. // DO NOT EDIT BY HAND!!!
  9458. // Copyright 2008 Google Inc.
  9459. // All Rights Reserved.
  9460. //
  9461. // Redistribution and use in source and binary forms, with or without
  9462. // modification, are permitted provided that the following conditions are
  9463. // met:
  9464. //
  9465. // * Redistributions of source code must retain the above copyright
  9466. // notice, this list of conditions and the following disclaimer.
  9467. // * Redistributions in binary form must reproduce the above
  9468. // copyright notice, this list of conditions and the following disclaimer
  9469. // in the documentation and/or other materials provided with the
  9470. // distribution.
  9471. // * Neither the name of Google Inc. nor the names of its
  9472. // contributors may be used to endorse or promote products derived from
  9473. // this software without specific prior written permission.
  9474. //
  9475. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  9476. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  9477. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  9478. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  9479. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  9480. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  9481. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  9482. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  9483. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  9484. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  9485. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  9486. //
  9487. // Author: vladl@google.com (Vlad Losev)
  9488. // Type and function utilities for implementing parameterized tests.
  9489. // This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
  9490. //
  9491. // Currently Google Test supports at most 50 arguments in Values,
  9492. // and at most 10 arguments in Combine. Please contact
  9493. // googletestframework@googlegroups.com if you need more.
  9494. // Please note that the number of arguments to Combine is limited
  9495. // by the maximum arity of the implementation of tr1::tuple which is
  9496. // currently set at 10.
  9497. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
  9498. #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
  9499. // scripts/fuse_gtest.py depends on gtest's own header being #included
  9500. // *unconditionally*. Therefore these #includes cannot be moved
  9501. // inside #if GTEST_HAS_PARAM_TEST.
  9502. #if GTEST_HAS_PARAM_TEST
  9503. namespace testing {
  9504. // Forward declarations of ValuesIn(), which is implemented in
  9505. // include/gtest/gtest-param-test.h.
  9506. template <typename ForwardIterator>
  9507. internal::ParamGenerator<
  9508. typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
  9509. ValuesIn(ForwardIterator begin, ForwardIterator end);
  9510. template <typename T, size_t N>
  9511. internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
  9512. template <class Container>
  9513. internal::ParamGenerator<typename Container::value_type> ValuesIn(
  9514. const Container& container);
  9515. namespace internal {
  9516. // Used in the Values() function to provide polymorphic capabilities.
  9517. template <typename T1>
  9518. class ValueArray1 {
  9519. public:
  9520. explicit ValueArray1(T1 v1) : v1_(v1) {}
  9521. template <typename T>
  9522. operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }
  9523. private:
  9524. // No implementation - assignment is unsupported.
  9525. void operator=(const ValueArray1& other);
  9526. const T1 v1_;
  9527. };
  9528. template <typename T1, typename T2>
  9529. class ValueArray2 {
  9530. public:
  9531. ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
  9532. template <typename T>
  9533. operator ParamGenerator<T>() const {
  9534. const T array[] = {v1_, v2_};
  9535. return ValuesIn(array);
  9536. }
  9537. private:
  9538. // No implementation - assignment is unsupported.
  9539. void operator=(const ValueArray2& other);
  9540. const T1 v1_;
  9541. const T2 v2_;
  9542. };
  9543. template <typename T1, typename T2, typename T3>
  9544. class ValueArray3 {
  9545. public:
  9546. ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
  9547. template <typename T>
  9548. operator ParamGenerator<T>() const {
  9549. const T array[] = {v1_, v2_, v3_};
  9550. return ValuesIn(array);
  9551. }
  9552. private:
  9553. // No implementation - assignment is unsupported.
  9554. void operator=(const ValueArray3& other);
  9555. const T1 v1_;
  9556. const T2 v2_;
  9557. const T3 v3_;
  9558. };
  9559. template <typename T1, typename T2, typename T3, typename T4>
  9560. class ValueArray4 {
  9561. public:
  9562. ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
  9563. v4_(v4) {}
  9564. template <typename T>
  9565. operator ParamGenerator<T>() const {
  9566. const T array[] = {v1_, v2_, v3_, v4_};
  9567. return ValuesIn(array);
  9568. }
  9569. private:
  9570. // No implementation - assignment is unsupported.
  9571. void operator=(const ValueArray4& other);
  9572. const T1 v1_;
  9573. const T2 v2_;
  9574. const T3 v3_;
  9575. const T4 v4_;
  9576. };
  9577. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  9578. class ValueArray5 {
  9579. public:
  9580. ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
  9581. v4_(v4), v5_(v5) {}
  9582. template <typename T>
  9583. operator ParamGenerator<T>() const {
  9584. const T array[] = {v1_, v2_, v3_, v4_, v5_};
  9585. return ValuesIn(array);
  9586. }
  9587. private:
  9588. // No implementation - assignment is unsupported.
  9589. void operator=(const ValueArray5& other);
  9590. const T1 v1_;
  9591. const T2 v2_;
  9592. const T3 v3_;
  9593. const T4 v4_;
  9594. const T5 v5_;
  9595. };
  9596. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9597. typename T6>
  9598. class ValueArray6 {
  9599. public:
  9600. ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
  9601. v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
  9602. template <typename T>
  9603. operator ParamGenerator<T>() const {
  9604. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_};
  9605. return ValuesIn(array);
  9606. }
  9607. private:
  9608. // No implementation - assignment is unsupported.
  9609. void operator=(const ValueArray6& other);
  9610. const T1 v1_;
  9611. const T2 v2_;
  9612. const T3 v3_;
  9613. const T4 v4_;
  9614. const T5 v5_;
  9615. const T6 v6_;
  9616. };
  9617. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9618. typename T6, typename T7>
  9619. class ValueArray7 {
  9620. public:
  9621. ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
  9622. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
  9623. template <typename T>
  9624. operator ParamGenerator<T>() const {
  9625. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_};
  9626. return ValuesIn(array);
  9627. }
  9628. private:
  9629. // No implementation - assignment is unsupported.
  9630. void operator=(const ValueArray7& other);
  9631. const T1 v1_;
  9632. const T2 v2_;
  9633. const T3 v3_;
  9634. const T4 v4_;
  9635. const T5 v5_;
  9636. const T6 v6_;
  9637. const T7 v7_;
  9638. };
  9639. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9640. typename T6, typename T7, typename T8>
  9641. class ValueArray8 {
  9642. public:
  9643. ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  9644. T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  9645. v8_(v8) {}
  9646. template <typename T>
  9647. operator ParamGenerator<T>() const {
  9648. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_};
  9649. return ValuesIn(array);
  9650. }
  9651. private:
  9652. // No implementation - assignment is unsupported.
  9653. void operator=(const ValueArray8& other);
  9654. const T1 v1_;
  9655. const T2 v2_;
  9656. const T3 v3_;
  9657. const T4 v4_;
  9658. const T5 v5_;
  9659. const T6 v6_;
  9660. const T7 v7_;
  9661. const T8 v8_;
  9662. };
  9663. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9664. typename T6, typename T7, typename T8, typename T9>
  9665. class ValueArray9 {
  9666. public:
  9667. ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  9668. T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  9669. v8_(v8), v9_(v9) {}
  9670. template <typename T>
  9671. operator ParamGenerator<T>() const {
  9672. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_};
  9673. return ValuesIn(array);
  9674. }
  9675. private:
  9676. // No implementation - assignment is unsupported.
  9677. void operator=(const ValueArray9& other);
  9678. const T1 v1_;
  9679. const T2 v2_;
  9680. const T3 v3_;
  9681. const T4 v4_;
  9682. const T5 v5_;
  9683. const T6 v6_;
  9684. const T7 v7_;
  9685. const T8 v8_;
  9686. const T9 v9_;
  9687. };
  9688. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9689. typename T6, typename T7, typename T8, typename T9, typename T10>
  9690. class ValueArray10 {
  9691. public:
  9692. ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9693. T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  9694. v8_(v8), v9_(v9), v10_(v10) {}
  9695. template <typename T>
  9696. operator ParamGenerator<T>() const {
  9697. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_};
  9698. return ValuesIn(array);
  9699. }
  9700. private:
  9701. // No implementation - assignment is unsupported.
  9702. void operator=(const ValueArray10& other);
  9703. const T1 v1_;
  9704. const T2 v2_;
  9705. const T3 v3_;
  9706. const T4 v4_;
  9707. const T5 v5_;
  9708. const T6 v6_;
  9709. const T7 v7_;
  9710. const T8 v8_;
  9711. const T9 v9_;
  9712. const T10 v10_;
  9713. };
  9714. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9715. typename T6, typename T7, typename T8, typename T9, typename T10,
  9716. typename T11>
  9717. class ValueArray11 {
  9718. public:
  9719. ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9720. T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  9721. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
  9722. template <typename T>
  9723. operator ParamGenerator<T>() const {
  9724. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_};
  9725. return ValuesIn(array);
  9726. }
  9727. private:
  9728. // No implementation - assignment is unsupported.
  9729. void operator=(const ValueArray11& other);
  9730. const T1 v1_;
  9731. const T2 v2_;
  9732. const T3 v3_;
  9733. const T4 v4_;
  9734. const T5 v5_;
  9735. const T6 v6_;
  9736. const T7 v7_;
  9737. const T8 v8_;
  9738. const T9 v9_;
  9739. const T10 v10_;
  9740. const T11 v11_;
  9741. };
  9742. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9743. typename T6, typename T7, typename T8, typename T9, typename T10,
  9744. typename T11, typename T12>
  9745. class ValueArray12 {
  9746. public:
  9747. ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9748. T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  9749. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
  9750. template <typename T>
  9751. operator ParamGenerator<T>() const {
  9752. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9753. v12_};
  9754. return ValuesIn(array);
  9755. }
  9756. private:
  9757. // No implementation - assignment is unsupported.
  9758. void operator=(const ValueArray12& other);
  9759. const T1 v1_;
  9760. const T2 v2_;
  9761. const T3 v3_;
  9762. const T4 v4_;
  9763. const T5 v5_;
  9764. const T6 v6_;
  9765. const T7 v7_;
  9766. const T8 v8_;
  9767. const T9 v9_;
  9768. const T10 v10_;
  9769. const T11 v11_;
  9770. const T12 v12_;
  9771. };
  9772. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9773. typename T6, typename T7, typename T8, typename T9, typename T10,
  9774. typename T11, typename T12, typename T13>
  9775. class ValueArray13 {
  9776. public:
  9777. ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9778. T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  9779. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  9780. v12_(v12), v13_(v13) {}
  9781. template <typename T>
  9782. operator ParamGenerator<T>() const {
  9783. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9784. v12_, v13_};
  9785. return ValuesIn(array);
  9786. }
  9787. private:
  9788. // No implementation - assignment is unsupported.
  9789. void operator=(const ValueArray13& other);
  9790. const T1 v1_;
  9791. const T2 v2_;
  9792. const T3 v3_;
  9793. const T4 v4_;
  9794. const T5 v5_;
  9795. const T6 v6_;
  9796. const T7 v7_;
  9797. const T8 v8_;
  9798. const T9 v9_;
  9799. const T10 v10_;
  9800. const T11 v11_;
  9801. const T12 v12_;
  9802. const T13 v13_;
  9803. };
  9804. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9805. typename T6, typename T7, typename T8, typename T9, typename T10,
  9806. typename T11, typename T12, typename T13, typename T14>
  9807. class ValueArray14 {
  9808. public:
  9809. ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9810. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
  9811. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  9812. v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
  9813. template <typename T>
  9814. operator ParamGenerator<T>() const {
  9815. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9816. v12_, v13_, v14_};
  9817. return ValuesIn(array);
  9818. }
  9819. private:
  9820. // No implementation - assignment is unsupported.
  9821. void operator=(const ValueArray14& other);
  9822. const T1 v1_;
  9823. const T2 v2_;
  9824. const T3 v3_;
  9825. const T4 v4_;
  9826. const T5 v5_;
  9827. const T6 v6_;
  9828. const T7 v7_;
  9829. const T8 v8_;
  9830. const T9 v9_;
  9831. const T10 v10_;
  9832. const T11 v11_;
  9833. const T12 v12_;
  9834. const T13 v13_;
  9835. const T14 v14_;
  9836. };
  9837. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9838. typename T6, typename T7, typename T8, typename T9, typename T10,
  9839. typename T11, typename T12, typename T13, typename T14, typename T15>
  9840. class ValueArray15 {
  9841. public:
  9842. ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9843. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
  9844. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  9845. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
  9846. template <typename T>
  9847. operator ParamGenerator<T>() const {
  9848. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9849. v12_, v13_, v14_, v15_};
  9850. return ValuesIn(array);
  9851. }
  9852. private:
  9853. // No implementation - assignment is unsupported.
  9854. void operator=(const ValueArray15& other);
  9855. const T1 v1_;
  9856. const T2 v2_;
  9857. const T3 v3_;
  9858. const T4 v4_;
  9859. const T5 v5_;
  9860. const T6 v6_;
  9861. const T7 v7_;
  9862. const T8 v8_;
  9863. const T9 v9_;
  9864. const T10 v10_;
  9865. const T11 v11_;
  9866. const T12 v12_;
  9867. const T13 v13_;
  9868. const T14 v14_;
  9869. const T15 v15_;
  9870. };
  9871. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9872. typename T6, typename T7, typename T8, typename T9, typename T10,
  9873. typename T11, typename T12, typename T13, typename T14, typename T15,
  9874. typename T16>
  9875. class ValueArray16 {
  9876. public:
  9877. ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9878. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
  9879. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  9880. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  9881. v16_(v16) {}
  9882. template <typename T>
  9883. operator ParamGenerator<T>() const {
  9884. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9885. v12_, v13_, v14_, v15_, v16_};
  9886. return ValuesIn(array);
  9887. }
  9888. private:
  9889. // No implementation - assignment is unsupported.
  9890. void operator=(const ValueArray16& other);
  9891. const T1 v1_;
  9892. const T2 v2_;
  9893. const T3 v3_;
  9894. const T4 v4_;
  9895. const T5 v5_;
  9896. const T6 v6_;
  9897. const T7 v7_;
  9898. const T8 v8_;
  9899. const T9 v9_;
  9900. const T10 v10_;
  9901. const T11 v11_;
  9902. const T12 v12_;
  9903. const T13 v13_;
  9904. const T14 v14_;
  9905. const T15 v15_;
  9906. const T16 v16_;
  9907. };
  9908. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9909. typename T6, typename T7, typename T8, typename T9, typename T10,
  9910. typename T11, typename T12, typename T13, typename T14, typename T15,
  9911. typename T16, typename T17>
  9912. class ValueArray17 {
  9913. public:
  9914. ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9915. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
  9916. T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  9917. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  9918. v15_(v15), v16_(v16), v17_(v17) {}
  9919. template <typename T>
  9920. operator ParamGenerator<T>() const {
  9921. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9922. v12_, v13_, v14_, v15_, v16_, v17_};
  9923. return ValuesIn(array);
  9924. }
  9925. private:
  9926. // No implementation - assignment is unsupported.
  9927. void operator=(const ValueArray17& other);
  9928. const T1 v1_;
  9929. const T2 v2_;
  9930. const T3 v3_;
  9931. const T4 v4_;
  9932. const T5 v5_;
  9933. const T6 v6_;
  9934. const T7 v7_;
  9935. const T8 v8_;
  9936. const T9 v9_;
  9937. const T10 v10_;
  9938. const T11 v11_;
  9939. const T12 v12_;
  9940. const T13 v13_;
  9941. const T14 v14_;
  9942. const T15 v15_;
  9943. const T16 v16_;
  9944. const T17 v17_;
  9945. };
  9946. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9947. typename T6, typename T7, typename T8, typename T9, typename T10,
  9948. typename T11, typename T12, typename T13, typename T14, typename T15,
  9949. typename T16, typename T17, typename T18>
  9950. class ValueArray18 {
  9951. public:
  9952. ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9953. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  9954. T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  9955. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  9956. v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
  9957. template <typename T>
  9958. operator ParamGenerator<T>() const {
  9959. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9960. v12_, v13_, v14_, v15_, v16_, v17_, v18_};
  9961. return ValuesIn(array);
  9962. }
  9963. private:
  9964. // No implementation - assignment is unsupported.
  9965. void operator=(const ValueArray18& other);
  9966. const T1 v1_;
  9967. const T2 v2_;
  9968. const T3 v3_;
  9969. const T4 v4_;
  9970. const T5 v5_;
  9971. const T6 v6_;
  9972. const T7 v7_;
  9973. const T8 v8_;
  9974. const T9 v9_;
  9975. const T10 v10_;
  9976. const T11 v11_;
  9977. const T12 v12_;
  9978. const T13 v13_;
  9979. const T14 v14_;
  9980. const T15 v15_;
  9981. const T16 v16_;
  9982. const T17 v17_;
  9983. const T18 v18_;
  9984. };
  9985. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  9986. typename T6, typename T7, typename T8, typename T9, typename T10,
  9987. typename T11, typename T12, typename T13, typename T14, typename T15,
  9988. typename T16, typename T17, typename T18, typename T19>
  9989. class ValueArray19 {
  9990. public:
  9991. ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  9992. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  9993. T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  9994. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  9995. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
  9996. template <typename T>
  9997. operator ParamGenerator<T>() const {
  9998. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  9999. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_};
  10000. return ValuesIn(array);
  10001. }
  10002. private:
  10003. // No implementation - assignment is unsupported.
  10004. void operator=(const ValueArray19& other);
  10005. const T1 v1_;
  10006. const T2 v2_;
  10007. const T3 v3_;
  10008. const T4 v4_;
  10009. const T5 v5_;
  10010. const T6 v6_;
  10011. const T7 v7_;
  10012. const T8 v8_;
  10013. const T9 v9_;
  10014. const T10 v10_;
  10015. const T11 v11_;
  10016. const T12 v12_;
  10017. const T13 v13_;
  10018. const T14 v14_;
  10019. const T15 v15_;
  10020. const T16 v16_;
  10021. const T17 v17_;
  10022. const T18 v18_;
  10023. const T19 v19_;
  10024. };
  10025. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10026. typename T6, typename T7, typename T8, typename T9, typename T10,
  10027. typename T11, typename T12, typename T13, typename T14, typename T15,
  10028. typename T16, typename T17, typename T18, typename T19, typename T20>
  10029. class ValueArray20 {
  10030. public:
  10031. ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10032. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10033. T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  10034. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  10035. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  10036. v19_(v19), v20_(v20) {}
  10037. template <typename T>
  10038. operator ParamGenerator<T>() const {
  10039. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10040. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_};
  10041. return ValuesIn(array);
  10042. }
  10043. private:
  10044. // No implementation - assignment is unsupported.
  10045. void operator=(const ValueArray20& other);
  10046. const T1 v1_;
  10047. const T2 v2_;
  10048. const T3 v3_;
  10049. const T4 v4_;
  10050. const T5 v5_;
  10051. const T6 v6_;
  10052. const T7 v7_;
  10053. const T8 v8_;
  10054. const T9 v9_;
  10055. const T10 v10_;
  10056. const T11 v11_;
  10057. const T12 v12_;
  10058. const T13 v13_;
  10059. const T14 v14_;
  10060. const T15 v15_;
  10061. const T16 v16_;
  10062. const T17 v17_;
  10063. const T18 v18_;
  10064. const T19 v19_;
  10065. const T20 v20_;
  10066. };
  10067. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10068. typename T6, typename T7, typename T8, typename T9, typename T10,
  10069. typename T11, typename T12, typename T13, typename T14, typename T15,
  10070. typename T16, typename T17, typename T18, typename T19, typename T20,
  10071. typename T21>
  10072. class ValueArray21 {
  10073. public:
  10074. ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10075. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10076. T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  10077. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  10078. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  10079. v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
  10080. template <typename T>
  10081. operator ParamGenerator<T>() const {
  10082. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10083. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_};
  10084. return ValuesIn(array);
  10085. }
  10086. private:
  10087. // No implementation - assignment is unsupported.
  10088. void operator=(const ValueArray21& other);
  10089. const T1 v1_;
  10090. const T2 v2_;
  10091. const T3 v3_;
  10092. const T4 v4_;
  10093. const T5 v5_;
  10094. const T6 v6_;
  10095. const T7 v7_;
  10096. const T8 v8_;
  10097. const T9 v9_;
  10098. const T10 v10_;
  10099. const T11 v11_;
  10100. const T12 v12_;
  10101. const T13 v13_;
  10102. const T14 v14_;
  10103. const T15 v15_;
  10104. const T16 v16_;
  10105. const T17 v17_;
  10106. const T18 v18_;
  10107. const T19 v19_;
  10108. const T20 v20_;
  10109. const T21 v21_;
  10110. };
  10111. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10112. typename T6, typename T7, typename T8, typename T9, typename T10,
  10113. typename T11, typename T12, typename T13, typename T14, typename T15,
  10114. typename T16, typename T17, typename T18, typename T19, typename T20,
  10115. typename T21, typename T22>
  10116. class ValueArray22 {
  10117. public:
  10118. ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10119. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10120. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
  10121. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  10122. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  10123. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
  10124. template <typename T>
  10125. operator ParamGenerator<T>() const {
  10126. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10127. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_};
  10128. return ValuesIn(array);
  10129. }
  10130. private:
  10131. // No implementation - assignment is unsupported.
  10132. void operator=(const ValueArray22& other);
  10133. const T1 v1_;
  10134. const T2 v2_;
  10135. const T3 v3_;
  10136. const T4 v4_;
  10137. const T5 v5_;
  10138. const T6 v6_;
  10139. const T7 v7_;
  10140. const T8 v8_;
  10141. const T9 v9_;
  10142. const T10 v10_;
  10143. const T11 v11_;
  10144. const T12 v12_;
  10145. const T13 v13_;
  10146. const T14 v14_;
  10147. const T15 v15_;
  10148. const T16 v16_;
  10149. const T17 v17_;
  10150. const T18 v18_;
  10151. const T19 v19_;
  10152. const T20 v20_;
  10153. const T21 v21_;
  10154. const T22 v22_;
  10155. };
  10156. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10157. typename T6, typename T7, typename T8, typename T9, typename T10,
  10158. typename T11, typename T12, typename T13, typename T14, typename T15,
  10159. typename T16, typename T17, typename T18, typename T19, typename T20,
  10160. typename T21, typename T22, typename T23>
  10161. class ValueArray23 {
  10162. public:
  10163. ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10164. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10165. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
  10166. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  10167. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  10168. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  10169. v23_(v23) {}
  10170. template <typename T>
  10171. operator ParamGenerator<T>() const {
  10172. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10173. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_,
  10174. v23_};
  10175. return ValuesIn(array);
  10176. }
  10177. private:
  10178. // No implementation - assignment is unsupported.
  10179. void operator=(const ValueArray23& other);
  10180. const T1 v1_;
  10181. const T2 v2_;
  10182. const T3 v3_;
  10183. const T4 v4_;
  10184. const T5 v5_;
  10185. const T6 v6_;
  10186. const T7 v7_;
  10187. const T8 v8_;
  10188. const T9 v9_;
  10189. const T10 v10_;
  10190. const T11 v11_;
  10191. const T12 v12_;
  10192. const T13 v13_;
  10193. const T14 v14_;
  10194. const T15 v15_;
  10195. const T16 v16_;
  10196. const T17 v17_;
  10197. const T18 v18_;
  10198. const T19 v19_;
  10199. const T20 v20_;
  10200. const T21 v21_;
  10201. const T22 v22_;
  10202. const T23 v23_;
  10203. };
  10204. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10205. typename T6, typename T7, typename T8, typename T9, typename T10,
  10206. typename T11, typename T12, typename T13, typename T14, typename T15,
  10207. typename T16, typename T17, typename T18, typename T19, typename T20,
  10208. typename T21, typename T22, typename T23, typename T24>
  10209. class ValueArray24 {
  10210. public:
  10211. ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10212. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10213. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
  10214. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  10215. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  10216. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  10217. v22_(v22), v23_(v23), v24_(v24) {}
  10218. template <typename T>
  10219. operator ParamGenerator<T>() const {
  10220. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10221. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10222. v24_};
  10223. return ValuesIn(array);
  10224. }
  10225. private:
  10226. // No implementation - assignment is unsupported.
  10227. void operator=(const ValueArray24& other);
  10228. const T1 v1_;
  10229. const T2 v2_;
  10230. const T3 v3_;
  10231. const T4 v4_;
  10232. const T5 v5_;
  10233. const T6 v6_;
  10234. const T7 v7_;
  10235. const T8 v8_;
  10236. const T9 v9_;
  10237. const T10 v10_;
  10238. const T11 v11_;
  10239. const T12 v12_;
  10240. const T13 v13_;
  10241. const T14 v14_;
  10242. const T15 v15_;
  10243. const T16 v16_;
  10244. const T17 v17_;
  10245. const T18 v18_;
  10246. const T19 v19_;
  10247. const T20 v20_;
  10248. const T21 v21_;
  10249. const T22 v22_;
  10250. const T23 v23_;
  10251. const T24 v24_;
  10252. };
  10253. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10254. typename T6, typename T7, typename T8, typename T9, typename T10,
  10255. typename T11, typename T12, typename T13, typename T14, typename T15,
  10256. typename T16, typename T17, typename T18, typename T19, typename T20,
  10257. typename T21, typename T22, typename T23, typename T24, typename T25>
  10258. class ValueArray25 {
  10259. public:
  10260. ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10261. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10262. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
  10263. T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  10264. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  10265. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  10266. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
  10267. template <typename T>
  10268. operator ParamGenerator<T>() const {
  10269. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10270. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10271. v24_, v25_};
  10272. return ValuesIn(array);
  10273. }
  10274. private:
  10275. // No implementation - assignment is unsupported.
  10276. void operator=(const ValueArray25& other);
  10277. const T1 v1_;
  10278. const T2 v2_;
  10279. const T3 v3_;
  10280. const T4 v4_;
  10281. const T5 v5_;
  10282. const T6 v6_;
  10283. const T7 v7_;
  10284. const T8 v8_;
  10285. const T9 v9_;
  10286. const T10 v10_;
  10287. const T11 v11_;
  10288. const T12 v12_;
  10289. const T13 v13_;
  10290. const T14 v14_;
  10291. const T15 v15_;
  10292. const T16 v16_;
  10293. const T17 v17_;
  10294. const T18 v18_;
  10295. const T19 v19_;
  10296. const T20 v20_;
  10297. const T21 v21_;
  10298. const T22 v22_;
  10299. const T23 v23_;
  10300. const T24 v24_;
  10301. const T25 v25_;
  10302. };
  10303. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10304. typename T6, typename T7, typename T8, typename T9, typename T10,
  10305. typename T11, typename T12, typename T13, typename T14, typename T15,
  10306. typename T16, typename T17, typename T18, typename T19, typename T20,
  10307. typename T21, typename T22, typename T23, typename T24, typename T25,
  10308. typename T26>
  10309. class ValueArray26 {
  10310. public:
  10311. ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10312. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10313. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10314. T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  10315. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  10316. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  10317. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
  10318. template <typename T>
  10319. operator ParamGenerator<T>() const {
  10320. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10321. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10322. v24_, v25_, v26_};
  10323. return ValuesIn(array);
  10324. }
  10325. private:
  10326. // No implementation - assignment is unsupported.
  10327. void operator=(const ValueArray26& other);
  10328. const T1 v1_;
  10329. const T2 v2_;
  10330. const T3 v3_;
  10331. const T4 v4_;
  10332. const T5 v5_;
  10333. const T6 v6_;
  10334. const T7 v7_;
  10335. const T8 v8_;
  10336. const T9 v9_;
  10337. const T10 v10_;
  10338. const T11 v11_;
  10339. const T12 v12_;
  10340. const T13 v13_;
  10341. const T14 v14_;
  10342. const T15 v15_;
  10343. const T16 v16_;
  10344. const T17 v17_;
  10345. const T18 v18_;
  10346. const T19 v19_;
  10347. const T20 v20_;
  10348. const T21 v21_;
  10349. const T22 v22_;
  10350. const T23 v23_;
  10351. const T24 v24_;
  10352. const T25 v25_;
  10353. const T26 v26_;
  10354. };
  10355. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10356. typename T6, typename T7, typename T8, typename T9, typename T10,
  10357. typename T11, typename T12, typename T13, typename T14, typename T15,
  10358. typename T16, typename T17, typename T18, typename T19, typename T20,
  10359. typename T21, typename T22, typename T23, typename T24, typename T25,
  10360. typename T26, typename T27>
  10361. class ValueArray27 {
  10362. public:
  10363. ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10364. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10365. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10366. T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  10367. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  10368. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
  10369. v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
  10370. v26_(v26), v27_(v27) {}
  10371. template <typename T>
  10372. operator ParamGenerator<T>() const {
  10373. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10374. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10375. v24_, v25_, v26_, v27_};
  10376. return ValuesIn(array);
  10377. }
  10378. private:
  10379. // No implementation - assignment is unsupported.
  10380. void operator=(const ValueArray27& other);
  10381. const T1 v1_;
  10382. const T2 v2_;
  10383. const T3 v3_;
  10384. const T4 v4_;
  10385. const T5 v5_;
  10386. const T6 v6_;
  10387. const T7 v7_;
  10388. const T8 v8_;
  10389. const T9 v9_;
  10390. const T10 v10_;
  10391. const T11 v11_;
  10392. const T12 v12_;
  10393. const T13 v13_;
  10394. const T14 v14_;
  10395. const T15 v15_;
  10396. const T16 v16_;
  10397. const T17 v17_;
  10398. const T18 v18_;
  10399. const T19 v19_;
  10400. const T20 v20_;
  10401. const T21 v21_;
  10402. const T22 v22_;
  10403. const T23 v23_;
  10404. const T24 v24_;
  10405. const T25 v25_;
  10406. const T26 v26_;
  10407. const T27 v27_;
  10408. };
  10409. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10410. typename T6, typename T7, typename T8, typename T9, typename T10,
  10411. typename T11, typename T12, typename T13, typename T14, typename T15,
  10412. typename T16, typename T17, typename T18, typename T19, typename T20,
  10413. typename T21, typename T22, typename T23, typename T24, typename T25,
  10414. typename T26, typename T27, typename T28>
  10415. class ValueArray28 {
  10416. public:
  10417. ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10418. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10419. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10420. T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  10421. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  10422. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  10423. v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
  10424. v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
  10425. template <typename T>
  10426. operator ParamGenerator<T>() const {
  10427. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10428. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10429. v24_, v25_, v26_, v27_, v28_};
  10430. return ValuesIn(array);
  10431. }
  10432. private:
  10433. // No implementation - assignment is unsupported.
  10434. void operator=(const ValueArray28& other);
  10435. const T1 v1_;
  10436. const T2 v2_;
  10437. const T3 v3_;
  10438. const T4 v4_;
  10439. const T5 v5_;
  10440. const T6 v6_;
  10441. const T7 v7_;
  10442. const T8 v8_;
  10443. const T9 v9_;
  10444. const T10 v10_;
  10445. const T11 v11_;
  10446. const T12 v12_;
  10447. const T13 v13_;
  10448. const T14 v14_;
  10449. const T15 v15_;
  10450. const T16 v16_;
  10451. const T17 v17_;
  10452. const T18 v18_;
  10453. const T19 v19_;
  10454. const T20 v20_;
  10455. const T21 v21_;
  10456. const T22 v22_;
  10457. const T23 v23_;
  10458. const T24 v24_;
  10459. const T25 v25_;
  10460. const T26 v26_;
  10461. const T27 v27_;
  10462. const T28 v28_;
  10463. };
  10464. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10465. typename T6, typename T7, typename T8, typename T9, typename T10,
  10466. typename T11, typename T12, typename T13, typename T14, typename T15,
  10467. typename T16, typename T17, typename T18, typename T19, typename T20,
  10468. typename T21, typename T22, typename T23, typename T24, typename T25,
  10469. typename T26, typename T27, typename T28, typename T29>
  10470. class ValueArray29 {
  10471. public:
  10472. ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10473. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10474. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10475. T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  10476. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  10477. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  10478. v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
  10479. v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
  10480. template <typename T>
  10481. operator ParamGenerator<T>() const {
  10482. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10483. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10484. v24_, v25_, v26_, v27_, v28_, v29_};
  10485. return ValuesIn(array);
  10486. }
  10487. private:
  10488. // No implementation - assignment is unsupported.
  10489. void operator=(const ValueArray29& other);
  10490. const T1 v1_;
  10491. const T2 v2_;
  10492. const T3 v3_;
  10493. const T4 v4_;
  10494. const T5 v5_;
  10495. const T6 v6_;
  10496. const T7 v7_;
  10497. const T8 v8_;
  10498. const T9 v9_;
  10499. const T10 v10_;
  10500. const T11 v11_;
  10501. const T12 v12_;
  10502. const T13 v13_;
  10503. const T14 v14_;
  10504. const T15 v15_;
  10505. const T16 v16_;
  10506. const T17 v17_;
  10507. const T18 v18_;
  10508. const T19 v19_;
  10509. const T20 v20_;
  10510. const T21 v21_;
  10511. const T22 v22_;
  10512. const T23 v23_;
  10513. const T24 v24_;
  10514. const T25 v25_;
  10515. const T26 v26_;
  10516. const T27 v27_;
  10517. const T28 v28_;
  10518. const T29 v29_;
  10519. };
  10520. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10521. typename T6, typename T7, typename T8, typename T9, typename T10,
  10522. typename T11, typename T12, typename T13, typename T14, typename T15,
  10523. typename T16, typename T17, typename T18, typename T19, typename T20,
  10524. typename T21, typename T22, typename T23, typename T24, typename T25,
  10525. typename T26, typename T27, typename T28, typename T29, typename T30>
  10526. class ValueArray30 {
  10527. public:
  10528. ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10529. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10530. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10531. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
  10532. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  10533. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  10534. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  10535. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  10536. v29_(v29), v30_(v30) {}
  10537. template <typename T>
  10538. operator ParamGenerator<T>() const {
  10539. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10540. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10541. v24_, v25_, v26_, v27_, v28_, v29_, v30_};
  10542. return ValuesIn(array);
  10543. }
  10544. private:
  10545. // No implementation - assignment is unsupported.
  10546. void operator=(const ValueArray30& other);
  10547. const T1 v1_;
  10548. const T2 v2_;
  10549. const T3 v3_;
  10550. const T4 v4_;
  10551. const T5 v5_;
  10552. const T6 v6_;
  10553. const T7 v7_;
  10554. const T8 v8_;
  10555. const T9 v9_;
  10556. const T10 v10_;
  10557. const T11 v11_;
  10558. const T12 v12_;
  10559. const T13 v13_;
  10560. const T14 v14_;
  10561. const T15 v15_;
  10562. const T16 v16_;
  10563. const T17 v17_;
  10564. const T18 v18_;
  10565. const T19 v19_;
  10566. const T20 v20_;
  10567. const T21 v21_;
  10568. const T22 v22_;
  10569. const T23 v23_;
  10570. const T24 v24_;
  10571. const T25 v25_;
  10572. const T26 v26_;
  10573. const T27 v27_;
  10574. const T28 v28_;
  10575. const T29 v29_;
  10576. const T30 v30_;
  10577. };
  10578. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10579. typename T6, typename T7, typename T8, typename T9, typename T10,
  10580. typename T11, typename T12, typename T13, typename T14, typename T15,
  10581. typename T16, typename T17, typename T18, typename T19, typename T20,
  10582. typename T21, typename T22, typename T23, typename T24, typename T25,
  10583. typename T26, typename T27, typename T28, typename T29, typename T30,
  10584. typename T31>
  10585. class ValueArray31 {
  10586. public:
  10587. ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10588. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10589. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10590. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
  10591. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  10592. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  10593. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  10594. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  10595. v29_(v29), v30_(v30), v31_(v31) {}
  10596. template <typename T>
  10597. operator ParamGenerator<T>() const {
  10598. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10599. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10600. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_};
  10601. return ValuesIn(array);
  10602. }
  10603. private:
  10604. // No implementation - assignment is unsupported.
  10605. void operator=(const ValueArray31& other);
  10606. const T1 v1_;
  10607. const T2 v2_;
  10608. const T3 v3_;
  10609. const T4 v4_;
  10610. const T5 v5_;
  10611. const T6 v6_;
  10612. const T7 v7_;
  10613. const T8 v8_;
  10614. const T9 v9_;
  10615. const T10 v10_;
  10616. const T11 v11_;
  10617. const T12 v12_;
  10618. const T13 v13_;
  10619. const T14 v14_;
  10620. const T15 v15_;
  10621. const T16 v16_;
  10622. const T17 v17_;
  10623. const T18 v18_;
  10624. const T19 v19_;
  10625. const T20 v20_;
  10626. const T21 v21_;
  10627. const T22 v22_;
  10628. const T23 v23_;
  10629. const T24 v24_;
  10630. const T25 v25_;
  10631. const T26 v26_;
  10632. const T27 v27_;
  10633. const T28 v28_;
  10634. const T29 v29_;
  10635. const T30 v30_;
  10636. const T31 v31_;
  10637. };
  10638. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10639. typename T6, typename T7, typename T8, typename T9, typename T10,
  10640. typename T11, typename T12, typename T13, typename T14, typename T15,
  10641. typename T16, typename T17, typename T18, typename T19, typename T20,
  10642. typename T21, typename T22, typename T23, typename T24, typename T25,
  10643. typename T26, typename T27, typename T28, typename T29, typename T30,
  10644. typename T31, typename T32>
  10645. class ValueArray32 {
  10646. public:
  10647. ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10648. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10649. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10650. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
  10651. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  10652. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  10653. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  10654. v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
  10655. v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
  10656. template <typename T>
  10657. operator ParamGenerator<T>() const {
  10658. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10659. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10660. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_};
  10661. return ValuesIn(array);
  10662. }
  10663. private:
  10664. // No implementation - assignment is unsupported.
  10665. void operator=(const ValueArray32& other);
  10666. const T1 v1_;
  10667. const T2 v2_;
  10668. const T3 v3_;
  10669. const T4 v4_;
  10670. const T5 v5_;
  10671. const T6 v6_;
  10672. const T7 v7_;
  10673. const T8 v8_;
  10674. const T9 v9_;
  10675. const T10 v10_;
  10676. const T11 v11_;
  10677. const T12 v12_;
  10678. const T13 v13_;
  10679. const T14 v14_;
  10680. const T15 v15_;
  10681. const T16 v16_;
  10682. const T17 v17_;
  10683. const T18 v18_;
  10684. const T19 v19_;
  10685. const T20 v20_;
  10686. const T21 v21_;
  10687. const T22 v22_;
  10688. const T23 v23_;
  10689. const T24 v24_;
  10690. const T25 v25_;
  10691. const T26 v26_;
  10692. const T27 v27_;
  10693. const T28 v28_;
  10694. const T29 v29_;
  10695. const T30 v30_;
  10696. const T31 v31_;
  10697. const T32 v32_;
  10698. };
  10699. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10700. typename T6, typename T7, typename T8, typename T9, typename T10,
  10701. typename T11, typename T12, typename T13, typename T14, typename T15,
  10702. typename T16, typename T17, typename T18, typename T19, typename T20,
  10703. typename T21, typename T22, typename T23, typename T24, typename T25,
  10704. typename T26, typename T27, typename T28, typename T29, typename T30,
  10705. typename T31, typename T32, typename T33>
  10706. class ValueArray33 {
  10707. public:
  10708. ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10709. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10710. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10711. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
  10712. T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  10713. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  10714. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  10715. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  10716. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  10717. v33_(v33) {}
  10718. template <typename T>
  10719. operator ParamGenerator<T>() const {
  10720. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10721. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10722. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_};
  10723. return ValuesIn(array);
  10724. }
  10725. private:
  10726. // No implementation - assignment is unsupported.
  10727. void operator=(const ValueArray33& other);
  10728. const T1 v1_;
  10729. const T2 v2_;
  10730. const T3 v3_;
  10731. const T4 v4_;
  10732. const T5 v5_;
  10733. const T6 v6_;
  10734. const T7 v7_;
  10735. const T8 v8_;
  10736. const T9 v9_;
  10737. const T10 v10_;
  10738. const T11 v11_;
  10739. const T12 v12_;
  10740. const T13 v13_;
  10741. const T14 v14_;
  10742. const T15 v15_;
  10743. const T16 v16_;
  10744. const T17 v17_;
  10745. const T18 v18_;
  10746. const T19 v19_;
  10747. const T20 v20_;
  10748. const T21 v21_;
  10749. const T22 v22_;
  10750. const T23 v23_;
  10751. const T24 v24_;
  10752. const T25 v25_;
  10753. const T26 v26_;
  10754. const T27 v27_;
  10755. const T28 v28_;
  10756. const T29 v29_;
  10757. const T30 v30_;
  10758. const T31 v31_;
  10759. const T32 v32_;
  10760. const T33 v33_;
  10761. };
  10762. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10763. typename T6, typename T7, typename T8, typename T9, typename T10,
  10764. typename T11, typename T12, typename T13, typename T14, typename T15,
  10765. typename T16, typename T17, typename T18, typename T19, typename T20,
  10766. typename T21, typename T22, typename T23, typename T24, typename T25,
  10767. typename T26, typename T27, typename T28, typename T29, typename T30,
  10768. typename T31, typename T32, typename T33, typename T34>
  10769. class ValueArray34 {
  10770. public:
  10771. ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10772. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10773. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10774. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  10775. T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  10776. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  10777. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  10778. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  10779. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  10780. v33_(v33), v34_(v34) {}
  10781. template <typename T>
  10782. operator ParamGenerator<T>() const {
  10783. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10784. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10785. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_};
  10786. return ValuesIn(array);
  10787. }
  10788. private:
  10789. // No implementation - assignment is unsupported.
  10790. void operator=(const ValueArray34& other);
  10791. const T1 v1_;
  10792. const T2 v2_;
  10793. const T3 v3_;
  10794. const T4 v4_;
  10795. const T5 v5_;
  10796. const T6 v6_;
  10797. const T7 v7_;
  10798. const T8 v8_;
  10799. const T9 v9_;
  10800. const T10 v10_;
  10801. const T11 v11_;
  10802. const T12 v12_;
  10803. const T13 v13_;
  10804. const T14 v14_;
  10805. const T15 v15_;
  10806. const T16 v16_;
  10807. const T17 v17_;
  10808. const T18 v18_;
  10809. const T19 v19_;
  10810. const T20 v20_;
  10811. const T21 v21_;
  10812. const T22 v22_;
  10813. const T23 v23_;
  10814. const T24 v24_;
  10815. const T25 v25_;
  10816. const T26 v26_;
  10817. const T27 v27_;
  10818. const T28 v28_;
  10819. const T29 v29_;
  10820. const T30 v30_;
  10821. const T31 v31_;
  10822. const T32 v32_;
  10823. const T33 v33_;
  10824. const T34 v34_;
  10825. };
  10826. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10827. typename T6, typename T7, typename T8, typename T9, typename T10,
  10828. typename T11, typename T12, typename T13, typename T14, typename T15,
  10829. typename T16, typename T17, typename T18, typename T19, typename T20,
  10830. typename T21, typename T22, typename T23, typename T24, typename T25,
  10831. typename T26, typename T27, typename T28, typename T29, typename T30,
  10832. typename T31, typename T32, typename T33, typename T34, typename T35>
  10833. class ValueArray35 {
  10834. public:
  10835. ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10836. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10837. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10838. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  10839. T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  10840. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  10841. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
  10842. v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
  10843. v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
  10844. v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
  10845. template <typename T>
  10846. operator ParamGenerator<T>() const {
  10847. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10848. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10849. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_,
  10850. v35_};
  10851. return ValuesIn(array);
  10852. }
  10853. private:
  10854. // No implementation - assignment is unsupported.
  10855. void operator=(const ValueArray35& other);
  10856. const T1 v1_;
  10857. const T2 v2_;
  10858. const T3 v3_;
  10859. const T4 v4_;
  10860. const T5 v5_;
  10861. const T6 v6_;
  10862. const T7 v7_;
  10863. const T8 v8_;
  10864. const T9 v9_;
  10865. const T10 v10_;
  10866. const T11 v11_;
  10867. const T12 v12_;
  10868. const T13 v13_;
  10869. const T14 v14_;
  10870. const T15 v15_;
  10871. const T16 v16_;
  10872. const T17 v17_;
  10873. const T18 v18_;
  10874. const T19 v19_;
  10875. const T20 v20_;
  10876. const T21 v21_;
  10877. const T22 v22_;
  10878. const T23 v23_;
  10879. const T24 v24_;
  10880. const T25 v25_;
  10881. const T26 v26_;
  10882. const T27 v27_;
  10883. const T28 v28_;
  10884. const T29 v29_;
  10885. const T30 v30_;
  10886. const T31 v31_;
  10887. const T32 v32_;
  10888. const T33 v33_;
  10889. const T34 v34_;
  10890. const T35 v35_;
  10891. };
  10892. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10893. typename T6, typename T7, typename T8, typename T9, typename T10,
  10894. typename T11, typename T12, typename T13, typename T14, typename T15,
  10895. typename T16, typename T17, typename T18, typename T19, typename T20,
  10896. typename T21, typename T22, typename T23, typename T24, typename T25,
  10897. typename T26, typename T27, typename T28, typename T29, typename T30,
  10898. typename T31, typename T32, typename T33, typename T34, typename T35,
  10899. typename T36>
  10900. class ValueArray36 {
  10901. public:
  10902. ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10903. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10904. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10905. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  10906. T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  10907. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  10908. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  10909. v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
  10910. v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
  10911. v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
  10912. template <typename T>
  10913. operator ParamGenerator<T>() const {
  10914. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10915. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10916. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  10917. v36_};
  10918. return ValuesIn(array);
  10919. }
  10920. private:
  10921. // No implementation - assignment is unsupported.
  10922. void operator=(const ValueArray36& other);
  10923. const T1 v1_;
  10924. const T2 v2_;
  10925. const T3 v3_;
  10926. const T4 v4_;
  10927. const T5 v5_;
  10928. const T6 v6_;
  10929. const T7 v7_;
  10930. const T8 v8_;
  10931. const T9 v9_;
  10932. const T10 v10_;
  10933. const T11 v11_;
  10934. const T12 v12_;
  10935. const T13 v13_;
  10936. const T14 v14_;
  10937. const T15 v15_;
  10938. const T16 v16_;
  10939. const T17 v17_;
  10940. const T18 v18_;
  10941. const T19 v19_;
  10942. const T20 v20_;
  10943. const T21 v21_;
  10944. const T22 v22_;
  10945. const T23 v23_;
  10946. const T24 v24_;
  10947. const T25 v25_;
  10948. const T26 v26_;
  10949. const T27 v27_;
  10950. const T28 v28_;
  10951. const T29 v29_;
  10952. const T30 v30_;
  10953. const T31 v31_;
  10954. const T32 v32_;
  10955. const T33 v33_;
  10956. const T34 v34_;
  10957. const T35 v35_;
  10958. const T36 v36_;
  10959. };
  10960. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  10961. typename T6, typename T7, typename T8, typename T9, typename T10,
  10962. typename T11, typename T12, typename T13, typename T14, typename T15,
  10963. typename T16, typename T17, typename T18, typename T19, typename T20,
  10964. typename T21, typename T22, typename T23, typename T24, typename T25,
  10965. typename T26, typename T27, typename T28, typename T29, typename T30,
  10966. typename T31, typename T32, typename T33, typename T34, typename T35,
  10967. typename T36, typename T37>
  10968. class ValueArray37 {
  10969. public:
  10970. ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  10971. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  10972. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  10973. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  10974. T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  10975. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  10976. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  10977. v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
  10978. v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
  10979. v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
  10980. v36_(v36), v37_(v37) {}
  10981. template <typename T>
  10982. operator ParamGenerator<T>() const {
  10983. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  10984. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  10985. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  10986. v36_, v37_};
  10987. return ValuesIn(array);
  10988. }
  10989. private:
  10990. // No implementation - assignment is unsupported.
  10991. void operator=(const ValueArray37& other);
  10992. const T1 v1_;
  10993. const T2 v2_;
  10994. const T3 v3_;
  10995. const T4 v4_;
  10996. const T5 v5_;
  10997. const T6 v6_;
  10998. const T7 v7_;
  10999. const T8 v8_;
  11000. const T9 v9_;
  11001. const T10 v10_;
  11002. const T11 v11_;
  11003. const T12 v12_;
  11004. const T13 v13_;
  11005. const T14 v14_;
  11006. const T15 v15_;
  11007. const T16 v16_;
  11008. const T17 v17_;
  11009. const T18 v18_;
  11010. const T19 v19_;
  11011. const T20 v20_;
  11012. const T21 v21_;
  11013. const T22 v22_;
  11014. const T23 v23_;
  11015. const T24 v24_;
  11016. const T25 v25_;
  11017. const T26 v26_;
  11018. const T27 v27_;
  11019. const T28 v28_;
  11020. const T29 v29_;
  11021. const T30 v30_;
  11022. const T31 v31_;
  11023. const T32 v32_;
  11024. const T33 v33_;
  11025. const T34 v34_;
  11026. const T35 v35_;
  11027. const T36 v36_;
  11028. const T37 v37_;
  11029. };
  11030. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11031. typename T6, typename T7, typename T8, typename T9, typename T10,
  11032. typename T11, typename T12, typename T13, typename T14, typename T15,
  11033. typename T16, typename T17, typename T18, typename T19, typename T20,
  11034. typename T21, typename T22, typename T23, typename T24, typename T25,
  11035. typename T26, typename T27, typename T28, typename T29, typename T30,
  11036. typename T31, typename T32, typename T33, typename T34, typename T35,
  11037. typename T36, typename T37, typename T38>
  11038. class ValueArray38 {
  11039. public:
  11040. ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11041. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11042. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11043. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11044. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
  11045. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11046. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  11047. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  11048. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  11049. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  11050. v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
  11051. template <typename T>
  11052. operator ParamGenerator<T>() const {
  11053. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11054. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11055. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11056. v36_, v37_, v38_};
  11057. return ValuesIn(array);
  11058. }
  11059. private:
  11060. // No implementation - assignment is unsupported.
  11061. void operator=(const ValueArray38& other);
  11062. const T1 v1_;
  11063. const T2 v2_;
  11064. const T3 v3_;
  11065. const T4 v4_;
  11066. const T5 v5_;
  11067. const T6 v6_;
  11068. const T7 v7_;
  11069. const T8 v8_;
  11070. const T9 v9_;
  11071. const T10 v10_;
  11072. const T11 v11_;
  11073. const T12 v12_;
  11074. const T13 v13_;
  11075. const T14 v14_;
  11076. const T15 v15_;
  11077. const T16 v16_;
  11078. const T17 v17_;
  11079. const T18 v18_;
  11080. const T19 v19_;
  11081. const T20 v20_;
  11082. const T21 v21_;
  11083. const T22 v22_;
  11084. const T23 v23_;
  11085. const T24 v24_;
  11086. const T25 v25_;
  11087. const T26 v26_;
  11088. const T27 v27_;
  11089. const T28 v28_;
  11090. const T29 v29_;
  11091. const T30 v30_;
  11092. const T31 v31_;
  11093. const T32 v32_;
  11094. const T33 v33_;
  11095. const T34 v34_;
  11096. const T35 v35_;
  11097. const T36 v36_;
  11098. const T37 v37_;
  11099. const T38 v38_;
  11100. };
  11101. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11102. typename T6, typename T7, typename T8, typename T9, typename T10,
  11103. typename T11, typename T12, typename T13, typename T14, typename T15,
  11104. typename T16, typename T17, typename T18, typename T19, typename T20,
  11105. typename T21, typename T22, typename T23, typename T24, typename T25,
  11106. typename T26, typename T27, typename T28, typename T29, typename T30,
  11107. typename T31, typename T32, typename T33, typename T34, typename T35,
  11108. typename T36, typename T37, typename T38, typename T39>
  11109. class ValueArray39 {
  11110. public:
  11111. ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11112. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11113. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11114. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11115. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
  11116. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11117. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  11118. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  11119. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  11120. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  11121. v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
  11122. template <typename T>
  11123. operator ParamGenerator<T>() const {
  11124. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11125. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11126. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11127. v36_, v37_, v38_, v39_};
  11128. return ValuesIn(array);
  11129. }
  11130. private:
  11131. // No implementation - assignment is unsupported.
  11132. void operator=(const ValueArray39& other);
  11133. const T1 v1_;
  11134. const T2 v2_;
  11135. const T3 v3_;
  11136. const T4 v4_;
  11137. const T5 v5_;
  11138. const T6 v6_;
  11139. const T7 v7_;
  11140. const T8 v8_;
  11141. const T9 v9_;
  11142. const T10 v10_;
  11143. const T11 v11_;
  11144. const T12 v12_;
  11145. const T13 v13_;
  11146. const T14 v14_;
  11147. const T15 v15_;
  11148. const T16 v16_;
  11149. const T17 v17_;
  11150. const T18 v18_;
  11151. const T19 v19_;
  11152. const T20 v20_;
  11153. const T21 v21_;
  11154. const T22 v22_;
  11155. const T23 v23_;
  11156. const T24 v24_;
  11157. const T25 v25_;
  11158. const T26 v26_;
  11159. const T27 v27_;
  11160. const T28 v28_;
  11161. const T29 v29_;
  11162. const T30 v30_;
  11163. const T31 v31_;
  11164. const T32 v32_;
  11165. const T33 v33_;
  11166. const T34 v34_;
  11167. const T35 v35_;
  11168. const T36 v36_;
  11169. const T37 v37_;
  11170. const T38 v38_;
  11171. const T39 v39_;
  11172. };
  11173. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11174. typename T6, typename T7, typename T8, typename T9, typename T10,
  11175. typename T11, typename T12, typename T13, typename T14, typename T15,
  11176. typename T16, typename T17, typename T18, typename T19, typename T20,
  11177. typename T21, typename T22, typename T23, typename T24, typename T25,
  11178. typename T26, typename T27, typename T28, typename T29, typename T30,
  11179. typename T31, typename T32, typename T33, typename T34, typename T35,
  11180. typename T36, typename T37, typename T38, typename T39, typename T40>
  11181. class ValueArray40 {
  11182. public:
  11183. ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11184. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11185. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11186. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11187. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
  11188. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  11189. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  11190. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  11191. v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
  11192. v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
  11193. v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
  11194. v40_(v40) {}
  11195. template <typename T>
  11196. operator ParamGenerator<T>() const {
  11197. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11198. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11199. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11200. v36_, v37_, v38_, v39_, v40_};
  11201. return ValuesIn(array);
  11202. }
  11203. private:
  11204. // No implementation - assignment is unsupported.
  11205. void operator=(const ValueArray40& other);
  11206. const T1 v1_;
  11207. const T2 v2_;
  11208. const T3 v3_;
  11209. const T4 v4_;
  11210. const T5 v5_;
  11211. const T6 v6_;
  11212. const T7 v7_;
  11213. const T8 v8_;
  11214. const T9 v9_;
  11215. const T10 v10_;
  11216. const T11 v11_;
  11217. const T12 v12_;
  11218. const T13 v13_;
  11219. const T14 v14_;
  11220. const T15 v15_;
  11221. const T16 v16_;
  11222. const T17 v17_;
  11223. const T18 v18_;
  11224. const T19 v19_;
  11225. const T20 v20_;
  11226. const T21 v21_;
  11227. const T22 v22_;
  11228. const T23 v23_;
  11229. const T24 v24_;
  11230. const T25 v25_;
  11231. const T26 v26_;
  11232. const T27 v27_;
  11233. const T28 v28_;
  11234. const T29 v29_;
  11235. const T30 v30_;
  11236. const T31 v31_;
  11237. const T32 v32_;
  11238. const T33 v33_;
  11239. const T34 v34_;
  11240. const T35 v35_;
  11241. const T36 v36_;
  11242. const T37 v37_;
  11243. const T38 v38_;
  11244. const T39 v39_;
  11245. const T40 v40_;
  11246. };
  11247. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11248. typename T6, typename T7, typename T8, typename T9, typename T10,
  11249. typename T11, typename T12, typename T13, typename T14, typename T15,
  11250. typename T16, typename T17, typename T18, typename T19, typename T20,
  11251. typename T21, typename T22, typename T23, typename T24, typename T25,
  11252. typename T26, typename T27, typename T28, typename T29, typename T30,
  11253. typename T31, typename T32, typename T33, typename T34, typename T35,
  11254. typename T36, typename T37, typename T38, typename T39, typename T40,
  11255. typename T41>
  11256. class ValueArray41 {
  11257. public:
  11258. ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11259. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11260. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11261. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11262. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
  11263. T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11264. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11265. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  11266. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  11267. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  11268. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  11269. v39_(v39), v40_(v40), v41_(v41) {}
  11270. template <typename T>
  11271. operator ParamGenerator<T>() const {
  11272. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11273. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11274. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11275. v36_, v37_, v38_, v39_, v40_, v41_};
  11276. return ValuesIn(array);
  11277. }
  11278. private:
  11279. // No implementation - assignment is unsupported.
  11280. void operator=(const ValueArray41& other);
  11281. const T1 v1_;
  11282. const T2 v2_;
  11283. const T3 v3_;
  11284. const T4 v4_;
  11285. const T5 v5_;
  11286. const T6 v6_;
  11287. const T7 v7_;
  11288. const T8 v8_;
  11289. const T9 v9_;
  11290. const T10 v10_;
  11291. const T11 v11_;
  11292. const T12 v12_;
  11293. const T13 v13_;
  11294. const T14 v14_;
  11295. const T15 v15_;
  11296. const T16 v16_;
  11297. const T17 v17_;
  11298. const T18 v18_;
  11299. const T19 v19_;
  11300. const T20 v20_;
  11301. const T21 v21_;
  11302. const T22 v22_;
  11303. const T23 v23_;
  11304. const T24 v24_;
  11305. const T25 v25_;
  11306. const T26 v26_;
  11307. const T27 v27_;
  11308. const T28 v28_;
  11309. const T29 v29_;
  11310. const T30 v30_;
  11311. const T31 v31_;
  11312. const T32 v32_;
  11313. const T33 v33_;
  11314. const T34 v34_;
  11315. const T35 v35_;
  11316. const T36 v36_;
  11317. const T37 v37_;
  11318. const T38 v38_;
  11319. const T39 v39_;
  11320. const T40 v40_;
  11321. const T41 v41_;
  11322. };
  11323. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11324. typename T6, typename T7, typename T8, typename T9, typename T10,
  11325. typename T11, typename T12, typename T13, typename T14, typename T15,
  11326. typename T16, typename T17, typename T18, typename T19, typename T20,
  11327. typename T21, typename T22, typename T23, typename T24, typename T25,
  11328. typename T26, typename T27, typename T28, typename T29, typename T30,
  11329. typename T31, typename T32, typename T33, typename T34, typename T35,
  11330. typename T36, typename T37, typename T38, typename T39, typename T40,
  11331. typename T41, typename T42>
  11332. class ValueArray42 {
  11333. public:
  11334. ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11335. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11336. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11337. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11338. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11339. T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11340. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11341. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  11342. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  11343. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  11344. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  11345. v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
  11346. template <typename T>
  11347. operator ParamGenerator<T>() const {
  11348. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11349. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11350. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11351. v36_, v37_, v38_, v39_, v40_, v41_, v42_};
  11352. return ValuesIn(array);
  11353. }
  11354. private:
  11355. // No implementation - assignment is unsupported.
  11356. void operator=(const ValueArray42& other);
  11357. const T1 v1_;
  11358. const T2 v2_;
  11359. const T3 v3_;
  11360. const T4 v4_;
  11361. const T5 v5_;
  11362. const T6 v6_;
  11363. const T7 v7_;
  11364. const T8 v8_;
  11365. const T9 v9_;
  11366. const T10 v10_;
  11367. const T11 v11_;
  11368. const T12 v12_;
  11369. const T13 v13_;
  11370. const T14 v14_;
  11371. const T15 v15_;
  11372. const T16 v16_;
  11373. const T17 v17_;
  11374. const T18 v18_;
  11375. const T19 v19_;
  11376. const T20 v20_;
  11377. const T21 v21_;
  11378. const T22 v22_;
  11379. const T23 v23_;
  11380. const T24 v24_;
  11381. const T25 v25_;
  11382. const T26 v26_;
  11383. const T27 v27_;
  11384. const T28 v28_;
  11385. const T29 v29_;
  11386. const T30 v30_;
  11387. const T31 v31_;
  11388. const T32 v32_;
  11389. const T33 v33_;
  11390. const T34 v34_;
  11391. const T35 v35_;
  11392. const T36 v36_;
  11393. const T37 v37_;
  11394. const T38 v38_;
  11395. const T39 v39_;
  11396. const T40 v40_;
  11397. const T41 v41_;
  11398. const T42 v42_;
  11399. };
  11400. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11401. typename T6, typename T7, typename T8, typename T9, typename T10,
  11402. typename T11, typename T12, typename T13, typename T14, typename T15,
  11403. typename T16, typename T17, typename T18, typename T19, typename T20,
  11404. typename T21, typename T22, typename T23, typename T24, typename T25,
  11405. typename T26, typename T27, typename T28, typename T29, typename T30,
  11406. typename T31, typename T32, typename T33, typename T34, typename T35,
  11407. typename T36, typename T37, typename T38, typename T39, typename T40,
  11408. typename T41, typename T42, typename T43>
  11409. class ValueArray43 {
  11410. public:
  11411. ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11412. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11413. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11414. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11415. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11416. T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
  11417. v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
  11418. v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
  11419. v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
  11420. v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
  11421. v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
  11422. v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
  11423. template <typename T>
  11424. operator ParamGenerator<T>() const {
  11425. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11426. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11427. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11428. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_};
  11429. return ValuesIn(array);
  11430. }
  11431. private:
  11432. // No implementation - assignment is unsupported.
  11433. void operator=(const ValueArray43& other);
  11434. const T1 v1_;
  11435. const T2 v2_;
  11436. const T3 v3_;
  11437. const T4 v4_;
  11438. const T5 v5_;
  11439. const T6 v6_;
  11440. const T7 v7_;
  11441. const T8 v8_;
  11442. const T9 v9_;
  11443. const T10 v10_;
  11444. const T11 v11_;
  11445. const T12 v12_;
  11446. const T13 v13_;
  11447. const T14 v14_;
  11448. const T15 v15_;
  11449. const T16 v16_;
  11450. const T17 v17_;
  11451. const T18 v18_;
  11452. const T19 v19_;
  11453. const T20 v20_;
  11454. const T21 v21_;
  11455. const T22 v22_;
  11456. const T23 v23_;
  11457. const T24 v24_;
  11458. const T25 v25_;
  11459. const T26 v26_;
  11460. const T27 v27_;
  11461. const T28 v28_;
  11462. const T29 v29_;
  11463. const T30 v30_;
  11464. const T31 v31_;
  11465. const T32 v32_;
  11466. const T33 v33_;
  11467. const T34 v34_;
  11468. const T35 v35_;
  11469. const T36 v36_;
  11470. const T37 v37_;
  11471. const T38 v38_;
  11472. const T39 v39_;
  11473. const T40 v40_;
  11474. const T41 v41_;
  11475. const T42 v42_;
  11476. const T43 v43_;
  11477. };
  11478. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11479. typename T6, typename T7, typename T8, typename T9, typename T10,
  11480. typename T11, typename T12, typename T13, typename T14, typename T15,
  11481. typename T16, typename T17, typename T18, typename T19, typename T20,
  11482. typename T21, typename T22, typename T23, typename T24, typename T25,
  11483. typename T26, typename T27, typename T28, typename T29, typename T30,
  11484. typename T31, typename T32, typename T33, typename T34, typename T35,
  11485. typename T36, typename T37, typename T38, typename T39, typename T40,
  11486. typename T41, typename T42, typename T43, typename T44>
  11487. class ValueArray44 {
  11488. public:
  11489. ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11490. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11491. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11492. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11493. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11494. T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
  11495. v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
  11496. v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
  11497. v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
  11498. v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
  11499. v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
  11500. v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
  11501. v43_(v43), v44_(v44) {}
  11502. template <typename T>
  11503. operator ParamGenerator<T>() const {
  11504. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11505. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11506. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11507. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_};
  11508. return ValuesIn(array);
  11509. }
  11510. private:
  11511. // No implementation - assignment is unsupported.
  11512. void operator=(const ValueArray44& other);
  11513. const T1 v1_;
  11514. const T2 v2_;
  11515. const T3 v3_;
  11516. const T4 v4_;
  11517. const T5 v5_;
  11518. const T6 v6_;
  11519. const T7 v7_;
  11520. const T8 v8_;
  11521. const T9 v9_;
  11522. const T10 v10_;
  11523. const T11 v11_;
  11524. const T12 v12_;
  11525. const T13 v13_;
  11526. const T14 v14_;
  11527. const T15 v15_;
  11528. const T16 v16_;
  11529. const T17 v17_;
  11530. const T18 v18_;
  11531. const T19 v19_;
  11532. const T20 v20_;
  11533. const T21 v21_;
  11534. const T22 v22_;
  11535. const T23 v23_;
  11536. const T24 v24_;
  11537. const T25 v25_;
  11538. const T26 v26_;
  11539. const T27 v27_;
  11540. const T28 v28_;
  11541. const T29 v29_;
  11542. const T30 v30_;
  11543. const T31 v31_;
  11544. const T32 v32_;
  11545. const T33 v33_;
  11546. const T34 v34_;
  11547. const T35 v35_;
  11548. const T36 v36_;
  11549. const T37 v37_;
  11550. const T38 v38_;
  11551. const T39 v39_;
  11552. const T40 v40_;
  11553. const T41 v41_;
  11554. const T42 v42_;
  11555. const T43 v43_;
  11556. const T44 v44_;
  11557. };
  11558. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11559. typename T6, typename T7, typename T8, typename T9, typename T10,
  11560. typename T11, typename T12, typename T13, typename T14, typename T15,
  11561. typename T16, typename T17, typename T18, typename T19, typename T20,
  11562. typename T21, typename T22, typename T23, typename T24, typename T25,
  11563. typename T26, typename T27, typename T28, typename T29, typename T30,
  11564. typename T31, typename T32, typename T33, typename T34, typename T35,
  11565. typename T36, typename T37, typename T38, typename T39, typename T40,
  11566. typename T41, typename T42, typename T43, typename T44, typename T45>
  11567. class ValueArray45 {
  11568. public:
  11569. ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11570. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11571. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11572. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11573. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11574. T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
  11575. v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
  11576. v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
  11577. v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
  11578. v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
  11579. v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
  11580. v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
  11581. v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
  11582. template <typename T>
  11583. operator ParamGenerator<T>() const {
  11584. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11585. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11586. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11587. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_};
  11588. return ValuesIn(array);
  11589. }
  11590. private:
  11591. // No implementation - assignment is unsupported.
  11592. void operator=(const ValueArray45& other);
  11593. const T1 v1_;
  11594. const T2 v2_;
  11595. const T3 v3_;
  11596. const T4 v4_;
  11597. const T5 v5_;
  11598. const T6 v6_;
  11599. const T7 v7_;
  11600. const T8 v8_;
  11601. const T9 v9_;
  11602. const T10 v10_;
  11603. const T11 v11_;
  11604. const T12 v12_;
  11605. const T13 v13_;
  11606. const T14 v14_;
  11607. const T15 v15_;
  11608. const T16 v16_;
  11609. const T17 v17_;
  11610. const T18 v18_;
  11611. const T19 v19_;
  11612. const T20 v20_;
  11613. const T21 v21_;
  11614. const T22 v22_;
  11615. const T23 v23_;
  11616. const T24 v24_;
  11617. const T25 v25_;
  11618. const T26 v26_;
  11619. const T27 v27_;
  11620. const T28 v28_;
  11621. const T29 v29_;
  11622. const T30 v30_;
  11623. const T31 v31_;
  11624. const T32 v32_;
  11625. const T33 v33_;
  11626. const T34 v34_;
  11627. const T35 v35_;
  11628. const T36 v36_;
  11629. const T37 v37_;
  11630. const T38 v38_;
  11631. const T39 v39_;
  11632. const T40 v40_;
  11633. const T41 v41_;
  11634. const T42 v42_;
  11635. const T43 v43_;
  11636. const T44 v44_;
  11637. const T45 v45_;
  11638. };
  11639. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11640. typename T6, typename T7, typename T8, typename T9, typename T10,
  11641. typename T11, typename T12, typename T13, typename T14, typename T15,
  11642. typename T16, typename T17, typename T18, typename T19, typename T20,
  11643. typename T21, typename T22, typename T23, typename T24, typename T25,
  11644. typename T26, typename T27, typename T28, typename T29, typename T30,
  11645. typename T31, typename T32, typename T33, typename T34, typename T35,
  11646. typename T36, typename T37, typename T38, typename T39, typename T40,
  11647. typename T41, typename T42, typename T43, typename T44, typename T45,
  11648. typename T46>
  11649. class ValueArray46 {
  11650. public:
  11651. ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11652. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11653. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11654. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11655. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11656. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
  11657. v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11658. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  11659. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  11660. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  11661. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  11662. v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
  11663. v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
  11664. template <typename T>
  11665. operator ParamGenerator<T>() const {
  11666. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11667. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11668. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11669. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_};
  11670. return ValuesIn(array);
  11671. }
  11672. private:
  11673. // No implementation - assignment is unsupported.
  11674. void operator=(const ValueArray46& other);
  11675. const T1 v1_;
  11676. const T2 v2_;
  11677. const T3 v3_;
  11678. const T4 v4_;
  11679. const T5 v5_;
  11680. const T6 v6_;
  11681. const T7 v7_;
  11682. const T8 v8_;
  11683. const T9 v9_;
  11684. const T10 v10_;
  11685. const T11 v11_;
  11686. const T12 v12_;
  11687. const T13 v13_;
  11688. const T14 v14_;
  11689. const T15 v15_;
  11690. const T16 v16_;
  11691. const T17 v17_;
  11692. const T18 v18_;
  11693. const T19 v19_;
  11694. const T20 v20_;
  11695. const T21 v21_;
  11696. const T22 v22_;
  11697. const T23 v23_;
  11698. const T24 v24_;
  11699. const T25 v25_;
  11700. const T26 v26_;
  11701. const T27 v27_;
  11702. const T28 v28_;
  11703. const T29 v29_;
  11704. const T30 v30_;
  11705. const T31 v31_;
  11706. const T32 v32_;
  11707. const T33 v33_;
  11708. const T34 v34_;
  11709. const T35 v35_;
  11710. const T36 v36_;
  11711. const T37 v37_;
  11712. const T38 v38_;
  11713. const T39 v39_;
  11714. const T40 v40_;
  11715. const T41 v41_;
  11716. const T42 v42_;
  11717. const T43 v43_;
  11718. const T44 v44_;
  11719. const T45 v45_;
  11720. const T46 v46_;
  11721. };
  11722. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11723. typename T6, typename T7, typename T8, typename T9, typename T10,
  11724. typename T11, typename T12, typename T13, typename T14, typename T15,
  11725. typename T16, typename T17, typename T18, typename T19, typename T20,
  11726. typename T21, typename T22, typename T23, typename T24, typename T25,
  11727. typename T26, typename T27, typename T28, typename T29, typename T30,
  11728. typename T31, typename T32, typename T33, typename T34, typename T35,
  11729. typename T36, typename T37, typename T38, typename T39, typename T40,
  11730. typename T41, typename T42, typename T43, typename T44, typename T45,
  11731. typename T46, typename T47>
  11732. class ValueArray47 {
  11733. public:
  11734. ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11735. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11736. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11737. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11738. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11739. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
  11740. v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
  11741. v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
  11742. v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
  11743. v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
  11744. v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
  11745. v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
  11746. v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
  11747. v47_(v47) {}
  11748. template <typename T>
  11749. operator ParamGenerator<T>() const {
  11750. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11751. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11752. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11753. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_,
  11754. v47_};
  11755. return ValuesIn(array);
  11756. }
  11757. private:
  11758. // No implementation - assignment is unsupported.
  11759. void operator=(const ValueArray47& other);
  11760. const T1 v1_;
  11761. const T2 v2_;
  11762. const T3 v3_;
  11763. const T4 v4_;
  11764. const T5 v5_;
  11765. const T6 v6_;
  11766. const T7 v7_;
  11767. const T8 v8_;
  11768. const T9 v9_;
  11769. const T10 v10_;
  11770. const T11 v11_;
  11771. const T12 v12_;
  11772. const T13 v13_;
  11773. const T14 v14_;
  11774. const T15 v15_;
  11775. const T16 v16_;
  11776. const T17 v17_;
  11777. const T18 v18_;
  11778. const T19 v19_;
  11779. const T20 v20_;
  11780. const T21 v21_;
  11781. const T22 v22_;
  11782. const T23 v23_;
  11783. const T24 v24_;
  11784. const T25 v25_;
  11785. const T26 v26_;
  11786. const T27 v27_;
  11787. const T28 v28_;
  11788. const T29 v29_;
  11789. const T30 v30_;
  11790. const T31 v31_;
  11791. const T32 v32_;
  11792. const T33 v33_;
  11793. const T34 v34_;
  11794. const T35 v35_;
  11795. const T36 v36_;
  11796. const T37 v37_;
  11797. const T38 v38_;
  11798. const T39 v39_;
  11799. const T40 v40_;
  11800. const T41 v41_;
  11801. const T42 v42_;
  11802. const T43 v43_;
  11803. const T44 v44_;
  11804. const T45 v45_;
  11805. const T46 v46_;
  11806. const T47 v47_;
  11807. };
  11808. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11809. typename T6, typename T7, typename T8, typename T9, typename T10,
  11810. typename T11, typename T12, typename T13, typename T14, typename T15,
  11811. typename T16, typename T17, typename T18, typename T19, typename T20,
  11812. typename T21, typename T22, typename T23, typename T24, typename T25,
  11813. typename T26, typename T27, typename T28, typename T29, typename T30,
  11814. typename T31, typename T32, typename T33, typename T34, typename T35,
  11815. typename T36, typename T37, typename T38, typename T39, typename T40,
  11816. typename T41, typename T42, typename T43, typename T44, typename T45,
  11817. typename T46, typename T47, typename T48>
  11818. class ValueArray48 {
  11819. public:
  11820. ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11821. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11822. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11823. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11824. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11825. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
  11826. v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
  11827. v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
  11828. v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
  11829. v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
  11830. v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
  11831. v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
  11832. v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
  11833. v46_(v46), v47_(v47), v48_(v48) {}
  11834. template <typename T>
  11835. operator ParamGenerator<T>() const {
  11836. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11837. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11838. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11839. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_,
  11840. v48_};
  11841. return ValuesIn(array);
  11842. }
  11843. private:
  11844. // No implementation - assignment is unsupported.
  11845. void operator=(const ValueArray48& other);
  11846. const T1 v1_;
  11847. const T2 v2_;
  11848. const T3 v3_;
  11849. const T4 v4_;
  11850. const T5 v5_;
  11851. const T6 v6_;
  11852. const T7 v7_;
  11853. const T8 v8_;
  11854. const T9 v9_;
  11855. const T10 v10_;
  11856. const T11 v11_;
  11857. const T12 v12_;
  11858. const T13 v13_;
  11859. const T14 v14_;
  11860. const T15 v15_;
  11861. const T16 v16_;
  11862. const T17 v17_;
  11863. const T18 v18_;
  11864. const T19 v19_;
  11865. const T20 v20_;
  11866. const T21 v21_;
  11867. const T22 v22_;
  11868. const T23 v23_;
  11869. const T24 v24_;
  11870. const T25 v25_;
  11871. const T26 v26_;
  11872. const T27 v27_;
  11873. const T28 v28_;
  11874. const T29 v29_;
  11875. const T30 v30_;
  11876. const T31 v31_;
  11877. const T32 v32_;
  11878. const T33 v33_;
  11879. const T34 v34_;
  11880. const T35 v35_;
  11881. const T36 v36_;
  11882. const T37 v37_;
  11883. const T38 v38_;
  11884. const T39 v39_;
  11885. const T40 v40_;
  11886. const T41 v41_;
  11887. const T42 v42_;
  11888. const T43 v43_;
  11889. const T44 v44_;
  11890. const T45 v45_;
  11891. const T46 v46_;
  11892. const T47 v47_;
  11893. const T48 v48_;
  11894. };
  11895. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11896. typename T6, typename T7, typename T8, typename T9, typename T10,
  11897. typename T11, typename T12, typename T13, typename T14, typename T15,
  11898. typename T16, typename T17, typename T18, typename T19, typename T20,
  11899. typename T21, typename T22, typename T23, typename T24, typename T25,
  11900. typename T26, typename T27, typename T28, typename T29, typename T30,
  11901. typename T31, typename T32, typename T33, typename T34, typename T35,
  11902. typename T36, typename T37, typename T38, typename T39, typename T40,
  11903. typename T41, typename T42, typename T43, typename T44, typename T45,
  11904. typename T46, typename T47, typename T48, typename T49>
  11905. class ValueArray49 {
  11906. public:
  11907. ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11908. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11909. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11910. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11911. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  11912. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
  11913. T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  11914. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  11915. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  11916. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  11917. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  11918. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  11919. v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
  11920. v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
  11921. template <typename T>
  11922. operator ParamGenerator<T>() const {
  11923. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  11924. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  11925. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  11926. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_,
  11927. v48_, v49_};
  11928. return ValuesIn(array);
  11929. }
  11930. private:
  11931. // No implementation - assignment is unsupported.
  11932. void operator=(const ValueArray49& other);
  11933. const T1 v1_;
  11934. const T2 v2_;
  11935. const T3 v3_;
  11936. const T4 v4_;
  11937. const T5 v5_;
  11938. const T6 v6_;
  11939. const T7 v7_;
  11940. const T8 v8_;
  11941. const T9 v9_;
  11942. const T10 v10_;
  11943. const T11 v11_;
  11944. const T12 v12_;
  11945. const T13 v13_;
  11946. const T14 v14_;
  11947. const T15 v15_;
  11948. const T16 v16_;
  11949. const T17 v17_;
  11950. const T18 v18_;
  11951. const T19 v19_;
  11952. const T20 v20_;
  11953. const T21 v21_;
  11954. const T22 v22_;
  11955. const T23 v23_;
  11956. const T24 v24_;
  11957. const T25 v25_;
  11958. const T26 v26_;
  11959. const T27 v27_;
  11960. const T28 v28_;
  11961. const T29 v29_;
  11962. const T30 v30_;
  11963. const T31 v31_;
  11964. const T32 v32_;
  11965. const T33 v33_;
  11966. const T34 v34_;
  11967. const T35 v35_;
  11968. const T36 v36_;
  11969. const T37 v37_;
  11970. const T38 v38_;
  11971. const T39 v39_;
  11972. const T40 v40_;
  11973. const T41 v41_;
  11974. const T42 v42_;
  11975. const T43 v43_;
  11976. const T44 v44_;
  11977. const T45 v45_;
  11978. const T46 v46_;
  11979. const T47 v47_;
  11980. const T48 v48_;
  11981. const T49 v49_;
  11982. };
  11983. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  11984. typename T6, typename T7, typename T8, typename T9, typename T10,
  11985. typename T11, typename T12, typename T13, typename T14, typename T15,
  11986. typename T16, typename T17, typename T18, typename T19, typename T20,
  11987. typename T21, typename T22, typename T23, typename T24, typename T25,
  11988. typename T26, typename T27, typename T28, typename T29, typename T30,
  11989. typename T31, typename T32, typename T33, typename T34, typename T35,
  11990. typename T36, typename T37, typename T38, typename T39, typename T40,
  11991. typename T41, typename T42, typename T43, typename T44, typename T45,
  11992. typename T46, typename T47, typename T48, typename T49, typename T50>
  11993. class ValueArray50 {
  11994. public:
  11995. ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  11996. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  11997. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  11998. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  11999. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  12000. T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
  12001. T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
  12002. v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
  12003. v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
  12004. v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
  12005. v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
  12006. v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
  12007. v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
  12008. v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
  12009. template <typename T>
  12010. operator ParamGenerator<T>() const {
  12011. const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
  12012. v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
  12013. v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
  12014. v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_,
  12015. v48_, v49_, v50_};
  12016. return ValuesIn(array);
  12017. }
  12018. private:
  12019. // No implementation - assignment is unsupported.
  12020. void operator=(const ValueArray50& other);
  12021. const T1 v1_;
  12022. const T2 v2_;
  12023. const T3 v3_;
  12024. const T4 v4_;
  12025. const T5 v5_;
  12026. const T6 v6_;
  12027. const T7 v7_;
  12028. const T8 v8_;
  12029. const T9 v9_;
  12030. const T10 v10_;
  12031. const T11 v11_;
  12032. const T12 v12_;
  12033. const T13 v13_;
  12034. const T14 v14_;
  12035. const T15 v15_;
  12036. const T16 v16_;
  12037. const T17 v17_;
  12038. const T18 v18_;
  12039. const T19 v19_;
  12040. const T20 v20_;
  12041. const T21 v21_;
  12042. const T22 v22_;
  12043. const T23 v23_;
  12044. const T24 v24_;
  12045. const T25 v25_;
  12046. const T26 v26_;
  12047. const T27 v27_;
  12048. const T28 v28_;
  12049. const T29 v29_;
  12050. const T30 v30_;
  12051. const T31 v31_;
  12052. const T32 v32_;
  12053. const T33 v33_;
  12054. const T34 v34_;
  12055. const T35 v35_;
  12056. const T36 v36_;
  12057. const T37 v37_;
  12058. const T38 v38_;
  12059. const T39 v39_;
  12060. const T40 v40_;
  12061. const T41 v41_;
  12062. const T42 v42_;
  12063. const T43 v43_;
  12064. const T44 v44_;
  12065. const T45 v45_;
  12066. const T46 v46_;
  12067. const T47 v47_;
  12068. const T48 v48_;
  12069. const T49 v49_;
  12070. const T50 v50_;
  12071. };
  12072. # if GTEST_HAS_COMBINE
  12073. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  12074. //
  12075. // Generates values from the Cartesian product of values produced
  12076. // by the argument generators.
  12077. //
  12078. template <typename T1, typename T2>
  12079. class CartesianProductGenerator2
  12080. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {
  12081. public:
  12082. typedef ::std::tr1::tuple<T1, T2> ParamType;
  12083. CartesianProductGenerator2(const ParamGenerator<T1>& g1,
  12084. const ParamGenerator<T2>& g2)
  12085. : g1_(g1), g2_(g2) {}
  12086. virtual ~CartesianProductGenerator2() {}
  12087. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12088. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
  12089. }
  12090. virtual ParamIteratorInterface<ParamType>* End() const {
  12091. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
  12092. }
  12093. private:
  12094. class Iterator : public ParamIteratorInterface<ParamType> {
  12095. public:
  12096. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12097. const ParamGenerator<T1>& g1,
  12098. const typename ParamGenerator<T1>::iterator& current1,
  12099. const ParamGenerator<T2>& g2,
  12100. const typename ParamGenerator<T2>::iterator& current2)
  12101. : base_(base),
  12102. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12103. begin2_(g2.begin()), end2_(g2.end()), current2_(current2) {
  12104. ComputeCurrentValue();
  12105. }
  12106. virtual ~Iterator() {}
  12107. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12108. return base_;
  12109. }
  12110. // Advance should not be called on beyond-of-range iterators
  12111. // so no component iterators must be beyond end of range, either.
  12112. virtual void Advance() {
  12113. assert(!AtEnd());
  12114. ++current2_;
  12115. if (current2_ == end2_) {
  12116. current2_ = begin2_;
  12117. ++current1_;
  12118. }
  12119. ComputeCurrentValue();
  12120. }
  12121. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12122. return new Iterator(*this);
  12123. }
  12124. virtual const ParamType* Current() const { return &current_value_; }
  12125. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12126. // Having the same base generator guarantees that the other
  12127. // iterator is of the same type and we can downcast.
  12128. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12129. << "The program attempted to compare iterators "
  12130. << "from different generators." << std::endl;
  12131. const Iterator* typed_other =
  12132. CheckedDowncastToActualType<const Iterator>(&other);
  12133. // We must report iterators equal if they both point beyond their
  12134. // respective ranges. That can happen in a variety of fashions,
  12135. // so we have to consult AtEnd().
  12136. return (AtEnd() && typed_other->AtEnd()) ||
  12137. (
  12138. current1_ == typed_other->current1_ &&
  12139. current2_ == typed_other->current2_);
  12140. }
  12141. private:
  12142. Iterator(const Iterator& other)
  12143. : base_(other.base_),
  12144. begin1_(other.begin1_),
  12145. end1_(other.end1_),
  12146. current1_(other.current1_),
  12147. begin2_(other.begin2_),
  12148. end2_(other.end2_),
  12149. current2_(other.current2_) {
  12150. ComputeCurrentValue();
  12151. }
  12152. void ComputeCurrentValue() {
  12153. if (!AtEnd())
  12154. current_value_ = ParamType(*current1_, *current2_);
  12155. }
  12156. bool AtEnd() const {
  12157. // We must report iterator past the end of the range when either of the
  12158. // component iterators has reached the end of its range.
  12159. return
  12160. current1_ == end1_ ||
  12161. current2_ == end2_;
  12162. }
  12163. // No implementation - assignment is unsupported.
  12164. void operator=(const Iterator& other);
  12165. const ParamGeneratorInterface<ParamType>* const base_;
  12166. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12167. // current[i]_ is the actual traversing iterator.
  12168. const typename ParamGenerator<T1>::iterator begin1_;
  12169. const typename ParamGenerator<T1>::iterator end1_;
  12170. typename ParamGenerator<T1>::iterator current1_;
  12171. const typename ParamGenerator<T2>::iterator begin2_;
  12172. const typename ParamGenerator<T2>::iterator end2_;
  12173. typename ParamGenerator<T2>::iterator current2_;
  12174. ParamType current_value_;
  12175. }; // class CartesianProductGenerator2::Iterator
  12176. // No implementation - assignment is unsupported.
  12177. void operator=(const CartesianProductGenerator2& other);
  12178. const ParamGenerator<T1> g1_;
  12179. const ParamGenerator<T2> g2_;
  12180. }; // class CartesianProductGenerator2
  12181. template <typename T1, typename T2, typename T3>
  12182. class CartesianProductGenerator3
  12183. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {
  12184. public:
  12185. typedef ::std::tr1::tuple<T1, T2, T3> ParamType;
  12186. CartesianProductGenerator3(const ParamGenerator<T1>& g1,
  12187. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
  12188. : g1_(g1), g2_(g2), g3_(g3) {}
  12189. virtual ~CartesianProductGenerator3() {}
  12190. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12191. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12192. g3_.begin());
  12193. }
  12194. virtual ParamIteratorInterface<ParamType>* End() const {
  12195. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
  12196. }
  12197. private:
  12198. class Iterator : public ParamIteratorInterface<ParamType> {
  12199. public:
  12200. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12201. const ParamGenerator<T1>& g1,
  12202. const typename ParamGenerator<T1>::iterator& current1,
  12203. const ParamGenerator<T2>& g2,
  12204. const typename ParamGenerator<T2>::iterator& current2,
  12205. const ParamGenerator<T3>& g3,
  12206. const typename ParamGenerator<T3>::iterator& current3)
  12207. : base_(base),
  12208. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12209. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  12210. begin3_(g3.begin()), end3_(g3.end()), current3_(current3) {
  12211. ComputeCurrentValue();
  12212. }
  12213. virtual ~Iterator() {}
  12214. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12215. return base_;
  12216. }
  12217. // Advance should not be called on beyond-of-range iterators
  12218. // so no component iterators must be beyond end of range, either.
  12219. virtual void Advance() {
  12220. assert(!AtEnd());
  12221. ++current3_;
  12222. if (current3_ == end3_) {
  12223. current3_ = begin3_;
  12224. ++current2_;
  12225. }
  12226. if (current2_ == end2_) {
  12227. current2_ = begin2_;
  12228. ++current1_;
  12229. }
  12230. ComputeCurrentValue();
  12231. }
  12232. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12233. return new Iterator(*this);
  12234. }
  12235. virtual const ParamType* Current() const { return &current_value_; }
  12236. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12237. // Having the same base generator guarantees that the other
  12238. // iterator is of the same type and we can downcast.
  12239. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12240. << "The program attempted to compare iterators "
  12241. << "from different generators." << std::endl;
  12242. const Iterator* typed_other =
  12243. CheckedDowncastToActualType<const Iterator>(&other);
  12244. // We must report iterators equal if they both point beyond their
  12245. // respective ranges. That can happen in a variety of fashions,
  12246. // so we have to consult AtEnd().
  12247. return (AtEnd() && typed_other->AtEnd()) ||
  12248. (
  12249. current1_ == typed_other->current1_ &&
  12250. current2_ == typed_other->current2_ &&
  12251. current3_ == typed_other->current3_);
  12252. }
  12253. private:
  12254. Iterator(const Iterator& other)
  12255. : base_(other.base_),
  12256. begin1_(other.begin1_),
  12257. end1_(other.end1_),
  12258. current1_(other.current1_),
  12259. begin2_(other.begin2_),
  12260. end2_(other.end2_),
  12261. current2_(other.current2_),
  12262. begin3_(other.begin3_),
  12263. end3_(other.end3_),
  12264. current3_(other.current3_) {
  12265. ComputeCurrentValue();
  12266. }
  12267. void ComputeCurrentValue() {
  12268. if (!AtEnd())
  12269. current_value_ = ParamType(*current1_, *current2_, *current3_);
  12270. }
  12271. bool AtEnd() const {
  12272. // We must report iterator past the end of the range when either of the
  12273. // component iterators has reached the end of its range.
  12274. return
  12275. current1_ == end1_ ||
  12276. current2_ == end2_ ||
  12277. current3_ == end3_;
  12278. }
  12279. // No implementation - assignment is unsupported.
  12280. void operator=(const Iterator& other);
  12281. const ParamGeneratorInterface<ParamType>* const base_;
  12282. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12283. // current[i]_ is the actual traversing iterator.
  12284. const typename ParamGenerator<T1>::iterator begin1_;
  12285. const typename ParamGenerator<T1>::iterator end1_;
  12286. typename ParamGenerator<T1>::iterator current1_;
  12287. const typename ParamGenerator<T2>::iterator begin2_;
  12288. const typename ParamGenerator<T2>::iterator end2_;
  12289. typename ParamGenerator<T2>::iterator current2_;
  12290. const typename ParamGenerator<T3>::iterator begin3_;
  12291. const typename ParamGenerator<T3>::iterator end3_;
  12292. typename ParamGenerator<T3>::iterator current3_;
  12293. ParamType current_value_;
  12294. }; // class CartesianProductGenerator3::Iterator
  12295. // No implementation - assignment is unsupported.
  12296. void operator=(const CartesianProductGenerator3& other);
  12297. const ParamGenerator<T1> g1_;
  12298. const ParamGenerator<T2> g2_;
  12299. const ParamGenerator<T3> g3_;
  12300. }; // class CartesianProductGenerator3
  12301. template <typename T1, typename T2, typename T3, typename T4>
  12302. class CartesianProductGenerator4
  12303. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {
  12304. public:
  12305. typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;
  12306. CartesianProductGenerator4(const ParamGenerator<T1>& g1,
  12307. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  12308. const ParamGenerator<T4>& g4)
  12309. : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
  12310. virtual ~CartesianProductGenerator4() {}
  12311. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12312. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12313. g3_.begin(), g4_, g4_.begin());
  12314. }
  12315. virtual ParamIteratorInterface<ParamType>* End() const {
  12316. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  12317. g4_, g4_.end());
  12318. }
  12319. private:
  12320. class Iterator : public ParamIteratorInterface<ParamType> {
  12321. public:
  12322. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12323. const ParamGenerator<T1>& g1,
  12324. const typename ParamGenerator<T1>::iterator& current1,
  12325. const ParamGenerator<T2>& g2,
  12326. const typename ParamGenerator<T2>::iterator& current2,
  12327. const ParamGenerator<T3>& g3,
  12328. const typename ParamGenerator<T3>::iterator& current3,
  12329. const ParamGenerator<T4>& g4,
  12330. const typename ParamGenerator<T4>::iterator& current4)
  12331. : base_(base),
  12332. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12333. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  12334. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  12335. begin4_(g4.begin()), end4_(g4.end()), current4_(current4) {
  12336. ComputeCurrentValue();
  12337. }
  12338. virtual ~Iterator() {}
  12339. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12340. return base_;
  12341. }
  12342. // Advance should not be called on beyond-of-range iterators
  12343. // so no component iterators must be beyond end of range, either.
  12344. virtual void Advance() {
  12345. assert(!AtEnd());
  12346. ++current4_;
  12347. if (current4_ == end4_) {
  12348. current4_ = begin4_;
  12349. ++current3_;
  12350. }
  12351. if (current3_ == end3_) {
  12352. current3_ = begin3_;
  12353. ++current2_;
  12354. }
  12355. if (current2_ == end2_) {
  12356. current2_ = begin2_;
  12357. ++current1_;
  12358. }
  12359. ComputeCurrentValue();
  12360. }
  12361. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12362. return new Iterator(*this);
  12363. }
  12364. virtual const ParamType* Current() const { return &current_value_; }
  12365. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12366. // Having the same base generator guarantees that the other
  12367. // iterator is of the same type and we can downcast.
  12368. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12369. << "The program attempted to compare iterators "
  12370. << "from different generators." << std::endl;
  12371. const Iterator* typed_other =
  12372. CheckedDowncastToActualType<const Iterator>(&other);
  12373. // We must report iterators equal if they both point beyond their
  12374. // respective ranges. That can happen in a variety of fashions,
  12375. // so we have to consult AtEnd().
  12376. return (AtEnd() && typed_other->AtEnd()) ||
  12377. (
  12378. current1_ == typed_other->current1_ &&
  12379. current2_ == typed_other->current2_ &&
  12380. current3_ == typed_other->current3_ &&
  12381. current4_ == typed_other->current4_);
  12382. }
  12383. private:
  12384. Iterator(const Iterator& other)
  12385. : base_(other.base_),
  12386. begin1_(other.begin1_),
  12387. end1_(other.end1_),
  12388. current1_(other.current1_),
  12389. begin2_(other.begin2_),
  12390. end2_(other.end2_),
  12391. current2_(other.current2_),
  12392. begin3_(other.begin3_),
  12393. end3_(other.end3_),
  12394. current3_(other.current3_),
  12395. begin4_(other.begin4_),
  12396. end4_(other.end4_),
  12397. current4_(other.current4_) {
  12398. ComputeCurrentValue();
  12399. }
  12400. void ComputeCurrentValue() {
  12401. if (!AtEnd())
  12402. current_value_ = ParamType(*current1_, *current2_, *current3_,
  12403. *current4_);
  12404. }
  12405. bool AtEnd() const {
  12406. // We must report iterator past the end of the range when either of the
  12407. // component iterators has reached the end of its range.
  12408. return
  12409. current1_ == end1_ ||
  12410. current2_ == end2_ ||
  12411. current3_ == end3_ ||
  12412. current4_ == end4_;
  12413. }
  12414. // No implementation - assignment is unsupported.
  12415. void operator=(const Iterator& other);
  12416. const ParamGeneratorInterface<ParamType>* const base_;
  12417. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12418. // current[i]_ is the actual traversing iterator.
  12419. const typename ParamGenerator<T1>::iterator begin1_;
  12420. const typename ParamGenerator<T1>::iterator end1_;
  12421. typename ParamGenerator<T1>::iterator current1_;
  12422. const typename ParamGenerator<T2>::iterator begin2_;
  12423. const typename ParamGenerator<T2>::iterator end2_;
  12424. typename ParamGenerator<T2>::iterator current2_;
  12425. const typename ParamGenerator<T3>::iterator begin3_;
  12426. const typename ParamGenerator<T3>::iterator end3_;
  12427. typename ParamGenerator<T3>::iterator current3_;
  12428. const typename ParamGenerator<T4>::iterator begin4_;
  12429. const typename ParamGenerator<T4>::iterator end4_;
  12430. typename ParamGenerator<T4>::iterator current4_;
  12431. ParamType current_value_;
  12432. }; // class CartesianProductGenerator4::Iterator
  12433. // No implementation - assignment is unsupported.
  12434. void operator=(const CartesianProductGenerator4& other);
  12435. const ParamGenerator<T1> g1_;
  12436. const ParamGenerator<T2> g2_;
  12437. const ParamGenerator<T3> g3_;
  12438. const ParamGenerator<T4> g4_;
  12439. }; // class CartesianProductGenerator4
  12440. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  12441. class CartesianProductGenerator5
  12442. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {
  12443. public:
  12444. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;
  12445. CartesianProductGenerator5(const ParamGenerator<T1>& g1,
  12446. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  12447. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
  12448. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
  12449. virtual ~CartesianProductGenerator5() {}
  12450. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12451. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12452. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
  12453. }
  12454. virtual ParamIteratorInterface<ParamType>* End() const {
  12455. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  12456. g4_, g4_.end(), g5_, g5_.end());
  12457. }
  12458. private:
  12459. class Iterator : public ParamIteratorInterface<ParamType> {
  12460. public:
  12461. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12462. const ParamGenerator<T1>& g1,
  12463. const typename ParamGenerator<T1>::iterator& current1,
  12464. const ParamGenerator<T2>& g2,
  12465. const typename ParamGenerator<T2>::iterator& current2,
  12466. const ParamGenerator<T3>& g3,
  12467. const typename ParamGenerator<T3>::iterator& current3,
  12468. const ParamGenerator<T4>& g4,
  12469. const typename ParamGenerator<T4>::iterator& current4,
  12470. const ParamGenerator<T5>& g5,
  12471. const typename ParamGenerator<T5>::iterator& current5)
  12472. : base_(base),
  12473. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12474. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  12475. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  12476. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  12477. begin5_(g5.begin()), end5_(g5.end()), current5_(current5) {
  12478. ComputeCurrentValue();
  12479. }
  12480. virtual ~Iterator() {}
  12481. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12482. return base_;
  12483. }
  12484. // Advance should not be called on beyond-of-range iterators
  12485. // so no component iterators must be beyond end of range, either.
  12486. virtual void Advance() {
  12487. assert(!AtEnd());
  12488. ++current5_;
  12489. if (current5_ == end5_) {
  12490. current5_ = begin5_;
  12491. ++current4_;
  12492. }
  12493. if (current4_ == end4_) {
  12494. current4_ = begin4_;
  12495. ++current3_;
  12496. }
  12497. if (current3_ == end3_) {
  12498. current3_ = begin3_;
  12499. ++current2_;
  12500. }
  12501. if (current2_ == end2_) {
  12502. current2_ = begin2_;
  12503. ++current1_;
  12504. }
  12505. ComputeCurrentValue();
  12506. }
  12507. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12508. return new Iterator(*this);
  12509. }
  12510. virtual const ParamType* Current() const { return &current_value_; }
  12511. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12512. // Having the same base generator guarantees that the other
  12513. // iterator is of the same type and we can downcast.
  12514. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12515. << "The program attempted to compare iterators "
  12516. << "from different generators." << std::endl;
  12517. const Iterator* typed_other =
  12518. CheckedDowncastToActualType<const Iterator>(&other);
  12519. // We must report iterators equal if they both point beyond their
  12520. // respective ranges. That can happen in a variety of fashions,
  12521. // so we have to consult AtEnd().
  12522. return (AtEnd() && typed_other->AtEnd()) ||
  12523. (
  12524. current1_ == typed_other->current1_ &&
  12525. current2_ == typed_other->current2_ &&
  12526. current3_ == typed_other->current3_ &&
  12527. current4_ == typed_other->current4_ &&
  12528. current5_ == typed_other->current5_);
  12529. }
  12530. private:
  12531. Iterator(const Iterator& other)
  12532. : base_(other.base_),
  12533. begin1_(other.begin1_),
  12534. end1_(other.end1_),
  12535. current1_(other.current1_),
  12536. begin2_(other.begin2_),
  12537. end2_(other.end2_),
  12538. current2_(other.current2_),
  12539. begin3_(other.begin3_),
  12540. end3_(other.end3_),
  12541. current3_(other.current3_),
  12542. begin4_(other.begin4_),
  12543. end4_(other.end4_),
  12544. current4_(other.current4_),
  12545. begin5_(other.begin5_),
  12546. end5_(other.end5_),
  12547. current5_(other.current5_) {
  12548. ComputeCurrentValue();
  12549. }
  12550. void ComputeCurrentValue() {
  12551. if (!AtEnd())
  12552. current_value_ = ParamType(*current1_, *current2_, *current3_,
  12553. *current4_, *current5_);
  12554. }
  12555. bool AtEnd() const {
  12556. // We must report iterator past the end of the range when either of the
  12557. // component iterators has reached the end of its range.
  12558. return
  12559. current1_ == end1_ ||
  12560. current2_ == end2_ ||
  12561. current3_ == end3_ ||
  12562. current4_ == end4_ ||
  12563. current5_ == end5_;
  12564. }
  12565. // No implementation - assignment is unsupported.
  12566. void operator=(const Iterator& other);
  12567. const ParamGeneratorInterface<ParamType>* const base_;
  12568. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12569. // current[i]_ is the actual traversing iterator.
  12570. const typename ParamGenerator<T1>::iterator begin1_;
  12571. const typename ParamGenerator<T1>::iterator end1_;
  12572. typename ParamGenerator<T1>::iterator current1_;
  12573. const typename ParamGenerator<T2>::iterator begin2_;
  12574. const typename ParamGenerator<T2>::iterator end2_;
  12575. typename ParamGenerator<T2>::iterator current2_;
  12576. const typename ParamGenerator<T3>::iterator begin3_;
  12577. const typename ParamGenerator<T3>::iterator end3_;
  12578. typename ParamGenerator<T3>::iterator current3_;
  12579. const typename ParamGenerator<T4>::iterator begin4_;
  12580. const typename ParamGenerator<T4>::iterator end4_;
  12581. typename ParamGenerator<T4>::iterator current4_;
  12582. const typename ParamGenerator<T5>::iterator begin5_;
  12583. const typename ParamGenerator<T5>::iterator end5_;
  12584. typename ParamGenerator<T5>::iterator current5_;
  12585. ParamType current_value_;
  12586. }; // class CartesianProductGenerator5::Iterator
  12587. // No implementation - assignment is unsupported.
  12588. void operator=(const CartesianProductGenerator5& other);
  12589. const ParamGenerator<T1> g1_;
  12590. const ParamGenerator<T2> g2_;
  12591. const ParamGenerator<T3> g3_;
  12592. const ParamGenerator<T4> g4_;
  12593. const ParamGenerator<T5> g5_;
  12594. }; // class CartesianProductGenerator5
  12595. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12596. typename T6>
  12597. class CartesianProductGenerator6
  12598. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,
  12599. T6> > {
  12600. public:
  12601. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;
  12602. CartesianProductGenerator6(const ParamGenerator<T1>& g1,
  12603. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  12604. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  12605. const ParamGenerator<T6>& g6)
  12606. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
  12607. virtual ~CartesianProductGenerator6() {}
  12608. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12609. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12610. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
  12611. }
  12612. virtual ParamIteratorInterface<ParamType>* End() const {
  12613. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  12614. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
  12615. }
  12616. private:
  12617. class Iterator : public ParamIteratorInterface<ParamType> {
  12618. public:
  12619. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12620. const ParamGenerator<T1>& g1,
  12621. const typename ParamGenerator<T1>::iterator& current1,
  12622. const ParamGenerator<T2>& g2,
  12623. const typename ParamGenerator<T2>::iterator& current2,
  12624. const ParamGenerator<T3>& g3,
  12625. const typename ParamGenerator<T3>::iterator& current3,
  12626. const ParamGenerator<T4>& g4,
  12627. const typename ParamGenerator<T4>::iterator& current4,
  12628. const ParamGenerator<T5>& g5,
  12629. const typename ParamGenerator<T5>::iterator& current5,
  12630. const ParamGenerator<T6>& g6,
  12631. const typename ParamGenerator<T6>::iterator& current6)
  12632. : base_(base),
  12633. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12634. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  12635. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  12636. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  12637. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  12638. begin6_(g6.begin()), end6_(g6.end()), current6_(current6) {
  12639. ComputeCurrentValue();
  12640. }
  12641. virtual ~Iterator() {}
  12642. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12643. return base_;
  12644. }
  12645. // Advance should not be called on beyond-of-range iterators
  12646. // so no component iterators must be beyond end of range, either.
  12647. virtual void Advance() {
  12648. assert(!AtEnd());
  12649. ++current6_;
  12650. if (current6_ == end6_) {
  12651. current6_ = begin6_;
  12652. ++current5_;
  12653. }
  12654. if (current5_ == end5_) {
  12655. current5_ = begin5_;
  12656. ++current4_;
  12657. }
  12658. if (current4_ == end4_) {
  12659. current4_ = begin4_;
  12660. ++current3_;
  12661. }
  12662. if (current3_ == end3_) {
  12663. current3_ = begin3_;
  12664. ++current2_;
  12665. }
  12666. if (current2_ == end2_) {
  12667. current2_ = begin2_;
  12668. ++current1_;
  12669. }
  12670. ComputeCurrentValue();
  12671. }
  12672. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12673. return new Iterator(*this);
  12674. }
  12675. virtual const ParamType* Current() const { return &current_value_; }
  12676. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12677. // Having the same base generator guarantees that the other
  12678. // iterator is of the same type and we can downcast.
  12679. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12680. << "The program attempted to compare iterators "
  12681. << "from different generators." << std::endl;
  12682. const Iterator* typed_other =
  12683. CheckedDowncastToActualType<const Iterator>(&other);
  12684. // We must report iterators equal if they both point beyond their
  12685. // respective ranges. That can happen in a variety of fashions,
  12686. // so we have to consult AtEnd().
  12687. return (AtEnd() && typed_other->AtEnd()) ||
  12688. (
  12689. current1_ == typed_other->current1_ &&
  12690. current2_ == typed_other->current2_ &&
  12691. current3_ == typed_other->current3_ &&
  12692. current4_ == typed_other->current4_ &&
  12693. current5_ == typed_other->current5_ &&
  12694. current6_ == typed_other->current6_);
  12695. }
  12696. private:
  12697. Iterator(const Iterator& other)
  12698. : base_(other.base_),
  12699. begin1_(other.begin1_),
  12700. end1_(other.end1_),
  12701. current1_(other.current1_),
  12702. begin2_(other.begin2_),
  12703. end2_(other.end2_),
  12704. current2_(other.current2_),
  12705. begin3_(other.begin3_),
  12706. end3_(other.end3_),
  12707. current3_(other.current3_),
  12708. begin4_(other.begin4_),
  12709. end4_(other.end4_),
  12710. current4_(other.current4_),
  12711. begin5_(other.begin5_),
  12712. end5_(other.end5_),
  12713. current5_(other.current5_),
  12714. begin6_(other.begin6_),
  12715. end6_(other.end6_),
  12716. current6_(other.current6_) {
  12717. ComputeCurrentValue();
  12718. }
  12719. void ComputeCurrentValue() {
  12720. if (!AtEnd())
  12721. current_value_ = ParamType(*current1_, *current2_, *current3_,
  12722. *current4_, *current5_, *current6_);
  12723. }
  12724. bool AtEnd() const {
  12725. // We must report iterator past the end of the range when either of the
  12726. // component iterators has reached the end of its range.
  12727. return
  12728. current1_ == end1_ ||
  12729. current2_ == end2_ ||
  12730. current3_ == end3_ ||
  12731. current4_ == end4_ ||
  12732. current5_ == end5_ ||
  12733. current6_ == end6_;
  12734. }
  12735. // No implementation - assignment is unsupported.
  12736. void operator=(const Iterator& other);
  12737. const ParamGeneratorInterface<ParamType>* const base_;
  12738. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12739. // current[i]_ is the actual traversing iterator.
  12740. const typename ParamGenerator<T1>::iterator begin1_;
  12741. const typename ParamGenerator<T1>::iterator end1_;
  12742. typename ParamGenerator<T1>::iterator current1_;
  12743. const typename ParamGenerator<T2>::iterator begin2_;
  12744. const typename ParamGenerator<T2>::iterator end2_;
  12745. typename ParamGenerator<T2>::iterator current2_;
  12746. const typename ParamGenerator<T3>::iterator begin3_;
  12747. const typename ParamGenerator<T3>::iterator end3_;
  12748. typename ParamGenerator<T3>::iterator current3_;
  12749. const typename ParamGenerator<T4>::iterator begin4_;
  12750. const typename ParamGenerator<T4>::iterator end4_;
  12751. typename ParamGenerator<T4>::iterator current4_;
  12752. const typename ParamGenerator<T5>::iterator begin5_;
  12753. const typename ParamGenerator<T5>::iterator end5_;
  12754. typename ParamGenerator<T5>::iterator current5_;
  12755. const typename ParamGenerator<T6>::iterator begin6_;
  12756. const typename ParamGenerator<T6>::iterator end6_;
  12757. typename ParamGenerator<T6>::iterator current6_;
  12758. ParamType current_value_;
  12759. }; // class CartesianProductGenerator6::Iterator
  12760. // No implementation - assignment is unsupported.
  12761. void operator=(const CartesianProductGenerator6& other);
  12762. const ParamGenerator<T1> g1_;
  12763. const ParamGenerator<T2> g2_;
  12764. const ParamGenerator<T3> g3_;
  12765. const ParamGenerator<T4> g4_;
  12766. const ParamGenerator<T5> g5_;
  12767. const ParamGenerator<T6> g6_;
  12768. }; // class CartesianProductGenerator6
  12769. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12770. typename T6, typename T7>
  12771. class CartesianProductGenerator7
  12772. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
  12773. T7> > {
  12774. public:
  12775. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
  12776. CartesianProductGenerator7(const ParamGenerator<T1>& g1,
  12777. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  12778. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  12779. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
  12780. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
  12781. virtual ~CartesianProductGenerator7() {}
  12782. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12783. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12784. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  12785. g7_.begin());
  12786. }
  12787. virtual ParamIteratorInterface<ParamType>* End() const {
  12788. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  12789. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
  12790. }
  12791. private:
  12792. class Iterator : public ParamIteratorInterface<ParamType> {
  12793. public:
  12794. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12795. const ParamGenerator<T1>& g1,
  12796. const typename ParamGenerator<T1>::iterator& current1,
  12797. const ParamGenerator<T2>& g2,
  12798. const typename ParamGenerator<T2>::iterator& current2,
  12799. const ParamGenerator<T3>& g3,
  12800. const typename ParamGenerator<T3>::iterator& current3,
  12801. const ParamGenerator<T4>& g4,
  12802. const typename ParamGenerator<T4>::iterator& current4,
  12803. const ParamGenerator<T5>& g5,
  12804. const typename ParamGenerator<T5>::iterator& current5,
  12805. const ParamGenerator<T6>& g6,
  12806. const typename ParamGenerator<T6>::iterator& current6,
  12807. const ParamGenerator<T7>& g7,
  12808. const typename ParamGenerator<T7>::iterator& current7)
  12809. : base_(base),
  12810. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  12811. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  12812. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  12813. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  12814. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  12815. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  12816. begin7_(g7.begin()), end7_(g7.end()), current7_(current7) {
  12817. ComputeCurrentValue();
  12818. }
  12819. virtual ~Iterator() {}
  12820. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  12821. return base_;
  12822. }
  12823. // Advance should not be called on beyond-of-range iterators
  12824. // so no component iterators must be beyond end of range, either.
  12825. virtual void Advance() {
  12826. assert(!AtEnd());
  12827. ++current7_;
  12828. if (current7_ == end7_) {
  12829. current7_ = begin7_;
  12830. ++current6_;
  12831. }
  12832. if (current6_ == end6_) {
  12833. current6_ = begin6_;
  12834. ++current5_;
  12835. }
  12836. if (current5_ == end5_) {
  12837. current5_ = begin5_;
  12838. ++current4_;
  12839. }
  12840. if (current4_ == end4_) {
  12841. current4_ = begin4_;
  12842. ++current3_;
  12843. }
  12844. if (current3_ == end3_) {
  12845. current3_ = begin3_;
  12846. ++current2_;
  12847. }
  12848. if (current2_ == end2_) {
  12849. current2_ = begin2_;
  12850. ++current1_;
  12851. }
  12852. ComputeCurrentValue();
  12853. }
  12854. virtual ParamIteratorInterface<ParamType>* Clone() const {
  12855. return new Iterator(*this);
  12856. }
  12857. virtual const ParamType* Current() const { return &current_value_; }
  12858. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  12859. // Having the same base generator guarantees that the other
  12860. // iterator is of the same type and we can downcast.
  12861. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  12862. << "The program attempted to compare iterators "
  12863. << "from different generators." << std::endl;
  12864. const Iterator* typed_other =
  12865. CheckedDowncastToActualType<const Iterator>(&other);
  12866. // We must report iterators equal if they both point beyond their
  12867. // respective ranges. That can happen in a variety of fashions,
  12868. // so we have to consult AtEnd().
  12869. return (AtEnd() && typed_other->AtEnd()) ||
  12870. (
  12871. current1_ == typed_other->current1_ &&
  12872. current2_ == typed_other->current2_ &&
  12873. current3_ == typed_other->current3_ &&
  12874. current4_ == typed_other->current4_ &&
  12875. current5_ == typed_other->current5_ &&
  12876. current6_ == typed_other->current6_ &&
  12877. current7_ == typed_other->current7_);
  12878. }
  12879. private:
  12880. Iterator(const Iterator& other)
  12881. : base_(other.base_),
  12882. begin1_(other.begin1_),
  12883. end1_(other.end1_),
  12884. current1_(other.current1_),
  12885. begin2_(other.begin2_),
  12886. end2_(other.end2_),
  12887. current2_(other.current2_),
  12888. begin3_(other.begin3_),
  12889. end3_(other.end3_),
  12890. current3_(other.current3_),
  12891. begin4_(other.begin4_),
  12892. end4_(other.end4_),
  12893. current4_(other.current4_),
  12894. begin5_(other.begin5_),
  12895. end5_(other.end5_),
  12896. current5_(other.current5_),
  12897. begin6_(other.begin6_),
  12898. end6_(other.end6_),
  12899. current6_(other.current6_),
  12900. begin7_(other.begin7_),
  12901. end7_(other.end7_),
  12902. current7_(other.current7_) {
  12903. ComputeCurrentValue();
  12904. }
  12905. void ComputeCurrentValue() {
  12906. if (!AtEnd())
  12907. current_value_ = ParamType(*current1_, *current2_, *current3_,
  12908. *current4_, *current5_, *current6_, *current7_);
  12909. }
  12910. bool AtEnd() const {
  12911. // We must report iterator past the end of the range when either of the
  12912. // component iterators has reached the end of its range.
  12913. return
  12914. current1_ == end1_ ||
  12915. current2_ == end2_ ||
  12916. current3_ == end3_ ||
  12917. current4_ == end4_ ||
  12918. current5_ == end5_ ||
  12919. current6_ == end6_ ||
  12920. current7_ == end7_;
  12921. }
  12922. // No implementation - assignment is unsupported.
  12923. void operator=(const Iterator& other);
  12924. const ParamGeneratorInterface<ParamType>* const base_;
  12925. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  12926. // current[i]_ is the actual traversing iterator.
  12927. const typename ParamGenerator<T1>::iterator begin1_;
  12928. const typename ParamGenerator<T1>::iterator end1_;
  12929. typename ParamGenerator<T1>::iterator current1_;
  12930. const typename ParamGenerator<T2>::iterator begin2_;
  12931. const typename ParamGenerator<T2>::iterator end2_;
  12932. typename ParamGenerator<T2>::iterator current2_;
  12933. const typename ParamGenerator<T3>::iterator begin3_;
  12934. const typename ParamGenerator<T3>::iterator end3_;
  12935. typename ParamGenerator<T3>::iterator current3_;
  12936. const typename ParamGenerator<T4>::iterator begin4_;
  12937. const typename ParamGenerator<T4>::iterator end4_;
  12938. typename ParamGenerator<T4>::iterator current4_;
  12939. const typename ParamGenerator<T5>::iterator begin5_;
  12940. const typename ParamGenerator<T5>::iterator end5_;
  12941. typename ParamGenerator<T5>::iterator current5_;
  12942. const typename ParamGenerator<T6>::iterator begin6_;
  12943. const typename ParamGenerator<T6>::iterator end6_;
  12944. typename ParamGenerator<T6>::iterator current6_;
  12945. const typename ParamGenerator<T7>::iterator begin7_;
  12946. const typename ParamGenerator<T7>::iterator end7_;
  12947. typename ParamGenerator<T7>::iterator current7_;
  12948. ParamType current_value_;
  12949. }; // class CartesianProductGenerator7::Iterator
  12950. // No implementation - assignment is unsupported.
  12951. void operator=(const CartesianProductGenerator7& other);
  12952. const ParamGenerator<T1> g1_;
  12953. const ParamGenerator<T2> g2_;
  12954. const ParamGenerator<T3> g3_;
  12955. const ParamGenerator<T4> g4_;
  12956. const ParamGenerator<T5> g5_;
  12957. const ParamGenerator<T6> g6_;
  12958. const ParamGenerator<T7> g7_;
  12959. }; // class CartesianProductGenerator7
  12960. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  12961. typename T6, typename T7, typename T8>
  12962. class CartesianProductGenerator8
  12963. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
  12964. T7, T8> > {
  12965. public:
  12966. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
  12967. CartesianProductGenerator8(const ParamGenerator<T1>& g1,
  12968. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  12969. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  12970. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
  12971. const ParamGenerator<T8>& g8)
  12972. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
  12973. g8_(g8) {}
  12974. virtual ~CartesianProductGenerator8() {}
  12975. virtual ParamIteratorInterface<ParamType>* Begin() const {
  12976. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  12977. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  12978. g7_.begin(), g8_, g8_.begin());
  12979. }
  12980. virtual ParamIteratorInterface<ParamType>* End() const {
  12981. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  12982. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
  12983. g8_.end());
  12984. }
  12985. private:
  12986. class Iterator : public ParamIteratorInterface<ParamType> {
  12987. public:
  12988. Iterator(const ParamGeneratorInterface<ParamType>* base,
  12989. const ParamGenerator<T1>& g1,
  12990. const typename ParamGenerator<T1>::iterator& current1,
  12991. const ParamGenerator<T2>& g2,
  12992. const typename ParamGenerator<T2>::iterator& current2,
  12993. const ParamGenerator<T3>& g3,
  12994. const typename ParamGenerator<T3>::iterator& current3,
  12995. const ParamGenerator<T4>& g4,
  12996. const typename ParamGenerator<T4>::iterator& current4,
  12997. const ParamGenerator<T5>& g5,
  12998. const typename ParamGenerator<T5>::iterator& current5,
  12999. const ParamGenerator<T6>& g6,
  13000. const typename ParamGenerator<T6>::iterator& current6,
  13001. const ParamGenerator<T7>& g7,
  13002. const typename ParamGenerator<T7>::iterator& current7,
  13003. const ParamGenerator<T8>& g8,
  13004. const typename ParamGenerator<T8>::iterator& current8)
  13005. : base_(base),
  13006. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  13007. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  13008. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  13009. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  13010. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  13011. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  13012. begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
  13013. begin8_(g8.begin()), end8_(g8.end()), current8_(current8) {
  13014. ComputeCurrentValue();
  13015. }
  13016. virtual ~Iterator() {}
  13017. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  13018. return base_;
  13019. }
  13020. // Advance should not be called on beyond-of-range iterators
  13021. // so no component iterators must be beyond end of range, either.
  13022. virtual void Advance() {
  13023. assert(!AtEnd());
  13024. ++current8_;
  13025. if (current8_ == end8_) {
  13026. current8_ = begin8_;
  13027. ++current7_;
  13028. }
  13029. if (current7_ == end7_) {
  13030. current7_ = begin7_;
  13031. ++current6_;
  13032. }
  13033. if (current6_ == end6_) {
  13034. current6_ = begin6_;
  13035. ++current5_;
  13036. }
  13037. if (current5_ == end5_) {
  13038. current5_ = begin5_;
  13039. ++current4_;
  13040. }
  13041. if (current4_ == end4_) {
  13042. current4_ = begin4_;
  13043. ++current3_;
  13044. }
  13045. if (current3_ == end3_) {
  13046. current3_ = begin3_;
  13047. ++current2_;
  13048. }
  13049. if (current2_ == end2_) {
  13050. current2_ = begin2_;
  13051. ++current1_;
  13052. }
  13053. ComputeCurrentValue();
  13054. }
  13055. virtual ParamIteratorInterface<ParamType>* Clone() const {
  13056. return new Iterator(*this);
  13057. }
  13058. virtual const ParamType* Current() const { return &current_value_; }
  13059. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  13060. // Having the same base generator guarantees that the other
  13061. // iterator is of the same type and we can downcast.
  13062. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  13063. << "The program attempted to compare iterators "
  13064. << "from different generators." << std::endl;
  13065. const Iterator* typed_other =
  13066. CheckedDowncastToActualType<const Iterator>(&other);
  13067. // We must report iterators equal if they both point beyond their
  13068. // respective ranges. That can happen in a variety of fashions,
  13069. // so we have to consult AtEnd().
  13070. return (AtEnd() && typed_other->AtEnd()) ||
  13071. (
  13072. current1_ == typed_other->current1_ &&
  13073. current2_ == typed_other->current2_ &&
  13074. current3_ == typed_other->current3_ &&
  13075. current4_ == typed_other->current4_ &&
  13076. current5_ == typed_other->current5_ &&
  13077. current6_ == typed_other->current6_ &&
  13078. current7_ == typed_other->current7_ &&
  13079. current8_ == typed_other->current8_);
  13080. }
  13081. private:
  13082. Iterator(const Iterator& other)
  13083. : base_(other.base_),
  13084. begin1_(other.begin1_),
  13085. end1_(other.end1_),
  13086. current1_(other.current1_),
  13087. begin2_(other.begin2_),
  13088. end2_(other.end2_),
  13089. current2_(other.current2_),
  13090. begin3_(other.begin3_),
  13091. end3_(other.end3_),
  13092. current3_(other.current3_),
  13093. begin4_(other.begin4_),
  13094. end4_(other.end4_),
  13095. current4_(other.current4_),
  13096. begin5_(other.begin5_),
  13097. end5_(other.end5_),
  13098. current5_(other.current5_),
  13099. begin6_(other.begin6_),
  13100. end6_(other.end6_),
  13101. current6_(other.current6_),
  13102. begin7_(other.begin7_),
  13103. end7_(other.end7_),
  13104. current7_(other.current7_),
  13105. begin8_(other.begin8_),
  13106. end8_(other.end8_),
  13107. current8_(other.current8_) {
  13108. ComputeCurrentValue();
  13109. }
  13110. void ComputeCurrentValue() {
  13111. if (!AtEnd())
  13112. current_value_ = ParamType(*current1_, *current2_, *current3_,
  13113. *current4_, *current5_, *current6_, *current7_, *current8_);
  13114. }
  13115. bool AtEnd() const {
  13116. // We must report iterator past the end of the range when either of the
  13117. // component iterators has reached the end of its range.
  13118. return
  13119. current1_ == end1_ ||
  13120. current2_ == end2_ ||
  13121. current3_ == end3_ ||
  13122. current4_ == end4_ ||
  13123. current5_ == end5_ ||
  13124. current6_ == end6_ ||
  13125. current7_ == end7_ ||
  13126. current8_ == end8_;
  13127. }
  13128. // No implementation - assignment is unsupported.
  13129. void operator=(const Iterator& other);
  13130. const ParamGeneratorInterface<ParamType>* const base_;
  13131. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  13132. // current[i]_ is the actual traversing iterator.
  13133. const typename ParamGenerator<T1>::iterator begin1_;
  13134. const typename ParamGenerator<T1>::iterator end1_;
  13135. typename ParamGenerator<T1>::iterator current1_;
  13136. const typename ParamGenerator<T2>::iterator begin2_;
  13137. const typename ParamGenerator<T2>::iterator end2_;
  13138. typename ParamGenerator<T2>::iterator current2_;
  13139. const typename ParamGenerator<T3>::iterator begin3_;
  13140. const typename ParamGenerator<T3>::iterator end3_;
  13141. typename ParamGenerator<T3>::iterator current3_;
  13142. const typename ParamGenerator<T4>::iterator begin4_;
  13143. const typename ParamGenerator<T4>::iterator end4_;
  13144. typename ParamGenerator<T4>::iterator current4_;
  13145. const typename ParamGenerator<T5>::iterator begin5_;
  13146. const typename ParamGenerator<T5>::iterator end5_;
  13147. typename ParamGenerator<T5>::iterator current5_;
  13148. const typename ParamGenerator<T6>::iterator begin6_;
  13149. const typename ParamGenerator<T6>::iterator end6_;
  13150. typename ParamGenerator<T6>::iterator current6_;
  13151. const typename ParamGenerator<T7>::iterator begin7_;
  13152. const typename ParamGenerator<T7>::iterator end7_;
  13153. typename ParamGenerator<T7>::iterator current7_;
  13154. const typename ParamGenerator<T8>::iterator begin8_;
  13155. const typename ParamGenerator<T8>::iterator end8_;
  13156. typename ParamGenerator<T8>::iterator current8_;
  13157. ParamType current_value_;
  13158. }; // class CartesianProductGenerator8::Iterator
  13159. // No implementation - assignment is unsupported.
  13160. void operator=(const CartesianProductGenerator8& other);
  13161. const ParamGenerator<T1> g1_;
  13162. const ParamGenerator<T2> g2_;
  13163. const ParamGenerator<T3> g3_;
  13164. const ParamGenerator<T4> g4_;
  13165. const ParamGenerator<T5> g5_;
  13166. const ParamGenerator<T6> g6_;
  13167. const ParamGenerator<T7> g7_;
  13168. const ParamGenerator<T8> g8_;
  13169. }; // class CartesianProductGenerator8
  13170. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13171. typename T6, typename T7, typename T8, typename T9>
  13172. class CartesianProductGenerator9
  13173. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
  13174. T7, T8, T9> > {
  13175. public:
  13176. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
  13177. CartesianProductGenerator9(const ParamGenerator<T1>& g1,
  13178. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  13179. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  13180. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
  13181. const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
  13182. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  13183. g9_(g9) {}
  13184. virtual ~CartesianProductGenerator9() {}
  13185. virtual ParamIteratorInterface<ParamType>* Begin() const {
  13186. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  13187. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  13188. g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
  13189. }
  13190. virtual ParamIteratorInterface<ParamType>* End() const {
  13191. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  13192. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
  13193. g8_.end(), g9_, g9_.end());
  13194. }
  13195. private:
  13196. class Iterator : public ParamIteratorInterface<ParamType> {
  13197. public:
  13198. Iterator(const ParamGeneratorInterface<ParamType>* base,
  13199. const ParamGenerator<T1>& g1,
  13200. const typename ParamGenerator<T1>::iterator& current1,
  13201. const ParamGenerator<T2>& g2,
  13202. const typename ParamGenerator<T2>::iterator& current2,
  13203. const ParamGenerator<T3>& g3,
  13204. const typename ParamGenerator<T3>::iterator& current3,
  13205. const ParamGenerator<T4>& g4,
  13206. const typename ParamGenerator<T4>::iterator& current4,
  13207. const ParamGenerator<T5>& g5,
  13208. const typename ParamGenerator<T5>::iterator& current5,
  13209. const ParamGenerator<T6>& g6,
  13210. const typename ParamGenerator<T6>::iterator& current6,
  13211. const ParamGenerator<T7>& g7,
  13212. const typename ParamGenerator<T7>::iterator& current7,
  13213. const ParamGenerator<T8>& g8,
  13214. const typename ParamGenerator<T8>::iterator& current8,
  13215. const ParamGenerator<T9>& g9,
  13216. const typename ParamGenerator<T9>::iterator& current9)
  13217. : base_(base),
  13218. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  13219. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  13220. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  13221. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  13222. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  13223. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  13224. begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
  13225. begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
  13226. begin9_(g9.begin()), end9_(g9.end()), current9_(current9) {
  13227. ComputeCurrentValue();
  13228. }
  13229. virtual ~Iterator() {}
  13230. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  13231. return base_;
  13232. }
  13233. // Advance should not be called on beyond-of-range iterators
  13234. // so no component iterators must be beyond end of range, either.
  13235. virtual void Advance() {
  13236. assert(!AtEnd());
  13237. ++current9_;
  13238. if (current9_ == end9_) {
  13239. current9_ = begin9_;
  13240. ++current8_;
  13241. }
  13242. if (current8_ == end8_) {
  13243. current8_ = begin8_;
  13244. ++current7_;
  13245. }
  13246. if (current7_ == end7_) {
  13247. current7_ = begin7_;
  13248. ++current6_;
  13249. }
  13250. if (current6_ == end6_) {
  13251. current6_ = begin6_;
  13252. ++current5_;
  13253. }
  13254. if (current5_ == end5_) {
  13255. current5_ = begin5_;
  13256. ++current4_;
  13257. }
  13258. if (current4_ == end4_) {
  13259. current4_ = begin4_;
  13260. ++current3_;
  13261. }
  13262. if (current3_ == end3_) {
  13263. current3_ = begin3_;
  13264. ++current2_;
  13265. }
  13266. if (current2_ == end2_) {
  13267. current2_ = begin2_;
  13268. ++current1_;
  13269. }
  13270. ComputeCurrentValue();
  13271. }
  13272. virtual ParamIteratorInterface<ParamType>* Clone() const {
  13273. return new Iterator(*this);
  13274. }
  13275. virtual const ParamType* Current() const { return &current_value_; }
  13276. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  13277. // Having the same base generator guarantees that the other
  13278. // iterator is of the same type and we can downcast.
  13279. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  13280. << "The program attempted to compare iterators "
  13281. << "from different generators." << std::endl;
  13282. const Iterator* typed_other =
  13283. CheckedDowncastToActualType<const Iterator>(&other);
  13284. // We must report iterators equal if they both point beyond their
  13285. // respective ranges. That can happen in a variety of fashions,
  13286. // so we have to consult AtEnd().
  13287. return (AtEnd() && typed_other->AtEnd()) ||
  13288. (
  13289. current1_ == typed_other->current1_ &&
  13290. current2_ == typed_other->current2_ &&
  13291. current3_ == typed_other->current3_ &&
  13292. current4_ == typed_other->current4_ &&
  13293. current5_ == typed_other->current5_ &&
  13294. current6_ == typed_other->current6_ &&
  13295. current7_ == typed_other->current7_ &&
  13296. current8_ == typed_other->current8_ &&
  13297. current9_ == typed_other->current9_);
  13298. }
  13299. private:
  13300. Iterator(const Iterator& other)
  13301. : base_(other.base_),
  13302. begin1_(other.begin1_),
  13303. end1_(other.end1_),
  13304. current1_(other.current1_),
  13305. begin2_(other.begin2_),
  13306. end2_(other.end2_),
  13307. current2_(other.current2_),
  13308. begin3_(other.begin3_),
  13309. end3_(other.end3_),
  13310. current3_(other.current3_),
  13311. begin4_(other.begin4_),
  13312. end4_(other.end4_),
  13313. current4_(other.current4_),
  13314. begin5_(other.begin5_),
  13315. end5_(other.end5_),
  13316. current5_(other.current5_),
  13317. begin6_(other.begin6_),
  13318. end6_(other.end6_),
  13319. current6_(other.current6_),
  13320. begin7_(other.begin7_),
  13321. end7_(other.end7_),
  13322. current7_(other.current7_),
  13323. begin8_(other.begin8_),
  13324. end8_(other.end8_),
  13325. current8_(other.current8_),
  13326. begin9_(other.begin9_),
  13327. end9_(other.end9_),
  13328. current9_(other.current9_) {
  13329. ComputeCurrentValue();
  13330. }
  13331. void ComputeCurrentValue() {
  13332. if (!AtEnd())
  13333. current_value_ = ParamType(*current1_, *current2_, *current3_,
  13334. *current4_, *current5_, *current6_, *current7_, *current8_,
  13335. *current9_);
  13336. }
  13337. bool AtEnd() const {
  13338. // We must report iterator past the end of the range when either of the
  13339. // component iterators has reached the end of its range.
  13340. return
  13341. current1_ == end1_ ||
  13342. current2_ == end2_ ||
  13343. current3_ == end3_ ||
  13344. current4_ == end4_ ||
  13345. current5_ == end5_ ||
  13346. current6_ == end6_ ||
  13347. current7_ == end7_ ||
  13348. current8_ == end8_ ||
  13349. current9_ == end9_;
  13350. }
  13351. // No implementation - assignment is unsupported.
  13352. void operator=(const Iterator& other);
  13353. const ParamGeneratorInterface<ParamType>* const base_;
  13354. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  13355. // current[i]_ is the actual traversing iterator.
  13356. const typename ParamGenerator<T1>::iterator begin1_;
  13357. const typename ParamGenerator<T1>::iterator end1_;
  13358. typename ParamGenerator<T1>::iterator current1_;
  13359. const typename ParamGenerator<T2>::iterator begin2_;
  13360. const typename ParamGenerator<T2>::iterator end2_;
  13361. typename ParamGenerator<T2>::iterator current2_;
  13362. const typename ParamGenerator<T3>::iterator begin3_;
  13363. const typename ParamGenerator<T3>::iterator end3_;
  13364. typename ParamGenerator<T3>::iterator current3_;
  13365. const typename ParamGenerator<T4>::iterator begin4_;
  13366. const typename ParamGenerator<T4>::iterator end4_;
  13367. typename ParamGenerator<T4>::iterator current4_;
  13368. const typename ParamGenerator<T5>::iterator begin5_;
  13369. const typename ParamGenerator<T5>::iterator end5_;
  13370. typename ParamGenerator<T5>::iterator current5_;
  13371. const typename ParamGenerator<T6>::iterator begin6_;
  13372. const typename ParamGenerator<T6>::iterator end6_;
  13373. typename ParamGenerator<T6>::iterator current6_;
  13374. const typename ParamGenerator<T7>::iterator begin7_;
  13375. const typename ParamGenerator<T7>::iterator end7_;
  13376. typename ParamGenerator<T7>::iterator current7_;
  13377. const typename ParamGenerator<T8>::iterator begin8_;
  13378. const typename ParamGenerator<T8>::iterator end8_;
  13379. typename ParamGenerator<T8>::iterator current8_;
  13380. const typename ParamGenerator<T9>::iterator begin9_;
  13381. const typename ParamGenerator<T9>::iterator end9_;
  13382. typename ParamGenerator<T9>::iterator current9_;
  13383. ParamType current_value_;
  13384. }; // class CartesianProductGenerator9::Iterator
  13385. // No implementation - assignment is unsupported.
  13386. void operator=(const CartesianProductGenerator9& other);
  13387. const ParamGenerator<T1> g1_;
  13388. const ParamGenerator<T2> g2_;
  13389. const ParamGenerator<T3> g3_;
  13390. const ParamGenerator<T4> g4_;
  13391. const ParamGenerator<T5> g5_;
  13392. const ParamGenerator<T6> g6_;
  13393. const ParamGenerator<T7> g7_;
  13394. const ParamGenerator<T8> g8_;
  13395. const ParamGenerator<T9> g9_;
  13396. }; // class CartesianProductGenerator9
  13397. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13398. typename T6, typename T7, typename T8, typename T9, typename T10>
  13399. class CartesianProductGenerator10
  13400. : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
  13401. T7, T8, T9, T10> > {
  13402. public:
  13403. typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
  13404. CartesianProductGenerator10(const ParamGenerator<T1>& g1,
  13405. const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
  13406. const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
  13407. const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
  13408. const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
  13409. const ParamGenerator<T10>& g10)
  13410. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  13411. g9_(g9), g10_(g10) {}
  13412. virtual ~CartesianProductGenerator10() {}
  13413. virtual ParamIteratorInterface<ParamType>* Begin() const {
  13414. return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
  13415. g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
  13416. g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
  13417. }
  13418. virtual ParamIteratorInterface<ParamType>* End() const {
  13419. return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
  13420. g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
  13421. g8_.end(), g9_, g9_.end(), g10_, g10_.end());
  13422. }
  13423. private:
  13424. class Iterator : public ParamIteratorInterface<ParamType> {
  13425. public:
  13426. Iterator(const ParamGeneratorInterface<ParamType>* base,
  13427. const ParamGenerator<T1>& g1,
  13428. const typename ParamGenerator<T1>::iterator& current1,
  13429. const ParamGenerator<T2>& g2,
  13430. const typename ParamGenerator<T2>::iterator& current2,
  13431. const ParamGenerator<T3>& g3,
  13432. const typename ParamGenerator<T3>::iterator& current3,
  13433. const ParamGenerator<T4>& g4,
  13434. const typename ParamGenerator<T4>::iterator& current4,
  13435. const ParamGenerator<T5>& g5,
  13436. const typename ParamGenerator<T5>::iterator& current5,
  13437. const ParamGenerator<T6>& g6,
  13438. const typename ParamGenerator<T6>::iterator& current6,
  13439. const ParamGenerator<T7>& g7,
  13440. const typename ParamGenerator<T7>::iterator& current7,
  13441. const ParamGenerator<T8>& g8,
  13442. const typename ParamGenerator<T8>::iterator& current8,
  13443. const ParamGenerator<T9>& g9,
  13444. const typename ParamGenerator<T9>::iterator& current9,
  13445. const ParamGenerator<T10>& g10,
  13446. const typename ParamGenerator<T10>::iterator& current10)
  13447. : base_(base),
  13448. begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
  13449. begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
  13450. begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
  13451. begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
  13452. begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
  13453. begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
  13454. begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
  13455. begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
  13456. begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
  13457. begin10_(g10.begin()), end10_(g10.end()), current10_(current10) {
  13458. ComputeCurrentValue();
  13459. }
  13460. virtual ~Iterator() {}
  13461. virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
  13462. return base_;
  13463. }
  13464. // Advance should not be called on beyond-of-range iterators
  13465. // so no component iterators must be beyond end of range, either.
  13466. virtual void Advance() {
  13467. assert(!AtEnd());
  13468. ++current10_;
  13469. if (current10_ == end10_) {
  13470. current10_ = begin10_;
  13471. ++current9_;
  13472. }
  13473. if (current9_ == end9_) {
  13474. current9_ = begin9_;
  13475. ++current8_;
  13476. }
  13477. if (current8_ == end8_) {
  13478. current8_ = begin8_;
  13479. ++current7_;
  13480. }
  13481. if (current7_ == end7_) {
  13482. current7_ = begin7_;
  13483. ++current6_;
  13484. }
  13485. if (current6_ == end6_) {
  13486. current6_ = begin6_;
  13487. ++current5_;
  13488. }
  13489. if (current5_ == end5_) {
  13490. current5_ = begin5_;
  13491. ++current4_;
  13492. }
  13493. if (current4_ == end4_) {
  13494. current4_ = begin4_;
  13495. ++current3_;
  13496. }
  13497. if (current3_ == end3_) {
  13498. current3_ = begin3_;
  13499. ++current2_;
  13500. }
  13501. if (current2_ == end2_) {
  13502. current2_ = begin2_;
  13503. ++current1_;
  13504. }
  13505. ComputeCurrentValue();
  13506. }
  13507. virtual ParamIteratorInterface<ParamType>* Clone() const {
  13508. return new Iterator(*this);
  13509. }
  13510. virtual const ParamType* Current() const { return &current_value_; }
  13511. virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
  13512. // Having the same base generator guarantees that the other
  13513. // iterator is of the same type and we can downcast.
  13514. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
  13515. << "The program attempted to compare iterators "
  13516. << "from different generators." << std::endl;
  13517. const Iterator* typed_other =
  13518. CheckedDowncastToActualType<const Iterator>(&other);
  13519. // We must report iterators equal if they both point beyond their
  13520. // respective ranges. That can happen in a variety of fashions,
  13521. // so we have to consult AtEnd().
  13522. return (AtEnd() && typed_other->AtEnd()) ||
  13523. (
  13524. current1_ == typed_other->current1_ &&
  13525. current2_ == typed_other->current2_ &&
  13526. current3_ == typed_other->current3_ &&
  13527. current4_ == typed_other->current4_ &&
  13528. current5_ == typed_other->current5_ &&
  13529. current6_ == typed_other->current6_ &&
  13530. current7_ == typed_other->current7_ &&
  13531. current8_ == typed_other->current8_ &&
  13532. current9_ == typed_other->current9_ &&
  13533. current10_ == typed_other->current10_);
  13534. }
  13535. private:
  13536. Iterator(const Iterator& other)
  13537. : base_(other.base_),
  13538. begin1_(other.begin1_),
  13539. end1_(other.end1_),
  13540. current1_(other.current1_),
  13541. begin2_(other.begin2_),
  13542. end2_(other.end2_),
  13543. current2_(other.current2_),
  13544. begin3_(other.begin3_),
  13545. end3_(other.end3_),
  13546. current3_(other.current3_),
  13547. begin4_(other.begin4_),
  13548. end4_(other.end4_),
  13549. current4_(other.current4_),
  13550. begin5_(other.begin5_),
  13551. end5_(other.end5_),
  13552. current5_(other.current5_),
  13553. begin6_(other.begin6_),
  13554. end6_(other.end6_),
  13555. current6_(other.current6_),
  13556. begin7_(other.begin7_),
  13557. end7_(other.end7_),
  13558. current7_(other.current7_),
  13559. begin8_(other.begin8_),
  13560. end8_(other.end8_),
  13561. current8_(other.current8_),
  13562. begin9_(other.begin9_),
  13563. end9_(other.end9_),
  13564. current9_(other.current9_),
  13565. begin10_(other.begin10_),
  13566. end10_(other.end10_),
  13567. current10_(other.current10_) {
  13568. ComputeCurrentValue();
  13569. }
  13570. void ComputeCurrentValue() {
  13571. if (!AtEnd())
  13572. current_value_ = ParamType(*current1_, *current2_, *current3_,
  13573. *current4_, *current5_, *current6_, *current7_, *current8_,
  13574. *current9_, *current10_);
  13575. }
  13576. bool AtEnd() const {
  13577. // We must report iterator past the end of the range when either of the
  13578. // component iterators has reached the end of its range.
  13579. return
  13580. current1_ == end1_ ||
  13581. current2_ == end2_ ||
  13582. current3_ == end3_ ||
  13583. current4_ == end4_ ||
  13584. current5_ == end5_ ||
  13585. current6_ == end6_ ||
  13586. current7_ == end7_ ||
  13587. current8_ == end8_ ||
  13588. current9_ == end9_ ||
  13589. current10_ == end10_;
  13590. }
  13591. // No implementation - assignment is unsupported.
  13592. void operator=(const Iterator& other);
  13593. const ParamGeneratorInterface<ParamType>* const base_;
  13594. // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
  13595. // current[i]_ is the actual traversing iterator.
  13596. const typename ParamGenerator<T1>::iterator begin1_;
  13597. const typename ParamGenerator<T1>::iterator end1_;
  13598. typename ParamGenerator<T1>::iterator current1_;
  13599. const typename ParamGenerator<T2>::iterator begin2_;
  13600. const typename ParamGenerator<T2>::iterator end2_;
  13601. typename ParamGenerator<T2>::iterator current2_;
  13602. const typename ParamGenerator<T3>::iterator begin3_;
  13603. const typename ParamGenerator<T3>::iterator end3_;
  13604. typename ParamGenerator<T3>::iterator current3_;
  13605. const typename ParamGenerator<T4>::iterator begin4_;
  13606. const typename ParamGenerator<T4>::iterator end4_;
  13607. typename ParamGenerator<T4>::iterator current4_;
  13608. const typename ParamGenerator<T5>::iterator begin5_;
  13609. const typename ParamGenerator<T5>::iterator end5_;
  13610. typename ParamGenerator<T5>::iterator current5_;
  13611. const typename ParamGenerator<T6>::iterator begin6_;
  13612. const typename ParamGenerator<T6>::iterator end6_;
  13613. typename ParamGenerator<T6>::iterator current6_;
  13614. const typename ParamGenerator<T7>::iterator begin7_;
  13615. const typename ParamGenerator<T7>::iterator end7_;
  13616. typename ParamGenerator<T7>::iterator current7_;
  13617. const typename ParamGenerator<T8>::iterator begin8_;
  13618. const typename ParamGenerator<T8>::iterator end8_;
  13619. typename ParamGenerator<T8>::iterator current8_;
  13620. const typename ParamGenerator<T9>::iterator begin9_;
  13621. const typename ParamGenerator<T9>::iterator end9_;
  13622. typename ParamGenerator<T9>::iterator current9_;
  13623. const typename ParamGenerator<T10>::iterator begin10_;
  13624. const typename ParamGenerator<T10>::iterator end10_;
  13625. typename ParamGenerator<T10>::iterator current10_;
  13626. ParamType current_value_;
  13627. }; // class CartesianProductGenerator10::Iterator
  13628. // No implementation - assignment is unsupported.
  13629. void operator=(const CartesianProductGenerator10& other);
  13630. const ParamGenerator<T1> g1_;
  13631. const ParamGenerator<T2> g2_;
  13632. const ParamGenerator<T3> g3_;
  13633. const ParamGenerator<T4> g4_;
  13634. const ParamGenerator<T5> g5_;
  13635. const ParamGenerator<T6> g6_;
  13636. const ParamGenerator<T7> g7_;
  13637. const ParamGenerator<T8> g8_;
  13638. const ParamGenerator<T9> g9_;
  13639. const ParamGenerator<T10> g10_;
  13640. }; // class CartesianProductGenerator10
  13641. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  13642. //
  13643. // Helper classes providing Combine() with polymorphic features. They allow
  13644. // casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
  13645. // convertible to U.
  13646. //
  13647. template <class Generator1, class Generator2>
  13648. class CartesianProductHolder2 {
  13649. public:
  13650. CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
  13651. : g1_(g1), g2_(g2) {}
  13652. template <typename T1, typename T2>
  13653. operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {
  13654. return ParamGenerator< ::std::tr1::tuple<T1, T2> >(
  13655. new CartesianProductGenerator2<T1, T2>(
  13656. static_cast<ParamGenerator<T1> >(g1_),
  13657. static_cast<ParamGenerator<T2> >(g2_)));
  13658. }
  13659. private:
  13660. // No implementation - assignment is unsupported.
  13661. void operator=(const CartesianProductHolder2& other);
  13662. const Generator1 g1_;
  13663. const Generator2 g2_;
  13664. }; // class CartesianProductHolder2
  13665. template <class Generator1, class Generator2, class Generator3>
  13666. class CartesianProductHolder3 {
  13667. public:
  13668. CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
  13669. const Generator3& g3)
  13670. : g1_(g1), g2_(g2), g3_(g3) {}
  13671. template <typename T1, typename T2, typename T3>
  13672. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {
  13673. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(
  13674. new CartesianProductGenerator3<T1, T2, T3>(
  13675. static_cast<ParamGenerator<T1> >(g1_),
  13676. static_cast<ParamGenerator<T2> >(g2_),
  13677. static_cast<ParamGenerator<T3> >(g3_)));
  13678. }
  13679. private:
  13680. // No implementation - assignment is unsupported.
  13681. void operator=(const CartesianProductHolder3& other);
  13682. const Generator1 g1_;
  13683. const Generator2 g2_;
  13684. const Generator3 g3_;
  13685. }; // class CartesianProductHolder3
  13686. template <class Generator1, class Generator2, class Generator3,
  13687. class Generator4>
  13688. class CartesianProductHolder4 {
  13689. public:
  13690. CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
  13691. const Generator3& g3, const Generator4& g4)
  13692. : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
  13693. template <typename T1, typename T2, typename T3, typename T4>
  13694. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {
  13695. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(
  13696. new CartesianProductGenerator4<T1, T2, T3, T4>(
  13697. static_cast<ParamGenerator<T1> >(g1_),
  13698. static_cast<ParamGenerator<T2> >(g2_),
  13699. static_cast<ParamGenerator<T3> >(g3_),
  13700. static_cast<ParamGenerator<T4> >(g4_)));
  13701. }
  13702. private:
  13703. // No implementation - assignment is unsupported.
  13704. void operator=(const CartesianProductHolder4& other);
  13705. const Generator1 g1_;
  13706. const Generator2 g2_;
  13707. const Generator3 g3_;
  13708. const Generator4 g4_;
  13709. }; // class CartesianProductHolder4
  13710. template <class Generator1, class Generator2, class Generator3,
  13711. class Generator4, class Generator5>
  13712. class CartesianProductHolder5 {
  13713. public:
  13714. CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
  13715. const Generator3& g3, const Generator4& g4, const Generator5& g5)
  13716. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
  13717. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  13718. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {
  13719. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(
  13720. new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
  13721. static_cast<ParamGenerator<T1> >(g1_),
  13722. static_cast<ParamGenerator<T2> >(g2_),
  13723. static_cast<ParamGenerator<T3> >(g3_),
  13724. static_cast<ParamGenerator<T4> >(g4_),
  13725. static_cast<ParamGenerator<T5> >(g5_)));
  13726. }
  13727. private:
  13728. // No implementation - assignment is unsupported.
  13729. void operator=(const CartesianProductHolder5& other);
  13730. const Generator1 g1_;
  13731. const Generator2 g2_;
  13732. const Generator3 g3_;
  13733. const Generator4 g4_;
  13734. const Generator5 g5_;
  13735. }; // class CartesianProductHolder5
  13736. template <class Generator1, class Generator2, class Generator3,
  13737. class Generator4, class Generator5, class Generator6>
  13738. class CartesianProductHolder6 {
  13739. public:
  13740. CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
  13741. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  13742. const Generator6& g6)
  13743. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
  13744. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13745. typename T6>
  13746. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {
  13747. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(
  13748. new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
  13749. static_cast<ParamGenerator<T1> >(g1_),
  13750. static_cast<ParamGenerator<T2> >(g2_),
  13751. static_cast<ParamGenerator<T3> >(g3_),
  13752. static_cast<ParamGenerator<T4> >(g4_),
  13753. static_cast<ParamGenerator<T5> >(g5_),
  13754. static_cast<ParamGenerator<T6> >(g6_)));
  13755. }
  13756. private:
  13757. // No implementation - assignment is unsupported.
  13758. void operator=(const CartesianProductHolder6& other);
  13759. const Generator1 g1_;
  13760. const Generator2 g2_;
  13761. const Generator3 g3_;
  13762. const Generator4 g4_;
  13763. const Generator5 g5_;
  13764. const Generator6 g6_;
  13765. }; // class CartesianProductHolder6
  13766. template <class Generator1, class Generator2, class Generator3,
  13767. class Generator4, class Generator5, class Generator6, class Generator7>
  13768. class CartesianProductHolder7 {
  13769. public:
  13770. CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
  13771. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  13772. const Generator6& g6, const Generator7& g7)
  13773. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
  13774. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13775. typename T6, typename T7>
  13776. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
  13777. T7> >() const {
  13778. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(
  13779. new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
  13780. static_cast<ParamGenerator<T1> >(g1_),
  13781. static_cast<ParamGenerator<T2> >(g2_),
  13782. static_cast<ParamGenerator<T3> >(g3_),
  13783. static_cast<ParamGenerator<T4> >(g4_),
  13784. static_cast<ParamGenerator<T5> >(g5_),
  13785. static_cast<ParamGenerator<T6> >(g6_),
  13786. static_cast<ParamGenerator<T7> >(g7_)));
  13787. }
  13788. private:
  13789. // No implementation - assignment is unsupported.
  13790. void operator=(const CartesianProductHolder7& other);
  13791. const Generator1 g1_;
  13792. const Generator2 g2_;
  13793. const Generator3 g3_;
  13794. const Generator4 g4_;
  13795. const Generator5 g5_;
  13796. const Generator6 g6_;
  13797. const Generator7 g7_;
  13798. }; // class CartesianProductHolder7
  13799. template <class Generator1, class Generator2, class Generator3,
  13800. class Generator4, class Generator5, class Generator6, class Generator7,
  13801. class Generator8>
  13802. class CartesianProductHolder8 {
  13803. public:
  13804. CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
  13805. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  13806. const Generator6& g6, const Generator7& g7, const Generator8& g8)
  13807. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
  13808. g8_(g8) {}
  13809. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13810. typename T6, typename T7, typename T8>
  13811. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,
  13812. T8> >() const {
  13813. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
  13814. new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
  13815. static_cast<ParamGenerator<T1> >(g1_),
  13816. static_cast<ParamGenerator<T2> >(g2_),
  13817. static_cast<ParamGenerator<T3> >(g3_),
  13818. static_cast<ParamGenerator<T4> >(g4_),
  13819. static_cast<ParamGenerator<T5> >(g5_),
  13820. static_cast<ParamGenerator<T6> >(g6_),
  13821. static_cast<ParamGenerator<T7> >(g7_),
  13822. static_cast<ParamGenerator<T8> >(g8_)));
  13823. }
  13824. private:
  13825. // No implementation - assignment is unsupported.
  13826. void operator=(const CartesianProductHolder8& other);
  13827. const Generator1 g1_;
  13828. const Generator2 g2_;
  13829. const Generator3 g3_;
  13830. const Generator4 g4_;
  13831. const Generator5 g5_;
  13832. const Generator6 g6_;
  13833. const Generator7 g7_;
  13834. const Generator8 g8_;
  13835. }; // class CartesianProductHolder8
  13836. template <class Generator1, class Generator2, class Generator3,
  13837. class Generator4, class Generator5, class Generator6, class Generator7,
  13838. class Generator8, class Generator9>
  13839. class CartesianProductHolder9 {
  13840. public:
  13841. CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
  13842. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  13843. const Generator6& g6, const Generator7& g7, const Generator8& g8,
  13844. const Generator9& g9)
  13845. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  13846. g9_(g9) {}
  13847. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13848. typename T6, typename T7, typename T8, typename T9>
  13849. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
  13850. T9> >() const {
  13851. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
  13852. T9> >(
  13853. new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
  13854. static_cast<ParamGenerator<T1> >(g1_),
  13855. static_cast<ParamGenerator<T2> >(g2_),
  13856. static_cast<ParamGenerator<T3> >(g3_),
  13857. static_cast<ParamGenerator<T4> >(g4_),
  13858. static_cast<ParamGenerator<T5> >(g5_),
  13859. static_cast<ParamGenerator<T6> >(g6_),
  13860. static_cast<ParamGenerator<T7> >(g7_),
  13861. static_cast<ParamGenerator<T8> >(g8_),
  13862. static_cast<ParamGenerator<T9> >(g9_)));
  13863. }
  13864. private:
  13865. // No implementation - assignment is unsupported.
  13866. void operator=(const CartesianProductHolder9& other);
  13867. const Generator1 g1_;
  13868. const Generator2 g2_;
  13869. const Generator3 g3_;
  13870. const Generator4 g4_;
  13871. const Generator5 g5_;
  13872. const Generator6 g6_;
  13873. const Generator7 g7_;
  13874. const Generator8 g8_;
  13875. const Generator9 g9_;
  13876. }; // class CartesianProductHolder9
  13877. template <class Generator1, class Generator2, class Generator3,
  13878. class Generator4, class Generator5, class Generator6, class Generator7,
  13879. class Generator8, class Generator9, class Generator10>
  13880. class CartesianProductHolder10 {
  13881. public:
  13882. CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
  13883. const Generator3& g3, const Generator4& g4, const Generator5& g5,
  13884. const Generator6& g6, const Generator7& g7, const Generator8& g8,
  13885. const Generator9& g9, const Generator10& g10)
  13886. : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
  13887. g9_(g9), g10_(g10) {}
  13888. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  13889. typename T6, typename T7, typename T8, typename T9, typename T10>
  13890. operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
  13891. T9, T10> >() const {
  13892. return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
  13893. T9, T10> >(
  13894. new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
  13895. T10>(
  13896. static_cast<ParamGenerator<T1> >(g1_),
  13897. static_cast<ParamGenerator<T2> >(g2_),
  13898. static_cast<ParamGenerator<T3> >(g3_),
  13899. static_cast<ParamGenerator<T4> >(g4_),
  13900. static_cast<ParamGenerator<T5> >(g5_),
  13901. static_cast<ParamGenerator<T6> >(g6_),
  13902. static_cast<ParamGenerator<T7> >(g7_),
  13903. static_cast<ParamGenerator<T8> >(g8_),
  13904. static_cast<ParamGenerator<T9> >(g9_),
  13905. static_cast<ParamGenerator<T10> >(g10_)));
  13906. }
  13907. private:
  13908. // No implementation - assignment is unsupported.
  13909. void operator=(const CartesianProductHolder10& other);
  13910. const Generator1 g1_;
  13911. const Generator2 g2_;
  13912. const Generator3 g3_;
  13913. const Generator4 g4_;
  13914. const Generator5 g5_;
  13915. const Generator6 g6_;
  13916. const Generator7 g7_;
  13917. const Generator8 g8_;
  13918. const Generator9 g9_;
  13919. const Generator10 g10_;
  13920. }; // class CartesianProductHolder10
  13921. # endif // GTEST_HAS_COMBINE
  13922. } // namespace internal
  13923. } // namespace testing
  13924. #endif // GTEST_HAS_PARAM_TEST
  13925. #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
  13926. #if GTEST_HAS_PARAM_TEST
  13927. namespace testing {
  13928. // Functions producing parameter generators.
  13929. //
  13930. // Google Test uses these generators to produce parameters for value-
  13931. // parameterized tests. When a parameterized test case is instantiated
  13932. // with a particular generator, Google Test creates and runs tests
  13933. // for each element in the sequence produced by the generator.
  13934. //
  13935. // In the following sample, tests from test case FooTest are instantiated
  13936. // each three times with parameter values 3, 5, and 8:
  13937. //
  13938. // class FooTest : public TestWithParam<int> { ... };
  13939. //
  13940. // TEST_P(FooTest, TestThis) {
  13941. // }
  13942. // TEST_P(FooTest, TestThat) {
  13943. // }
  13944. // INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
  13945. //
  13946. // Range() returns generators providing sequences of values in a range.
  13947. //
  13948. // Synopsis:
  13949. // Range(start, end)
  13950. // - returns a generator producing a sequence of values {start, start+1,
  13951. // start+2, ..., }.
  13952. // Range(start, end, step)
  13953. // - returns a generator producing a sequence of values {start, start+step,
  13954. // start+step+step, ..., }.
  13955. // Notes:
  13956. // * The generated sequences never include end. For example, Range(1, 5)
  13957. // returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
  13958. // returns a generator producing {1, 3, 5, 7}.
  13959. // * start and end must have the same type. That type may be any integral or
  13960. // floating-point type or a user defined type satisfying these conditions:
  13961. // * It must be assignable (have operator=() defined).
  13962. // * It must have operator+() (operator+(int-compatible type) for
  13963. // two-operand version).
  13964. // * It must have operator<() defined.
  13965. // Elements in the resulting sequences will also have that type.
  13966. // * Condition start < end must be satisfied in order for resulting sequences
  13967. // to contain any elements.
  13968. //
  13969. template <typename T, typename IncrementT>
  13970. internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
  13971. return internal::ParamGenerator<T>(
  13972. new internal::RangeGenerator<T, IncrementT>(start, end, step));
  13973. }
  13974. template <typename T>
  13975. internal::ParamGenerator<T> Range(T start, T end) {
  13976. return Range(start, end, 1);
  13977. }
  13978. // ValuesIn() function allows generation of tests with parameters coming from
  13979. // a container.
  13980. //
  13981. // Synopsis:
  13982. // ValuesIn(const T (&array)[N])
  13983. // - returns a generator producing sequences with elements from
  13984. // a C-style array.
  13985. // ValuesIn(const Container& container)
  13986. // - returns a generator producing sequences with elements from
  13987. // an STL-style container.
  13988. // ValuesIn(Iterator begin, Iterator end)
  13989. // - returns a generator producing sequences with elements from
  13990. // a range [begin, end) defined by a pair of STL-style iterators. These
  13991. // iterators can also be plain C pointers.
  13992. //
  13993. // Please note that ValuesIn copies the values from the containers
  13994. // passed in and keeps them to generate tests in RUN_ALL_TESTS().
  13995. //
  13996. // Examples:
  13997. //
  13998. // This instantiates tests from test case StringTest
  13999. // each with C-string values of "foo", "bar", and "baz":
  14000. //
  14001. // const char* strings[] = {"foo", "bar", "baz"};
  14002. // INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
  14003. //
  14004. // This instantiates tests from test case StlStringTest
  14005. // each with STL strings with values "a" and "b":
  14006. //
  14007. // ::std::vector< ::std::string> GetParameterStrings() {
  14008. // ::std::vector< ::std::string> v;
  14009. // v.push_back("a");
  14010. // v.push_back("b");
  14011. // return v;
  14012. // }
  14013. //
  14014. // INSTANTIATE_TEST_CASE_P(CharSequence,
  14015. // StlStringTest,
  14016. // ValuesIn(GetParameterStrings()));
  14017. //
  14018. //
  14019. // This will also instantiate tests from CharTest
  14020. // each with parameter values 'a' and 'b':
  14021. //
  14022. // ::std::list<char> GetParameterChars() {
  14023. // ::std::list<char> list;
  14024. // list.push_back('a');
  14025. // list.push_back('b');
  14026. // return list;
  14027. // }
  14028. // ::std::list<char> l = GetParameterChars();
  14029. // INSTANTIATE_TEST_CASE_P(CharSequence2,
  14030. // CharTest,
  14031. // ValuesIn(l.begin(), l.end()));
  14032. //
  14033. template <typename ForwardIterator>
  14034. internal::ParamGenerator<
  14035. typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
  14036. ValuesIn(ForwardIterator begin, ForwardIterator end) {
  14037. typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
  14038. ::value_type ParamType;
  14039. return internal::ParamGenerator<ParamType>(
  14040. new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
  14041. }
  14042. template <typename T, size_t N>
  14043. internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
  14044. return ValuesIn(array, array + N);
  14045. }
  14046. template <class Container>
  14047. internal::ParamGenerator<typename Container::value_type> ValuesIn(
  14048. const Container& container) {
  14049. return ValuesIn(container.begin(), container.end());
  14050. }
  14051. // Values() allows generating tests from explicitly specified list of
  14052. // parameters.
  14053. //
  14054. // Synopsis:
  14055. // Values(T v1, T v2, ..., T vN)
  14056. // - returns a generator producing sequences with elements v1, v2, ..., vN.
  14057. //
  14058. // For example, this instantiates tests from test case BarTest each
  14059. // with values "one", "two", and "three":
  14060. //
  14061. // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
  14062. //
  14063. // This instantiates tests from test case BazTest each with values 1, 2, 3.5.
  14064. // The exact type of values will depend on the type of parameter in BazTest.
  14065. //
  14066. // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
  14067. //
  14068. // Currently, Values() supports from 1 to 50 parameters.
  14069. //
  14070. template <typename T1>
  14071. internal::ValueArray1<T1> Values(T1 v1) {
  14072. return internal::ValueArray1<T1>(v1);
  14073. }
  14074. template <typename T1, typename T2>
  14075. internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
  14076. return internal::ValueArray2<T1, T2>(v1, v2);
  14077. }
  14078. template <typename T1, typename T2, typename T3>
  14079. internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
  14080. return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
  14081. }
  14082. template <typename T1, typename T2, typename T3, typename T4>
  14083. internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
  14084. return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
  14085. }
  14086. template <typename T1, typename T2, typename T3, typename T4, typename T5>
  14087. internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14088. T5 v5) {
  14089. return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
  14090. }
  14091. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14092. typename T6>
  14093. internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
  14094. T4 v4, T5 v5, T6 v6) {
  14095. return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
  14096. }
  14097. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14098. typename T6, typename T7>
  14099. internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
  14100. T4 v4, T5 v5, T6 v6, T7 v7) {
  14101. return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
  14102. v6, v7);
  14103. }
  14104. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14105. typename T6, typename T7, typename T8>
  14106. internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
  14107. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
  14108. return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
  14109. v5, v6, v7, v8);
  14110. }
  14111. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14112. typename T6, typename T7, typename T8, typename T9>
  14113. internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
  14114. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
  14115. return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
  14116. v4, v5, v6, v7, v8, v9);
  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. internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
  14121. T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
  14122. return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
  14123. v2, v3, v4, v5, v6, v7, v8, v9, v10);
  14124. }
  14125. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14126. typename T6, typename T7, typename T8, typename T9, typename T10,
  14127. typename T11>
  14128. internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
  14129. T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14130. T10 v10, T11 v11) {
  14131. return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
  14132. T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
  14133. }
  14134. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14135. typename T6, typename T7, typename T8, typename T9, typename T10,
  14136. typename T11, typename T12>
  14137. internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14138. T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14139. T10 v10, T11 v11, T12 v12) {
  14140. return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14141. T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
  14142. }
  14143. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14144. typename T6, typename T7, typename T8, typename T9, typename T10,
  14145. typename T11, typename T12, typename T13>
  14146. internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
  14147. T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14148. T10 v10, T11 v11, T12 v12, T13 v13) {
  14149. return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14150. T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
  14151. }
  14152. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14153. typename T6, typename T7, typename T8, typename T9, typename T10,
  14154. typename T11, typename T12, typename T13, typename T14>
  14155. internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14156. T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14157. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
  14158. return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14159. T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
  14160. v14);
  14161. }
  14162. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14163. typename T6, typename T7, typename T8, typename T9, typename T10,
  14164. typename T11, typename T12, typename T13, typename T14, typename T15>
  14165. internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14166. T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  14167. T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
  14168. return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14169. T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
  14170. v13, v14, v15);
  14171. }
  14172. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14173. typename T6, typename T7, typename T8, typename T9, typename T10,
  14174. typename T11, typename T12, typename T13, typename T14, typename T15,
  14175. typename T16>
  14176. internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14177. T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14178. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14179. T16 v16) {
  14180. return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14181. T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
  14182. v12, v13, v14, v15, v16);
  14183. }
  14184. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14185. typename T6, typename T7, typename T8, typename T9, typename T10,
  14186. typename T11, typename T12, typename T13, typename T14, typename T15,
  14187. typename T16, typename T17>
  14188. internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14189. T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14190. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14191. T16 v16, T17 v17) {
  14192. return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14193. T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
  14194. v11, v12, v13, v14, v15, v16, v17);
  14195. }
  14196. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14197. typename T6, typename T7, typename T8, typename T9, typename T10,
  14198. typename T11, typename T12, typename T13, typename T14, typename T15,
  14199. typename T16, typename T17, typename T18>
  14200. internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14201. T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
  14202. T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14203. T16 v16, T17 v17, T18 v18) {
  14204. return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14205. T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
  14206. v10, v11, v12, v13, v14, v15, v16, v17, v18);
  14207. }
  14208. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14209. typename T6, typename T7, typename T8, typename T9, typename T10,
  14210. typename T11, typename T12, typename T13, typename T14, typename T15,
  14211. typename T16, typename T17, typename T18, typename T19>
  14212. internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14213. T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
  14214. T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
  14215. T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
  14216. return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14217. T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
  14218. v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
  14219. }
  14220. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14221. typename T6, typename T7, typename T8, typename T9, typename T10,
  14222. typename T11, typename T12, typename T13, typename T14, typename T15,
  14223. typename T16, typename T17, typename T18, typename T19, typename T20>
  14224. internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14225. T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14226. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  14227. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
  14228. return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14229. T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
  14230. v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
  14231. }
  14232. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14233. typename T6, typename T7, typename T8, typename T9, typename T10,
  14234. typename T11, typename T12, typename T13, typename T14, typename T15,
  14235. typename T16, typename T17, typename T18, typename T19, typename T20,
  14236. typename T21>
  14237. internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14238. T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14239. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  14240. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
  14241. return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14242. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
  14243. v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
  14244. }
  14245. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14246. typename T6, typename T7, typename T8, typename T9, typename T10,
  14247. typename T11, typename T12, typename T13, typename T14, typename T15,
  14248. typename T16, typename T17, typename T18, typename T19, typename T20,
  14249. typename T21, typename T22>
  14250. internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14251. T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
  14252. T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14253. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14254. T21 v21, T22 v22) {
  14255. return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14256. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
  14257. v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  14258. v20, v21, v22);
  14259. }
  14260. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14261. typename T6, typename T7, typename T8, typename T9, typename T10,
  14262. typename T11, typename T12, typename T13, typename T14, typename T15,
  14263. typename T16, typename T17, typename T18, typename T19, typename T20,
  14264. typename T21, typename T22, typename T23>
  14265. internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14266. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
  14267. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14268. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14269. T21 v21, T22 v22, T23 v23) {
  14270. return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14271. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
  14272. v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  14273. v20, v21, v22, v23);
  14274. }
  14275. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14276. typename T6, typename T7, typename T8, typename T9, typename T10,
  14277. typename T11, typename T12, typename T13, typename T14, typename T15,
  14278. typename T16, typename T17, typename T18, typename T19, typename T20,
  14279. typename T21, typename T22, typename T23, typename T24>
  14280. internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14281. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
  14282. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14283. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14284. T21 v21, T22 v22, T23 v23, T24 v24) {
  14285. return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14286. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
  14287. v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
  14288. v19, v20, v21, v22, v23, v24);
  14289. }
  14290. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14291. typename T6, typename T7, typename T8, typename T9, typename T10,
  14292. typename T11, typename T12, typename T13, typename T14, typename T15,
  14293. typename T16, typename T17, typename T18, typename T19, typename T20,
  14294. typename T21, typename T22, typename T23, typename T24, typename T25>
  14295. internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14296. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
  14297. T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
  14298. T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
  14299. T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
  14300. return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14301. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
  14302. v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
  14303. v18, v19, v20, v21, v22, v23, v24, v25);
  14304. }
  14305. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14306. typename T6, typename T7, typename T8, typename T9, typename T10,
  14307. typename T11, typename T12, typename T13, typename T14, typename T15,
  14308. typename T16, typename T17, typename T18, typename T19, typename T20,
  14309. typename T21, typename T22, typename T23, typename T24, typename T25,
  14310. typename T26>
  14311. internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14312. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14313. T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14314. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14315. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14316. T26 v26) {
  14317. return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14318. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14319. T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
  14320. v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
  14321. }
  14322. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14323. typename T6, typename T7, typename T8, typename T9, typename T10,
  14324. typename T11, typename T12, typename T13, typename T14, typename T15,
  14325. typename T16, typename T17, typename T18, typename T19, typename T20,
  14326. typename T21, typename T22, typename T23, typename T24, typename T25,
  14327. typename T26, typename T27>
  14328. internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14329. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
  14330. T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14331. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14332. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14333. T26 v26, T27 v27) {
  14334. return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14335. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14336. T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
  14337. v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
  14338. }
  14339. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14340. typename T6, typename T7, typename T8, typename T9, typename T10,
  14341. typename T11, typename T12, typename T13, typename T14, typename T15,
  14342. typename T16, typename T17, typename T18, typename T19, typename T20,
  14343. typename T21, typename T22, typename T23, typename T24, typename T25,
  14344. typename T26, typename T27, typename T28>
  14345. internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14346. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
  14347. T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14348. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14349. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14350. T26 v26, T27 v27, T28 v28) {
  14351. return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14352. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14353. T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
  14354. v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
  14355. v28);
  14356. }
  14357. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14358. typename T6, typename T7, typename T8, typename T9, typename T10,
  14359. typename T11, typename T12, typename T13, typename T14, typename T15,
  14360. typename T16, typename T17, typename T18, typename T19, typename T20,
  14361. typename T21, typename T22, typename T23, typename T24, typename T25,
  14362. typename T26, typename T27, typename T28, typename T29>
  14363. internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14364. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14365. T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14366. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14367. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14368. T26 v26, T27 v27, T28 v28, T29 v29) {
  14369. return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14370. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14371. T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
  14372. v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
  14373. v27, v28, v29);
  14374. }
  14375. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14376. typename T6, typename T7, typename T8, typename T9, typename T10,
  14377. typename T11, typename T12, typename T13, typename T14, typename T15,
  14378. typename T16, typename T17, typename T18, typename T19, typename T20,
  14379. typename T21, typename T22, typename T23, typename T24, typename T25,
  14380. typename T26, typename T27, typename T28, typename T29, typename T30>
  14381. internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14382. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14383. T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  14384. T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
  14385. T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
  14386. T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
  14387. return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14388. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14389. T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
  14390. v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
  14391. v26, v27, v28, v29, v30);
  14392. }
  14393. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14394. typename T6, typename T7, typename T8, typename T9, typename T10,
  14395. typename T11, typename T12, typename T13, typename T14, typename T15,
  14396. typename T16, typename T17, typename T18, typename T19, typename T20,
  14397. typename T21, typename T22, typename T23, typename T24, typename T25,
  14398. typename T26, typename T27, typename T28, typename T29, typename T30,
  14399. typename T31>
  14400. internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14401. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14402. T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14403. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14404. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  14405. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
  14406. return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14407. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14408. T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
  14409. v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
  14410. v25, v26, v27, v28, v29, v30, v31);
  14411. }
  14412. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14413. typename T6, typename T7, typename T8, typename T9, typename T10,
  14414. typename T11, typename T12, typename T13, typename T14, typename T15,
  14415. typename T16, typename T17, typename T18, typename T19, typename T20,
  14416. typename T21, typename T22, typename T23, typename T24, typename T25,
  14417. typename T26, typename T27, typename T28, typename T29, typename T30,
  14418. typename T31, typename T32>
  14419. internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14420. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14421. T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14422. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14423. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  14424. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  14425. T32 v32) {
  14426. return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14427. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14428. T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
  14429. v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  14430. v24, v25, v26, v27, v28, v29, v30, v31, v32);
  14431. }
  14432. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14433. typename T6, typename T7, typename T8, typename T9, typename T10,
  14434. typename T11, typename T12, typename T13, typename T14, typename T15,
  14435. typename T16, typename T17, typename T18, typename T19, typename T20,
  14436. typename T21, typename T22, typename T23, typename T24, typename T25,
  14437. typename T26, typename T27, typename T28, typename T29, typename T30,
  14438. typename T31, typename T32, typename T33>
  14439. internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14440. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14441. T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
  14442. T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14443. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  14444. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  14445. T32 v32, T33 v33) {
  14446. return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14447. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14448. T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
  14449. v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  14450. v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
  14451. }
  14452. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14453. typename T6, typename T7, typename T8, typename T9, typename T10,
  14454. typename T11, typename T12, typename T13, typename T14, typename T15,
  14455. typename T16, typename T17, typename T18, typename T19, typename T20,
  14456. typename T21, typename T22, typename T23, typename T24, typename T25,
  14457. typename T26, typename T27, typename T28, typename T29, typename T30,
  14458. typename T31, typename T32, typename T33, typename T34>
  14459. internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14460. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14461. T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
  14462. T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
  14463. T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
  14464. T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
  14465. T31 v31, T32 v32, T33 v33, T34 v34) {
  14466. return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14467. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14468. T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
  14469. v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
  14470. v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
  14471. }
  14472. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14473. typename T6, typename T7, typename T8, typename T9, typename T10,
  14474. typename T11, typename T12, typename T13, typename T14, typename T15,
  14475. typename T16, typename T17, typename T18, typename T19, typename T20,
  14476. typename T21, typename T22, typename T23, typename T24, typename T25,
  14477. typename T26, typename T27, typename T28, typename T29, typename T30,
  14478. typename T31, typename T32, typename T33, typename T34, typename T35>
  14479. internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14480. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14481. T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14482. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  14483. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
  14484. T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
  14485. T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
  14486. return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14487. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14488. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
  14489. v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
  14490. v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
  14491. }
  14492. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14493. typename T6, typename T7, typename T8, typename T9, typename T10,
  14494. typename T11, typename T12, typename T13, typename T14, typename T15,
  14495. typename T16, typename T17, typename T18, typename T19, typename T20,
  14496. typename T21, typename T22, typename T23, typename T24, typename T25,
  14497. typename T26, typename T27, typename T28, typename T29, typename T30,
  14498. typename T31, typename T32, typename T33, typename T34, typename T35,
  14499. typename T36>
  14500. internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14501. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14502. T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14503. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  14504. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
  14505. T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
  14506. T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
  14507. return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14508. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14509. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
  14510. v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  14511. v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
  14512. v34, v35, v36);
  14513. }
  14514. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14515. typename T6, typename T7, typename T8, typename T9, typename T10,
  14516. typename T11, typename T12, typename T13, typename T14, typename T15,
  14517. typename T16, typename T17, typename T18, typename T19, typename T20,
  14518. typename T21, typename T22, typename T23, typename T24, typename T25,
  14519. typename T26, typename T27, typename T28, typename T29, typename T30,
  14520. typename T31, typename T32, typename T33, typename T34, typename T35,
  14521. typename T36, typename T37>
  14522. internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14523. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14524. T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
  14525. T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14526. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14527. T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
  14528. T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
  14529. T37 v37) {
  14530. return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14531. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14532. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
  14533. v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  14534. v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
  14535. v34, v35, v36, v37);
  14536. }
  14537. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14538. typename T6, typename T7, typename T8, typename T9, typename T10,
  14539. typename T11, typename T12, typename T13, typename T14, typename T15,
  14540. typename T16, typename T17, typename T18, typename T19, typename T20,
  14541. typename T21, typename T22, typename T23, typename T24, typename T25,
  14542. typename T26, typename T27, typename T28, typename T29, typename T30,
  14543. typename T31, typename T32, typename T33, typename T34, typename T35,
  14544. typename T36, typename T37, typename T38>
  14545. internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14546. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14547. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
  14548. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14549. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14550. T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
  14551. T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
  14552. T37 v37, T38 v38) {
  14553. return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14554. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14555. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
  14556. v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
  14557. v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
  14558. v33, v34, v35, v36, v37, v38);
  14559. }
  14560. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14561. typename T6, typename T7, typename T8, typename T9, typename T10,
  14562. typename T11, typename T12, typename T13, typename T14, typename T15,
  14563. typename T16, typename T17, typename T18, typename T19, typename T20,
  14564. typename T21, typename T22, typename T23, typename T24, typename T25,
  14565. typename T26, typename T27, typename T28, typename T29, typename T30,
  14566. typename T31, typename T32, typename T33, typename T34, typename T35,
  14567. typename T36, typename T37, typename T38, typename T39>
  14568. internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14569. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14570. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
  14571. T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
  14572. T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
  14573. T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
  14574. T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
  14575. T37 v37, T38 v38, T39 v39) {
  14576. return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14577. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14578. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
  14579. v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
  14580. v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
  14581. v32, v33, v34, v35, v36, v37, v38, v39);
  14582. }
  14583. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14584. typename T6, typename T7, typename T8, typename T9, typename T10,
  14585. typename T11, typename T12, typename T13, typename T14, typename T15,
  14586. typename T16, typename T17, typename T18, typename T19, typename T20,
  14587. typename T21, typename T22, typename T23, typename T24, typename T25,
  14588. typename T26, typename T27, typename T28, typename T29, typename T30,
  14589. typename T31, typename T32, typename T33, typename T34, typename T35,
  14590. typename T36, typename T37, typename T38, typename T39, typename T40>
  14591. internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14592. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14593. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
  14594. T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
  14595. T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
  14596. T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
  14597. T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
  14598. T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
  14599. return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14600. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14601. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14602. T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
  14603. v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
  14604. v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
  14605. }
  14606. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14607. typename T6, typename T7, typename T8, typename T9, typename T10,
  14608. typename T11, typename T12, typename T13, typename T14, typename T15,
  14609. typename T16, typename T17, typename T18, typename T19, typename T20,
  14610. typename T21, typename T22, typename T23, typename T24, typename T25,
  14611. typename T26, typename T27, typename T28, typename T29, typename T30,
  14612. typename T31, typename T32, typename T33, typename T34, typename T35,
  14613. typename T36, typename T37, typename T38, typename T39, typename T40,
  14614. typename T41>
  14615. internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14616. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14617. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
  14618. T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14619. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14620. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14621. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  14622. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
  14623. return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14624. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14625. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14626. T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
  14627. v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
  14628. v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
  14629. }
  14630. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14631. typename T6, typename T7, typename T8, typename T9, typename T10,
  14632. typename T11, typename T12, typename T13, typename T14, typename T15,
  14633. typename T16, typename T17, typename T18, typename T19, typename T20,
  14634. typename T21, typename T22, typename T23, typename T24, typename T25,
  14635. typename T26, typename T27, typename T28, typename T29, typename T30,
  14636. typename T31, typename T32, typename T33, typename T34, typename T35,
  14637. typename T36, typename T37, typename T38, typename T39, typename T40,
  14638. typename T41, typename T42>
  14639. internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14640. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14641. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
  14642. T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14643. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14644. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14645. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  14646. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  14647. T42 v42) {
  14648. return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14649. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14650. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14651. T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
  14652. v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
  14653. v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
  14654. v42);
  14655. }
  14656. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14657. typename T6, typename T7, typename T8, typename T9, typename T10,
  14658. typename T11, typename T12, typename T13, typename T14, typename T15,
  14659. typename T16, typename T17, typename T18, typename T19, typename T20,
  14660. typename T21, typename T22, typename T23, typename T24, typename T25,
  14661. typename T26, typename T27, typename T28, typename T29, typename T30,
  14662. typename T31, typename T32, typename T33, typename T34, typename T35,
  14663. typename T36, typename T37, typename T38, typename T39, typename T40,
  14664. typename T41, typename T42, typename T43>
  14665. internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14666. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14667. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
  14668. T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14669. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14670. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14671. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  14672. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  14673. T42 v42, T43 v43) {
  14674. return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14675. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14676. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14677. T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
  14678. v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
  14679. v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
  14680. v41, v42, v43);
  14681. }
  14682. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14683. typename T6, typename T7, typename T8, typename T9, typename T10,
  14684. typename T11, typename T12, typename T13, typename T14, typename T15,
  14685. typename T16, typename T17, typename T18, typename T19, typename T20,
  14686. typename T21, typename T22, typename T23, typename T24, typename T25,
  14687. typename T26, typename T27, typename T28, typename T29, typename T30,
  14688. typename T31, typename T32, typename T33, typename T34, typename T35,
  14689. typename T36, typename T37, typename T38, typename T39, typename T40,
  14690. typename T41, typename T42, typename T43, typename T44>
  14691. internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14692. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14693. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  14694. T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
  14695. T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
  14696. T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
  14697. T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
  14698. T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
  14699. T42 v42, T43 v43, T44 v44) {
  14700. return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14701. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14702. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14703. T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
  14704. v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
  14705. v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
  14706. v40, v41, v42, v43, v44);
  14707. }
  14708. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14709. typename T6, typename T7, typename T8, typename T9, typename T10,
  14710. typename T11, typename T12, typename T13, typename T14, typename T15,
  14711. typename T16, typename T17, typename T18, typename T19, typename T20,
  14712. typename T21, typename T22, typename T23, typename T24, typename T25,
  14713. typename T26, typename T27, typename T28, typename T29, typename T30,
  14714. typename T31, typename T32, typename T33, typename T34, typename T35,
  14715. typename T36, typename T37, typename T38, typename T39, typename T40,
  14716. typename T41, typename T42, typename T43, typename T44, typename T45>
  14717. internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14718. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14719. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  14720. T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
  14721. T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
  14722. T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
  14723. T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
  14724. T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
  14725. T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
  14726. return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14727. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14728. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14729. T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
  14730. v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
  14731. v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
  14732. v39, v40, v41, v42, v43, v44, v45);
  14733. }
  14734. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14735. typename T6, typename T7, typename T8, typename T9, typename T10,
  14736. typename T11, typename T12, typename T13, typename T14, typename T15,
  14737. typename T16, typename T17, typename T18, typename T19, typename T20,
  14738. typename T21, typename T22, typename T23, typename T24, typename T25,
  14739. typename T26, typename T27, typename T28, typename T29, typename T30,
  14740. typename T31, typename T32, typename T33, typename T34, typename T35,
  14741. typename T36, typename T37, typename T38, typename T39, typename T40,
  14742. typename T41, typename T42, typename T43, typename T44, typename T45,
  14743. typename T46>
  14744. internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14745. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14746. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  14747. T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14748. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14749. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  14750. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  14751. T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
  14752. T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
  14753. return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14754. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14755. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14756. T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
  14757. v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  14758. v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
  14759. v38, v39, v40, v41, v42, v43, v44, v45, v46);
  14760. }
  14761. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14762. typename T6, typename T7, typename T8, typename T9, typename T10,
  14763. typename T11, typename T12, typename T13, typename T14, typename T15,
  14764. typename T16, typename T17, typename T18, typename T19, typename T20,
  14765. typename T21, typename T22, typename T23, typename T24, typename T25,
  14766. typename T26, typename T27, typename T28, typename T29, typename T30,
  14767. typename T31, typename T32, typename T33, typename T34, typename T35,
  14768. typename T36, typename T37, typename T38, typename T39, typename T40,
  14769. typename T41, typename T42, typename T43, typename T44, typename T45,
  14770. typename T46, typename T47>
  14771. internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14772. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14773. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  14774. T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
  14775. T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14776. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  14777. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  14778. T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
  14779. T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
  14780. return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14781. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14782. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14783. T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
  14784. v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
  14785. v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
  14786. v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
  14787. }
  14788. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14789. typename T6, typename T7, typename T8, typename T9, typename T10,
  14790. typename T11, typename T12, typename T13, typename T14, typename T15,
  14791. typename T16, typename T17, typename T18, typename T19, typename T20,
  14792. typename T21, typename T22, typename T23, typename T24, typename T25,
  14793. typename T26, typename T27, typename T28, typename T29, typename T30,
  14794. typename T31, typename T32, typename T33, typename T34, typename T35,
  14795. typename T36, typename T37, typename T38, typename T39, typename T40,
  14796. typename T41, typename T42, typename T43, typename T44, typename T45,
  14797. typename T46, typename T47, typename T48>
  14798. internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14799. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14800. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  14801. T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
  14802. T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
  14803. T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
  14804. T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
  14805. T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
  14806. T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
  14807. T48 v48) {
  14808. return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14809. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14810. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14811. T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
  14812. v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
  14813. v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
  14814. v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
  14815. }
  14816. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14817. typename T6, typename T7, typename T8, typename T9, typename T10,
  14818. typename T11, typename T12, typename T13, typename T14, typename T15,
  14819. typename T16, typename T17, typename T18, typename T19, typename T20,
  14820. typename T21, typename T22, typename T23, typename T24, typename T25,
  14821. typename T26, typename T27, typename T28, typename T29, typename T30,
  14822. typename T31, typename T32, typename T33, typename T34, typename T35,
  14823. typename T36, typename T37, typename T38, typename T39, typename T40,
  14824. typename T41, typename T42, typename T43, typename T44, typename T45,
  14825. typename T46, typename T47, typename T48, typename T49>
  14826. internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14827. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14828. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  14829. T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
  14830. T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
  14831. T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
  14832. T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
  14833. T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
  14834. T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
  14835. T47 v47, T48 v48, T49 v49) {
  14836. return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14837. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14838. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14839. T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
  14840. v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
  14841. v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
  14842. v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
  14843. }
  14844. template <typename T1, typename T2, typename T3, typename T4, typename T5,
  14845. typename T6, typename T7, typename T8, typename T9, typename T10,
  14846. typename T11, typename T12, typename T13, typename T14, typename T15,
  14847. typename T16, typename T17, typename T18, typename T19, typename T20,
  14848. typename T21, typename T22, typename T23, typename T24, typename T25,
  14849. typename T26, typename T27, typename T28, typename T29, typename T30,
  14850. typename T31, typename T32, typename T33, typename T34, typename T35,
  14851. typename T36, typename T37, typename T38, typename T39, typename T40,
  14852. typename T41, typename T42, typename T43, typename T44, typename T45,
  14853. typename T46, typename T47, typename T48, typename T49, typename T50>
  14854. internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
  14855. T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
  14856. T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
  14857. T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
  14858. T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
  14859. T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
  14860. T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
  14861. T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
  14862. T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
  14863. T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
  14864. return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
  14865. T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
  14866. T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
  14867. T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
  14868. v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
  14869. v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
  14870. v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
  14871. v48, v49, v50);
  14872. }
  14873. // Bool() allows generating tests with parameters in a set of (false, true).
  14874. //
  14875. // Synopsis:
  14876. // Bool()
  14877. // - returns a generator producing sequences with elements {false, true}.
  14878. //
  14879. // It is useful when testing code that depends on Boolean flags. Combinations
  14880. // of multiple flags can be tested when several Bool()'s are combined using
  14881. // Combine() function.
  14882. //
  14883. // In the following example all tests in the test case FlagDependentTest
  14884. // will be instantiated twice with parameters false and true.
  14885. //
  14886. // class FlagDependentTest : public testing::TestWithParam<bool> {
  14887. // virtual void SetUp() {
  14888. // external_flag = GetParam();
  14889. // }
  14890. // }
  14891. // INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
  14892. //
  14893. inline internal::ParamGenerator<bool> Bool() {
  14894. return Values(false, true);
  14895. }
  14896. # if GTEST_HAS_COMBINE
  14897. // Combine() allows the user to combine two or more sequences to produce
  14898. // values of a Cartesian product of those sequences' elements.
  14899. //
  14900. // Synopsis:
  14901. // Combine(gen1, gen2, ..., genN)
  14902. // - returns a generator producing sequences with elements coming from
  14903. // the Cartesian product of elements from the sequences generated by
  14904. // gen1, gen2, ..., genN. The sequence elements will have a type of
  14905. // tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
  14906. // of elements from sequences produces by gen1, gen2, ..., genN.
  14907. //
  14908. // Combine can have up to 10 arguments. This number is currently limited
  14909. // by the maximum number of elements in the tuple implementation used by Google
  14910. // Test.
  14911. //
  14912. // Example:
  14913. //
  14914. // This will instantiate tests in test case AnimalTest each one with
  14915. // the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
  14916. // tuple("dog", BLACK), and tuple("dog", WHITE):
  14917. //
  14918. // enum Color { BLACK, GRAY, WHITE };
  14919. // class AnimalTest
  14920. // : public testing::TestWithParam<tuple<const char*, Color> > {...};
  14921. //
  14922. // TEST_P(AnimalTest, AnimalLooksNice) {...}
  14923. //
  14924. // INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
  14925. // Combine(Values("cat", "dog"),
  14926. // Values(BLACK, WHITE)));
  14927. //
  14928. // This will instantiate tests in FlagDependentTest with all variations of two
  14929. // Boolean flags:
  14930. //
  14931. // class FlagDependentTest
  14932. // : public testing::TestWithParam<tuple(bool, bool)> > {
  14933. // virtual void SetUp() {
  14934. // // Assigns external_flag_1 and external_flag_2 values from the tuple.
  14935. // tie(external_flag_1, external_flag_2) = GetParam();
  14936. // }
  14937. // };
  14938. //
  14939. // TEST_P(FlagDependentTest, TestFeature1) {
  14940. // // Test your code using external_flag_1 and external_flag_2 here.
  14941. // }
  14942. // INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
  14943. // Combine(Bool(), Bool()));
  14944. //
  14945. template <typename Generator1, typename Generator2>
  14946. internal::CartesianProductHolder2<Generator1, Generator2> Combine(
  14947. const Generator1& g1, const Generator2& g2) {
  14948. return internal::CartesianProductHolder2<Generator1, Generator2>(
  14949. g1, g2);
  14950. }
  14951. template <typename Generator1, typename Generator2, typename Generator3>
  14952. internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
  14953. const Generator1& g1, const Generator2& g2, const Generator3& g3) {
  14954. return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
  14955. g1, g2, g3);
  14956. }
  14957. template <typename Generator1, typename Generator2, typename Generator3,
  14958. typename Generator4>
  14959. internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
  14960. Generator4> Combine(
  14961. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  14962. const Generator4& g4) {
  14963. return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
  14964. Generator4>(
  14965. g1, g2, g3, g4);
  14966. }
  14967. template <typename Generator1, typename Generator2, typename Generator3,
  14968. typename Generator4, typename Generator5>
  14969. internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
  14970. Generator4, Generator5> Combine(
  14971. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  14972. const Generator4& g4, const Generator5& g5) {
  14973. return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
  14974. Generator4, Generator5>(
  14975. g1, g2, g3, g4, g5);
  14976. }
  14977. template <typename Generator1, typename Generator2, typename Generator3,
  14978. typename Generator4, typename Generator5, typename Generator6>
  14979. internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
  14980. Generator4, Generator5, Generator6> Combine(
  14981. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  14982. const Generator4& g4, const Generator5& g5, const Generator6& g6) {
  14983. return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
  14984. Generator4, Generator5, Generator6>(
  14985. g1, g2, g3, g4, g5, g6);
  14986. }
  14987. template <typename Generator1, typename Generator2, typename Generator3,
  14988. typename Generator4, typename Generator5, typename Generator6,
  14989. typename Generator7>
  14990. internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
  14991. Generator4, Generator5, Generator6, Generator7> Combine(
  14992. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  14993. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  14994. const Generator7& g7) {
  14995. return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
  14996. Generator4, Generator5, Generator6, Generator7>(
  14997. g1, g2, g3, g4, g5, g6, g7);
  14998. }
  14999. template <typename Generator1, typename Generator2, typename Generator3,
  15000. typename Generator4, typename Generator5, typename Generator6,
  15001. typename Generator7, typename Generator8>
  15002. internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
  15003. Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
  15004. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  15005. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  15006. const Generator7& g7, const Generator8& g8) {
  15007. return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
  15008. Generator4, Generator5, Generator6, Generator7, Generator8>(
  15009. g1, g2, g3, g4, g5, g6, g7, g8);
  15010. }
  15011. template <typename Generator1, typename Generator2, typename Generator3,
  15012. typename Generator4, typename Generator5, typename Generator6,
  15013. typename Generator7, typename Generator8, typename Generator9>
  15014. internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
  15015. Generator4, Generator5, Generator6, Generator7, Generator8,
  15016. Generator9> Combine(
  15017. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  15018. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  15019. const Generator7& g7, const Generator8& g8, const Generator9& g9) {
  15020. return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
  15021. Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
  15022. g1, g2, g3, g4, g5, g6, g7, g8, g9);
  15023. }
  15024. template <typename Generator1, typename Generator2, typename Generator3,
  15025. typename Generator4, typename Generator5, typename Generator6,
  15026. typename Generator7, typename Generator8, typename Generator9,
  15027. typename Generator10>
  15028. internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
  15029. Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
  15030. Generator10> Combine(
  15031. const Generator1& g1, const Generator2& g2, const Generator3& g3,
  15032. const Generator4& g4, const Generator5& g5, const Generator6& g6,
  15033. const Generator7& g7, const Generator8& g8, const Generator9& g9,
  15034. const Generator10& g10) {
  15035. return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
  15036. Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
  15037. Generator10>(
  15038. g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
  15039. }
  15040. # endif // GTEST_HAS_COMBINE
  15041. # define TEST_P(test_case_name, test_name) \
  15042. class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
  15043. : public test_case_name { \
  15044. public: \
  15045. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
  15046. virtual void TestBody(); \
  15047. private: \
  15048. static int AddToRegistry() { \
  15049. ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
  15050. GetTestCasePatternHolder<test_case_name>(\
  15051. #test_case_name, __FILE__, __LINE__)->AddTestPattern(\
  15052. #test_case_name, \
  15053. #test_name, \
  15054. new ::testing::internal::TestMetaFactory< \
  15055. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \
  15056. return 0; \
  15057. } \
  15058. static int gtest_registering_dummy_; \
  15059. GTEST_DISALLOW_COPY_AND_ASSIGN_(\
  15060. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
  15061. }; \
  15062. int GTEST_TEST_CLASS_NAME_(test_case_name, \
  15063. test_name)::gtest_registering_dummy_ = \
  15064. GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
  15065. void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
  15066. # define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
  15067. ::testing::internal::ParamGenerator<test_case_name::ParamType> \
  15068. gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
  15069. int gtest_##prefix##test_case_name##_dummy_ = \
  15070. ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
  15071. GetTestCasePatternHolder<test_case_name>(\
  15072. #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\
  15073. #prefix, \
  15074. &gtest_##prefix##test_case_name##_EvalGenerator_, \
  15075. __FILE__, __LINE__)
  15076. } // namespace testing
  15077. #endif // GTEST_HAS_PARAM_TEST
  15078. #endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
  15079. // Copyright 2006, Google Inc.
  15080. // All rights reserved.
  15081. //
  15082. // Redistribution and use in source and binary forms, with or without
  15083. // modification, are permitted provided that the following conditions are
  15084. // met:
  15085. //
  15086. // * Redistributions of source code must retain the above copyright
  15087. // notice, this list of conditions and the following disclaimer.
  15088. // * Redistributions in binary form must reproduce the above
  15089. // copyright notice, this list of conditions and the following disclaimer
  15090. // in the documentation and/or other materials provided with the
  15091. // distribution.
  15092. // * Neither the name of Google Inc. nor the names of its
  15093. // contributors may be used to endorse or promote products derived from
  15094. // this software without specific prior written permission.
  15095. //
  15096. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  15097. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  15098. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  15099. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  15100. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15101. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  15102. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  15103. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  15104. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  15105. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  15106. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  15107. //
  15108. // Author: wan@google.com (Zhanyong Wan)
  15109. //
  15110. // Google C++ Testing Framework definitions useful in production code.
  15111. #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
  15112. #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
  15113. // When you need to test the private or protected members of a class,
  15114. // use the FRIEND_TEST macro to declare your tests as friends of the
  15115. // class. For example:
  15116. //
  15117. // class MyClass {
  15118. // private:
  15119. // void MyMethod();
  15120. // FRIEND_TEST(MyClassTest, MyMethod);
  15121. // };
  15122. //
  15123. // class MyClassTest : public testing::Test {
  15124. // // ...
  15125. // };
  15126. //
  15127. // TEST_F(MyClassTest, MyMethod) {
  15128. // // Can call MyClass::MyMethod() here.
  15129. // }
  15130. #define FRIEND_TEST(test_case_name, test_name)\
  15131. friend class test_case_name##_##test_name##_Test
  15132. #endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
  15133. // Copyright 2008, Google Inc.
  15134. // All rights reserved.
  15135. //
  15136. // Redistribution and use in source and binary forms, with or without
  15137. // modification, are permitted provided that the following conditions are
  15138. // met:
  15139. //
  15140. // * Redistributions of source code must retain the above copyright
  15141. // notice, this list of conditions and the following disclaimer.
  15142. // * Redistributions in binary form must reproduce the above
  15143. // copyright notice, this list of conditions and the following disclaimer
  15144. // in the documentation and/or other materials provided with the
  15145. // distribution.
  15146. // * Neither the name of Google Inc. nor the names of its
  15147. // contributors may be used to endorse or promote products derived from
  15148. // this software without specific prior written permission.
  15149. //
  15150. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  15151. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  15152. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  15153. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  15154. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15155. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  15156. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  15157. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  15158. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  15159. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  15160. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  15161. //
  15162. // Author: mheule@google.com (Markus Heule)
  15163. //
  15164. #ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
  15165. #define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
  15166. #include <iosfwd>
  15167. #include <vector>
  15168. namespace testing {
  15169. // A copyable object representing the result of a test part (i.e. an
  15170. // assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
  15171. //
  15172. // Don't inherit from TestPartResult as its destructor is not virtual.
  15173. class GTEST_API_ TestPartResult {
  15174. public:
  15175. // The possible outcomes of a test part (i.e. an assertion or an
  15176. // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
  15177. enum Type {
  15178. kSuccess, // Succeeded.
  15179. kNonFatalFailure, // Failed but the test can continue.
  15180. kFatalFailure // Failed and the test should be terminated.
  15181. };
  15182. // C'tor. TestPartResult does NOT have a default constructor.
  15183. // Always use this constructor (with parameters) to create a
  15184. // TestPartResult object.
  15185. TestPartResult(Type a_type,
  15186. const char* a_file_name,
  15187. int a_line_number,
  15188. const char* a_message)
  15189. : type_(a_type),
  15190. file_name_(a_file_name),
  15191. line_number_(a_line_number),
  15192. summary_(ExtractSummary(a_message)),
  15193. message_(a_message) {
  15194. }
  15195. // Gets the outcome of the test part.
  15196. Type type() const { return type_; }
  15197. // Gets the name of the source file where the test part took place, or
  15198. // NULL if it's unknown.
  15199. const char* file_name() const { return file_name_.c_str(); }
  15200. // Gets the line in the source file where the test part took place,
  15201. // or -1 if it's unknown.
  15202. int line_number() const { return line_number_; }
  15203. // Gets the summary of the failure message.
  15204. const char* summary() const { return summary_.c_str(); }
  15205. // Gets the message associated with the test part.
  15206. const char* message() const { return message_.c_str(); }
  15207. // Returns true iff the test part passed.
  15208. bool passed() const { return type_ == kSuccess; }
  15209. // Returns true iff the test part failed.
  15210. bool failed() const { return type_ != kSuccess; }
  15211. // Returns true iff the test part non-fatally failed.
  15212. bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
  15213. // Returns true iff the test part fatally failed.
  15214. bool fatally_failed() const { return type_ == kFatalFailure; }
  15215. private:
  15216. Type type_;
  15217. // Gets the summary of the failure message by omitting the stack
  15218. // trace in it.
  15219. static internal::String ExtractSummary(const char* message);
  15220. // The name of the source file where the test part took place, or
  15221. // NULL if the source file is unknown.
  15222. internal::String file_name_;
  15223. // The line in the source file where the test part took place, or -1
  15224. // if the line number is unknown.
  15225. int line_number_;
  15226. internal::String summary_; // The test failure summary.
  15227. internal::String message_; // The test failure message.
  15228. };
  15229. // Prints a TestPartResult object.
  15230. std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
  15231. // An array of TestPartResult objects.
  15232. //
  15233. // Don't inherit from TestPartResultArray as its destructor is not
  15234. // virtual.
  15235. class GTEST_API_ TestPartResultArray {
  15236. public:
  15237. TestPartResultArray() {}
  15238. // Appends the given TestPartResult to the array.
  15239. void Append(const TestPartResult& result);
  15240. // Returns the TestPartResult at the given index (0-based).
  15241. const TestPartResult& GetTestPartResult(int index) const;
  15242. // Returns the number of TestPartResult objects in the array.
  15243. int size() const;
  15244. private:
  15245. std::vector<TestPartResult> array_;
  15246. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
  15247. };
  15248. // This interface knows how to report a test part result.
  15249. class TestPartResultReporterInterface {
  15250. public:
  15251. virtual ~TestPartResultReporterInterface() {}
  15252. virtual void ReportTestPartResult(const TestPartResult& result) = 0;
  15253. };
  15254. namespace internal {
  15255. // This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
  15256. // statement generates new fatal failures. To do so it registers itself as the
  15257. // current test part result reporter. Besides checking if fatal failures were
  15258. // reported, it only delegates the reporting to the former result reporter.
  15259. // The original result reporter is restored in the destructor.
  15260. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  15261. class GTEST_API_ HasNewFatalFailureHelper
  15262. : public TestPartResultReporterInterface {
  15263. public:
  15264. HasNewFatalFailureHelper();
  15265. virtual ~HasNewFatalFailureHelper();
  15266. virtual void ReportTestPartResult(const TestPartResult& result);
  15267. bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
  15268. private:
  15269. bool has_new_fatal_failure_;
  15270. TestPartResultReporterInterface* original_reporter_;
  15271. GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
  15272. };
  15273. } // namespace internal
  15274. } // namespace testing
  15275. #endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
  15276. // Copyright 2008 Google Inc.
  15277. // All Rights Reserved.
  15278. //
  15279. // Redistribution and use in source and binary forms, with or without
  15280. // modification, are permitted provided that the following conditions are
  15281. // met:
  15282. //
  15283. // * Redistributions of source code must retain the above copyright
  15284. // notice, this list of conditions and the following disclaimer.
  15285. // * Redistributions in binary form must reproduce the above
  15286. // copyright notice, this list of conditions and the following disclaimer
  15287. // in the documentation and/or other materials provided with the
  15288. // distribution.
  15289. // * Neither the name of Google Inc. nor the names of its
  15290. // contributors may be used to endorse or promote products derived from
  15291. // this software without specific prior written permission.
  15292. //
  15293. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  15294. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  15295. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  15296. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  15297. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15298. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  15299. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  15300. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  15301. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  15302. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  15303. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  15304. //
  15305. // Author: wan@google.com (Zhanyong Wan)
  15306. #ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
  15307. #define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
  15308. // This header implements typed tests and type-parameterized tests.
  15309. // Typed (aka type-driven) tests repeat the same test for types in a
  15310. // list. You must know which types you want to test with when writing
  15311. // typed tests. Here's how you do it:
  15312. #if 0
  15313. // First, define a fixture class template. It should be parameterized
  15314. // by a type. Remember to derive it from testing::Test.
  15315. template <typename T>
  15316. class FooTest : public testing::Test {
  15317. public:
  15318. ...
  15319. typedef std::list<T> List;
  15320. static T shared_;
  15321. T value_;
  15322. };
  15323. // Next, associate a list of types with the test case, which will be
  15324. // repeated for each type in the list. The typedef is necessary for
  15325. // the macro to parse correctly.
  15326. typedef testing::Types<char, int, unsigned int> MyTypes;
  15327. TYPED_TEST_CASE(FooTest, MyTypes);
  15328. // If the type list contains only one type, you can write that type
  15329. // directly without Types<...>:
  15330. // TYPED_TEST_CASE(FooTest, int);
  15331. // Then, use TYPED_TEST() instead of TEST_F() to define as many typed
  15332. // tests for this test case as you want.
  15333. TYPED_TEST(FooTest, DoesBlah) {
  15334. // Inside a test, refer to TypeParam to get the type parameter.
  15335. // Since we are inside a derived class template, C++ requires use to
  15336. // visit the members of FooTest via 'this'.
  15337. TypeParam n = this->value_;
  15338. // To visit static members of the fixture, add the TestFixture::
  15339. // prefix.
  15340. n += TestFixture::shared_;
  15341. // To refer to typedefs in the fixture, add the "typename
  15342. // TestFixture::" prefix.
  15343. typename TestFixture::List values;
  15344. values.push_back(n);
  15345. ...
  15346. }
  15347. TYPED_TEST(FooTest, HasPropertyA) { ... }
  15348. #endif // 0
  15349. // Type-parameterized tests are abstract test patterns parameterized
  15350. // by a type. Compared with typed tests, type-parameterized tests
  15351. // allow you to define the test pattern without knowing what the type
  15352. // parameters are. The defined pattern can be instantiated with
  15353. // different types any number of times, in any number of translation
  15354. // units.
  15355. //
  15356. // If you are designing an interface or concept, you can define a
  15357. // suite of type-parameterized tests to verify properties that any
  15358. // valid implementation of the interface/concept should have. Then,
  15359. // each implementation can easily instantiate the test suite to verify
  15360. // that it conforms to the requirements, without having to write
  15361. // similar tests repeatedly. Here's an example:
  15362. #if 0
  15363. // First, define a fixture class template. It should be parameterized
  15364. // by a type. Remember to derive it from testing::Test.
  15365. template <typename T>
  15366. class FooTest : public testing::Test {
  15367. ...
  15368. };
  15369. // Next, declare that you will define a type-parameterized test case
  15370. // (the _P suffix is for "parameterized" or "pattern", whichever you
  15371. // prefer):
  15372. TYPED_TEST_CASE_P(FooTest);
  15373. // Then, use TYPED_TEST_P() to define as many type-parameterized tests
  15374. // for this type-parameterized test case as you want.
  15375. TYPED_TEST_P(FooTest, DoesBlah) {
  15376. // Inside a test, refer to TypeParam to get the type parameter.
  15377. TypeParam n = 0;
  15378. ...
  15379. }
  15380. TYPED_TEST_P(FooTest, HasPropertyA) { ... }
  15381. // Now the tricky part: you need to register all test patterns before
  15382. // you can instantiate them. The first argument of the macro is the
  15383. // test case name; the rest are the names of the tests in this test
  15384. // case.
  15385. REGISTER_TYPED_TEST_CASE_P(FooTest,
  15386. DoesBlah, HasPropertyA);
  15387. // Finally, you are free to instantiate the pattern with the types you
  15388. // want. If you put the above code in a header file, you can #include
  15389. // it in multiple C++ source files and instantiate it multiple times.
  15390. //
  15391. // To distinguish different instances of the pattern, the first
  15392. // argument to the INSTANTIATE_* macro is a prefix that will be added
  15393. // to the actual test case name. Remember to pick unique prefixes for
  15394. // different instances.
  15395. typedef testing::Types<char, int, unsigned int> MyTypes;
  15396. INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
  15397. // If the type list contains only one type, you can write that type
  15398. // directly without Types<...>:
  15399. // INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
  15400. #endif // 0
  15401. // Implements typed tests.
  15402. #if GTEST_HAS_TYPED_TEST
  15403. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  15404. //
  15405. // Expands to the name of the typedef for the type parameters of the
  15406. // given test case.
  15407. # define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
  15408. // The 'Types' template argument below must have spaces around it
  15409. // since some compilers may choke on '>>' when passing a template
  15410. // instance (e.g. Types<int>)
  15411. # define TYPED_TEST_CASE(CaseName, Types) \
  15412. typedef ::testing::internal::TypeList< Types >::type \
  15413. GTEST_TYPE_PARAMS_(CaseName)
  15414. # define TYPED_TEST(CaseName, TestName) \
  15415. template <typename gtest_TypeParam_> \
  15416. class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
  15417. : public CaseName<gtest_TypeParam_> { \
  15418. private: \
  15419. typedef CaseName<gtest_TypeParam_> TestFixture; \
  15420. typedef gtest_TypeParam_ TypeParam; \
  15421. virtual void TestBody(); \
  15422. }; \
  15423. bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \
  15424. ::testing::internal::TypeParameterizedTest< \
  15425. CaseName, \
  15426. ::testing::internal::TemplateSel< \
  15427. GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
  15428. GTEST_TYPE_PARAMS_(CaseName)>::Register(\
  15429. "", #CaseName, #TestName, 0); \
  15430. template <typename gtest_TypeParam_> \
  15431. void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
  15432. #endif // GTEST_HAS_TYPED_TEST
  15433. // Implements type-parameterized tests.
  15434. #if GTEST_HAS_TYPED_TEST_P
  15435. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  15436. //
  15437. // Expands to the namespace name that the type-parameterized tests for
  15438. // the given type-parameterized test case are defined in. The exact
  15439. // name of the namespace is subject to change without notice.
  15440. # define GTEST_CASE_NAMESPACE_(TestCaseName) \
  15441. gtest_case_##TestCaseName##_
  15442. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  15443. //
  15444. // Expands to the name of the variable used to remember the names of
  15445. // the defined tests in the given test case.
  15446. # define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
  15447. gtest_typed_test_case_p_state_##TestCaseName##_
  15448. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
  15449. //
  15450. // Expands to the name of the variable used to remember the names of
  15451. // the registered tests in the given test case.
  15452. # define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
  15453. gtest_registered_test_names_##TestCaseName##_
  15454. // The variables defined in the type-parameterized test macros are
  15455. // static as typically these macros are used in a .h file that can be
  15456. // #included in multiple translation units linked together.
  15457. # define TYPED_TEST_CASE_P(CaseName) \
  15458. static ::testing::internal::TypedTestCasePState \
  15459. GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
  15460. # define TYPED_TEST_P(CaseName, TestName) \
  15461. namespace GTEST_CASE_NAMESPACE_(CaseName) { \
  15462. template <typename gtest_TypeParam_> \
  15463. class TestName : public CaseName<gtest_TypeParam_> { \
  15464. private: \
  15465. typedef CaseName<gtest_TypeParam_> TestFixture; \
  15466. typedef gtest_TypeParam_ TypeParam; \
  15467. virtual void TestBody(); \
  15468. }; \
  15469. static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
  15470. GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
  15471. __FILE__, __LINE__, #CaseName, #TestName); \
  15472. } \
  15473. template <typename gtest_TypeParam_> \
  15474. void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
  15475. # define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
  15476. namespace GTEST_CASE_NAMESPACE_(CaseName) { \
  15477. typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
  15478. } \
  15479. static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
  15480. GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
  15481. __FILE__, __LINE__, #__VA_ARGS__)
  15482. // The 'Types' template argument below must have spaces around it
  15483. // since some compilers may choke on '>>' when passing a template
  15484. // instance (e.g. Types<int>)
  15485. # define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \
  15486. bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
  15487. ::testing::internal::TypeParameterizedTestCase<CaseName, \
  15488. GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
  15489. ::testing::internal::TypeList< Types >::type>::Register(\
  15490. #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
  15491. #endif // GTEST_HAS_TYPED_TEST_P
  15492. #endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
  15493. // Depending on the platform, different string classes are available.
  15494. // On Linux, in addition to ::std::string, Google also makes use of
  15495. // class ::string, which has the same interface as ::std::string, but
  15496. // has a different implementation.
  15497. //
  15498. // The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
  15499. // ::string is available AND is a distinct type to ::std::string, or
  15500. // define it to 0 to indicate otherwise.
  15501. //
  15502. // If the user's ::std::string and ::string are the same class due to
  15503. // aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0.
  15504. //
  15505. // If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined
  15506. // heuristically.
  15507. namespace testing {
  15508. // Declares the flags.
  15509. // This flag temporary enables the disabled tests.
  15510. GTEST_DECLARE_bool_(also_run_disabled_tests);
  15511. // This flag brings the debugger on an assertion failure.
  15512. GTEST_DECLARE_bool_(break_on_failure);
  15513. // This flag controls whether Google Test catches all test-thrown exceptions
  15514. // and logs them as failures.
  15515. GTEST_DECLARE_bool_(catch_exceptions);
  15516. // This flag enables using colors in terminal output. Available values are
  15517. // "yes" to enable colors, "no" (disable colors), or "auto" (the default)
  15518. // to let Google Test decide.
  15519. GTEST_DECLARE_string_(color);
  15520. // This flag sets up the filter to select by name using a glob pattern
  15521. // the tests to run. If the filter is not given all tests are executed.
  15522. GTEST_DECLARE_string_(filter);
  15523. // This flag causes the Google Test to list tests. None of the tests listed
  15524. // are actually run if the flag is provided.
  15525. GTEST_DECLARE_bool_(list_tests);
  15526. // This flag controls whether Google Test emits a detailed XML report to a file
  15527. // in addition to its normal textual output.
  15528. GTEST_DECLARE_string_(output);
  15529. // This flags control whether Google Test prints the elapsed time for each
  15530. // test.
  15531. GTEST_DECLARE_bool_(print_time);
  15532. // This flag specifies the random number seed.
  15533. GTEST_DECLARE_int32_(random_seed);
  15534. // This flag sets how many times the tests are repeated. The default value
  15535. // is 1. If the value is -1 the tests are repeating forever.
  15536. GTEST_DECLARE_int32_(repeat);
  15537. // This flag controls whether Google Test includes Google Test internal
  15538. // stack frames in failure stack traces.
  15539. GTEST_DECLARE_bool_(show_internal_stack_frames);
  15540. // When this flag is specified, tests' order is randomized on every iteration.
  15541. GTEST_DECLARE_bool_(shuffle);
  15542. // This flag specifies the maximum number of stack frames to be
  15543. // printed in a failure message.
  15544. GTEST_DECLARE_int32_(stack_trace_depth);
  15545. // When this flag is specified, a failed assertion will throw an
  15546. // exception if exceptions are enabled, or exit the program with a
  15547. // non-zero code otherwise.
  15548. GTEST_DECLARE_bool_(throw_on_failure);
  15549. // When this flag is set with a "host:port" string, on supported
  15550. // platforms test results are streamed to the specified port on
  15551. // the specified host machine.
  15552. GTEST_DECLARE_string_(stream_result_to);
  15553. // The upper limit for valid stack trace depths.
  15554. const int kMaxStackTraceDepth = 100;
  15555. namespace internal {
  15556. class AssertHelper;
  15557. class DefaultGlobalTestPartResultReporter;
  15558. class ExecDeathTest;
  15559. class NoExecDeathTest;
  15560. class FinalSuccessChecker;
  15561. class GTestFlagSaver;
  15562. class TestResultAccessor;
  15563. class TestEventListenersAccessor;
  15564. class TestEventRepeater;
  15565. class WindowsDeathTest;
  15566. class UnitTestImpl* GetUnitTestImpl();
  15567. void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
  15568. const String& message);
  15569. // Converts a streamable value to a String. A NULL pointer is
  15570. // converted to "(null)". When the input value is a ::string,
  15571. // ::std::string, ::wstring, or ::std::wstring object, each NUL
  15572. // character in it is replaced with "\\0".
  15573. // Declared in gtest-internal.h but defined here, so that it has access
  15574. // to the definition of the Message class, required by the ARM
  15575. // compiler.
  15576. template <typename T>
  15577. String StreamableToString(const T& streamable) {
  15578. return (Message() << streamable).GetString();
  15579. }
  15580. } // namespace internal
  15581. // The friend relationship of some of these classes is cyclic.
  15582. // If we don't forward declare them the compiler might confuse the classes
  15583. // in friendship clauses with same named classes on the scope.
  15584. class Test;
  15585. class TestCase;
  15586. class TestInfo;
  15587. class UnitTest;
  15588. // A class for indicating whether an assertion was successful. When
  15589. // the assertion wasn't successful, the AssertionResult object
  15590. // remembers a non-empty message that describes how it failed.
  15591. //
  15592. // To create an instance of this class, use one of the factory functions
  15593. // (AssertionSuccess() and AssertionFailure()).
  15594. //
  15595. // This class is useful for two purposes:
  15596. // 1. Defining predicate functions to be used with Boolean test assertions
  15597. // EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
  15598. // 2. Defining predicate-format functions to be
  15599. // used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
  15600. //
  15601. // For example, if you define IsEven predicate:
  15602. //
  15603. // testing::AssertionResult IsEven(int n) {
  15604. // if ((n % 2) == 0)
  15605. // return testing::AssertionSuccess();
  15606. // else
  15607. // return testing::AssertionFailure() << n << " is odd";
  15608. // }
  15609. //
  15610. // Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
  15611. // will print the message
  15612. //
  15613. // Value of: IsEven(Fib(5))
  15614. // Actual: false (5 is odd)
  15615. // Expected: true
  15616. //
  15617. // instead of a more opaque
  15618. //
  15619. // Value of: IsEven(Fib(5))
  15620. // Actual: false
  15621. // Expected: true
  15622. //
  15623. // in case IsEven is a simple Boolean predicate.
  15624. //
  15625. // If you expect your predicate to be reused and want to support informative
  15626. // messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
  15627. // about half as often as positive ones in our tests), supply messages for
  15628. // both success and failure cases:
  15629. //
  15630. // testing::AssertionResult IsEven(int n) {
  15631. // if ((n % 2) == 0)
  15632. // return testing::AssertionSuccess() << n << " is even";
  15633. // else
  15634. // return testing::AssertionFailure() << n << " is odd";
  15635. // }
  15636. //
  15637. // Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
  15638. //
  15639. // Value of: IsEven(Fib(6))
  15640. // Actual: true (8 is even)
  15641. // Expected: false
  15642. //
  15643. // NB: Predicates that support negative Boolean assertions have reduced
  15644. // performance in positive ones so be careful not to use them in tests
  15645. // that have lots (tens of thousands) of positive Boolean assertions.
  15646. //
  15647. // To use this class with EXPECT_PRED_FORMAT assertions such as:
  15648. //
  15649. // // Verifies that Foo() returns an even number.
  15650. // EXPECT_PRED_FORMAT1(IsEven, Foo());
  15651. //
  15652. // you need to define:
  15653. //
  15654. // testing::AssertionResult IsEven(const char* expr, int n) {
  15655. // if ((n % 2) == 0)
  15656. // return testing::AssertionSuccess();
  15657. // else
  15658. // return testing::AssertionFailure()
  15659. // << "Expected: " << expr << " is even\n Actual: it's " << n;
  15660. // }
  15661. //
  15662. // If Foo() returns 5, you will see the following message:
  15663. //
  15664. // Expected: Foo() is even
  15665. // Actual: it's 5
  15666. //
  15667. class GTEST_API_ AssertionResult {
  15668. public:
  15669. // Copy constructor.
  15670. // Used in EXPECT_TRUE/FALSE(assertion_result).
  15671. AssertionResult(const AssertionResult& other);
  15672. // Used in the EXPECT_TRUE/FALSE(bool_expression).
  15673. explicit AssertionResult(bool success) : success_(success) {}
  15674. // Returns true iff the assertion succeeded.
  15675. operator bool() const { return success_; } // NOLINT
  15676. // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
  15677. AssertionResult operator!() const;
  15678. // Returns the text streamed into this AssertionResult. Test assertions
  15679. // use it when they fail (i.e., the predicate's outcome doesn't match the
  15680. // assertion's expectation). When nothing has been streamed into the
  15681. // object, returns an empty string.
  15682. const char* message() const {
  15683. return message_.get() != NULL ? message_->c_str() : "";
  15684. }
  15685. // TODO(vladl@google.com): Remove this after making sure no clients use it.
  15686. // Deprecated; please use message() instead.
  15687. const char* failure_message() const { return message(); }
  15688. // Streams a custom failure message into this object.
  15689. template <typename T> AssertionResult& operator<<(const T& value) {
  15690. AppendMessage(Message() << value);
  15691. return *this;
  15692. }
  15693. // Allows streaming basic output manipulators such as endl or flush into
  15694. // this object.
  15695. AssertionResult& operator<<(
  15696. ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
  15697. AppendMessage(Message() << basic_manipulator);
  15698. return *this;
  15699. }
  15700. private:
  15701. // Appends the contents of message to message_.
  15702. void AppendMessage(const Message& a_message) {
  15703. if (message_.get() == NULL)
  15704. message_.reset(new ::std::string);
  15705. message_->append(a_message.GetString().c_str());
  15706. }
  15707. // Stores result of the assertion predicate.
  15708. bool success_;
  15709. // Stores the message describing the condition in case the expectation
  15710. // construct is not satisfied with the predicate's outcome.
  15711. // Referenced via a pointer to avoid taking too much stack frame space
  15712. // with test assertions.
  15713. internal::scoped_ptr< ::std::string> message_;
  15714. GTEST_DISALLOW_ASSIGN_(AssertionResult);
  15715. };
  15716. // Makes a successful assertion result.
  15717. GTEST_API_ AssertionResult AssertionSuccess();
  15718. // Makes a failed assertion result.
  15719. GTEST_API_ AssertionResult AssertionFailure();
  15720. // Makes a failed assertion result with the given failure message.
  15721. // Deprecated; use AssertionFailure() << msg.
  15722. GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
  15723. // The abstract class that all tests inherit from.
  15724. //
  15725. // In Google Test, a unit test program contains one or many TestCases, and
  15726. // each TestCase contains one or many Tests.
  15727. //
  15728. // When you define a test using the TEST macro, you don't need to
  15729. // explicitly derive from Test - the TEST macro automatically does
  15730. // this for you.
  15731. //
  15732. // The only time you derive from Test is when defining a test fixture
  15733. // to be used a TEST_F. For example:
  15734. //
  15735. // class FooTest : public testing::Test {
  15736. // protected:
  15737. // virtual void SetUp() { ... }
  15738. // virtual void TearDown() { ... }
  15739. // ...
  15740. // };
  15741. //
  15742. // TEST_F(FooTest, Bar) { ... }
  15743. // TEST_F(FooTest, Baz) { ... }
  15744. //
  15745. // Test is not copyable.
  15746. class GTEST_API_ Test {
  15747. public:
  15748. friend class TestInfo;
  15749. // Defines types for pointers to functions that set up and tear down
  15750. // a test case.
  15751. typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
  15752. typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
  15753. // The d'tor is virtual as we intend to inherit from Test.
  15754. virtual ~Test();
  15755. // Sets up the stuff shared by all tests in this test case.
  15756. //
  15757. // Google Test will call Foo::SetUpTestCase() before running the first
  15758. // test in test case Foo. Hence a sub-class can define its own
  15759. // SetUpTestCase() method to shadow the one defined in the super
  15760. // class.
  15761. static void SetUpTestCase() {}
  15762. // Tears down the stuff shared by all tests in this test case.
  15763. //
  15764. // Google Test will call Foo::TearDownTestCase() after running the last
  15765. // test in test case Foo. Hence a sub-class can define its own
  15766. // TearDownTestCase() method to shadow the one defined in the super
  15767. // class.
  15768. static void TearDownTestCase() {}
  15769. // Returns true iff the current test has a fatal failure.
  15770. static bool HasFatalFailure();
  15771. // Returns true iff the current test has a non-fatal failure.
  15772. static bool HasNonfatalFailure();
  15773. // Returns true iff the current test has a (either fatal or
  15774. // non-fatal) failure.
  15775. static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
  15776. // Logs a property for the current test. Only the last value for a given
  15777. // key is remembered.
  15778. // These are public static so they can be called from utility functions
  15779. // that are not members of the test fixture.
  15780. // The arguments are const char* instead strings, as Google Test is used
  15781. // on platforms where string doesn't compile.
  15782. //
  15783. // Note that a driving consideration for these RecordProperty methods
  15784. // was to produce xml output suited to the Greenspan charting utility,
  15785. // which at present will only chart values that fit in a 32-bit int. It
  15786. // is the user's responsibility to restrict their values to 32-bit ints
  15787. // if they intend them to be used with Greenspan.
  15788. static void RecordProperty(const char* key, const char* value);
  15789. static void RecordProperty(const char* key, int value);
  15790. protected:
  15791. // Creates a Test object.
  15792. Test();
  15793. // Sets up the test fixture.
  15794. virtual void SetUp();
  15795. // Tears down the test fixture.
  15796. virtual void TearDown();
  15797. private:
  15798. // Returns true iff the current test has the same fixture class as
  15799. // the first test in the current test case.
  15800. static bool HasSameFixtureClass();
  15801. // Runs the test after the test fixture has been set up.
  15802. //
  15803. // A sub-class must implement this to define the test logic.
  15804. //
  15805. // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
  15806. // Instead, use the TEST or TEST_F macro.
  15807. virtual void TestBody() = 0;
  15808. // Sets up, executes, and tears down the test.
  15809. void Run();
  15810. // Deletes self. We deliberately pick an unusual name for this
  15811. // internal method to avoid clashing with names used in user TESTs.
  15812. void DeleteSelf_() { delete this; }
  15813. // Uses a GTestFlagSaver to save and restore all Google Test flags.
  15814. const internal::GTestFlagSaver* const gtest_flag_saver_;
  15815. // Often a user mis-spells SetUp() as Setup() and spends a long time
  15816. // wondering why it is never called by Google Test. The declaration of
  15817. // the following method is solely for catching such an error at
  15818. // compile time:
  15819. //
  15820. // - The return type is deliberately chosen to be not void, so it
  15821. // will be a conflict if a user declares void Setup() in his test
  15822. // fixture.
  15823. //
  15824. // - This method is private, so it will be another compiler error
  15825. // if a user calls it from his test fixture.
  15826. //
  15827. // DO NOT OVERRIDE THIS FUNCTION.
  15828. //
  15829. // If you see an error about overriding the following function or
  15830. // about it being private, you have mis-spelled SetUp() as Setup().
  15831. struct Setup_should_be_spelled_SetUp {};
  15832. virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
  15833. // We disallow copying Tests.
  15834. GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
  15835. };
  15836. typedef internal::TimeInMillis TimeInMillis;
  15837. // A copyable object representing a user specified test property which can be
  15838. // output as a key/value string pair.
  15839. //
  15840. // Don't inherit from TestProperty as its destructor is not virtual.
  15841. class TestProperty {
  15842. public:
  15843. // C'tor. TestProperty does NOT have a default constructor.
  15844. // Always use this constructor (with parameters) to create a
  15845. // TestProperty object.
  15846. TestProperty(const char* a_key, const char* a_value) :
  15847. key_(a_key), value_(a_value) {
  15848. }
  15849. // Gets the user supplied key.
  15850. const char* key() const {
  15851. return key_.c_str();
  15852. }
  15853. // Gets the user supplied value.
  15854. const char* value() const {
  15855. return value_.c_str();
  15856. }
  15857. // Sets a new value, overriding the one supplied in the constructor.
  15858. void SetValue(const char* new_value) {
  15859. value_ = new_value;
  15860. }
  15861. private:
  15862. // The key supplied by the user.
  15863. internal::String key_;
  15864. // The value supplied by the user.
  15865. internal::String value_;
  15866. };
  15867. // The result of a single Test. This includes a list of
  15868. // TestPartResults, a list of TestProperties, a count of how many
  15869. // death tests there are in the Test, and how much time it took to run
  15870. // the Test.
  15871. //
  15872. // TestResult is not copyable.
  15873. class GTEST_API_ TestResult {
  15874. public:
  15875. // Creates an empty TestResult.
  15876. TestResult();
  15877. // D'tor. Do not inherit from TestResult.
  15878. ~TestResult();
  15879. // Gets the number of all test parts. This is the sum of the number
  15880. // of successful test parts and the number of failed test parts.
  15881. int total_part_count() const;
  15882. // Returns the number of the test properties.
  15883. int test_property_count() const;
  15884. // Returns true iff the test passed (i.e. no test part failed).
  15885. bool Passed() const { return !Failed(); }
  15886. // Returns true iff the test failed.
  15887. bool Failed() const;
  15888. // Returns true iff the test fatally failed.
  15889. bool HasFatalFailure() const;
  15890. // Returns true iff the test has a non-fatal failure.
  15891. bool HasNonfatalFailure() const;
  15892. // Returns the elapsed time, in milliseconds.
  15893. TimeInMillis elapsed_time() const { return elapsed_time_; }
  15894. // Returns the i-th test part result among all the results. i can range
  15895. // from 0 to test_property_count() - 1. If i is not in that range, aborts
  15896. // the program.
  15897. const TestPartResult& GetTestPartResult(int i) const;
  15898. // Returns the i-th test property. i can range from 0 to
  15899. // test_property_count() - 1. If i is not in that range, aborts the
  15900. // program.
  15901. const TestProperty& GetTestProperty(int i) const;
  15902. private:
  15903. friend class TestInfo;
  15904. friend class UnitTest;
  15905. friend class internal::DefaultGlobalTestPartResultReporter;
  15906. friend class internal::ExecDeathTest;
  15907. friend class internal::TestResultAccessor;
  15908. friend class internal::UnitTestImpl;
  15909. friend class internal::WindowsDeathTest;
  15910. // Gets the vector of TestPartResults.
  15911. const std::vector<TestPartResult>& test_part_results() const {
  15912. return test_part_results_;
  15913. }
  15914. // Gets the vector of TestProperties.
  15915. const std::vector<TestProperty>& test_properties() const {
  15916. return test_properties_;
  15917. }
  15918. // Sets the elapsed time.
  15919. void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
  15920. // Adds a test property to the list. The property is validated and may add
  15921. // a non-fatal failure if invalid (e.g., if it conflicts with reserved
  15922. // key names). If a property is already recorded for the same key, the
  15923. // value will be updated, rather than storing multiple values for the same
  15924. // key.
  15925. void RecordProperty(const TestProperty& test_property);
  15926. // Adds a failure if the key is a reserved attribute of Google Test
  15927. // testcase tags. Returns true if the property is valid.
  15928. // TODO(russr): Validate attribute names are legal and human readable.
  15929. static bool ValidateTestProperty(const TestProperty& test_property);
  15930. // Adds a test part result to the list.
  15931. void AddTestPartResult(const TestPartResult& test_part_result);
  15932. // Returns the death test count.
  15933. int death_test_count() const { return death_test_count_; }
  15934. // Increments the death test count, returning the new count.
  15935. int increment_death_test_count() { return ++death_test_count_; }
  15936. // Clears the test part results.
  15937. void ClearTestPartResults();
  15938. // Clears the object.
  15939. void Clear();
  15940. // Protects mutable state of the property vector and of owned
  15941. // properties, whose values may be updated.
  15942. internal::Mutex test_properites_mutex_;
  15943. // The vector of TestPartResults
  15944. std::vector<TestPartResult> test_part_results_;
  15945. // The vector of TestProperties
  15946. std::vector<TestProperty> test_properties_;
  15947. // Running count of death tests.
  15948. int death_test_count_;
  15949. // The elapsed time, in milliseconds.
  15950. TimeInMillis elapsed_time_;
  15951. // We disallow copying TestResult.
  15952. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
  15953. }; // class TestResult
  15954. // A TestInfo object stores the following information about a test:
  15955. //
  15956. // Test case name
  15957. // Test name
  15958. // Whether the test should be run
  15959. // A function pointer that creates the test object when invoked
  15960. // Test result
  15961. //
  15962. // The constructor of TestInfo registers itself with the UnitTest
  15963. // singleton such that the RUN_ALL_TESTS() macro knows which tests to
  15964. // run.
  15965. class GTEST_API_ TestInfo {
  15966. public:
  15967. // Destructs a TestInfo object. This function is not virtual, so
  15968. // don't inherit from TestInfo.
  15969. ~TestInfo();
  15970. // Returns the test case name.
  15971. const char* test_case_name() const { return test_case_name_.c_str(); }
  15972. // Returns the test name.
  15973. const char* name() const { return name_.c_str(); }
  15974. // Returns the name of the parameter type, or NULL if this is not a typed
  15975. // or a type-parameterized test.
  15976. const char* type_param() const {
  15977. if (type_param_.get() != NULL)
  15978. return type_param_->c_str();
  15979. return NULL;
  15980. }
  15981. // Returns the text representation of the value parameter, or NULL if this
  15982. // is not a value-parameterized test.
  15983. const char* value_param() const {
  15984. if (value_param_.get() != NULL)
  15985. return value_param_->c_str();
  15986. return NULL;
  15987. }
  15988. // Returns true if this test should run, that is if the test is not disabled
  15989. // (or it is disabled but the also_run_disabled_tests flag has been specified)
  15990. // and its full name matches the user-specified filter.
  15991. //
  15992. // Google Test allows the user to filter the tests by their full names.
  15993. // The full name of a test Bar in test case Foo is defined as
  15994. // "Foo.Bar". Only the tests that match the filter will run.
  15995. //
  15996. // A filter is a colon-separated list of glob (not regex) patterns,
  15997. // optionally followed by a '-' and a colon-separated list of
  15998. // negative patterns (tests to exclude). A test is run if it
  15999. // matches one of the positive patterns and does not match any of
  16000. // the negative patterns.
  16001. //
  16002. // For example, *A*:Foo.* is a filter that matches any string that
  16003. // contains the character 'A' or starts with "Foo.".
  16004. bool should_run() const { return should_run_; }
  16005. // Returns the result of the test.
  16006. const TestResult* result() const { return &result_; }
  16007. private:
  16008. #if GTEST_HAS_DEATH_TEST
  16009. friend class internal::DefaultDeathTestFactory;
  16010. #endif // GTEST_HAS_DEATH_TEST
  16011. friend class Test;
  16012. friend class TestCase;
  16013. friend class internal::UnitTestImpl;
  16014. friend TestInfo* internal::MakeAndRegisterTestInfo(
  16015. const char* test_case_name, const char* name,
  16016. const char* type_param,
  16017. const char* value_param,
  16018. internal::TypeId fixture_class_id,
  16019. Test::SetUpTestCaseFunc set_up_tc,
  16020. Test::TearDownTestCaseFunc tear_down_tc,
  16021. internal::TestFactoryBase* factory);
  16022. // Constructs a TestInfo object. The newly constructed instance assumes
  16023. // ownership of the factory object.
  16024. TestInfo(const char* test_case_name, const char* name,
  16025. const char* a_type_param,
  16026. const char* a_value_param,
  16027. internal::TypeId fixture_class_id,
  16028. internal::TestFactoryBase* factory);
  16029. // Increments the number of death tests encountered in this test so
  16030. // far.
  16031. int increment_death_test_count() {
  16032. return result_.increment_death_test_count();
  16033. }
  16034. // Creates the test object, runs it, records its result, and then
  16035. // deletes it.
  16036. void Run();
  16037. static void ClearTestResult(TestInfo* test_info) {
  16038. test_info->result_.Clear();
  16039. }
  16040. // These fields are immutable properties of the test.
  16041. const std::string test_case_name_; // Test case name
  16042. const std::string name_; // Test name
  16043. // Name of the parameter type, or NULL if this is not a typed or a
  16044. // type-parameterized test.
  16045. const internal::scoped_ptr<const ::std::string> type_param_;
  16046. // Text representation of the value parameter, or NULL if this is not a
  16047. // value-parameterized test.
  16048. const internal::scoped_ptr<const ::std::string> value_param_;
  16049. const internal::TypeId fixture_class_id_; // ID of the test fixture class
  16050. bool should_run_; // True iff this test should run
  16051. bool is_disabled_; // True iff this test is disabled
  16052. bool matches_filter_; // True if this test matches the
  16053. // user-specified filter.
  16054. internal::TestFactoryBase* const factory_; // The factory that creates
  16055. // the test object
  16056. // This field is mutable and needs to be reset before running the
  16057. // test for the second time.
  16058. TestResult result_;
  16059. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
  16060. };
  16061. // A test case, which consists of a vector of TestInfos.
  16062. //
  16063. // TestCase is not copyable.
  16064. class GTEST_API_ TestCase {
  16065. public:
  16066. // Creates a TestCase with the given name.
  16067. //
  16068. // TestCase does NOT have a default constructor. Always use this
  16069. // constructor to create a TestCase object.
  16070. //
  16071. // Arguments:
  16072. //
  16073. // name: name of the test case
  16074. // a_type_param: the name of the test's type parameter, or NULL if
  16075. // this is not a type-parameterized test.
  16076. // set_up_tc: pointer to the function that sets up the test case
  16077. // tear_down_tc: pointer to the function that tears down the test case
  16078. TestCase(const char* name, const char* a_type_param,
  16079. Test::SetUpTestCaseFunc set_up_tc,
  16080. Test::TearDownTestCaseFunc tear_down_tc);
  16081. // Destructor of TestCase.
  16082. virtual ~TestCase();
  16083. // Gets the name of the TestCase.
  16084. const char* name() const { return name_.c_str(); }
  16085. // Returns the name of the parameter type, or NULL if this is not a
  16086. // type-parameterized test case.
  16087. const char* type_param() const {
  16088. if (type_param_.get() != NULL)
  16089. return type_param_->c_str();
  16090. return NULL;
  16091. }
  16092. // Returns true if any test in this test case should run.
  16093. bool should_run() const { return should_run_; }
  16094. // Gets the number of successful tests in this test case.
  16095. int successful_test_count() const;
  16096. // Gets the number of failed tests in this test case.
  16097. int failed_test_count() const;
  16098. // Gets the number of disabled tests in this test case.
  16099. int disabled_test_count() const;
  16100. // Get the number of tests in this test case that should run.
  16101. int test_to_run_count() const;
  16102. // Gets the number of all tests in this test case.
  16103. int total_test_count() const;
  16104. // Returns true iff the test case passed.
  16105. bool Passed() const { return !Failed(); }
  16106. // Returns true iff the test case failed.
  16107. bool Failed() const { return failed_test_count() > 0; }
  16108. // Returns the elapsed time, in milliseconds.
  16109. TimeInMillis elapsed_time() const { return elapsed_time_; }
  16110. // Returns the i-th test among all the tests. i can range from 0 to
  16111. // total_test_count() - 1. If i is not in that range, returns NULL.
  16112. const TestInfo* GetTestInfo(int i) const;
  16113. private:
  16114. friend class Test;
  16115. friend class internal::UnitTestImpl;
  16116. // Gets the (mutable) vector of TestInfos in this TestCase.
  16117. std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
  16118. // Gets the (immutable) vector of TestInfos in this TestCase.
  16119. const std::vector<TestInfo*>& test_info_list() const {
  16120. return test_info_list_;
  16121. }
  16122. // Returns the i-th test among all the tests. i can range from 0 to
  16123. // total_test_count() - 1. If i is not in that range, returns NULL.
  16124. TestInfo* GetMutableTestInfo(int i);
  16125. // Sets the should_run member.
  16126. void set_should_run(bool should) { should_run_ = should; }
  16127. // Adds a TestInfo to this test case. Will delete the TestInfo upon
  16128. // destruction of the TestCase object.
  16129. void AddTestInfo(TestInfo * test_info);
  16130. // Clears the results of all tests in this test case.
  16131. void ClearResult();
  16132. // Clears the results of all tests in the given test case.
  16133. static void ClearTestCaseResult(TestCase* test_case) {
  16134. test_case->ClearResult();
  16135. }
  16136. // Runs every test in this TestCase.
  16137. void Run();
  16138. // Runs SetUpTestCase() for this TestCase. This wrapper is needed
  16139. // for catching exceptions thrown from SetUpTestCase().
  16140. void RunSetUpTestCase() { (*set_up_tc_)(); }
  16141. // Runs TearDownTestCase() for this TestCase. This wrapper is
  16142. // needed for catching exceptions thrown from TearDownTestCase().
  16143. void RunTearDownTestCase() { (*tear_down_tc_)(); }
  16144. // Returns true iff test passed.
  16145. static bool TestPassed(const TestInfo* test_info) {
  16146. return test_info->should_run() && test_info->result()->Passed();
  16147. }
  16148. // Returns true iff test failed.
  16149. static bool TestFailed(const TestInfo* test_info) {
  16150. return test_info->should_run() && test_info->result()->Failed();
  16151. }
  16152. // Returns true iff test is disabled.
  16153. static bool TestDisabled(const TestInfo* test_info) {
  16154. return test_info->is_disabled_;
  16155. }
  16156. // Returns true if the given test should run.
  16157. static bool ShouldRunTest(const TestInfo* test_info) {
  16158. return test_info->should_run();
  16159. }
  16160. // Shuffles the tests in this test case.
  16161. void ShuffleTests(internal::Random* random);
  16162. // Restores the test order to before the first shuffle.
  16163. void UnshuffleTests();
  16164. // Name of the test case.
  16165. internal::String name_;
  16166. // Name of the parameter type, or NULL if this is not a typed or a
  16167. // type-parameterized test.
  16168. const internal::scoped_ptr<const ::std::string> type_param_;
  16169. // The vector of TestInfos in their original order. It owns the
  16170. // elements in the vector.
  16171. std::vector<TestInfo*> test_info_list_;
  16172. // Provides a level of indirection for the test list to allow easy
  16173. // shuffling and restoring the test order. The i-th element in this
  16174. // vector is the index of the i-th test in the shuffled test list.
  16175. std::vector<int> test_indices_;
  16176. // Pointer to the function that sets up the test case.
  16177. Test::SetUpTestCaseFunc set_up_tc_;
  16178. // Pointer to the function that tears down the test case.
  16179. Test::TearDownTestCaseFunc tear_down_tc_;
  16180. // True iff any test in this test case should run.
  16181. bool should_run_;
  16182. // Elapsed time, in milliseconds.
  16183. TimeInMillis elapsed_time_;
  16184. // We disallow copying TestCases.
  16185. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
  16186. };
  16187. // An Environment object is capable of setting up and tearing down an
  16188. // environment. The user should subclass this to define his own
  16189. // environment(s).
  16190. //
  16191. // An Environment object does the set-up and tear-down in virtual
  16192. // methods SetUp() and TearDown() instead of the constructor and the
  16193. // destructor, as:
  16194. //
  16195. // 1. You cannot safely throw from a destructor. This is a problem
  16196. // as in some cases Google Test is used where exceptions are enabled, and
  16197. // we may want to implement ASSERT_* using exceptions where they are
  16198. // available.
  16199. // 2. You cannot use ASSERT_* directly in a constructor or
  16200. // destructor.
  16201. class Environment {
  16202. public:
  16203. // The d'tor is virtual as we need to subclass Environment.
  16204. virtual ~Environment() {}
  16205. // Override this to define how to set up the environment.
  16206. virtual void SetUp() {}
  16207. // Override this to define how to tear down the environment.
  16208. virtual void TearDown() {}
  16209. private:
  16210. // If you see an error about overriding the following function or
  16211. // about it being private, you have mis-spelled SetUp() as Setup().
  16212. struct Setup_should_be_spelled_SetUp {};
  16213. virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
  16214. };
  16215. // The interface for tracing execution of tests. The methods are organized in
  16216. // the order the corresponding events are fired.
  16217. class TestEventListener {
  16218. public:
  16219. virtual ~TestEventListener() {}
  16220. // Fired before any test activity starts.
  16221. virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
  16222. // Fired before each iteration of tests starts. There may be more than
  16223. // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
  16224. // index, starting from 0.
  16225. virtual void OnTestIterationStart(const UnitTest& unit_test,
  16226. int iteration) = 0;
  16227. // Fired before environment set-up for each iteration of tests starts.
  16228. virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
  16229. // Fired after environment set-up for each iteration of tests ends.
  16230. virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
  16231. // Fired before the test case starts.
  16232. virtual void OnTestCaseStart(const TestCase& test_case) = 0;
  16233. // Fired before the test starts.
  16234. virtual void OnTestStart(const TestInfo& test_info) = 0;
  16235. // Fired after a failed assertion or a SUCCEED() invocation.
  16236. virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
  16237. // Fired after the test ends.
  16238. virtual void OnTestEnd(const TestInfo& test_info) = 0;
  16239. // Fired after the test case ends.
  16240. virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
  16241. // Fired before environment tear-down for each iteration of tests starts.
  16242. virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
  16243. // Fired after environment tear-down for each iteration of tests ends.
  16244. virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
  16245. // Fired after each iteration of tests finishes.
  16246. virtual void OnTestIterationEnd(const UnitTest& unit_test,
  16247. int iteration) = 0;
  16248. // Fired after all test activities have ended.
  16249. virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
  16250. };
  16251. // The convenience class for users who need to override just one or two
  16252. // methods and are not concerned that a possible change to a signature of
  16253. // the methods they override will not be caught during the build. For
  16254. // comments about each method please see the definition of TestEventListener
  16255. // above.
  16256. class EmptyTestEventListener : public TestEventListener {
  16257. public:
  16258. virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
  16259. virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
  16260. int /*iteration*/) {}
  16261. virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
  16262. virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
  16263. virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
  16264. virtual void OnTestStart(const TestInfo& /*test_info*/) {}
  16265. virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
  16266. virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
  16267. virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
  16268. virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
  16269. virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
  16270. virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
  16271. int /*iteration*/) {}
  16272. virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
  16273. };
  16274. // TestEventListeners lets users add listeners to track events in Google Test.
  16275. class GTEST_API_ TestEventListeners {
  16276. public:
  16277. TestEventListeners();
  16278. ~TestEventListeners();
  16279. // Appends an event listener to the end of the list. Google Test assumes
  16280. // the ownership of the listener (i.e. it will delete the listener when
  16281. // the test program finishes).
  16282. void Append(TestEventListener* listener);
  16283. // Removes the given event listener from the list and returns it. It then
  16284. // becomes the caller's responsibility to delete the listener. Returns
  16285. // NULL if the listener is not found in the list.
  16286. TestEventListener* Release(TestEventListener* listener);
  16287. // Returns the standard listener responsible for the default console
  16288. // output. Can be removed from the listeners list to shut down default
  16289. // console output. Note that removing this object from the listener list
  16290. // with Release transfers its ownership to the caller and makes this
  16291. // function return NULL the next time.
  16292. TestEventListener* default_result_printer() const {
  16293. return default_result_printer_;
  16294. }
  16295. // Returns the standard listener responsible for the default XML output
  16296. // controlled by the --gtest_output=xml flag. Can be removed from the
  16297. // listeners list by users who want to shut down the default XML output
  16298. // controlled by this flag and substitute it with custom one. Note that
  16299. // removing this object from the listener list with Release transfers its
  16300. // ownership to the caller and makes this function return NULL the next
  16301. // time.
  16302. TestEventListener* default_xml_generator() const {
  16303. return default_xml_generator_;
  16304. }
  16305. private:
  16306. friend class TestCase;
  16307. friend class TestInfo;
  16308. friend class internal::DefaultGlobalTestPartResultReporter;
  16309. friend class internal::NoExecDeathTest;
  16310. friend class internal::TestEventListenersAccessor;
  16311. friend class internal::UnitTestImpl;
  16312. // Returns repeater that broadcasts the TestEventListener events to all
  16313. // subscribers.
  16314. TestEventListener* repeater();
  16315. // Sets the default_result_printer attribute to the provided listener.
  16316. // The listener is also added to the listener list and previous
  16317. // default_result_printer is removed from it and deleted. The listener can
  16318. // also be NULL in which case it will not be added to the list. Does
  16319. // nothing if the previous and the current listener objects are the same.
  16320. void SetDefaultResultPrinter(TestEventListener* listener);
  16321. // Sets the default_xml_generator attribute to the provided listener. The
  16322. // listener is also added to the listener list and previous
  16323. // default_xml_generator is removed from it and deleted. The listener can
  16324. // also be NULL in which case it will not be added to the list. Does
  16325. // nothing if the previous and the current listener objects are the same.
  16326. void SetDefaultXmlGenerator(TestEventListener* listener);
  16327. // Controls whether events will be forwarded by the repeater to the
  16328. // listeners in the list.
  16329. bool EventForwardingEnabled() const;
  16330. void SuppressEventForwarding();
  16331. // The actual list of listeners.
  16332. internal::TestEventRepeater* repeater_;
  16333. // Listener responsible for the standard result output.
  16334. TestEventListener* default_result_printer_;
  16335. // Listener responsible for the creation of the XML output file.
  16336. TestEventListener* default_xml_generator_;
  16337. // We disallow copying TestEventListeners.
  16338. GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
  16339. };
  16340. // A UnitTest consists of a vector of TestCases.
  16341. //
  16342. // This is a singleton class. The only instance of UnitTest is
  16343. // created when UnitTest::GetInstance() is first called. This
  16344. // instance is never deleted.
  16345. //
  16346. // UnitTest is not copyable.
  16347. //
  16348. // This class is thread-safe as long as the methods are called
  16349. // according to their specification.
  16350. class GTEST_API_ UnitTest {
  16351. public:
  16352. // Gets the singleton UnitTest object. The first time this method
  16353. // is called, a UnitTest object is constructed and returned.
  16354. // Consecutive calls will return the same object.
  16355. static UnitTest* GetInstance();
  16356. // Runs all tests in this UnitTest object and prints the result.
  16357. // Returns 0 if successful, or 1 otherwise.
  16358. //
  16359. // This method can only be called from the main thread.
  16360. //
  16361. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16362. int Run() GTEST_MUST_USE_RESULT_;
  16363. // Returns the working directory when the first TEST() or TEST_F()
  16364. // was executed. The UnitTest object owns the string.
  16365. const char* original_working_dir() const;
  16366. // Returns the TestCase object for the test that's currently running,
  16367. // or NULL if no test is running.
  16368. const TestCase* current_test_case() const;
  16369. // Returns the TestInfo object for the test that's currently running,
  16370. // or NULL if no test is running.
  16371. const TestInfo* current_test_info() const;
  16372. // Returns the random seed used at the start of the current test run.
  16373. int random_seed() const;
  16374. #if GTEST_HAS_PARAM_TEST
  16375. // Returns the ParameterizedTestCaseRegistry object used to keep track of
  16376. // value-parameterized tests and instantiate and register them.
  16377. //
  16378. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16379. internal::ParameterizedTestCaseRegistry& parameterized_test_registry();
  16380. #endif // GTEST_HAS_PARAM_TEST
  16381. // Gets the number of successful test cases.
  16382. int successful_test_case_count() const;
  16383. // Gets the number of failed test cases.
  16384. int failed_test_case_count() const;
  16385. // Gets the number of all test cases.
  16386. int total_test_case_count() const;
  16387. // Gets the number of all test cases that contain at least one test
  16388. // that should run.
  16389. int test_case_to_run_count() const;
  16390. // Gets the number of successful tests.
  16391. int successful_test_count() const;
  16392. // Gets the number of failed tests.
  16393. int failed_test_count() const;
  16394. // Gets the number of disabled tests.
  16395. int disabled_test_count() const;
  16396. // Gets the number of all tests.
  16397. int total_test_count() const;
  16398. // Gets the number of tests that should run.
  16399. int test_to_run_count() const;
  16400. // Gets the elapsed time, in milliseconds.
  16401. TimeInMillis elapsed_time() const;
  16402. // Returns true iff the unit test passed (i.e. all test cases passed).
  16403. bool Passed() const;
  16404. // Returns true iff the unit test failed (i.e. some test case failed
  16405. // or something outside of all tests failed).
  16406. bool Failed() const;
  16407. // Gets the i-th test case among all the test cases. i can range from 0 to
  16408. // total_test_case_count() - 1. If i is not in that range, returns NULL.
  16409. const TestCase* GetTestCase(int i) const;
  16410. // Returns the list of event listeners that can be used to track events
  16411. // inside Google Test.
  16412. TestEventListeners& listeners();
  16413. private:
  16414. // Registers and returns a global test environment. When a test
  16415. // program is run, all global test environments will be set-up in
  16416. // the order they were registered. After all tests in the program
  16417. // have finished, all global test environments will be torn-down in
  16418. // the *reverse* order they were registered.
  16419. //
  16420. // The UnitTest object takes ownership of the given environment.
  16421. //
  16422. // This method can only be called from the main thread.
  16423. Environment* AddEnvironment(Environment* env);
  16424. // Adds a TestPartResult to the current TestResult object. All
  16425. // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
  16426. // eventually call this to report their results. The user code
  16427. // should use the assertion macros instead of calling this directly.
  16428. void AddTestPartResult(TestPartResult::Type result_type,
  16429. const char* file_name,
  16430. int line_number,
  16431. const internal::String& message,
  16432. const internal::String& os_stack_trace);
  16433. // Adds a TestProperty to the current TestResult object. If the result already
  16434. // contains a property with the same key, the value will be updated.
  16435. void RecordPropertyForCurrentTest(const char* key, const char* value);
  16436. // Gets the i-th test case among all the test cases. i can range from 0 to
  16437. // total_test_case_count() - 1. If i is not in that range, returns NULL.
  16438. TestCase* GetMutableTestCase(int i);
  16439. // Accessors for the implementation object.
  16440. internal::UnitTestImpl* impl() { return impl_; }
  16441. const internal::UnitTestImpl* impl() const { return impl_; }
  16442. // These classes and funcions are friends as they need to access private
  16443. // members of UnitTest.
  16444. friend class Test;
  16445. friend class internal::AssertHelper;
  16446. friend class internal::ScopedTrace;
  16447. friend Environment* AddGlobalTestEnvironment(Environment* env);
  16448. friend internal::UnitTestImpl* internal::GetUnitTestImpl();
  16449. friend void internal::ReportFailureInUnknownLocation(
  16450. TestPartResult::Type result_type,
  16451. const internal::String& message);
  16452. // Creates an empty UnitTest.
  16453. UnitTest();
  16454. // D'tor
  16455. virtual ~UnitTest();
  16456. // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
  16457. // Google Test trace stack.
  16458. void PushGTestTrace(const internal::TraceInfo& trace);
  16459. // Pops a trace from the per-thread Google Test trace stack.
  16460. void PopGTestTrace();
  16461. // Protects mutable state in *impl_. This is mutable as some const
  16462. // methods need to lock it too.
  16463. mutable internal::Mutex mutex_;
  16464. // Opaque implementation object. This field is never changed once
  16465. // the object is constructed. We don't mark it as const here, as
  16466. // doing so will cause a warning in the constructor of UnitTest.
  16467. // Mutable state in *impl_ is protected by mutex_.
  16468. internal::UnitTestImpl* impl_;
  16469. // We disallow copying UnitTest.
  16470. GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
  16471. };
  16472. // A convenient wrapper for adding an environment for the test
  16473. // program.
  16474. //
  16475. // You should call this before RUN_ALL_TESTS() is called, probably in
  16476. // main(). If you use gtest_main, you need to call this before main()
  16477. // starts for it to take effect. For example, you can define a global
  16478. // variable like this:
  16479. //
  16480. // testing::Environment* const foo_env =
  16481. // testing::AddGlobalTestEnvironment(new FooEnvironment);
  16482. //
  16483. // However, we strongly recommend you to write your own main() and
  16484. // call AddGlobalTestEnvironment() there, as relying on initialization
  16485. // of global variables makes the code harder to read and may cause
  16486. // problems when you register multiple environments from different
  16487. // translation units and the environments have dependencies among them
  16488. // (remember that the compiler doesn't guarantee the order in which
  16489. // global variables from different translation units are initialized).
  16490. inline Environment* AddGlobalTestEnvironment(Environment* env) {
  16491. return UnitTest::GetInstance()->AddEnvironment(env);
  16492. }
  16493. // Initializes Google Test. This must be called before calling
  16494. // RUN_ALL_TESTS(). In particular, it parses a command line for the
  16495. // flags that Google Test recognizes. Whenever a Google Test flag is
  16496. // seen, it is removed from argv, and *argc is decremented.
  16497. //
  16498. // No value is returned. Instead, the Google Test flag variables are
  16499. // updated.
  16500. //
  16501. // Calling the function for the second time has no user-visible effect.
  16502. GTEST_API_ void InitGoogleTest(int* argc, char** argv);
  16503. // This overloaded version can be used in Windows programs compiled in
  16504. // UNICODE mode.
  16505. GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
  16506. namespace internal {
  16507. // Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
  16508. // operand to be used in a failure message. The type (but not value)
  16509. // of the other operand may affect the format. This allows us to
  16510. // print a char* as a raw pointer when it is compared against another
  16511. // char*, and print it as a C string when it is compared against an
  16512. // std::string object, for example.
  16513. //
  16514. // The default implementation ignores the type of the other operand.
  16515. // Some specialized versions are used to handle formatting wide or
  16516. // narrow C strings.
  16517. //
  16518. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16519. template <typename T1, typename T2>
  16520. String FormatForComparisonFailureMessage(const T1& value,
  16521. const T2& /* other_operand */) {
  16522. // C++Builder compiles this incorrectly if the namespace isn't explicitly
  16523. // given.
  16524. return ::testing::PrintToString(value);
  16525. }
  16526. // The helper function for {ASSERT|EXPECT}_EQ.
  16527. template <typename T1, typename T2>
  16528. AssertionResult CmpHelperEQ(const char* expected_expression,
  16529. const char* actual_expression,
  16530. const T1& expected,
  16531. const T2& actual) {
  16532. #ifdef _MSC_VER
  16533. # pragma warning(push) // Saves the current warning state.
  16534. # pragma warning(disable:4389) // Temporarily disables warning on
  16535. // signed/unsigned mismatch.
  16536. #elif __clang__
  16537. #pragma clang diagnostic push
  16538. #pragma clang diagnostic ignored "-Wsign-compare"
  16539. #elif __GNUC__
  16540. #pragma gcc diagnostic push
  16541. #pragma gcc diagnostic ignored "-Wsign-compare"
  16542. #endif
  16543. if (expected == actual) {
  16544. return AssertionSuccess();
  16545. }
  16546. #ifdef _MSC_VER
  16547. # pragma warning(pop) // Restores the warning state.
  16548. #elif __clang__
  16549. #pragma clang diagnostic pop
  16550. #elif __GNUC__
  16551. #pragma gcc diagnostic pop
  16552. #endif
  16553. return EqFailure(expected_expression,
  16554. actual_expression,
  16555. FormatForComparisonFailureMessage(expected, actual),
  16556. FormatForComparisonFailureMessage(actual, expected),
  16557. false);
  16558. }
  16559. // With this overloaded version, we allow anonymous enums to be used
  16560. // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
  16561. // can be implicitly cast to BiggestInt.
  16562. GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression,
  16563. const char* actual_expression,
  16564. BiggestInt expected,
  16565. BiggestInt actual);
  16566. // The helper class for {ASSERT|EXPECT}_EQ. The template argument
  16567. // lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
  16568. // is a null pointer literal. The following default implementation is
  16569. // for lhs_is_null_literal being false.
  16570. template <bool lhs_is_null_literal>
  16571. class EqHelper {
  16572. public:
  16573. // This templatized version is for the general case.
  16574. template <typename T1, typename T2>
  16575. static AssertionResult Compare(const char* expected_expression,
  16576. const char* actual_expression,
  16577. const T1& expected,
  16578. const T2& actual) {
  16579. return CmpHelperEQ(expected_expression, actual_expression, expected,
  16580. actual);
  16581. }
  16582. // With this overloaded version, we allow anonymous enums to be used
  16583. // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
  16584. // enums can be implicitly cast to BiggestInt.
  16585. //
  16586. // Even though its body looks the same as the above version, we
  16587. // cannot merge the two, as it will make anonymous enums unhappy.
  16588. static AssertionResult Compare(const char* expected_expression,
  16589. const char* actual_expression,
  16590. BiggestInt expected,
  16591. BiggestInt actual) {
  16592. return CmpHelperEQ(expected_expression, actual_expression, expected,
  16593. actual);
  16594. }
  16595. };
  16596. // This specialization is used when the first argument to ASSERT_EQ()
  16597. // is a null pointer literal, like NULL, false, or 0.
  16598. template <>
  16599. class EqHelper<true> {
  16600. public:
  16601. // We define two overloaded versions of Compare(). The first
  16602. // version will be picked when the second argument to ASSERT_EQ() is
  16603. // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
  16604. // EXPECT_EQ(false, a_bool).
  16605. template <typename T1, typename T2>
  16606. static AssertionResult Compare(
  16607. const char* expected_expression,
  16608. const char* actual_expression,
  16609. const T1& expected,
  16610. const T2& actual,
  16611. // The following line prevents this overload from being considered if T2
  16612. // is not a pointer type. We need this because ASSERT_EQ(NULL, my_ptr)
  16613. // expands to Compare("", "", NULL, my_ptr), which requires a conversion
  16614. // to match the Secret* in the other overload, which would otherwise make
  16615. // this template match better.
  16616. typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
  16617. return CmpHelperEQ(expected_expression, actual_expression, expected,
  16618. actual);
  16619. }
  16620. // This version will be picked when the second argument to ASSERT_EQ() is a
  16621. // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
  16622. template <typename T>
  16623. static AssertionResult Compare(
  16624. const char* expected_expression,
  16625. const char* actual_expression,
  16626. // We used to have a second template parameter instead of Secret*. That
  16627. // template parameter would deduce to 'long', making this a better match
  16628. // than the first overload even without the first overload's EnableIf.
  16629. // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
  16630. // non-pointer argument" (even a deduced integral argument), so the old
  16631. // implementation caused warnings in user code.
  16632. Secret* /* expected (NULL) */,
  16633. T* actual) {
  16634. // We already know that 'expected' is a null pointer.
  16635. return CmpHelperEQ(expected_expression, actual_expression,
  16636. static_cast<T*>(NULL), actual);
  16637. }
  16638. };
  16639. // A macro for implementing the helper functions needed to implement
  16640. // ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste
  16641. // of similar code.
  16642. //
  16643. // For each templatized helper function, we also define an overloaded
  16644. // version for BiggestInt in order to reduce code bloat and allow
  16645. // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
  16646. // with gcc 4.
  16647. //
  16648. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16649. #define GTEST_IMPL_CMP_HELPER_(op_name, op)\
  16650. template <typename T1, typename T2>\
  16651. AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
  16652. const T1& val1, const T2& val2) {\
  16653. if (val1 op val2) {\
  16654. return AssertionSuccess();\
  16655. } else {\
  16656. return AssertionFailure() \
  16657. << "Expected: (" << expr1 << ") " #op " (" << expr2\
  16658. << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
  16659. << " vs " << FormatForComparisonFailureMessage(val2, val1);\
  16660. }\
  16661. }\
  16662. GTEST_API_ AssertionResult CmpHelper##op_name(\
  16663. const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
  16664. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16665. // Implements the helper function for {ASSERT|EXPECT}_NE
  16666. GTEST_IMPL_CMP_HELPER_(NE, !=);
  16667. // Implements the helper function for {ASSERT|EXPECT}_LE
  16668. GTEST_IMPL_CMP_HELPER_(LE, <=);
  16669. // Implements the helper function for {ASSERT|EXPECT}_LT
  16670. GTEST_IMPL_CMP_HELPER_(LT, < );
  16671. // Implements the helper function for {ASSERT|EXPECT}_GE
  16672. GTEST_IMPL_CMP_HELPER_(GE, >=);
  16673. // Implements the helper function for {ASSERT|EXPECT}_GT
  16674. GTEST_IMPL_CMP_HELPER_(GT, > );
  16675. #undef GTEST_IMPL_CMP_HELPER_
  16676. // The helper function for {ASSERT|EXPECT}_STREQ.
  16677. //
  16678. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16679. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
  16680. const char* actual_expression,
  16681. const char* expected,
  16682. const char* actual);
  16683. // The helper function for {ASSERT|EXPECT}_STRCASEEQ.
  16684. //
  16685. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16686. GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,
  16687. const char* actual_expression,
  16688. const char* expected,
  16689. const char* actual);
  16690. // The helper function for {ASSERT|EXPECT}_STRNE.
  16691. //
  16692. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16693. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
  16694. const char* s2_expression,
  16695. const char* s1,
  16696. const char* s2);
  16697. // The helper function for {ASSERT|EXPECT}_STRCASENE.
  16698. //
  16699. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16700. GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
  16701. const char* s2_expression,
  16702. const char* s1,
  16703. const char* s2);
  16704. // Helper function for *_STREQ on wide strings.
  16705. //
  16706. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16707. GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
  16708. const char* actual_expression,
  16709. const wchar_t* expected,
  16710. const wchar_t* actual);
  16711. // Helper function for *_STRNE on wide strings.
  16712. //
  16713. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16714. GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
  16715. const char* s2_expression,
  16716. const wchar_t* s1,
  16717. const wchar_t* s2);
  16718. } // namespace internal
  16719. // IsSubstring() and IsNotSubstring() are intended to be used as the
  16720. // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
  16721. // themselves. They check whether needle is a substring of haystack
  16722. // (NULL is considered a substring of itself only), and return an
  16723. // appropriate error message when they fail.
  16724. //
  16725. // The {needle,haystack}_expr arguments are the stringified
  16726. // expressions that generated the two real arguments.
  16727. GTEST_API_ AssertionResult IsSubstring(
  16728. const char* needle_expr, const char* haystack_expr,
  16729. const char* needle, const char* haystack);
  16730. GTEST_API_ AssertionResult IsSubstring(
  16731. const char* needle_expr, const char* haystack_expr,
  16732. const wchar_t* needle, const wchar_t* haystack);
  16733. GTEST_API_ AssertionResult IsNotSubstring(
  16734. const char* needle_expr, const char* haystack_expr,
  16735. const char* needle, const char* haystack);
  16736. GTEST_API_ AssertionResult IsNotSubstring(
  16737. const char* needle_expr, const char* haystack_expr,
  16738. const wchar_t* needle, const wchar_t* haystack);
  16739. GTEST_API_ AssertionResult IsSubstring(
  16740. const char* needle_expr, const char* haystack_expr,
  16741. const ::std::string& needle, const ::std::string& haystack);
  16742. GTEST_API_ AssertionResult IsNotSubstring(
  16743. const char* needle_expr, const char* haystack_expr,
  16744. const ::std::string& needle, const ::std::string& haystack);
  16745. #if GTEST_HAS_STD_WSTRING
  16746. GTEST_API_ AssertionResult IsSubstring(
  16747. const char* needle_expr, const char* haystack_expr,
  16748. const ::std::wstring& needle, const ::std::wstring& haystack);
  16749. GTEST_API_ AssertionResult IsNotSubstring(
  16750. const char* needle_expr, const char* haystack_expr,
  16751. const ::std::wstring& needle, const ::std::wstring& haystack);
  16752. #endif // GTEST_HAS_STD_WSTRING
  16753. namespace internal {
  16754. // Helper template function for comparing floating-points.
  16755. //
  16756. // Template parameter:
  16757. //
  16758. // RawType: the raw floating-point type (either float or double)
  16759. //
  16760. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16761. template <typename RawType>
  16762. AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression,
  16763. const char* actual_expression,
  16764. RawType expected,
  16765. RawType actual) {
  16766. const FloatingPoint<RawType> lhs(expected), rhs(actual);
  16767. if (lhs.AlmostEquals(rhs)) {
  16768. return AssertionSuccess();
  16769. }
  16770. ::std::stringstream expected_ss;
  16771. expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
  16772. << expected;
  16773. ::std::stringstream actual_ss;
  16774. actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
  16775. << actual;
  16776. return EqFailure(expected_expression,
  16777. actual_expression,
  16778. StringStreamToString(&expected_ss),
  16779. StringStreamToString(&actual_ss),
  16780. false);
  16781. }
  16782. // Helper function for implementing ASSERT_NEAR.
  16783. //
  16784. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
  16785. GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
  16786. const char* expr2,
  16787. const char* abs_error_expr,
  16788. double val1,
  16789. double val2,
  16790. double abs_error);
  16791. // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
  16792. // A class that enables one to stream messages to assertion macros
  16793. class GTEST_API_ AssertHelper {
  16794. public:
  16795. // Constructor.
  16796. AssertHelper(TestPartResult::Type type,
  16797. const char* file,
  16798. int line,
  16799. const char* message);
  16800. ~AssertHelper();
  16801. // Message assignment is a semantic trick to enable assertion
  16802. // streaming; see the GTEST_MESSAGE_ macro below.
  16803. void operator=(const Message& message) const;
  16804. private:
  16805. // We put our data in a struct so that the size of the AssertHelper class can
  16806. // be as small as possible. This is important because gcc is incapable of
  16807. // re-using stack space even for temporary variables, so every EXPECT_EQ
  16808. // reserves stack space for another AssertHelper.
  16809. struct AssertHelperData {
  16810. AssertHelperData(TestPartResult::Type t,
  16811. const char* srcfile,
  16812. int line_num,
  16813. const char* msg)
  16814. : type(t), file(srcfile), line(line_num), message(msg) { }
  16815. TestPartResult::Type const type;
  16816. const char* const file;
  16817. int const line;
  16818. String const message;
  16819. private:
  16820. GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
  16821. };
  16822. AssertHelperData* const data_;
  16823. GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
  16824. };
  16825. } // namespace internal
  16826. #if GTEST_HAS_PARAM_TEST
  16827. // The pure interface class that all value-parameterized tests inherit from.
  16828. // A value-parameterized class must inherit from both ::testing::Test and
  16829. // ::testing::WithParamInterface. In most cases that just means inheriting
  16830. // from ::testing::TestWithParam, but more complicated test hierarchies
  16831. // may need to inherit from Test and WithParamInterface at different levels.
  16832. //
  16833. // This interface has support for accessing the test parameter value via
  16834. // the GetParam() method.
  16835. //
  16836. // Use it with one of the parameter generator defining functions, like Range(),
  16837. // Values(), ValuesIn(), Bool(), and Combine().
  16838. //
  16839. // class FooTest : public ::testing::TestWithParam<int> {
  16840. // protected:
  16841. // FooTest() {
  16842. // // Can use GetParam() here.
  16843. // }
  16844. // virtual ~FooTest() {
  16845. // // Can use GetParam() here.
  16846. // }
  16847. // virtual void SetUp() {
  16848. // // Can use GetParam() here.
  16849. // }
  16850. // virtual void TearDown {
  16851. // // Can use GetParam() here.
  16852. // }
  16853. // };
  16854. // TEST_P(FooTest, DoesBar) {
  16855. // // Can use GetParam() method here.
  16856. // Foo foo;
  16857. // ASSERT_TRUE(foo.DoesBar(GetParam()));
  16858. // }
  16859. // INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
  16860. template <typename T>
  16861. class WithParamInterface {
  16862. public:
  16863. typedef T ParamType;
  16864. virtual ~WithParamInterface() {}
  16865. // The current parameter value. Is also available in the test fixture's
  16866. // constructor. This member function is non-static, even though it only
  16867. // references static data, to reduce the opportunity for incorrect uses
  16868. // like writing 'WithParamInterface<bool>::GetParam()' for a test that
  16869. // uses a fixture whose parameter type is int.
  16870. const ParamType& GetParam() const { return *parameter_; }
  16871. private:
  16872. // Sets parameter value. The caller is responsible for making sure the value
  16873. // remains alive and unchanged throughout the current test.
  16874. static void SetParam(const ParamType* parameter) {
  16875. parameter_ = parameter;
  16876. }
  16877. // Static value used for accessing parameter during a test lifetime.
  16878. static const ParamType* parameter_;
  16879. // TestClass must be a subclass of WithParamInterface<T> and Test.
  16880. template <class TestClass> friend class internal::ParameterizedTestFactory;
  16881. };
  16882. template <typename T>
  16883. const T* WithParamInterface<T>::parameter_ = NULL;
  16884. // Most value-parameterized classes can ignore the existence of
  16885. // WithParamInterface, and can just inherit from ::testing::TestWithParam.
  16886. template <typename T>
  16887. class TestWithParam : public Test, public WithParamInterface<T> {
  16888. };
  16889. #endif // GTEST_HAS_PARAM_TEST
  16890. // Macros for indicating success/failure in test code.
  16891. // ADD_FAILURE unconditionally adds a failure to the current test.
  16892. // SUCCEED generates a success - it doesn't automatically make the
  16893. // current test successful, as a test is only successful when it has
  16894. // no failure.
  16895. //
  16896. // EXPECT_* verifies that a certain condition is satisfied. If not,
  16897. // it behaves like ADD_FAILURE. In particular:
  16898. //
  16899. // EXPECT_TRUE verifies that a Boolean condition is true.
  16900. // EXPECT_FALSE verifies that a Boolean condition is false.
  16901. //
  16902. // FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
  16903. // that they will also abort the current function on failure. People
  16904. // usually want the fail-fast behavior of FAIL and ASSERT_*, but those
  16905. // writing data-driven tests often find themselves using ADD_FAILURE
  16906. // and EXPECT_* more.
  16907. //
  16908. // Examples:
  16909. //
  16910. // EXPECT_TRUE(server.StatusIsOK());
  16911. // ASSERT_FALSE(server.HasPendingRequest(port))
  16912. // << "There are still pending requests " << "on port " << port;
  16913. // Generates a nonfatal failure with a generic message.
  16914. #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
  16915. // Generates a nonfatal failure at the given source file location with
  16916. // a generic message.
  16917. #define ADD_FAILURE_AT(file, line) \
  16918. GTEST_MESSAGE_AT_(file, line, "Failed", \
  16919. ::testing::TestPartResult::kNonFatalFailure)
  16920. // Generates a fatal failure with a generic message.
  16921. #define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
  16922. // Define this macro to 1 to omit the definition of FAIL(), which is a
  16923. // generic name and clashes with some other libraries.
  16924. #if !GTEST_DONT_DEFINE_FAIL
  16925. # define FAIL() GTEST_FAIL()
  16926. #endif
  16927. // Generates a success with a generic message.
  16928. #define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
  16929. // Define this macro to 1 to omit the definition of SUCCEED(), which
  16930. // is a generic name and clashes with some other libraries.
  16931. #if !GTEST_DONT_DEFINE_SUCCEED
  16932. # define SUCCEED() GTEST_SUCCEED()
  16933. #endif
  16934. // Macros for testing exceptions.
  16935. //
  16936. // * {ASSERT|EXPECT}_THROW(statement, expected_exception):
  16937. // Tests that the statement throws the expected exception.
  16938. // * {ASSERT|EXPECT}_NO_THROW(statement):
  16939. // Tests that the statement doesn't throw any exception.
  16940. // * {ASSERT|EXPECT}_ANY_THROW(statement):
  16941. // Tests that the statement throws an exception.
  16942. #define EXPECT_THROW(statement, expected_exception) \
  16943. GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
  16944. #define EXPECT_NO_THROW(statement) \
  16945. GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
  16946. #define EXPECT_ANY_THROW(statement) \
  16947. GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
  16948. #define ASSERT_THROW(statement, expected_exception) \
  16949. GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
  16950. #define ASSERT_NO_THROW(statement) \
  16951. GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
  16952. #define ASSERT_ANY_THROW(statement) \
  16953. GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
  16954. // Boolean assertions. Condition can be either a Boolean expression or an
  16955. // AssertionResult. For more information on how to use AssertionResult with
  16956. // these macros see comments on that class.
  16957. #define EXPECT_TRUE(condition) \
  16958. GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
  16959. GTEST_NONFATAL_FAILURE_)
  16960. #define EXPECT_FALSE(condition) \
  16961. GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
  16962. GTEST_NONFATAL_FAILURE_)
  16963. #define ASSERT_TRUE(condition) \
  16964. GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
  16965. GTEST_FATAL_FAILURE_)
  16966. #define ASSERT_FALSE(condition) \
  16967. GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
  16968. GTEST_FATAL_FAILURE_)
  16969. // Includes the auto-generated header that implements a family of
  16970. // generic predicate assertion macros.
  16971. // Copyright 2006, Google Inc.
  16972. // All rights reserved.
  16973. //
  16974. // Redistribution and use in source and binary forms, with or without
  16975. // modification, are permitted provided that the following conditions are
  16976. // met:
  16977. //
  16978. // * Redistributions of source code must retain the above copyright
  16979. // notice, this list of conditions and the following disclaimer.
  16980. // * Redistributions in binary form must reproduce the above
  16981. // copyright notice, this list of conditions and the following disclaimer
  16982. // in the documentation and/or other materials provided with the
  16983. // distribution.
  16984. // * Neither the name of Google Inc. nor the names of its
  16985. // contributors may be used to endorse or promote products derived from
  16986. // this software without specific prior written permission.
  16987. //
  16988. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  16989. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  16990. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  16991. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  16992. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16993. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16994. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  16995. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  16996. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  16997. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  16998. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  16999. // This file is AUTOMATICALLY GENERATED on 09/24/2010 by command
  17000. // 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
  17001. //
  17002. // Implements a family of generic predicate assertion macros.
  17003. #ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
  17004. #define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
  17005. // Makes sure this header is not included before gtest.h.
  17006. #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
  17007. # error Do not include gtest_pred_impl.h directly. Include gtest.h instead.
  17008. #endif // GTEST_INCLUDE_GTEST_GTEST_H_
  17009. // This header implements a family of generic predicate assertion
  17010. // macros:
  17011. //
  17012. // ASSERT_PRED_FORMAT1(pred_format, v1)
  17013. // ASSERT_PRED_FORMAT2(pred_format, v1, v2)
  17014. // ...
  17015. //
  17016. // where pred_format is a function or functor that takes n (in the
  17017. // case of ASSERT_PRED_FORMATn) values and their source expression
  17018. // text, and returns a testing::AssertionResult. See the definition
  17019. // of ASSERT_EQ in gtest.h for an example.
  17020. //
  17021. // If you don't care about formatting, you can use the more
  17022. // restrictive version:
  17023. //
  17024. // ASSERT_PRED1(pred, v1)
  17025. // ASSERT_PRED2(pred, v1, v2)
  17026. // ...
  17027. //
  17028. // where pred is an n-ary function or functor that returns bool,
  17029. // and the values v1, v2, ..., must support the << operator for
  17030. // streaming to std::ostream.
  17031. //
  17032. // We also define the EXPECT_* variations.
  17033. //
  17034. // For now we only support predicates whose arity is at most 5.
  17035. // Please email googletestframework@googlegroups.com if you need
  17036. // support for higher arities.
  17037. // GTEST_ASSERT_ is the basic statement to which all of the assertions
  17038. // in this file reduce. Don't use this in your code.
  17039. #define GTEST_ASSERT_(expression, on_failure) \
  17040. GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
  17041. if (const ::testing::AssertionResult gtest_ar = (expression)) \
  17042. ; \
  17043. else \
  17044. on_failure(gtest_ar.failure_message())
  17045. // Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use
  17046. // this in your code.
  17047. template <typename Pred,
  17048. typename T1>
  17049. AssertionResult AssertPred1Helper(const char* pred_text,
  17050. const char* e1,
  17051. Pred pred,
  17052. const T1& v1) {
  17053. if (pred(v1)) return AssertionSuccess();
  17054. return AssertionFailure() << pred_text << "("
  17055. << e1 << ") evaluates to false, where"
  17056. << "\n" << e1 << " evaluates to " << v1;
  17057. }
  17058. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
  17059. // Don't use this in your code.
  17060. #define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
  17061. GTEST_ASSERT_(pred_format(#v1, v1),\
  17062. on_failure)
  17063. // Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use
  17064. // this in your code.
  17065. #define GTEST_PRED1_(pred, v1, on_failure)\
  17066. GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
  17067. #v1, \
  17068. pred, \
  17069. v1), on_failure)
  17070. // Unary predicate assertion macros.
  17071. #define EXPECT_PRED_FORMAT1(pred_format, v1) \
  17072. GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
  17073. #define EXPECT_PRED1(pred, v1) \
  17074. GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
  17075. #define ASSERT_PRED_FORMAT1(pred_format, v1) \
  17076. GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
  17077. #define ASSERT_PRED1(pred, v1) \
  17078. GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
  17079. // Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use
  17080. // this in your code.
  17081. template <typename Pred,
  17082. typename T1,
  17083. typename T2>
  17084. AssertionResult AssertPred2Helper(const char* pred_text,
  17085. const char* e1,
  17086. const char* e2,
  17087. Pred pred,
  17088. const T1& v1,
  17089. const T2& v2) {
  17090. if (pred(v1, v2)) return AssertionSuccess();
  17091. return AssertionFailure() << pred_text << "("
  17092. << e1 << ", "
  17093. << e2 << ") evaluates to false, where"
  17094. << "\n" << e1 << " evaluates to " << v1
  17095. << "\n" << e2 << " evaluates to " << v2;
  17096. }
  17097. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
  17098. // Don't use this in your code.
  17099. #define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
  17100. GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2),\
  17101. on_failure)
  17102. // Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use
  17103. // this in your code.
  17104. #define GTEST_PRED2_(pred, v1, v2, on_failure)\
  17105. GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
  17106. #v1, \
  17107. #v2, \
  17108. pred, \
  17109. v1, \
  17110. v2), on_failure)
  17111. // Binary predicate assertion macros.
  17112. #define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
  17113. GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
  17114. #define EXPECT_PRED2(pred, v1, v2) \
  17115. GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
  17116. #define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
  17117. GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
  17118. #define ASSERT_PRED2(pred, v1, v2) \
  17119. GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
  17120. // Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use
  17121. // this in your code.
  17122. template <typename Pred,
  17123. typename T1,
  17124. typename T2,
  17125. typename T3>
  17126. AssertionResult AssertPred3Helper(const char* pred_text,
  17127. const char* e1,
  17128. const char* e2,
  17129. const char* e3,
  17130. Pred pred,
  17131. const T1& v1,
  17132. const T2& v2,
  17133. const T3& v3) {
  17134. if (pred(v1, v2, v3)) return AssertionSuccess();
  17135. return AssertionFailure() << pred_text << "("
  17136. << e1 << ", "
  17137. << e2 << ", "
  17138. << e3 << ") evaluates to false, where"
  17139. << "\n" << e1 << " evaluates to " << v1
  17140. << "\n" << e2 << " evaluates to " << v2
  17141. << "\n" << e3 << " evaluates to " << v3;
  17142. }
  17143. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
  17144. // Don't use this in your code.
  17145. #define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
  17146. GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3),\
  17147. on_failure)
  17148. // Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use
  17149. // this in your code.
  17150. #define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
  17151. GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
  17152. #v1, \
  17153. #v2, \
  17154. #v3, \
  17155. pred, \
  17156. v1, \
  17157. v2, \
  17158. v3), on_failure)
  17159. // Ternary predicate assertion macros.
  17160. #define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
  17161. GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
  17162. #define EXPECT_PRED3(pred, v1, v2, v3) \
  17163. GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
  17164. #define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
  17165. GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
  17166. #define ASSERT_PRED3(pred, v1, v2, v3) \
  17167. GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
  17168. // Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use
  17169. // this in your code.
  17170. template <typename Pred,
  17171. typename T1,
  17172. typename T2,
  17173. typename T3,
  17174. typename T4>
  17175. AssertionResult AssertPred4Helper(const char* pred_text,
  17176. const char* e1,
  17177. const char* e2,
  17178. const char* e3,
  17179. const char* e4,
  17180. Pred pred,
  17181. const T1& v1,
  17182. const T2& v2,
  17183. const T3& v3,
  17184. const T4& v4) {
  17185. if (pred(v1, v2, v3, v4)) return AssertionSuccess();
  17186. return AssertionFailure() << pred_text << "("
  17187. << e1 << ", "
  17188. << e2 << ", "
  17189. << e3 << ", "
  17190. << e4 << ") evaluates to false, where"
  17191. << "\n" << e1 << " evaluates to " << v1
  17192. << "\n" << e2 << " evaluates to " << v2
  17193. << "\n" << e3 << " evaluates to " << v3
  17194. << "\n" << e4 << " evaluates to " << v4;
  17195. }
  17196. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
  17197. // Don't use this in your code.
  17198. #define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
  17199. GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4),\
  17200. on_failure)
  17201. // Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use
  17202. // this in your code.
  17203. #define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
  17204. GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
  17205. #v1, \
  17206. #v2, \
  17207. #v3, \
  17208. #v4, \
  17209. pred, \
  17210. v1, \
  17211. v2, \
  17212. v3, \
  17213. v4), on_failure)
  17214. // 4-ary predicate assertion macros.
  17215. #define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
  17216. GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
  17217. #define EXPECT_PRED4(pred, v1, v2, v3, v4) \
  17218. GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
  17219. #define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
  17220. GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
  17221. #define ASSERT_PRED4(pred, v1, v2, v3, v4) \
  17222. GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
  17223. // Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use
  17224. // this in your code.
  17225. template <typename Pred,
  17226. typename T1,
  17227. typename T2,
  17228. typename T3,
  17229. typename T4,
  17230. typename T5>
  17231. AssertionResult AssertPred5Helper(const char* pred_text,
  17232. const char* e1,
  17233. const char* e2,
  17234. const char* e3,
  17235. const char* e4,
  17236. const char* e5,
  17237. Pred pred,
  17238. const T1& v1,
  17239. const T2& v2,
  17240. const T3& v3,
  17241. const T4& v4,
  17242. const T5& v5) {
  17243. if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
  17244. return AssertionFailure() << pred_text << "("
  17245. << e1 << ", "
  17246. << e2 << ", "
  17247. << e3 << ", "
  17248. << e4 << ", "
  17249. << e5 << ") evaluates to false, where"
  17250. << "\n" << e1 << " evaluates to " << v1
  17251. << "\n" << e2 << " evaluates to " << v2
  17252. << "\n" << e3 << " evaluates to " << v3
  17253. << "\n" << e4 << " evaluates to " << v4
  17254. << "\n" << e5 << " evaluates to " << v5;
  17255. }
  17256. // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
  17257. // Don't use this in your code.
  17258. #define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
  17259. GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5),\
  17260. on_failure)
  17261. // Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use
  17262. // this in your code.
  17263. #define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
  17264. GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
  17265. #v1, \
  17266. #v2, \
  17267. #v3, \
  17268. #v4, \
  17269. #v5, \
  17270. pred, \
  17271. v1, \
  17272. v2, \
  17273. v3, \
  17274. v4, \
  17275. v5), on_failure)
  17276. // 5-ary predicate assertion macros.
  17277. #define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
  17278. GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
  17279. #define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
  17280. GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
  17281. #define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
  17282. GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
  17283. #define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
  17284. GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
  17285. #endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
  17286. // Macros for testing equalities and inequalities.
  17287. //
  17288. // * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual
  17289. // * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
  17290. // * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2
  17291. // * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2
  17292. // * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2
  17293. // * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2
  17294. //
  17295. // When they are not, Google Test prints both the tested expressions and
  17296. // their actual values. The values must be compatible built-in types,
  17297. // or you will get a compiler error. By "compatible" we mean that the
  17298. // values can be compared by the respective operator.
  17299. //
  17300. // Note:
  17301. //
  17302. // 1. It is possible to make a user-defined type work with
  17303. // {ASSERT|EXPECT}_??(), but that requires overloading the
  17304. // comparison operators and is thus discouraged by the Google C++
  17305. // Usage Guide. Therefore, you are advised to use the
  17306. // {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
  17307. // equal.
  17308. //
  17309. // 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
  17310. // pointers (in particular, C strings). Therefore, if you use it
  17311. // with two C strings, you are testing how their locations in memory
  17312. // are related, not how their content is related. To compare two C
  17313. // strings by content, use {ASSERT|EXPECT}_STR*().
  17314. //
  17315. // 3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to
  17316. // {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you
  17317. // what the actual value is when it fails, and similarly for the
  17318. // other comparisons.
  17319. //
  17320. // 4. Do not depend on the order in which {ASSERT|EXPECT}_??()
  17321. // evaluate their arguments, which is undefined.
  17322. //
  17323. // 5. These macros evaluate their arguments exactly once.
  17324. //
  17325. // Examples:
  17326. //
  17327. // EXPECT_NE(5, Foo());
  17328. // EXPECT_EQ(NULL, a_pointer);
  17329. // ASSERT_LT(i, array_size);
  17330. // ASSERT_GT(records.size(), 0) << "There is no record left.";
  17331. #define EXPECT_EQ(expected, actual) \
  17332. EXPECT_PRED_FORMAT2(::testing::internal:: \
  17333. EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
  17334. expected, actual)
  17335. #define EXPECT_NE(expected, actual) \
  17336. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual)
  17337. #define EXPECT_LE(val1, val2) \
  17338. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
  17339. #define EXPECT_LT(val1, val2) \
  17340. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
  17341. #define EXPECT_GE(val1, val2) \
  17342. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
  17343. #define EXPECT_GT(val1, val2) \
  17344. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
  17345. #define GTEST_ASSERT_EQ(expected, actual) \
  17346. ASSERT_PRED_FORMAT2(::testing::internal:: \
  17347. EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
  17348. expected, actual)
  17349. #define GTEST_ASSERT_NE(val1, val2) \
  17350. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
  17351. #define GTEST_ASSERT_LE(val1, val2) \
  17352. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
  17353. #define GTEST_ASSERT_LT(val1, val2) \
  17354. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
  17355. #define GTEST_ASSERT_GE(val1, val2) \
  17356. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
  17357. #define GTEST_ASSERT_GT(val1, val2) \
  17358. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
  17359. // Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
  17360. // ASSERT_XY(), which clashes with some users' own code.
  17361. #if !GTEST_DONT_DEFINE_ASSERT_EQ
  17362. # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
  17363. #endif
  17364. #if !GTEST_DONT_DEFINE_ASSERT_NE
  17365. # define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
  17366. #endif
  17367. #if !GTEST_DONT_DEFINE_ASSERT_LE
  17368. # define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
  17369. #endif
  17370. #if !GTEST_DONT_DEFINE_ASSERT_LT
  17371. # define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
  17372. #endif
  17373. #if !GTEST_DONT_DEFINE_ASSERT_GE
  17374. # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
  17375. #endif
  17376. #if !GTEST_DONT_DEFINE_ASSERT_GT
  17377. # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
  17378. #endif
  17379. // C String Comparisons. All tests treat NULL and any non-NULL string
  17380. // as different. Two NULLs are equal.
  17381. //
  17382. // * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2
  17383. // * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2
  17384. // * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
  17385. // * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
  17386. //
  17387. // For wide or narrow string objects, you can use the
  17388. // {ASSERT|EXPECT}_??() macros.
  17389. //
  17390. // Don't depend on the order in which the arguments are evaluated,
  17391. // which is undefined.
  17392. //
  17393. // These macros evaluate their arguments exactly once.
  17394. #define EXPECT_STREQ(expected, actual) \
  17395. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
  17396. #define EXPECT_STRNE(s1, s2) \
  17397. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
  17398. #define EXPECT_STRCASEEQ(expected, actual) \
  17399. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
  17400. #define EXPECT_STRCASENE(s1, s2)\
  17401. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
  17402. #define ASSERT_STREQ(expected, actual) \
  17403. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
  17404. #define ASSERT_STRNE(s1, s2) \
  17405. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
  17406. #define ASSERT_STRCASEEQ(expected, actual) \
  17407. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
  17408. #define ASSERT_STRCASENE(s1, s2)\
  17409. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
  17410. // Macros for comparing floating-point numbers.
  17411. //
  17412. // * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual):
  17413. // Tests that two float values are almost equal.
  17414. // * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual):
  17415. // Tests that two double values are almost equal.
  17416. // * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
  17417. // Tests that v1 and v2 are within the given distance to each other.
  17418. //
  17419. // Google Test uses ULP-based comparison to automatically pick a default
  17420. // error bound that is appropriate for the operands. See the
  17421. // FloatingPoint template class in gtest-internal.h if you are
  17422. // interested in the implementation details.
  17423. #define EXPECT_FLOAT_EQ(expected, actual)\
  17424. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
  17425. expected, actual)
  17426. #define EXPECT_DOUBLE_EQ(expected, actual)\
  17427. EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
  17428. expected, actual)
  17429. #define ASSERT_FLOAT_EQ(expected, actual)\
  17430. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
  17431. expected, actual)
  17432. #define ASSERT_DOUBLE_EQ(expected, actual)\
  17433. ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
  17434. expected, actual)
  17435. #define EXPECT_NEAR(val1, val2, abs_error)\
  17436. EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
  17437. val1, val2, abs_error)
  17438. #define ASSERT_NEAR(val1, val2, abs_error)\
  17439. ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
  17440. val1, val2, abs_error)
  17441. // These predicate format functions work on floating-point values, and
  17442. // can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
  17443. //
  17444. // EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
  17445. // Asserts that val1 is less than, or almost equal to, val2. Fails
  17446. // otherwise. In particular, it fails if either val1 or val2 is NaN.
  17447. GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
  17448. float val1, float val2);
  17449. GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
  17450. double val1, double val2);
  17451. #if GTEST_OS_WINDOWS
  17452. // Macros that test for HRESULT failure and success, these are only useful
  17453. // on Windows, and rely on Windows SDK macros and APIs to compile.
  17454. //
  17455. // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
  17456. //
  17457. // When expr unexpectedly fails or succeeds, Google Test prints the
  17458. // expected result and the actual result with both a human-readable
  17459. // string representation of the error, if available, as well as the
  17460. // hex result code.
  17461. # define EXPECT_HRESULT_SUCCEEDED(expr) \
  17462. EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
  17463. # define ASSERT_HRESULT_SUCCEEDED(expr) \
  17464. ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
  17465. # define EXPECT_HRESULT_FAILED(expr) \
  17466. EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
  17467. # define ASSERT_HRESULT_FAILED(expr) \
  17468. ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
  17469. #endif // GTEST_OS_WINDOWS
  17470. // Macros that execute statement and check that it doesn't generate new fatal
  17471. // failures in the current thread.
  17472. //
  17473. // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
  17474. //
  17475. // Examples:
  17476. //
  17477. // EXPECT_NO_FATAL_FAILURE(Process());
  17478. // ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
  17479. //
  17480. #define ASSERT_NO_FATAL_FAILURE(statement) \
  17481. GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
  17482. #define EXPECT_NO_FATAL_FAILURE(statement) \
  17483. GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
  17484. // Causes a trace (including the source file path, the current line
  17485. // number, and the given message) to be included in every test failure
  17486. // message generated by code in the current scope. The effect is
  17487. // undone when the control leaves the current scope.
  17488. //
  17489. // The message argument can be anything streamable to std::ostream.
  17490. //
  17491. // In the implementation, we include the current line number as part
  17492. // of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
  17493. // to appear in the same block - as long as they are on different
  17494. // lines.
  17495. #define SCOPED_TRACE(message) \
  17496. ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
  17497. __FILE__, __LINE__, ::testing::Message() << (message))
  17498. // Compile-time assertion for type equality.
  17499. // StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
  17500. // the same type. The value it returns is not interesting.
  17501. //
  17502. // Instead of making StaticAssertTypeEq a class template, we make it a
  17503. // function template that invokes a helper class template. This
  17504. // prevents a user from misusing StaticAssertTypeEq<T1, T2> by
  17505. // defining objects of that type.
  17506. //
  17507. // CAVEAT:
  17508. //
  17509. // When used inside a method of a class template,
  17510. // StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
  17511. // instantiated. For example, given:
  17512. //
  17513. // template <typename T> class Foo {
  17514. // public:
  17515. // void Bar() { testing::StaticAssertTypeEq<int, T>(); }
  17516. // };
  17517. //
  17518. // the code:
  17519. //
  17520. // void Test1() { Foo<bool> foo; }
  17521. //
  17522. // will NOT generate a compiler error, as Foo<bool>::Bar() is never
  17523. // actually instantiated. Instead, you need:
  17524. //
  17525. // void Test2() { Foo<bool> foo; foo.Bar(); }
  17526. //
  17527. // to cause a compiler error.
  17528. template <typename T1, typename T2>
  17529. bool StaticAssertTypeEq() {
  17530. (void)internal::StaticAssertTypeEqHelper<T1, T2>();
  17531. return true;
  17532. }
  17533. // Defines a test.
  17534. //
  17535. // The first parameter is the name of the test case, and the second
  17536. // parameter is the name of the test within the test case.
  17537. //
  17538. // The convention is to end the test case name with "Test". For
  17539. // example, a test case for the Foo class can be named FooTest.
  17540. //
  17541. // The user should put his test code between braces after using this
  17542. // macro. Example:
  17543. //
  17544. // TEST(FooTest, InitializesCorrectly) {
  17545. // Foo foo;
  17546. // EXPECT_TRUE(foo.StatusIsOK());
  17547. // }
  17548. // Note that we call GetTestTypeId() instead of GetTypeId<
  17549. // ::testing::Test>() here to get the type ID of testing::Test. This
  17550. // is to work around a suspected linker bug when using Google Test as
  17551. // a framework on Mac OS X. The bug causes GetTypeId<
  17552. // ::testing::Test>() to return different values depending on whether
  17553. // the call is from the Google Test framework itself or from user test
  17554. // code. GetTestTypeId() is guaranteed to always return the same
  17555. // value, as it always calls GetTypeId<>() from the Google Test
  17556. // framework.
  17557. #define GTEST_TEST(test_case_name, test_name)\
  17558. GTEST_TEST_(test_case_name, test_name, \
  17559. ::testing::Test, ::testing::internal::GetTestTypeId())
  17560. // Define this macro to 1 to omit the definition of TEST(), which
  17561. // is a generic name and clashes with some other libraries.
  17562. #if !GTEST_DONT_DEFINE_TEST
  17563. # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
  17564. #endif
  17565. // Defines a test that uses a test fixture.
  17566. //
  17567. // The first parameter is the name of the test fixture class, which
  17568. // also doubles as the test case name. The second parameter is the
  17569. // name of the test within the test case.
  17570. //
  17571. // A test fixture class must be declared earlier. The user should put
  17572. // his test code between braces after using this macro. Example:
  17573. //
  17574. // class FooTest : public testing::Test {
  17575. // protected:
  17576. // virtual void SetUp() { b_.AddElement(3); }
  17577. //
  17578. // Foo a_;
  17579. // Foo b_;
  17580. // };
  17581. //
  17582. // TEST_F(FooTest, InitializesCorrectly) {
  17583. // EXPECT_TRUE(a_.StatusIsOK());
  17584. // }
  17585. //
  17586. // TEST_F(FooTest, ReturnsElementCountCorrectly) {
  17587. // EXPECT_EQ(0, a_.size());
  17588. // EXPECT_EQ(1, b_.size());
  17589. // }
  17590. #define TEST_F(test_fixture, test_name)\
  17591. GTEST_TEST_(test_fixture, test_name, test_fixture, \
  17592. ::testing::internal::GetTypeId<test_fixture>())
  17593. // Use this macro in main() to run all tests. It returns 0 if all
  17594. // tests are successful, or 1 otherwise.
  17595. //
  17596. // RUN_ALL_TESTS() should be invoked after the command line has been
  17597. // parsed by InitGoogleTest().
  17598. #define RUN_ALL_TESTS()\
  17599. (::testing::UnitTest::GetInstance()->Run())
  17600. } // namespace testing
  17601. #if defined(_MSC_VER)
  17602. #pragma warning( pop )
  17603. #endif
  17604. #if __clang__
  17605. #pragma clang diagnostic pop
  17606. #elif __GNUC__
  17607. #pragma gcc diagnostic pop
  17608. #endif
  17609. #endif // GTEST_INCLUDE_GTEST_GTEST_H_